@sumaris-net/ngx-components 1.5.1 → 1.5.5
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 -39
- 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 +6 -0
- package/esm2015/src/app/core/form/editor.class.js +5 -3
- package/esm2015/src/app/core/services/local-settings.service.js +3 -3
- package/esm2015/src/app/core/settings/settings.page.js +10 -13
- package/esm2015/src/app/shared/functions.js +5 -6
- package/esm2015/src/app/shared/material/autocomplete/material.autocomplete.js +12 -4
- package/esm2015/src/app/shared/observables.js +25 -2
- package/fesm2015/sumaris-net.ngx-components.js +54 -25
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/settings/settings.page.d.ts +3 -3
- package/src/app/shared/observables.d.ts +1 -0
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -544,18 +544,17 @@
|
|
|
544
544
|
target = target.slice();
|
|
545
545
|
target.sort(propertiesPathComparator(keys));
|
|
546
546
|
var total = items.length || 0;
|
|
547
|
-
var fetchMore;
|
|
548
547
|
// Truncate if need
|
|
549
548
|
if (opts) {
|
|
550
549
|
if (isNil(opts.offset) && opts.offset > 0) {
|
|
551
|
-
|
|
550
|
+
target = target.slice(opts.offset);
|
|
552
551
|
}
|
|
553
|
-
if (isNotNil(opts.size) &&
|
|
554
|
-
|
|
552
|
+
if (isNotNil(opts.size) && target.length > opts.size) {
|
|
553
|
+
target = target.slice(0, opts.size);
|
|
555
554
|
}
|
|
556
555
|
}
|
|
557
556
|
var res = {
|
|
558
|
-
data:
|
|
557
|
+
data: target,
|
|
559
558
|
total: total
|
|
560
559
|
};
|
|
561
560
|
// Add fetch more capability, if total was fetched
|
|
@@ -1146,6 +1145,32 @@
|
|
|
1146
1145
|
});
|
|
1147
1146
|
});
|
|
1148
1147
|
}
|
|
1148
|
+
function waitForTrue(observable, opts) {
|
|
1149
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1150
|
+
var firstTrueObservable, $timeout;
|
|
1151
|
+
return __generator(this, function (_a) {
|
|
1152
|
+
firstTrueObservable = observable.pipe(operators.first(function (v) { return v === true; }), operators.map(function () { }) // convert to void
|
|
1153
|
+
);
|
|
1154
|
+
// Timeout (+ dueTime)
|
|
1155
|
+
if (opts && opts.timeout > 0) {
|
|
1156
|
+
$timeout = rxjs.timer(opts.timeout);
|
|
1157
|
+
return [2 /*return*/, rxjs.merge(rxjs.timer(opts.dueTime || 0)
|
|
1158
|
+
.pipe(operators.switchMap(function () { return firstTrueObservable; }), operators.takeUntil($timeout)), $timeout
|
|
1159
|
+
.pipe(operators.map(function () {
|
|
1160
|
+
throw new Error("Timeout ready() - after " + opts.timeout + "ms");
|
|
1161
|
+
})))
|
|
1162
|
+
.toPromise()];
|
|
1163
|
+
}
|
|
1164
|
+
// dueTime (without timeout)
|
|
1165
|
+
if (opts && opts.dueTime > 0) {
|
|
1166
|
+
return [2 /*return*/, rxjs.timer(opts.dueTime)
|
|
1167
|
+
.pipe(operators.switchMap(function () { return firstTrueObservable; }))
|
|
1168
|
+
.toPromise()];
|
|
1169
|
+
}
|
|
1170
|
+
return [2 /*return*/, firstTrueObservable.toPromise()];
|
|
1171
|
+
});
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1149
1174
|
|
|
1150
1175
|
function createPromiseEventEmitter() {
|
|
1151
1176
|
return new i0.EventEmitter(true);
|
|
@@ -1396,7 +1421,7 @@
|
|
|
1396
1421
|
this.displayWith = this.displayWith || this.config.displayWith;
|
|
1397
1422
|
this.mobile = toBoolean(this.mobile, this.config.mobile);
|
|
1398
1423
|
this.suggestLengthThreshold = toNumber(this.suggestLengthThreshold, this.config.suggestLengthThreshold || 0);
|
|
1399
|
-
this.showAllOnFocus = toBoolean(this.showAllOnFocus, toBoolean(this.config.showAllOnFocus, this.suggestLengthThreshold
|
|
1424
|
+
this.showAllOnFocus = toBoolean(this.showAllOnFocus, toBoolean(this.config.showAllOnFocus, this.suggestLengthThreshold <= 0));
|
|
1400
1425
|
this.showPanelOnFocus = toBoolean(this.showPanelOnFocus, toBoolean(this.config.showPanelOnFocus));
|
|
1401
1426
|
this.classList = this.classList || this.config.class;
|
|
1402
1427
|
this.debounceTime = toNumber(this.debounceTime, this.config.debounceTime);
|
|
@@ -1516,8 +1541,16 @@
|
|
|
1516
1541
|
.pipe(operators.filter(function (event) { return _this.enabled && _this.searchable && (!event || !event.defaultPrevented); }), operators.map(function (_) { return _this.showAllOnFocus ? '*' : _this.formControl.value; })), rxjs.merge(this.$inputItems, this._filter$)
|
|
1517
1542
|
.pipe(operators.filter(function (event) { return _this.enabled && _this.searchable; }), operators.map(function (_) { return _this.formControl.value; })))
|
|
1518
1543
|
.pipe(
|
|
1519
|
-
//
|
|
1520
|
-
|
|
1544
|
+
// Start to suggest when :
|
|
1545
|
+
// - '*'
|
|
1546
|
+
// - is nil, and there is no min length threshold
|
|
1547
|
+
// - is not nil and not a string type (e.g. object)
|
|
1548
|
+
// - is not nil and is a string, and has enough character
|
|
1549
|
+
operators.filter(function (value) { return value === '*'
|
|
1550
|
+
|| (isNil(value)
|
|
1551
|
+
? (_this.suggestLengthThreshold <= 0)
|
|
1552
|
+
: (!(typeof value === 'string')
|
|
1553
|
+
|| value.length >= _this.suggestLengthThreshold)); }),
|
|
1521
1554
|
// Distinguish changes
|
|
1522
1555
|
operators.distinctUntilChanged()))
|
|
1523
1556
|
.pipe(
|
|
@@ -10830,9 +10863,9 @@
|
|
|
10830
10863
|
LocalSettingsService.prototype.ngOnStart = function () {
|
|
10831
10864
|
console.info('[settings] Starting service...');
|
|
10832
10865
|
// Restoring local settings
|
|
10833
|
-
this._data.mobile =
|
|
10866
|
+
this._data.mobile = toBoolean(this._data.mobile, this.platform.is('mobile'));
|
|
10834
10867
|
this._data.touchUi = this._data.mobile || this.platform.is('phablet') || this.platform.is('tablet');
|
|
10835
|
-
this._data.usageMode = this.platform.is('android') ? 'FIELD' : 'DESK'; // FIELD by default if Android
|
|
10868
|
+
this._data.usageMode = this.platform.is('android') || this.platform.is('ios') ? 'FIELD' : 'DESK'; // FIELD by default if Android or iOs
|
|
10836
10869
|
// Restoring local settings
|
|
10837
10870
|
return this.restoreLocally();
|
|
10838
10871
|
};
|
|
@@ -21257,13 +21290,14 @@
|
|
|
21257
21290
|
SettingsPage.prototype.save = function (event, options) {
|
|
21258
21291
|
return __awaiter(this, void 0, void 0, function () {
|
|
21259
21292
|
var data, peerChanged, err_1;
|
|
21293
|
+
var _this = this;
|
|
21260
21294
|
return __generator(this, function (_a) {
|
|
21261
21295
|
switch (_a.label) {
|
|
21262
21296
|
case 0:
|
|
21263
21297
|
if (this.saving)
|
|
21264
21298
|
return [2 /*return*/]; // Skip
|
|
21265
|
-
|
|
21266
|
-
|
|
21299
|
+
if (event)
|
|
21300
|
+
event.preventDefault();
|
|
21267
21301
|
// Remove all empty controls
|
|
21268
21302
|
this.propertiesFormHelper.removeAllEmpty();
|
|
21269
21303
|
if (!!this.form.valid) return [3 /*break*/, 2];
|
|
@@ -21280,6 +21314,7 @@
|
|
|
21280
21314
|
console.debug('[settings] Saving local settings...');
|
|
21281
21315
|
this.saving = true;
|
|
21282
21316
|
this.error = undefined;
|
|
21317
|
+
this.markForCheck();
|
|
21283
21318
|
return [4 /*yield*/, this.getValue()];
|
|
21284
21319
|
case 3:
|
|
21285
21320
|
data = _a.sent();
|
|
@@ -21311,8 +21346,11 @@
|
|
|
21311
21346
|
this.enable({ emitEvent: false });
|
|
21312
21347
|
// Apply inheritance
|
|
21313
21348
|
this.setAccountInheritance(data.accountInheritance, { emitEvent: false });
|
|
21314
|
-
|
|
21315
|
-
|
|
21349
|
+
// Add a delay, because of option menu that is always opened after save!!
|
|
21350
|
+
setTimeout(function () {
|
|
21351
|
+
_this.saving = false;
|
|
21352
|
+
_this.markForCheck();
|
|
21353
|
+
}, 400);
|
|
21316
21354
|
return [7 /*endfinally*/];
|
|
21317
21355
|
case 8: return [2 /*return*/];
|
|
21318
21356
|
}
|
|
@@ -21392,25 +21430,11 @@
|
|
|
21392
21430
|
};
|
|
21393
21431
|
SettingsPage.prototype.close = function (event) {
|
|
21394
21432
|
return __awaiter(this, void 0, void 0, function () {
|
|
21395
|
-
var confirmation;
|
|
21396
21433
|
return __generator(this, function (_a) {
|
|
21397
|
-
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
if (!this.dirty) return [3 /*break*/, 3];
|
|
21402
|
-
return [4 /*yield*/, Alerts.askSaveBeforeLeave(this.alertCtrl, this.translate)];
|
|
21403
|
-
case 1:
|
|
21404
|
-
confirmation = _a.sent();
|
|
21405
|
-
if (!confirmation) return [3 /*break*/, 3];
|
|
21406
|
-
return [4 /*yield*/, this.save(event)];
|
|
21407
|
-
case 2:
|
|
21408
|
-
_a.sent();
|
|
21409
|
-
_a.label = 3;
|
|
21410
|
-
case 3:
|
|
21411
|
-
// Back to home
|
|
21412
|
-
return [2 /*return*/, this.router.navigateByUrl('/', { replaceUrl: true })]; // back to home
|
|
21413
|
-
}
|
|
21434
|
+
if (this.saving)
|
|
21435
|
+
return [2 /*return*/];
|
|
21436
|
+
// Back to home
|
|
21437
|
+
return [2 /*return*/, this.router.navigateByUrl('/', { replaceUrl: true })]; // back to home
|
|
21414
21438
|
});
|
|
21415
21439
|
});
|
|
21416
21440
|
};
|
|
@@ -21468,7 +21492,7 @@
|
|
|
21468
21492
|
SettingsPage.decorators = [
|
|
21469
21493
|
{ type: i0.Component, args: [{
|
|
21470
21494
|
selector: 'page-settings',
|
|
21471
|
-
template: "<app-toolbar [title]=\"'SETTINGS.TITLE'|translate\" color=\"primary\"\n [hasValidate]=\"dirty && !saving\"\n [hasClose]=\"!dirty && !saving\"\n (onValidate)=\"save($event)\"\n (onClose)=\"close($event)\">\n\n <ion-buttons slot=\"end\">\n <!-- options menu -->\n <ion-button [matMenuTriggerFor]=\"optionsMenu\" [disabled]=\"saving\">\n <mat-icon slot=\"icon-only\">more_vert</mat-icon>\n </ion-button>\n </ion-buttons>\n</app-toolbar>\n\n<!-- Options menu -->\n<mat-menu #optionsMenu=\"matMenu\">\n <!-- Clear cache -->\n <button mat-menu-item (click)=\"clearCache($event)\">\n <ion-label translate>SETTINGS.BTN_CLEAR_CACHE</ion-label>\n </button>\n\n <!-- Reset -->\n <button mat-menu-item\n [disabled]=\"!dirty\"\n (click)=\"cancel($event)\">\n <ion-label>\n <mat-icon><ion-icon slot=\"start\" name=\"refresh\"></ion-icon></mat-icon> \n <span translate>COMMON.BTN_RESET</span>\n </ion-label>\n </button>\n</mat-menu>\n\n<ion-content>\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"save($event)\" class=\"form-container\">\n\n <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding\">\n\n <!-- left margin -->\n <ion-col size=\"0\" size-lg=\"2\"> \n </ion-col>\n\n <ion-col class=\"ion-padding\">\n\n <!-- error -->\n <ion-item *ngIf=\"error\" 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 <p [innerHTML]=\"'SETTINGS.DESCRIPTION'|translate\"></p>\n\n <!-- account inheritance (desktop) -->\n <mat-form-field [hidden]=\"!isLogin\" *ngIf=\"!mobile; else accountInheritanceMobile\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- check box (if desktop) -->\n <mat-checkbox\n *ngIf=\"!mobile; else accountInheritanceMobile\"\n (change)=\"setAccountInheritance($event.checked)\"\n [checked]=\"accountInheritance\">\n <span translate>SETTINGS.INHERIT_FROM_ACCOUNT</span>\n </mat-checkbox>\n\n <mat-error *ngIf=\"form.controls.accountInheritance.hasError('required')\" translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- account inheritance (if mobile) -->\n <ng-template #accountInheritanceMobile>\n <mat-form-field [hidden]=\"!isLogin\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- slide toggle -->\n <ion-text translate>SETTINGS.INHERIT_FROM_ACCOUNT</ion-text>\n <mat-slide-toggle matSuffix\n (change)=\"setAccountInheritance($event.checked)\"\n [checked]=\"accountInheritance\">\n\n </mat-slide-toggle>\n <mat-error *ngIf=\"form.controls.accountInheritance.hasError('required')\" translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n </ng-template>\n\n <!-- locale -->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.LOCALE'|translate\" formControlName=\"locale\" required>\n <mat-option *ngFor=\"let item of locales\" [value]=\"item.key\">\n {{item.value}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"form.controls.locale.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n </mat-form-field>\n\n <!-- Network entry -->\n <h3>\n <ion-text translate>SETTINGS.NETWORK_DIVIDER</ion-text>\n </h3>\n\n <!-- Peer address -->\n <mat-form-field>\n <input matInput type=\"text\" [placeholder]=\"'SETTINGS.PEER_URL'|translate\" formControlName=\"peerUrl\"\n required>\n\n <button mat-icon-button type=\"button\" matSuffix (click)=\"showSelectPeerModal()\" tabindex=\"-1\"\n [title]=\"'SETTINGS.BTN_CHANGE_PEER'|translate\">\n <mat-icon>search</mat-icon>\n </button>\n\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('peerAlive')\"\n translate>SETTINGS.ERROR.PEER_NOT_REACHABLE\n </mat-error>\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('peerNotCompatible')\"\n translate>SETTINGS.ERROR.PEER_NOT_COMPATIBLE\n </mat-error>\n </mat-form-field>\n\n <!-- Offline mode (if mobile) -->\n <mat-form-field *ngIf=\"mobile\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- slide toggle -->\n <ion-text translate>SETTINGS.OFFLINE_MODE</ion-text>\n <mat-slide-toggle matSuffix\n (change)=\"network.setForceOffline($event.checked)\"\n [checked]=\"network.offline\">\n\n </mat-slide-toggle>\n </mat-form-field>\n\n <!-- Data entry -->\n <h3>\n <ion-text translate>SETTINGS.DATA_ENTRY_DIVIDER</ion-text>\n </h3>\n\n <!-- Usage mode -->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.USAGE_MODE'|translate\" formControlName=\"usageMode\"\n required>\n <mat-option *ngFor=\"let item of usageModes\" [value]=\"item\">\n {{'SETTINGS.USAGE_MODES.'+item|translate}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"form.controls.usageMode.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- lat/long format-->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.LAT_LONG_FORMAT'|translate\" formControlName=\"latLongFormat\"\n required>\n <mat-option *ngFor=\"let item of latLongFormats\" [value]=\"item\">\n {{'COMMON.LAT_LONG.'+item+'_PLACEHOLDER'|translate}}\n </mat-option>\n </mat-select>\n <mat-error\n *ngIf=\"form.controls.latLongFormat.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- fields options -->\n <ion-grid formArrayName=\"properties\" class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding\">\n <ion-col class=\"ion-no-padding ion-align-self-end\" size=\"12\">\n <span class=\"toolbar-spacer\"></span>\n\n <!-- Show more options -->\n <ion-button color=\"light\" *ngIf=\"propertiesForm?.length === 0\"\n [title]=\"'SETTINGS.BTN_SHOW_MORE_HELP'|translate\"\n (click)=\"propertiesFormHelper.add()\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n </ion-col>\n </ion-row>\n\n <!-- Fields options -->\n <ng-container *ngFor=\"let propertyForm of propertiesForm?.controls; let i=index\">\n <ion-row class=\"ion-no-padding\" [formGroupName]=\"i\">\n\n <!-- property key -->\n <ion-col class=\"ion-no-padding\">\n <mat-form-field>\n <mat-select formControlName=\"key\"\n [placeholder]=\" 'SETTINGS.PROPERTY_KEY'|translate\">\n <mat-option *ngFor=\"let item of propertyDefinitions\" [value]=\"item.key\">{{ item.label | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n\n <!-- property value -->\n <ion-col class=\"ion-no-padding\" padding-left>\n <app-form-field *ngIf=\"getPropertyDefinition(i); let definition\"\n floatLabel=\"never\"\n [definition]=\"definition\"\n [formControl]=\"propertyForm.controls.value\"\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [required]=\"true\">\n </app-form-field>\n </ion-col>\n <ion-col size=\"2\" class=\"ion-no-padding\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"loading\"\n [title]=\"'COMMON.BTN_DELETE'|translate\"\n (click)=\"removePropertyAt(i)\">\n <mat-icon>close</mat-icon>\n </button>\n <button *ngIf=\"propertiesFormHelper.isLast(i)\"\n type=\"button\"\n mat-icon-button\n color=\"light\"\n [disabled]=\"loading\"\n [title]=\"'SETTINGS.BTN_ADD_PROPERTY'|translate\"\n (click)=\"propertiesFormHelper.add()\">\n <mat-icon>add</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n </ng-container>\n </ion-grid>\n </ion-col>\n\n <!-- right margin -->\n <ion-col size=\"0\" size-lg=\"2\"> \n </ion-col>\n </ion-row>\n </ion-grid>\n\n\n </form>\n</ion-content>\n\n<ion-footer hidden-xs hidden-sm hidden-mobile>\n <app-form-buttons-bar (onCancel)=\"cancel()\" (onSave)=\"save($event)\" [disabled]=\"!form.dirty || saving\"></app-form-buttons-bar>\n</ion-footer>\n",
|
|
21495
|
+
template: "<app-toolbar [title]=\"'SETTINGS.TITLE'|translate\" color=\"primary\"\n [hasValidate]=\"dirty && !saving\"\n [hasClose]=\"!dirty && !saving\"\n (onValidate)=\"save($event)\"\n (onClose)=\"close($event)\">\n\n <ion-buttons slot=\"end\">\n <!-- options menu -->\n <ion-button [matMenuTriggerFor]=\"optionsMenu\"\n *ngIf=\"!saving\"\n [disabled]=\"saving\">\n <mat-icon slot=\"icon-only\">more_vert</mat-icon>\n </ion-button>\n </ion-buttons>\n</app-toolbar>\n\n<!-- Options menu -->\n<mat-menu #optionsMenu=\"matMenu\">\n <!-- Clear cache -->\n <button mat-menu-item (click)=\"clearCache($event)\">\n <ion-label translate>SETTINGS.BTN_CLEAR_CACHE</ion-label>\n </button>\n\n <!-- Reset -->\n <button mat-menu-item\n [disabled]=\"!dirty\"\n (click)=\"cancel($event)\">\n <ion-label>\n <mat-icon><ion-icon slot=\"start\" name=\"refresh\"></ion-icon></mat-icon> \n <span translate>COMMON.BTN_RESET</span>\n </ion-label>\n </button>\n</mat-menu>\n\n<ion-content>\n\n <form [formGroup]=\"form\" novalidate (ngSubmit)=\"save($event)\" class=\"form-container\">\n\n <ion-grid class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding\">\n\n <!-- left margin -->\n <ion-col size=\"0\" size-lg=\"2\"> \n </ion-col>\n\n <ion-col class=\"ion-padding\">\n\n <!-- error -->\n <ion-item *ngIf=\"error\" 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 <p [innerHTML]=\"'SETTINGS.DESCRIPTION'|translate\"></p>\n\n <!-- account inheritance (desktop) -->\n <mat-form-field [hidden]=\"!isLogin\" *ngIf=\"!mobile; else accountInheritanceMobile\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- check box (if desktop) -->\n <mat-checkbox\n *ngIf=\"!mobile; else accountInheritanceMobile\"\n (change)=\"setAccountInheritance($event.checked)\"\n [checked]=\"accountInheritance\">\n <span translate>SETTINGS.INHERIT_FROM_ACCOUNT</span>\n </mat-checkbox>\n\n <mat-error *ngIf=\"form.controls.accountInheritance.hasError('required')\" translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- account inheritance (if mobile) -->\n <ng-template #accountInheritanceMobile>\n <mat-form-field [hidden]=\"!isLogin\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- slide toggle -->\n <ion-text translate>SETTINGS.INHERIT_FROM_ACCOUNT</ion-text>\n <mat-slide-toggle matSuffix\n (change)=\"setAccountInheritance($event.checked)\"\n [checked]=\"accountInheritance\">\n\n </mat-slide-toggle>\n <mat-error *ngIf=\"form.controls.accountInheritance.hasError('required')\" translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n </ng-template>\n\n <!-- locale -->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.LOCALE'|translate\" formControlName=\"locale\" required>\n <mat-option *ngFor=\"let item of locales\" [value]=\"item.key\">\n {{item.value}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"form.controls.locale.hasError('required')\" translate>ERROR.FIELD_REQUIRED</mat-error>\n </mat-form-field>\n\n <!-- Network entry -->\n <h3>\n <ion-text translate>SETTINGS.NETWORK_DIVIDER</ion-text>\n </h3>\n\n <!-- Peer address -->\n <mat-form-field>\n <input matInput type=\"text\" [placeholder]=\"'SETTINGS.PEER_URL'|translate\" formControlName=\"peerUrl\"\n required>\n\n <button mat-icon-button type=\"button\" matSuffix (click)=\"showSelectPeerModal()\" tabindex=\"-1\"\n [title]=\"'SETTINGS.BTN_CHANGE_PEER'|translate\">\n <mat-icon>search</mat-icon>\n </button>\n\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('peerAlive')\"\n translate>SETTINGS.ERROR.PEER_NOT_REACHABLE\n </mat-error>\n <mat-error *ngIf=\"form.controls.peerUrl.hasError('peerNotCompatible')\"\n translate>SETTINGS.ERROR.PEER_NOT_COMPATIBLE\n </mat-error>\n </mat-form-field>\n\n <!-- Offline mode (if mobile) -->\n <mat-form-field *ngIf=\"mobile\">\n <input matInput hidden formControlName=\"accountInheritance\" type=\"text\">\n\n <!-- slide toggle -->\n <ion-text translate>SETTINGS.OFFLINE_MODE</ion-text>\n <mat-slide-toggle matSuffix\n (change)=\"network.setForceOffline($event.checked)\"\n [checked]=\"network.offline\">\n\n </mat-slide-toggle>\n </mat-form-field>\n\n <!-- Data entry -->\n <h3>\n <ion-text translate>SETTINGS.DATA_ENTRY_DIVIDER</ion-text>\n </h3>\n\n <!-- Usage mode -->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.USAGE_MODE'|translate\" formControlName=\"usageMode\"\n required>\n <mat-option *ngFor=\"let item of usageModes\" [value]=\"item\">\n {{'SETTINGS.USAGE_MODES.'+item|translate}}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"form.controls.usageMode.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- lat/long format-->\n <mat-form-field>\n <mat-select [placeholder]=\"'SETTINGS.LAT_LONG_FORMAT'|translate\" formControlName=\"latLongFormat\"\n required>\n <mat-option *ngFor=\"let item of latLongFormats\" [value]=\"item\">\n {{'COMMON.LAT_LONG.'+item+'_PLACEHOLDER'|translate}}\n </mat-option>\n </mat-select>\n <mat-error\n *ngIf=\"form.controls.latLongFormat.hasError('required')\"\n translate>ERROR.FIELD_REQUIRED\n </mat-error>\n </mat-form-field>\n\n <!-- fields options -->\n <ion-grid formArrayName=\"properties\" class=\"ion-no-padding\">\n <ion-row class=\"ion-no-padding\">\n <ion-col class=\"ion-no-padding ion-align-self-end\" size=\"12\">\n <span class=\"toolbar-spacer\"></span>\n\n <!-- Show more options -->\n <ion-button color=\"light\" *ngIf=\"propertiesForm?.length === 0\"\n [title]=\"'SETTINGS.BTN_SHOW_MORE_HELP'|translate\"\n (click)=\"propertiesFormHelper.add()\">\n <ion-label translate>COMMON.BTN_SHOW_MORE</ion-label>\n <mat-icon slot=\"end\">arrow_drop_down</mat-icon>\n </ion-button>\n </ion-col>\n </ion-row>\n\n <!-- Fields options -->\n <ng-container *ngFor=\"let propertyForm of propertiesForm?.controls; let i=index\">\n <ion-row class=\"ion-no-padding\" [formGroupName]=\"i\">\n\n <!-- property key -->\n <ion-col class=\"ion-no-padding\">\n <mat-form-field>\n <mat-select formControlName=\"key\"\n [placeholder]=\" 'SETTINGS.PROPERTY_KEY'|translate\">\n <mat-option *ngFor=\"let item of propertyDefinitions\" [value]=\"item.key\">{{ item.label | translate }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </ion-col>\n\n <!-- property value -->\n <ion-col class=\"ion-no-padding\" padding-left>\n <app-form-field *ngIf=\"getPropertyDefinition(i); let definition\"\n floatLabel=\"never\"\n [definition]=\"definition\"\n [formControl]=\"propertyForm.controls.value\"\n [placeholder]=\"'SETTINGS.PROPERTY_VALUE' | translate\"\n [required]=\"true\">\n </app-form-field>\n </ion-col>\n <ion-col size=\"2\" class=\"ion-no-padding\">\n <button type=\"button\" mat-icon-button color=\"light\"\n [disabled]=\"loading\"\n [title]=\"'COMMON.BTN_DELETE'|translate\"\n (click)=\"removePropertyAt(i)\">\n <mat-icon>close</mat-icon>\n </button>\n <button *ngIf=\"propertiesFormHelper.isLast(i)\"\n type=\"button\"\n mat-icon-button\n color=\"light\"\n [disabled]=\"loading\"\n [title]=\"'SETTINGS.BTN_ADD_PROPERTY'|translate\"\n (click)=\"propertiesFormHelper.add()\">\n <mat-icon>add</mat-icon>\n </button>\n </ion-col>\n </ion-row>\n </ng-container>\n </ion-grid>\n </ion-col>\n\n <!-- right margin -->\n <ion-col size=\"0\" size-lg=\"2\"> \n </ion-col>\n </ion-row>\n </ion-grid>\n\n\n </form>\n</ion-content>\n\n<ion-footer hidden-xs hidden-sm hidden-mobile>\n <app-form-buttons-bar (onCancel)=\"cancel()\" (onSave)=\"save($event)\" [disabled]=\"!form.dirty || saving\"></app-form-buttons-bar>\n</ion-footer>\n",
|
|
21472
21496
|
providers: [
|
|
21473
21497
|
{ provide: ngxMaterialTable.ValidatorService, useExisting: LocalSettingsValidatorService },
|
|
21474
21498
|
],
|
|
@@ -25928,6 +25952,8 @@
|
|
|
25928
25952
|
};
|
|
25929
25953
|
AppEditor.prototype.ngOnDestroy = function () {
|
|
25930
25954
|
this._subscription.unsubscribe();
|
|
25955
|
+
this._$ready.complete();
|
|
25956
|
+
this._$ready.unsubscribe();
|
|
25931
25957
|
};
|
|
25932
25958
|
AppEditor.prototype.addChildForm = function (form) {
|
|
25933
25959
|
if (!form)
|
|
@@ -26025,12 +26051,7 @@
|
|
|
26025
26051
|
AppEditor.prototype.ready = function (opts) {
|
|
26026
26052
|
return __awaiter(this, void 0, void 0, function () {
|
|
26027
26053
|
return __generator(this, function (_b) {
|
|
26028
|
-
|
|
26029
|
-
case 0: return [4 /*yield*/, firstTruePromise(this._$ready)];
|
|
26030
|
-
case 1:
|
|
26031
|
-
_b.sent();
|
|
26032
|
-
return [2 /*return*/];
|
|
26033
|
-
}
|
|
26054
|
+
return [2 /*return*/, waitForTrue(this._$ready, opts)];
|
|
26034
26055
|
});
|
|
26035
26056
|
});
|
|
26036
26057
|
};
|
|
@@ -28798,6 +28819,7 @@
|
|
|
28798
28819
|
exports.uncapitalizeFirstLetter = uncapitalizeFirstLetter;
|
|
28799
28820
|
exports.updateValueAndValidity = updateValueAndValidity;
|
|
28800
28821
|
exports.waitFor = waitFor;
|
|
28822
|
+
exports.waitForTrue = waitForTrue;
|
|
28801
28823
|
exports.waitIdle = waitIdle;
|
|
28802
28824
|
exports.waitWhilePending = waitWhilePending;
|
|
28803
28825
|
exports["ɵ0"] = ɵ0$5;
|