@sumaris-net/ngx-components 0.25.20 → 0.26.3
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 +180 -54
- 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 +7 -0
- package/esm2015/src/app/core/account/account.js +5 -7
- package/esm2015/src/app/core/auth/form/form-auth.js +6 -7
- package/esm2015/src/app/core/form/entity-editor.class.js +25 -16
- package/esm2015/src/app/core/form/form.class.js +29 -12
- package/esm2015/src/app/core/form/list.form.js +2 -2
- package/esm2015/src/app/core/form/properties.form.js +2 -3
- package/esm2015/src/app/core/settings/settings.page.js +5 -7
- package/esm2015/src/app/core/table/table.class.js +4 -4
- package/esm2015/src/app/shared/material/badge/badge-icon.directive.js +62 -0
- package/esm2015/src/app/shared/material/badge/badge-icon.module.js +23 -0
- package/esm2015/src/app/shared/material/badge/badge-icon.test.js +10 -0
- package/esm2015/src/app/shared/material/material.module.js +4 -2
- package/esm2015/src/app/shared/material/testing/material.testing.module.js +9 -2
- package/esm2015/src/app/shared/material/testing/material.testing.page.js +2 -2
- package/esm2015/src/app/shared/pipes/form.pipes.js +1 -1
- package/esm2015/src/app/shared/validator/form-error-adapter.class.js +3 -3
- package/esm2015/sumaris-net.ngx-components.js +10 -7
- package/fesm2015/sumaris-net.ngx-components.js +164 -49
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/account/account.d.ts +2 -5
- package/src/app/core/auth/form/form-auth.d.ts +2 -4
- package/src/app/core/form/entity-editor.class.d.ts +13 -2
- package/src/app/core/form/form.class.d.ts +15 -12
- package/src/app/core/form/properties.form.d.ts +0 -1
- package/src/app/core/settings/settings.page.d.ts +2 -5
- package/src/app/core/table/table.class.d.ts +4 -7
- package/src/app/shared/material/badge/badge-icon.directive.d.ts +15 -0
- package/src/app/shared/material/badge/badge-icon.module.d.ts +2 -0
- package/src/app/shared/material/badge/badge-icon.test.d.ts +2 -0
- package/src/app/shared/pipes/form.pipes.d.ts +2 -2
- package/src/app/shared/validator/form-error-adapter.class.d.ts +6 -6
- package/sumaris-net.ngx-components.d.ts +9 -6
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -4018,8 +4018,8 @@
|
|
|
4018
4018
|
}, "");
|
|
4019
4019
|
};
|
|
4020
4020
|
FormErrorAdapter.prototype.translateControlPath = function (path, opts) {
|
|
4021
|
-
if (opts === null || opts === void 0 ? void 0 : opts.
|
|
4022
|
-
return opts === null || opts === void 0 ? void 0 : opts.
|
|
4021
|
+
if (opts === null || opts === void 0 ? void 0 : opts.controlPathTranslator) {
|
|
4022
|
+
return opts === null || opts === void 0 ? void 0 : opts.controlPathTranslator.translateControlPath(path);
|
|
4023
4023
|
}
|
|
4024
4024
|
var i18nKey = (opts && opts.i18nPrefix || '') + changeCaseToUnderscore(path).toUpperCase();
|
|
4025
4025
|
return this.translate.instant(i18nKey);
|
|
@@ -7760,6 +7760,89 @@
|
|
|
7760
7760
|
},] }
|
|
7761
7761
|
];
|
|
7762
7762
|
|
|
7763
|
+
var MatBadgeIconDirective = /** @class */ (function () {
|
|
7764
|
+
function MatBadgeIconDirective(el) {
|
|
7765
|
+
this.el = el;
|
|
7766
|
+
}
|
|
7767
|
+
MatBadgeIconDirective.prototype.ngOnInit = function () {
|
|
7768
|
+
this.size = this.size || 'medium';
|
|
7769
|
+
this.color = this.color || 'primary';
|
|
7770
|
+
if (this.color === 'warn')
|
|
7771
|
+
this.color = 'warning';
|
|
7772
|
+
var fontSize;
|
|
7773
|
+
switch (this.size) {
|
|
7774
|
+
case 'large':
|
|
7775
|
+
fontSize = '24px';
|
|
7776
|
+
break;
|
|
7777
|
+
case 'medium':
|
|
7778
|
+
fontSize = '22px';
|
|
7779
|
+
break;
|
|
7780
|
+
case 'small':
|
|
7781
|
+
fontSize = '16px';
|
|
7782
|
+
break;
|
|
7783
|
+
}
|
|
7784
|
+
var badge = this.el.nativeElement.querySelector('.mat-badge-content');
|
|
7785
|
+
badge.style.display = 'flex';
|
|
7786
|
+
badge.style.alignItems = 'center';
|
|
7787
|
+
badge.style.justifyContent = 'center';
|
|
7788
|
+
if (this.color !== 'accent') {
|
|
7789
|
+
if (this.fill !== 'clear') {
|
|
7790
|
+
badge.style.background = "var(--ion-color-" + this.color + ")";
|
|
7791
|
+
badge.style.color = "var(--ion-color-" + this.color + "-contrast)";
|
|
7792
|
+
}
|
|
7793
|
+
else {
|
|
7794
|
+
badge.style.color = "var(--ion-color-" + this.color + ")";
|
|
7795
|
+
badge.style.background = 'transparent';
|
|
7796
|
+
}
|
|
7797
|
+
}
|
|
7798
|
+
if (this.matIcon) {
|
|
7799
|
+
badge.innerHTML = "<i class=\"material-icons\" style=\"font-size: " + fontSize + ";\">" + this.matIcon + "</i>";
|
|
7800
|
+
}
|
|
7801
|
+
else if (this.ionIcon) {
|
|
7802
|
+
badge.innerHTML = "<ion-icon style=\"font-size: " + fontSize + ";\" name=\"" + this.ionIcon + "\"></ion-icon>";
|
|
7803
|
+
}
|
|
7804
|
+
};
|
|
7805
|
+
return MatBadgeIconDirective;
|
|
7806
|
+
}());
|
|
7807
|
+
MatBadgeIconDirective.decorators = [
|
|
7808
|
+
{ type: i0.Directive, args: [{
|
|
7809
|
+
selector: '[matBadgeIcon], [ionBadgeIcon]',
|
|
7810
|
+
inputs: [
|
|
7811
|
+
'size: matBadgeSize',
|
|
7812
|
+
'color: matBadgeColor',
|
|
7813
|
+
'fill: matBadgeFill',
|
|
7814
|
+
]
|
|
7815
|
+
},] }
|
|
7816
|
+
];
|
|
7817
|
+
MatBadgeIconDirective.ctorParameters = function () { return [
|
|
7818
|
+
{ type: i0.ElementRef }
|
|
7819
|
+
]; };
|
|
7820
|
+
MatBadgeIconDirective.propDecorators = {
|
|
7821
|
+
matIcon: [{ type: i0.Input, args: ['matBadgeIcon',] }],
|
|
7822
|
+
ionIcon: [{ type: i0.Input, args: ['ionBadgeIcon',] }]
|
|
7823
|
+
};
|
|
7824
|
+
|
|
7825
|
+
var SharedMatBadgeIconModule = /** @class */ (function () {
|
|
7826
|
+
function SharedMatBadgeIconModule() {
|
|
7827
|
+
}
|
|
7828
|
+
return SharedMatBadgeIconModule;
|
|
7829
|
+
}());
|
|
7830
|
+
SharedMatBadgeIconModule.decorators = [
|
|
7831
|
+
{ type: i0.NgModule, args: [{
|
|
7832
|
+
imports: [
|
|
7833
|
+
i1$4.CommonModule,
|
|
7834
|
+
i1$5.IonicModule,
|
|
7835
|
+
badge.MatBadgeModule,
|
|
7836
|
+
],
|
|
7837
|
+
exports: [
|
|
7838
|
+
MatBadgeIconDirective
|
|
7839
|
+
],
|
|
7840
|
+
declarations: [
|
|
7841
|
+
MatBadgeIconDirective
|
|
7842
|
+
]
|
|
7843
|
+
},] }
|
|
7844
|
+
];
|
|
7845
|
+
|
|
7763
7846
|
var modules = [
|
|
7764
7847
|
// Angular material components
|
|
7765
7848
|
i1$3.MatCommonModule,
|
|
@@ -7801,7 +7884,8 @@
|
|
|
7801
7884
|
SharedMatBooleanModule,
|
|
7802
7885
|
SharedMatNumpadModule,
|
|
7803
7886
|
SharedMatSwipeModule,
|
|
7804
|
-
MaterialChipsModule
|
|
7887
|
+
MaterialChipsModule,
|
|
7888
|
+
SharedMatBadgeIconModule
|
|
7805
7889
|
];
|
|
7806
7890
|
var SharedMaterialModule = /** @class */ (function () {
|
|
7807
7891
|
function SharedMaterialModule() {
|
|
@@ -18462,7 +18546,7 @@
|
|
|
18462
18546
|
MaterialTestingPage.decorators = [
|
|
18463
18547
|
{ type: i0.Component, args: [{
|
|
18464
18548
|
selector: 'app-material-testing',
|
|
18465
|
-
template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Material components</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <ion-list>\n\n <ion-item-divider>Shared Material components</ion-item-divider>\n\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./datetime')\">\n Date/Time field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./autocomplete')\">\n Autocomplete field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./latlong')\">\n Lat/Long field\n </ion-item>\n<!-- <ion-item tappable class=\"text-1x\" (click)=\"openPage('./numpad')\">-->\n<!-- Numeric pad component-->\n<!-- </ion-item>-->\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./swipe')\">\n Swipe component\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./chips')\">\n Chips component\n </ion-item>\n\n <ng-container *ngIf=\"pages && pages.length\">\n <ion-item-divider>Other components</ion-item-divider>\n\n <ion-item *ngFor=\"let item of pages\"\n tappable class=\"text-1x\"\n (click)=\"openPage(item.page)\">{{item.label}}</ion-item>\n\n </ng-container>\n </ion-list>\n\n</ion-content>\n"
|
|
18549
|
+
template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>Material components</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n\n <ion-list>\n\n <ion-item-divider>Shared Material components</ion-item-divider>\n\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./datetime')\">\n Date/Time field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./autocomplete')\">\n Autocomplete field\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./latlong')\">\n Lat/Long field\n </ion-item>\n<!-- <ion-item tappable class=\"text-1x\" (click)=\"openPage('./numpad')\">-->\n<!-- Numeric pad component-->\n<!-- </ion-item>-->\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./swipe')\">\n Swipe component\n </ion-item>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./chips')\">\n Chips component\n </ion-item>\n\n <ion-item-divider>Directive</ion-item-divider>\n <ion-item tappable class=\"text-1x\" (click)=\"openPage('./badge-icon')\">\n Badge icon directive\n </ion-item>\n\n <ng-container *ngIf=\"pages && pages.length\">\n <ion-item-divider>Other components</ion-item-divider>\n\n <ion-item *ngFor=\"let item of pages\"\n tappable class=\"text-1x\"\n (click)=\"openPage(item.page)\">{{item.label}}</ion-item>\n\n </ng-container>\n </ion-list>\n\n</ion-content>\n"
|
|
18466
18550
|
},] }
|
|
18467
18551
|
];
|
|
18468
18552
|
MaterialTestingPage.ctorParameters = function () { return [
|
|
@@ -18747,6 +18831,18 @@
|
|
|
18747
18831
|
{ type: i1.FormBuilder }
|
|
18748
18832
|
]; };
|
|
18749
18833
|
|
|
18834
|
+
var MatBadgeIconTestPage = /** @class */ (function () {
|
|
18835
|
+
function MatBadgeIconTestPage() {
|
|
18836
|
+
}
|
|
18837
|
+
return MatBadgeIconTestPage;
|
|
18838
|
+
}());
|
|
18839
|
+
MatBadgeIconTestPage.decorators = [
|
|
18840
|
+
{ type: i0.Component, args: [{
|
|
18841
|
+
selector: 'mat-badge-icon-test',
|
|
18842
|
+
template: "\n<ion-header>\n <ion-toolbar color=\"primary\">\n\n <ion-buttons slot=\"start\">\n <ion-back-button></ion-back-button>\n </ion-buttons>\n\n <ion-title>matBadgeIcon directive</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n\n <!-- small badge -->\n <p>\n <ion-text color=\"tertiary\">\n <span matBadge matIcon=\"check\"\n matBadgeSize=\"small\"\n matBadgeColor=\"accent\"\n matBadgeOverlap=\"false\">Small badge</span>\n </ion-text>\n </p>\n\n <!-- medium badge -->\n <p>\n <ion-text matBadge matBadgeIcon=\"check\"\n matBadgeSize=\"medium\"\n matBadgeColor=\"tertiary\"\n matBadgeOverlap=\"false\"\n >Medium badge</ion-text>\n </p>\n\n <!-- small badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"close\" matBadgeSize=\"large\"\n matBadgeOverlap=\"false\">Large badge</ion-label>\n </p>\n\n <!-- default size badge -->\n <p>\n <ion-label matBadge matBadgeIcon=\"check\" matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge (no size, no color)\n </ion-label>\n </p>\n\n <!-- ion icon -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark\"\n matBadgeColor=\"success\"\n matBadgeOverlap=\"false\">Badge with ion-icon\n </ion-label>\n </p>\n\n <!-- ion icon clear -->\n <p>\n <ion-label matBadge\n ionBadgeIcon=\"checkmark-circle\"\n matBadgeColor=\"tertiary\"\n matBadgeFill=\"clear\"\n matBadgeOverlap=\"false\">Badge with clear icon\n </ion-label>\n </p>\n\n\n</ion-content>\n"
|
|
18843
|
+
},] }
|
|
18844
|
+
];
|
|
18845
|
+
|
|
18750
18846
|
var routes$1 = [
|
|
18751
18847
|
{
|
|
18752
18848
|
path: '',
|
|
@@ -18782,6 +18878,11 @@
|
|
|
18782
18878
|
path: 'chips',
|
|
18783
18879
|
pathMatch: 'full',
|
|
18784
18880
|
component: ChipsTestPage
|
|
18881
|
+
},
|
|
18882
|
+
{
|
|
18883
|
+
path: 'badge-icon',
|
|
18884
|
+
pathMatch: 'full',
|
|
18885
|
+
component: MatBadgeIconTestPage
|
|
18785
18886
|
}
|
|
18786
18887
|
];
|
|
18787
18888
|
var MaterialTestingModule = /** @class */ (function () {
|
|
@@ -18806,7 +18907,8 @@
|
|
|
18806
18907
|
LatLongTestPage,
|
|
18807
18908
|
// NumpadTestPage,
|
|
18808
18909
|
SwipeTestPage,
|
|
18809
|
-
ChipsTestPage
|
|
18910
|
+
ChipsTestPage,
|
|
18911
|
+
MatBadgeIconTestPage
|
|
18810
18912
|
],
|
|
18811
18913
|
exports: [
|
|
18812
18914
|
SharedMaterialModule,
|
|
@@ -18908,20 +19010,22 @@
|
|
|
18908
19010
|
|
|
18909
19011
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
18910
19012
|
var AppForm = /** @class */ (function () {
|
|
18911
|
-
function AppForm(
|
|
18912
|
-
|
|
18913
|
-
this.
|
|
18914
|
-
this._subscription = new rxjs.Subscription();
|
|
19013
|
+
function AppForm(injector, form) {
|
|
19014
|
+
var _this = this;
|
|
19015
|
+
this.error = null;
|
|
18915
19016
|
this._enable = false;
|
|
18916
19017
|
this._loading = true;
|
|
18917
|
-
this.
|
|
19018
|
+
this.i18nFieldPrefix = null;
|
|
19019
|
+
this._subscription = new rxjs.Subscription();
|
|
18918
19020
|
this.debug = false;
|
|
18919
19021
|
this.onCancel = new i0.EventEmitter();
|
|
18920
19022
|
this.onSubmit = new i0.EventEmitter();
|
|
18921
19023
|
if (form)
|
|
18922
19024
|
this.setForm(form);
|
|
18923
|
-
this.
|
|
18924
|
-
|
|
19025
|
+
this.settings = injector.get(LocalSettingsService);
|
|
19026
|
+
this.errorTranslator = injector.get(FormErrorAdapter);
|
|
19027
|
+
this.autocompleteHelper = new MatAutocompleteConfigHolder(this.settings && {
|
|
19028
|
+
getUserAttributes: function (a, b) { return _this.settings.getFieldDisplayAttributes(a, b); }
|
|
18925
19029
|
});
|
|
18926
19030
|
this.autocompleteFields = this.autocompleteHelper.fields;
|
|
18927
19031
|
}
|
|
@@ -19021,6 +19125,9 @@
|
|
|
19021
19125
|
});
|
|
19022
19126
|
AppForm.prototype.ngOnInit = function () {
|
|
19023
19127
|
this._enable ? this.enable() : this.disable();
|
|
19128
|
+
this.errorTranslatorOptions = this.errorTranslatorOptions || {
|
|
19129
|
+
controlPathTranslator: this
|
|
19130
|
+
};
|
|
19024
19131
|
};
|
|
19025
19132
|
AppForm.prototype.ngOnDestroy = function () {
|
|
19026
19133
|
this._subscription.unsubscribe();
|
|
@@ -19130,7 +19237,18 @@
|
|
|
19130
19237
|
if (!opts || opts.emitEvent !== false)
|
|
19131
19238
|
this.markForCheck();
|
|
19132
19239
|
};
|
|
19240
|
+
AppForm.prototype.translateControlPath = function (path) {
|
|
19241
|
+
return this.getFieldName(path);
|
|
19242
|
+
};
|
|
19133
19243
|
/* -- protected methods -- */
|
|
19244
|
+
AppForm.prototype.getFormError = function (form, opts) {
|
|
19245
|
+
if (!form || !this.errorTranslator)
|
|
19246
|
+
return undefined;
|
|
19247
|
+
return this.errorTranslator.translateErrors(this.form, Object.assign({ controlPathTranslator: this }, opts));
|
|
19248
|
+
};
|
|
19249
|
+
AppForm.prototype.getFieldName = function (path) {
|
|
19250
|
+
return (this.i18nFieldPrefix || '') + changeCaseToUnderscore(path).toUpperCase();
|
|
19251
|
+
};
|
|
19134
19252
|
AppForm.prototype.registerSubscription = function (sub) {
|
|
19135
19253
|
return this._subscription.add(sub);
|
|
19136
19254
|
};
|
|
@@ -19147,13 +19265,13 @@
|
|
|
19147
19265
|
{ type: i0.Directive }
|
|
19148
19266
|
];
|
|
19149
19267
|
AppForm.ctorParameters = function () { return [
|
|
19150
|
-
{ type:
|
|
19151
|
-
{ type: i1.FormGroup }
|
|
19152
|
-
{ type: LocalSettingsService }
|
|
19268
|
+
{ type: i0.Injector },
|
|
19269
|
+
{ type: i1.FormGroup }
|
|
19153
19270
|
]; };
|
|
19154
19271
|
AppForm.propDecorators = {
|
|
19155
19272
|
debug: [{ type: i0.Input }],
|
|
19156
19273
|
tabindex: [{ type: i0.Input }],
|
|
19274
|
+
errorTranslatorOptions: [{ type: i0.Input }],
|
|
19157
19275
|
form: [{ type: i0.Input }],
|
|
19158
19276
|
onCancel: [{ type: i0.Output }],
|
|
19159
19277
|
onSubmit: [{ type: i0.Output }]
|
|
@@ -19161,12 +19279,12 @@
|
|
|
19161
19279
|
|
|
19162
19280
|
var AuthForm = /** @class */ (function (_super) {
|
|
19163
19281
|
__extends(AuthForm, _super);
|
|
19164
|
-
function AuthForm(
|
|
19165
|
-
var _this = _super.call(this,
|
|
19282
|
+
function AuthForm(injector, platform, formBuilder, settings, configService, modalCtrl, network, cd, environment) {
|
|
19283
|
+
var _this = _super.call(this, injector, formBuilder.group({
|
|
19166
19284
|
username: [null, i1.Validators.required],
|
|
19167
19285
|
password: [null, i1.Validators.required],
|
|
19168
19286
|
offline: [network.offline]
|
|
19169
|
-
})
|
|
19287
|
+
})) || this;
|
|
19170
19288
|
_this.configService = configService;
|
|
19171
19289
|
_this.modalCtrl = modalCtrl;
|
|
19172
19290
|
_this.network = network;
|
|
@@ -19270,8 +19388,8 @@
|
|
|
19270
19388
|
},] }
|
|
19271
19389
|
];
|
|
19272
19390
|
AuthForm.ctorParameters = function () { return [
|
|
19391
|
+
{ type: i0.Injector },
|
|
19273
19392
|
{ type: PlatformService },
|
|
19274
|
-
{ type: i1$3.DateAdapter },
|
|
19275
19393
|
{ type: i1.FormBuilder },
|
|
19276
19394
|
{ type: LocalSettingsService },
|
|
19277
19395
|
{ type: ConfigService },
|
|
@@ -19974,9 +20092,8 @@
|
|
|
19974
20092
|
|
|
19975
20093
|
var AccountPage = /** @class */ (function (_super) {
|
|
19976
20094
|
__extends(AccountPage, _super);
|
|
19977
|
-
function AccountPage(
|
|
19978
|
-
var _this = _super.call(this,
|
|
19979
|
-
_this.dateAdapter = dateAdapter;
|
|
20095
|
+
function AccountPage(injector, router, formBuilder, accountService, validatorService, settingsValidatorService, translate, settings, cd, locales) {
|
|
20096
|
+
var _this = _super.call(this, injector, validatorService.getFormGroup(accountService.account)) || this;
|
|
19980
20097
|
_this.router = router;
|
|
19981
20098
|
_this.formBuilder = formBuilder;
|
|
19982
20099
|
_this.accountService = accountService;
|
|
@@ -20172,7 +20289,7 @@
|
|
|
20172
20289
|
},] }
|
|
20173
20290
|
];
|
|
20174
20291
|
AccountPage.ctorParameters = function () { return [
|
|
20175
|
-
{ type:
|
|
20292
|
+
{ type: i0.Injector },
|
|
20176
20293
|
{ type: i3.Router },
|
|
20177
20294
|
{ type: i1.FormBuilder },
|
|
20178
20295
|
{ type: AccountService },
|
|
@@ -20571,9 +20688,8 @@
|
|
|
20571
20688
|
|
|
20572
20689
|
var SettingsPage = /** @class */ (function (_super_1) {
|
|
20573
20690
|
__extends(SettingsPage, _super_1);
|
|
20574
|
-
function SettingsPage(
|
|
20575
|
-
var _this = _super_1.call(this,
|
|
20576
|
-
_this.dateAdapter = dateAdapter;
|
|
20691
|
+
function SettingsPage(injector, platform, router, validatorService, alertCtrl, translate, formBuilder, accountService, settings, cd, network, locales) {
|
|
20692
|
+
var _this = _super_1.call(this, injector, validatorService.getFormGroup()) || this;
|
|
20577
20693
|
_this.platform = platform;
|
|
20578
20694
|
_this.router = router;
|
|
20579
20695
|
_this.validatorService = validatorService;
|
|
@@ -20927,7 +21043,7 @@
|
|
|
20927
21043
|
},] }
|
|
20928
21044
|
];
|
|
20929
21045
|
SettingsPage.ctorParameters = function () { return [
|
|
20930
|
-
{ type:
|
|
21046
|
+
{ type: i0.Injector },
|
|
20931
21047
|
{ type: PlatformService },
|
|
20932
21048
|
{ type: i3.Router },
|
|
20933
21049
|
{ type: LocalSettingsValidatorService },
|
|
@@ -20944,8 +21060,7 @@
|
|
|
20944
21060
|
var AppPropertiesForm = /** @class */ (function (_super) {
|
|
20945
21061
|
__extends(AppPropertiesForm, _super);
|
|
20946
21062
|
function AppPropertiesForm(injector, formBuilder, dateAdapter, settings, cd, formGroupDir) {
|
|
20947
|
-
var _this = _super.call(this,
|
|
20948
|
-
_this.injector = injector;
|
|
21063
|
+
var _this = _super.call(this, injector, null) || this;
|
|
20949
21064
|
_this.formBuilder = formBuilder;
|
|
20950
21065
|
_this.dateAdapter = dateAdapter;
|
|
20951
21066
|
_this.settings = settings;
|
|
@@ -21069,7 +21184,7 @@
|
|
|
21069
21184
|
var AppListForm = /** @class */ (function (_super) {
|
|
21070
21185
|
__extends(AppListForm, _super);
|
|
21071
21186
|
function AppListForm(injector, formBuilder, dateAdapter, settings, cd, formGroupDir) {
|
|
21072
|
-
var _this = _super.call(this,
|
|
21187
|
+
var _this = _super.call(this, injector, null) || this;
|
|
21073
21188
|
_this.injector = injector;
|
|
21074
21189
|
_this.formBuilder = formBuilder;
|
|
21075
21190
|
_this.dateAdapter = dateAdapter;
|
|
@@ -23714,7 +23829,7 @@
|
|
|
23714
23829
|
this.saveBeforeSort = toBoolean(this.saveBeforeSort, !this.readOnly); // force to false when readonly
|
|
23715
23830
|
this.saveBeforeFilter = toBoolean(this.saveBeforeFilter, !this.readOnly); // force to false when readonly
|
|
23716
23831
|
this.keepEditedRowOnSave = toBoolean(this.keepEditedRowOnSave, this.inlineEdition);
|
|
23717
|
-
this.
|
|
23832
|
+
this.errorTranslatorOptions = this.errorTranslatorOptions || { separator: ', ', controlPathTranslator: this }; // Can be override in subclasses constructors
|
|
23718
23833
|
// Check ask user confirmation is possible
|
|
23719
23834
|
if (this.confirmBeforeDelete && !this.alertCtrl)
|
|
23720
23835
|
throw Error('Missing \'alertCtrl\' or \'injector\' in component\'s constructor.');
|
|
@@ -24791,7 +24906,7 @@
|
|
|
24791
24906
|
return this._autocompleteConfigHolder.add(fieldName, options);
|
|
24792
24907
|
};
|
|
24793
24908
|
AppTable.prototype.getI18nColumnName = function (columnName) {
|
|
24794
|
-
return this.i18nColumnPrefix + changeCaseToUnderscore(columnName).toUpperCase();
|
|
24909
|
+
return (this.i18nColumnPrefix || '') + changeCaseToUnderscore(columnName).toUpperCase();
|
|
24795
24910
|
};
|
|
24796
24911
|
AppTable.prototype.generateTableId = function () {
|
|
24797
24912
|
return this.location.path(true).replace(/[?].*$/g, '').replace(/\/[\d]+/g, '_id') + '_' + this.constructor.name;
|
|
@@ -24910,7 +25025,7 @@
|
|
|
24910
25025
|
row = row || this.editedRow;
|
|
24911
25026
|
if (!row || !this.formErrorAdapter)
|
|
24912
25027
|
return undefined;
|
|
24913
|
-
return this.formErrorAdapter.translateErrors(row.validator, Object.assign(Object.assign({}, this.
|
|
25028
|
+
return this.formErrorAdapter.translateErrors(row.validator, Object.assign(Object.assign({}, this.errorTranslatorOptions), opts));
|
|
24914
25029
|
};
|
|
24915
25030
|
AppTable.prototype.setError = function (value, opts) {
|
|
24916
25031
|
if (this.errorSubject.value !== value) {
|
|
@@ -25755,6 +25870,7 @@
|
|
|
25755
25870
|
enableListenChanges: (injector.get(ENVIRONMENT).listenRemoteChanges === true), pathIdAttribute: 'id', autoLoad: true, autoUpdateRoute: true, i18nPrefix: ''
|
|
25756
25871
|
}, options);
|
|
25757
25872
|
_this.settings = injector.get(LocalSettingsService);
|
|
25873
|
+
_this.formErrorAdapter = injector.get(FormErrorAdapter);
|
|
25758
25874
|
_this.cd = injector.get(i0.ChangeDetectorRef);
|
|
25759
25875
|
_this.dateFormat = injector.get(DateFormatPipe);
|
|
25760
25876
|
_this.toastController = injector.get(i1$5.ToastController);
|
|
@@ -25856,7 +25972,6 @@
|
|
|
25856
25972
|
/**
|
|
25857
25973
|
* Load data from the snapshot route
|
|
25858
25974
|
*
|
|
25859
|
-
* @param route
|
|
25860
25975
|
* @protected
|
|
25861
25976
|
*/
|
|
25862
25977
|
AppEntityEditor.prototype.loadFromRoute = function () {
|
|
@@ -25965,7 +26080,7 @@
|
|
|
25965
26080
|
idChanged = isNotNil(data.id)
|
|
25966
26081
|
&& this.previousDataId !== undefined // Ignore if first loading (=undefined)
|
|
25967
26082
|
&& this.previousDataId !== data.id;
|
|
25968
|
-
opts = Object.assign({ updateRoute: this._autoUpdateRoute && idChanged && !this.loading, openTabIndex: this._autoOpenNextTab && idChanged && this.computeNextTabIndex() }, opts);
|
|
26083
|
+
opts = Object.assign({ updateRoute: this._autoUpdateRoute && idChanged && !this.loading, openTabIndex: this._autoOpenNextTab && idChanged && isNil(this.previousDataId) && this.computeNextTabIndex() }, opts);
|
|
25969
26084
|
this.data = data;
|
|
25970
26085
|
this.previousDataId = data.id || null;
|
|
25971
26086
|
promiseOrVoid = this.setValue(data);
|
|
@@ -25986,7 +26101,7 @@
|
|
|
25986
26101
|
.then(function () { return _this.updateTitle(data); });
|
|
25987
26102
|
}
|
|
25988
26103
|
else {
|
|
25989
|
-
// Update the
|
|
26104
|
+
// Update the next tab
|
|
25990
26105
|
this.updateTabIndex(opts.openTabIndex);
|
|
25991
26106
|
// Update the title.
|
|
25992
26107
|
this.updateTitle(data);
|
|
@@ -26021,7 +26136,7 @@
|
|
|
26021
26136
|
switch (_b.label) {
|
|
26022
26137
|
case 0:
|
|
26023
26138
|
this.queryParams = this.queryParams || {};
|
|
26024
|
-
// Open the tab
|
|
26139
|
+
// Open the next tab
|
|
26025
26140
|
this.updateTabIndex(opts && opts.openTabIndex);
|
|
26026
26141
|
// Save the opened tab into the queryParams
|
|
26027
26142
|
this.queryParams.tab = this.selectedTabIndex;
|
|
@@ -26054,12 +26169,9 @@
|
|
|
26054
26169
|
* Update the route location, and open the next tab
|
|
26055
26170
|
*/
|
|
26056
26171
|
AppEntityEditor.prototype.updateTabIndex = function (tabIndex) {
|
|
26057
|
-
|
|
26058
|
-
|
|
26059
|
-
|
|
26060
|
-
this.selectedTabIndex = tabIndex;
|
|
26061
|
-
this.markForCheck();
|
|
26062
|
-
}
|
|
26172
|
+
if (isNotNil(tabIndex) && tabIndex > this.selectedTabIndex) {
|
|
26173
|
+
this.selectedTabIndex = tabIndex;
|
|
26174
|
+
this.markForCheck();
|
|
26063
26175
|
}
|
|
26064
26176
|
};
|
|
26065
26177
|
AppEntityEditor.prototype.saveAndClose = function (event, options) {
|
|
@@ -26093,7 +26205,13 @@
|
|
|
26093
26205
|
});
|
|
26094
26206
|
});
|
|
26095
26207
|
};
|
|
26096
|
-
|
|
26208
|
+
/**
|
|
26209
|
+
* Save the editor, by calling the dataService.save().
|
|
26210
|
+
* Ensure that editor if valid. If not, display an error
|
|
26211
|
+
* @param event
|
|
26212
|
+
* @param opts
|
|
26213
|
+
*/
|
|
26214
|
+
AppEntityEditor.prototype.save = function (event, opts) {
|
|
26097
26215
|
return __awaiter(this, void 0, void 0, function () {
|
|
26098
26216
|
var data, updatedData, err_2;
|
|
26099
26217
|
return __generator(this, function (_b) {
|
|
@@ -26131,14 +26249,14 @@
|
|
|
26131
26249
|
case 3:
|
|
26132
26250
|
data = _b.sent();
|
|
26133
26251
|
this.disable();
|
|
26134
|
-
return [4 /*yield*/, this.dataService.save(data,
|
|
26252
|
+
return [4 /*yield*/, this.dataService.save(data, opts)];
|
|
26135
26253
|
case 4:
|
|
26136
26254
|
updatedData = _b.sent();
|
|
26137
26255
|
return [4 /*yield*/, this.onEntitySaved(updatedData)];
|
|
26138
26256
|
case 5:
|
|
26139
26257
|
_b.sent();
|
|
26140
26258
|
// Update the view (e.g metadata)
|
|
26141
|
-
return [4 /*yield*/, this.updateView(updatedData,
|
|
26259
|
+
return [4 /*yield*/, this.updateView(updatedData, opts)];
|
|
26142
26260
|
case 6:
|
|
26143
26261
|
// Update the view (e.g metadata)
|
|
26144
26262
|
_b.sent();
|
|
@@ -26296,7 +26414,7 @@
|
|
|
26296
26414
|
});
|
|
26297
26415
|
};
|
|
26298
26416
|
AppEntityEditor.prototype.setError = function (err) {
|
|
26299
|
-
console.error('[
|
|
26417
|
+
console.error('[entity-editor] Error: ' + err && err.message || '', err);
|
|
26300
26418
|
var userMessage = err && err.message && this.translate.instant(err.message) || err;
|
|
26301
26419
|
// Add details error (if any) under the main message
|
|
26302
26420
|
var detailMessage = err && err.details && (err.details.message || err.details) || undefined;
|
|
@@ -26308,8 +26426,13 @@
|
|
|
26308
26426
|
this.error = userMessage;
|
|
26309
26427
|
};
|
|
26310
26428
|
/* -- protected methods -- */
|
|
26429
|
+
/**
|
|
26430
|
+
* Return undefined to keep same tab
|
|
26431
|
+
* @protected
|
|
26432
|
+
*/
|
|
26311
26433
|
AppEntityEditor.prototype.computeNextTabIndex = function () {
|
|
26312
|
-
|
|
26434
|
+
var nextTabIndex = this.selectedTabIndex + 1;
|
|
26435
|
+
return nextTabIndex < this.tabCount ? nextTabIndex : undefined;
|
|
26313
26436
|
};
|
|
26314
26437
|
AppEntityEditor.prototype.unload = function () {
|
|
26315
26438
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -28028,12 +28151,15 @@
|
|
|
28028
28151
|
exports["ɵ0"] = ɵ0$5;
|
|
28029
28152
|
exports["ɵa"] = CustomReuseStrategy;
|
|
28030
28153
|
exports["ɵb"] = MatNumpadDomService;
|
|
28031
|
-
exports["ɵc"] =
|
|
28032
|
-
exports["ɵd"] =
|
|
28033
|
-
exports["ɵe"] =
|
|
28034
|
-
exports["ɵf"] =
|
|
28035
|
-
exports["ɵg"] =
|
|
28036
|
-
exports["ɵh"] =
|
|
28154
|
+
exports["ɵc"] = SharedMatBadgeIconModule;
|
|
28155
|
+
exports["ɵd"] = MatBadgeIconDirective;
|
|
28156
|
+
exports["ɵe"] = isFocusableElement;
|
|
28157
|
+
exports["ɵf"] = MatBadgeIconTestPage;
|
|
28158
|
+
exports["ɵg"] = RegisterForm;
|
|
28159
|
+
exports["ɵh"] = AccountValidatorService;
|
|
28160
|
+
exports["ɵi"] = RegisterModal;
|
|
28161
|
+
exports["ɵj"] = UserSettingsValidatorService;
|
|
28162
|
+
exports["ɵk"] = LocalSettingsValidatorService;
|
|
28037
28163
|
|
|
28038
28164
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
28039
28165
|
|