@sumaris-net/ngx-components 2.8.3-beta22 → 2.8.3-beta24
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/esm2022/src/app/core/table/entities-async-table-datasource.class.mjs +9 -6
- package/esm2022/src/app/core/table/entities-table-datasource.class.mjs +9 -6
- package/esm2022/src/app/shared/named-filter/named-filter-selector.component.mjs +5 -2
- package/fesm2022/sumaris-net.ngx-components.mjs +19 -10
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/table/entities-async-table-datasource.class.d.ts +1 -0
- package/src/app/core/table/entities-table-datasource.class.d.ts +1 -0
- package/src/app/shared/inputs.d.ts +1 -1
|
@@ -22154,6 +22154,9 @@ class NamedFilterSelector extends AppForm {
|
|
|
22154
22154
|
console.debug(`${this.logPrefix} import named filter`, data);
|
|
22155
22155
|
if (this.filterImportCallback) {
|
|
22156
22156
|
data = await this.filterImportCallback(data);
|
|
22157
|
+
if (isNil(data)) {
|
|
22158
|
+
return; // Abort import if callback returns null or undefined
|
|
22159
|
+
}
|
|
22157
22160
|
}
|
|
22158
22161
|
this.setControlValue(data);
|
|
22159
22162
|
this.filterSelected.emit(data.content);
|
|
@@ -28263,8 +28266,8 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
28263
28266
|
if (this._saving) {
|
|
28264
28267
|
console.info(`[entities-table-datasource] Received ${this._entityName} data (from service), but still saving: skip`);
|
|
28265
28268
|
}
|
|
28266
|
-
else if (this.
|
|
28267
|
-
console.warn(`[entities-table-datasource] Received ${this._entityName} data, while some row still
|
|
28269
|
+
else if (this.hasSomeDirtyRow()) {
|
|
28270
|
+
console.warn(`[entities-table-datasource] Received ${this._entityName} data, while some row still dirty: skip; Please check save() implementation in the table!`);
|
|
28268
28271
|
}
|
|
28269
28272
|
else {
|
|
28270
28273
|
this.updateDatasource((res.data || []));
|
|
@@ -28279,7 +28282,7 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
28279
28282
|
}
|
|
28280
28283
|
updateDatasourceFromRows(rows) {
|
|
28281
28284
|
// Avoid to update dataSourceSubject, when not need
|
|
28282
|
-
if (this.datasourceSubject.
|
|
28285
|
+
if (this.datasourceSubject.observed) {
|
|
28283
28286
|
if (!this.config.suppressErrors)
|
|
28284
28287
|
console.warn("[entities-table-datasource] Update datasource subject. Please prefer using 'rowsSubject' instead of 'datasourceSubject'");
|
|
28285
28288
|
super.updateDatasourceFromRows(rows);
|
|
@@ -28491,6 +28494,9 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
28491
28494
|
hasSomeEditingRow() {
|
|
28492
28495
|
return (this.rowsSubject.value || []).some((row) => row.editing);
|
|
28493
28496
|
}
|
|
28497
|
+
hasSomeDirtyRow() {
|
|
28498
|
+
return (this.rowsSubject.value || []).some((row) => row.dirty);
|
|
28499
|
+
}
|
|
28494
28500
|
async createNew(insertAt, opts = { editing: true }) {
|
|
28495
28501
|
// Avoid multiple call (only one editing row is allowed)
|
|
28496
28502
|
if (this._creating && opts.editing)
|
|
@@ -28523,8 +28529,8 @@ class EntitiesTableDataSource extends TableDataSource {
|
|
|
28523
28529
|
async fetchMore(opts) {
|
|
28524
28530
|
if (!this._fetchMoreFn)
|
|
28525
28531
|
return false; // Avoid multiple call
|
|
28526
|
-
if (this.
|
|
28527
|
-
console.warn(`Cannot fetch more ${this._entityName} because some row) still
|
|
28532
|
+
if (this.hasSomeDirtyRow()) {
|
|
28533
|
+
console.warn(`Cannot fetch more ${this._entityName} because some row) still dirty`);
|
|
28528
28534
|
return;
|
|
28529
28535
|
}
|
|
28530
28536
|
console.debug(`Will fetching more row(s) still...`);
|
|
@@ -31501,8 +31507,8 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
|
|
|
31501
31507
|
if (this._saving) {
|
|
31502
31508
|
console.info(`[entities-table-datasource] Received ${this._entityName} data (from service), but still saving: skip`);
|
|
31503
31509
|
}
|
|
31504
|
-
else if (this.
|
|
31505
|
-
console.warn(`[entities-table-datasource] Received ${this._entityName} data, while some row still
|
|
31510
|
+
else if (this.hasSomeDirtyRow()) {
|
|
31511
|
+
console.warn(`[entities-table-datasource] Received ${this._entityName} data, while some row still dirty: skip; Please check save() implementation in the table!`);
|
|
31506
31512
|
}
|
|
31507
31513
|
else {
|
|
31508
31514
|
this.updateDatasource((res.data || []));
|
|
@@ -31517,7 +31523,7 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
|
|
|
31517
31523
|
}
|
|
31518
31524
|
updateDatasourceFromRows(rows) {
|
|
31519
31525
|
// Avoid to update dataSourceSubject, when not need
|
|
31520
|
-
if (this.datasourceSubject.
|
|
31526
|
+
if (this.datasourceSubject.observed) {
|
|
31521
31527
|
if (!this.config.suppressErrors)
|
|
31522
31528
|
console.warn("[entities-table-datasource] Update datasource subject. Please prefer using 'rowsSubject' instead of 'datasourceSubject'");
|
|
31523
31529
|
super.updateDatasourceFromRows(rows);
|
|
@@ -31742,6 +31748,9 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
|
|
|
31742
31748
|
hasSomeEditingRow() {
|
|
31743
31749
|
return this.getRows().some((row) => row.editing);
|
|
31744
31750
|
}
|
|
31751
|
+
hasSomeDirtyRow() {
|
|
31752
|
+
return this.getRows().some((row) => row.dirty);
|
|
31753
|
+
}
|
|
31745
31754
|
async createNew(insertAt, opts = { editing: true }) {
|
|
31746
31755
|
// Avoid multiple call (only one editing row is allowed)
|
|
31747
31756
|
if (this._creating && opts.editing)
|
|
@@ -31774,8 +31783,8 @@ class EntitiesAsyncTableDataSource extends AsyncTableDataSource {
|
|
|
31774
31783
|
async fetchMore(opts) {
|
|
31775
31784
|
if (!this._fetchMoreFn)
|
|
31776
31785
|
return false; // Avoid multiple call
|
|
31777
|
-
if (this.
|
|
31778
|
-
console.warn(`Cannot fetch more ${this._entityName} because some row) still
|
|
31786
|
+
if (this.hasSomeDirtyRow()) {
|
|
31787
|
+
console.warn(`Cannot fetch more ${this._entityName} because some row) still dirty`);
|
|
31779
31788
|
return;
|
|
31780
31789
|
}
|
|
31781
31790
|
console.debug(`Will fetching more row(s) still...`);
|