@sumaris-net/ngx-components 1.21.4 → 1.21.7
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 +47 -40
- package/bundles/sumaris-net.ngx-components.umd.js.map +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js +1 -1
- package/bundles/sumaris-net.ngx-components.umd.min.js.map +1 -1
- package/esm2015/src/app/core/form/editor.class.js +13 -2
- package/esm2015/src/app/core/form/entity-editor-modal.class.js +19 -24
- package/fesm2015/sumaris-net.ngx-components.js +30 -24
- package/fesm2015/sumaris-net.ngx-components.js.map +1 -1
- package/package.json +1 -1
- package/src/app/core/form/editor.class.d.ts +5 -2
- package/src/app/core/form/entity-editor-modal.class.d.ts +1 -1
- package/sumaris-net.ngx-components.metadata.json +1 -1
|
@@ -28053,6 +28053,13 @@
|
|
|
28053
28053
|
enumerable: false,
|
|
28054
28054
|
configurable: true
|
|
28055
28055
|
});
|
|
28056
|
+
Object.defineProperty(AppEditor.prototype, "editors", {
|
|
28057
|
+
get: function () {
|
|
28058
|
+
return this._children && this._children.filter(function (c) { return c instanceof AppEditor; });
|
|
28059
|
+
},
|
|
28060
|
+
enumerable: false,
|
|
28061
|
+
configurable: true
|
|
28062
|
+
});
|
|
28056
28063
|
Object.defineProperty(AppEditor.prototype, "dirty", {
|
|
28057
28064
|
get: function () {
|
|
28058
28065
|
var _a;
|
|
@@ -28154,7 +28161,15 @@
|
|
|
28154
28161
|
AppEditor.prototype.addChildForms = function (forms) {
|
|
28155
28162
|
var _this = this;
|
|
28156
28163
|
(forms || []).forEach(function (form) { return _this.addChildForm(form); });
|
|
28157
|
-
|
|
28164
|
+
};
|
|
28165
|
+
AppEditor.prototype.removeChildForm = function (form) {
|
|
28166
|
+
if (!form)
|
|
28167
|
+
throw new Error('Trying to remove an undefined child form');
|
|
28168
|
+
var index = (this._children || []).findIndex(function (c) { return c === form; });
|
|
28169
|
+
if (index !== -1) {
|
|
28170
|
+
return this._children.splice(index, 1)[0];
|
|
28171
|
+
}
|
|
28172
|
+
return undefined;
|
|
28158
28173
|
};
|
|
28159
28174
|
AppEditor.prototype.disable = function (opts) {
|
|
28160
28175
|
var _a;
|
|
@@ -29588,19 +29603,19 @@
|
|
|
29588
29603
|
{ type: AppEditorOptions, decorators: [{ type: i0.Optional }] }
|
|
29589
29604
|
]; };
|
|
29590
29605
|
|
|
29591
|
-
var AppEntityEditorModalOptions = /** @class */ (function (
|
|
29592
|
-
__extends(AppEntityEditorModalOptions,
|
|
29606
|
+
var AppEntityEditorModalOptions = /** @class */ (function (_super) {
|
|
29607
|
+
__extends(AppEntityEditorModalOptions, _super);
|
|
29593
29608
|
function AppEntityEditorModalOptions() {
|
|
29594
|
-
return
|
|
29609
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29595
29610
|
}
|
|
29596
29611
|
return AppEntityEditorModalOptions;
|
|
29597
29612
|
}(AppTabEditorOptions));
|
|
29598
29613
|
// @dynamic
|
|
29599
29614
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
|
29600
|
-
var AppEntityEditorModal = /** @class */ (function (
|
|
29601
|
-
__extends(AppEntityEditorModal,
|
|
29615
|
+
var AppEntityEditorModal = /** @class */ (function (_super) {
|
|
29616
|
+
__extends(AppEntityEditorModal, _super);
|
|
29602
29617
|
function AppEntityEditorModal(injector, dataType, options) {
|
|
29603
|
-
var _this =
|
|
29618
|
+
var _this = _super.call(this, null, injector.get(i3.Router), injector.get(i1$5.AlertController), injector.get(i1$2.TranslateService), options) || this;
|
|
29604
29619
|
_this.dataType = dataType;
|
|
29605
29620
|
_this.savingSubject = new rxjs.BehaviorSubject(false);
|
|
29606
29621
|
_this.$title = new rxjs.Subject();
|
|
@@ -29674,37 +29689,29 @@
|
|
|
29674
29689
|
}
|
|
29675
29690
|
};
|
|
29676
29691
|
AppEntityEditorModal.prototype.ngOnInit = function () {
|
|
29677
|
-
var
|
|
29678
|
-
|
|
29679
|
-
|
|
29680
|
-
|
|
29681
|
-
|
|
29682
|
-
|
|
29683
|
-
|
|
29684
|
-
|
|
29685
|
-
|
|
29686
|
-
|
|
29687
|
-
|
|
29688
|
-
|
|
29689
|
-
|
|
29690
|
-
|
|
29691
|
-
|
|
29692
|
-
|
|
29693
|
-
|
|
29694
|
-
}
|
|
29695
|
-
|
|
29696
|
-
// Update title each time value changes
|
|
29697
|
-
this.registerSubscription(this.form.valueChanges
|
|
29698
|
-
.pipe(operators.debounceTime(250))
|
|
29699
|
-
.subscribe(function (json) { return _this.updateTitle(json); }));
|
|
29700
|
-
}
|
|
29701
|
-
return [2 /*return*/];
|
|
29702
|
-
});
|
|
29703
|
-
});
|
|
29692
|
+
var _this = this;
|
|
29693
|
+
// Default values
|
|
29694
|
+
this.mobile = isNotNil(this.mobile) ? this.mobile : this.settings.mobile;
|
|
29695
|
+
_super.prototype.ngOnInit.call(this);
|
|
29696
|
+
// Register forms
|
|
29697
|
+
this.registerForms();
|
|
29698
|
+
// Disable
|
|
29699
|
+
if (this.disabled)
|
|
29700
|
+
this.disable();
|
|
29701
|
+
if (this.isNewData) {
|
|
29702
|
+
// Update the title.
|
|
29703
|
+
this.updateTitle();
|
|
29704
|
+
}
|
|
29705
|
+
else {
|
|
29706
|
+
// Update title each time value changes
|
|
29707
|
+
this.registerSubscription(this.form.valueChanges
|
|
29708
|
+
.pipe(operators.debounceTime(250))
|
|
29709
|
+
.subscribe(function (json) { return _this.updateTitle(json); }));
|
|
29710
|
+
}
|
|
29704
29711
|
};
|
|
29705
29712
|
AppEntityEditorModal.prototype.ngAfterViewInit = function () {
|
|
29706
29713
|
var _this = this;
|
|
29707
|
-
|
|
29714
|
+
_super.prototype.ngAfterViewInit.call(this);
|
|
29708
29715
|
if (this.onAfterModalInit) {
|
|
29709
29716
|
Promise.resolve(this.onAfterModalInit(this))
|
|
29710
29717
|
.then(function () { return _this.load(); });
|
|
@@ -29714,7 +29721,7 @@
|
|
|
29714
29721
|
}
|
|
29715
29722
|
};
|
|
29716
29723
|
AppEntityEditorModal.prototype.ngOnDestroy = function () {
|
|
29717
|
-
|
|
29724
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
29718
29725
|
this.$title.complete();
|
|
29719
29726
|
this.$title.unsubscribe();
|
|
29720
29727
|
this.savingSubject.unsubscribe();
|
|
@@ -29723,7 +29730,7 @@
|
|
|
29723
29730
|
// Wait end of saving
|
|
29724
29731
|
if (this.saving)
|
|
29725
29732
|
return waitForFalse(this.savingSubject);
|
|
29726
|
-
return
|
|
29733
|
+
return _super.prototype.waitIdle.call(this, opts);
|
|
29727
29734
|
};
|
|
29728
29735
|
AppEntityEditorModal.prototype.load = function () {
|
|
29729
29736
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -30010,11 +30017,11 @@
|
|
|
30010
30017
|
};
|
|
30011
30018
|
AppEntityEditorModal.prototype.setError = function (err, opts) {
|
|
30012
30019
|
if (!err) {
|
|
30013
|
-
|
|
30020
|
+
_super.prototype.setError.call(this, undefined, opts);
|
|
30014
30021
|
}
|
|
30015
30022
|
else if (typeof err === 'string') {
|
|
30016
30023
|
console.error('[entity-editor] Error: ' + (err || ''));
|
|
30017
|
-
|
|
30024
|
+
_super.prototype.setError.call(this, err, opts);
|
|
30018
30025
|
}
|
|
30019
30026
|
else {
|
|
30020
30027
|
console.error('[entity-editor] Error: ' + err.message || '', err);
|
|
@@ -30029,7 +30036,7 @@
|
|
|
30029
30036
|
userMessage += detailMessage.length < 70 ? detailMessage : detailMessage.substring(0, 67) + '...';
|
|
30030
30037
|
userMessage += '</small>';
|
|
30031
30038
|
}
|
|
30032
|
-
|
|
30039
|
+
_super.prototype.setError.call(this, userMessage, opts);
|
|
30033
30040
|
}
|
|
30034
30041
|
};
|
|
30035
30042
|
/* -- protected methods -- */
|