@sumaris-net/ngx-components 18.7.9 → 18.7.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/doc/changelog.md +3 -0
- package/esm2022/src/app/core/table/async-table.class.mjs +16 -9
- package/esm2022/src/app/core/table/table.class.mjs +16 -9
- package/fesm2022/sumaris-net.ngx-components.mjs +30 -16
- package/fesm2022/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app/core/table/async-table.class.d.ts +3 -2
- package/src/app/core/table/table.class.d.ts +2 -1
- package/src/app/shared/inputs.d.ts +1 -1
- package/src/assets/manifest.json +1 -1
|
@@ -33537,6 +33537,7 @@ class AppTable {
|
|
|
33537
33537
|
return this.permanentSelection?.selected || AppTableUtils.getEntities(this.selection.selected);
|
|
33538
33538
|
}
|
|
33539
33539
|
onRefresh = new EventEmitter();
|
|
33540
|
+
onClickRow = new EventEmitter();
|
|
33540
33541
|
onOpenRow = new EventEmitter();
|
|
33541
33542
|
onNewRow = new EventEmitter();
|
|
33542
33543
|
onStartEditingRow = new EventEmitter();
|
|
@@ -33938,9 +33939,9 @@ class AppTable {
|
|
|
33938
33939
|
this.applyFilter(filter, opts);
|
|
33939
33940
|
}
|
|
33940
33941
|
}
|
|
33941
|
-
confirmAndAdd(event, row) {
|
|
33942
|
+
async confirmAndAdd(event, row) {
|
|
33942
33943
|
if (!this.confirmEditCreate(event, row)) {
|
|
33943
|
-
return
|
|
33944
|
+
return false;
|
|
33944
33945
|
}
|
|
33945
33946
|
// Add row
|
|
33946
33947
|
return this.addRow(event);
|
|
@@ -34342,10 +34343,9 @@ class AppTable {
|
|
|
34342
34343
|
console.debug('[table] clickRow event is defaultPrevented');
|
|
34343
34344
|
return false;
|
|
34344
34345
|
}
|
|
34345
|
-
//
|
|
34346
|
-
if (
|
|
34347
|
-
|
|
34348
|
-
console.debug('[table] Row already editing. Skip clickRow event');
|
|
34346
|
+
// Call onClickRow if observed
|
|
34347
|
+
if (this.onClickRow.observed) {
|
|
34348
|
+
this.onClickRow.next(row);
|
|
34349
34349
|
return true;
|
|
34350
34350
|
}
|
|
34351
34351
|
// Open the detail page (if not inline editing)
|
|
@@ -34358,7 +34358,6 @@ class AppTable {
|
|
|
34358
34358
|
}
|
|
34359
34359
|
this._openingRow = true; // Prevent double click
|
|
34360
34360
|
this.markAsLoading();
|
|
34361
|
-
this.selection.clear();
|
|
34362
34361
|
this.openRow(row.currentData.id, row)
|
|
34363
34362
|
.catch((err) => console.error('Failed to open row', err)) // Continue
|
|
34364
34363
|
.then(() => {
|
|
@@ -34651,6 +34650,8 @@ class AppTable {
|
|
|
34651
34650
|
console.warn('[table] Opening row details, but table has unsaved changes!');
|
|
34652
34651
|
}
|
|
34653
34652
|
if (this.onOpenRow.observed) {
|
|
34653
|
+
// Clear selection (because next route can change the current table content)
|
|
34654
|
+
this.selection.clear();
|
|
34654
34655
|
this.onOpenRow.emit(row);
|
|
34655
34656
|
return true;
|
|
34656
34657
|
}
|
|
@@ -34659,6 +34660,8 @@ class AppTable {
|
|
|
34659
34660
|
console.warn('[table] Opening row details, but data has no id!');
|
|
34660
34661
|
return false;
|
|
34661
34662
|
}
|
|
34663
|
+
// Clear selection (because next route can change the current table content)
|
|
34664
|
+
this.selection.clear();
|
|
34662
34665
|
return this.navController.navigateForward(`${this.router.url}/${id}`, {
|
|
34663
34666
|
queryParams: {},
|
|
34664
34667
|
});
|
|
@@ -34672,6 +34675,8 @@ class AppTable {
|
|
|
34672
34675
|
this.onNewRow.emit(event);
|
|
34673
34676
|
return true;
|
|
34674
34677
|
}
|
|
34678
|
+
// Clear selection (because next route can change the current table content)
|
|
34679
|
+
this.selection.clear();
|
|
34675
34680
|
return this.navController.navigateForward(`${this.router.url}/new`);
|
|
34676
34681
|
}
|
|
34677
34682
|
// can be overridden to add more required columns
|
|
@@ -35144,7 +35149,7 @@ class AppTable {
|
|
|
35144
35149
|
}
|
|
35145
35150
|
}
|
|
35146
35151
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppTable, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
35147
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: AppTable, inputs: { settingsId: "settingsId", debug: "debug", i18nColumnPrefix: "i18nColumnPrefix", i18nColumnSuffix: "i18nColumnSuffix", autoLoad: "autoLoad", readOnly: "readOnly", inlineEdition: "inlineEdition", focusFirstColumn: "focusFirstColumn", confirmBeforeDelete: "confirmBeforeDelete", confirmBeforeCancel: "confirmBeforeCancel", undoableDeletion: "undoableDeletion", saveBeforeDelete: "saveBeforeDelete", keepEditedRowOnSave: "keepEditedRowOnSave", saveBeforeSort: "saveBeforeSort", saveBeforeFilter: "saveBeforeFilter", propagateRowError: "propagateRowError", permanentSelectionAllowed: "permanentSelectionAllowed", openRowThrottleTime: "openRowThrottleTime", defaultSortBy: "defaultSortBy", defaultSortDirection: "defaultSortDirection", defaultPageSize: "defaultPageSize", defaultPageSizeOptions: "defaultPageSizeOptions", focusColumn: "focusColumn", dataSource: "dataSource", filter: "filter", disabled: "disabled", paginator: "paginator" }, outputs: { onRefresh: "onRefresh", onOpenRow: "onOpenRow", onNewRow: "onNewRow", onStartEditingRow: "onStartEditingRow", onConfirmEditCreateRow: "onConfirmEditCreateRow", onCancelOrDeleteRow: "onCancelOrDeleteRow", onBeforeDeleteRows: "onBeforeDeleteRows", onBeforeCancelRows: "onBeforeCancelRows", onBeforeSave: "onBeforeSave", onAfterDeletedRows: "onAfterDeletedRows", onSort: "onSort", onDirty: "onDirty", onError: "onError" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "childPaginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], ngImport: i0 });
|
|
35152
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: AppTable, inputs: { settingsId: "settingsId", debug: "debug", i18nColumnPrefix: "i18nColumnPrefix", i18nColumnSuffix: "i18nColumnSuffix", autoLoad: "autoLoad", readOnly: "readOnly", inlineEdition: "inlineEdition", focusFirstColumn: "focusFirstColumn", confirmBeforeDelete: "confirmBeforeDelete", confirmBeforeCancel: "confirmBeforeCancel", undoableDeletion: "undoableDeletion", saveBeforeDelete: "saveBeforeDelete", keepEditedRowOnSave: "keepEditedRowOnSave", saveBeforeSort: "saveBeforeSort", saveBeforeFilter: "saveBeforeFilter", propagateRowError: "propagateRowError", permanentSelectionAllowed: "permanentSelectionAllowed", openRowThrottleTime: "openRowThrottleTime", defaultSortBy: "defaultSortBy", defaultSortDirection: "defaultSortDirection", defaultPageSize: "defaultPageSize", defaultPageSizeOptions: "defaultPageSizeOptions", focusColumn: "focusColumn", dataSource: "dataSource", filter: "filter", disabled: "disabled", paginator: "paginator" }, outputs: { onRefresh: "onRefresh", onClickRow: "onClickRow", onOpenRow: "onOpenRow", onNewRow: "onNewRow", onStartEditingRow: "onStartEditingRow", onConfirmEditCreateRow: "onConfirmEditCreateRow", onCancelOrDeleteRow: "onCancelOrDeleteRow", onBeforeDeleteRows: "onBeforeDeleteRows", onBeforeCancelRows: "onBeforeCancelRows", onBeforeSave: "onBeforeSave", onAfterDeletedRows: "onAfterDeletedRows", onSort: "onSort", onDirty: "onDirty", onError: "onError" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "childPaginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], ngImport: i0 });
|
|
35148
35153
|
}
|
|
35149
35154
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppTable, decorators: [{
|
|
35150
35155
|
type: Directive
|
|
@@ -35200,6 +35205,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
35200
35205
|
type: Input
|
|
35201
35206
|
}], onRefresh: [{
|
|
35202
35207
|
type: Output
|
|
35208
|
+
}], onClickRow: [{
|
|
35209
|
+
type: Output
|
|
35203
35210
|
}], onOpenRow: [{
|
|
35204
35211
|
type: Output
|
|
35205
35212
|
}], onNewRow: [{
|
|
@@ -36282,6 +36289,7 @@ class AppAsyncTable {
|
|
|
36282
36289
|
return this.permanentSelection?.selected || AppTableUtils.getEntities(this.selection.selected);
|
|
36283
36290
|
}
|
|
36284
36291
|
onRefresh = new EventEmitter();
|
|
36292
|
+
onClickRow = new EventEmitter();
|
|
36285
36293
|
onOpenRow = new EventEmitter();
|
|
36286
36294
|
onNewRow = new EventEmitter();
|
|
36287
36295
|
onStartEditingRow = new EventEmitter();
|
|
@@ -36697,7 +36705,7 @@ class AppAsyncTable {
|
|
|
36697
36705
|
await this.editRowById(event, row.id, { focusColumn: this.lastUserColumn });
|
|
36698
36706
|
return true;
|
|
36699
36707
|
}
|
|
36700
|
-
// Edit
|
|
36708
|
+
// Edit row
|
|
36701
36709
|
await this.editRow(event, row, { focusColumn: this.lastUserColumn });
|
|
36702
36710
|
return true;
|
|
36703
36711
|
}
|
|
@@ -37027,7 +37035,7 @@ class AppAsyncTable {
|
|
|
37027
37035
|
toggleSelectRow(event, row) {
|
|
37028
37036
|
// /!\ DO NOT prevent default, otherwise the checkbox will not be updated
|
|
37029
37037
|
//event?.preventDefault();
|
|
37030
|
-
event
|
|
37038
|
+
event?.stopPropagation();
|
|
37031
37039
|
this.selection.toggle(row);
|
|
37032
37040
|
}
|
|
37033
37041
|
async clickRow(event, row) {
|
|
@@ -37045,10 +37053,9 @@ class AppAsyncTable {
|
|
|
37045
37053
|
console.debug('[table] clickRow event is defaultPrevented');
|
|
37046
37054
|
return false;
|
|
37047
37055
|
}
|
|
37048
|
-
//
|
|
37049
|
-
if (
|
|
37050
|
-
|
|
37051
|
-
console.debug('[table] Row already editing. Skip clickRow event');
|
|
37056
|
+
// Call onClickRow if observed
|
|
37057
|
+
if (this.onClickRow.observed) {
|
|
37058
|
+
this.onClickRow.next(row);
|
|
37052
37059
|
return true;
|
|
37053
37060
|
}
|
|
37054
37061
|
// Open the detail page (if not inline editing)
|
|
@@ -37061,7 +37068,6 @@ class AppAsyncTable {
|
|
|
37061
37068
|
}
|
|
37062
37069
|
this._openingRow = true; // Prevent double click
|
|
37063
37070
|
this.markAsLoading();
|
|
37064
|
-
this.selection.clear();
|
|
37065
37071
|
this.openRow(row.currentData.id, row)
|
|
37066
37072
|
.catch((err) => console.error('Failed to open row', err)) // Continue
|
|
37067
37073
|
.then(() => {
|
|
@@ -37352,6 +37358,8 @@ class AppAsyncTable {
|
|
|
37352
37358
|
console.warn('[table] Opening row details, but table has unsaved changes!');
|
|
37353
37359
|
}
|
|
37354
37360
|
if (this.onOpenRow.observed) {
|
|
37361
|
+
// Clear selection (because next route can change the current table content)
|
|
37362
|
+
this.selection.clear();
|
|
37355
37363
|
this.onOpenRow.emit(row);
|
|
37356
37364
|
return true;
|
|
37357
37365
|
}
|
|
@@ -37360,6 +37368,8 @@ class AppAsyncTable {
|
|
|
37360
37368
|
console.warn('[table] Opening row details, but data has no id!');
|
|
37361
37369
|
return false;
|
|
37362
37370
|
}
|
|
37371
|
+
// Clear selection (because next route can change the current table content)
|
|
37372
|
+
this.selection.clear();
|
|
37363
37373
|
return this.navController.navigateForward(`${this.router.url}/${id}`, {
|
|
37364
37374
|
queryParams: {},
|
|
37365
37375
|
});
|
|
@@ -37373,6 +37383,8 @@ class AppAsyncTable {
|
|
|
37373
37383
|
this.onNewRow.emit(event);
|
|
37374
37384
|
return true;
|
|
37375
37385
|
}
|
|
37386
|
+
// Clear selection (because next route can change the current table content)
|
|
37387
|
+
this.selection.clear();
|
|
37376
37388
|
return this.navController.navigateForward(`${this.router.url}/new`);
|
|
37377
37389
|
}
|
|
37378
37390
|
// can be overridden to add more required columns
|
|
@@ -37839,7 +37851,7 @@ class AppAsyncTable {
|
|
|
37839
37851
|
}
|
|
37840
37852
|
}
|
|
37841
37853
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppAsyncTable, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
|
37842
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: AppAsyncTable, inputs: { settingsId: "settingsId", debug: "debug", i18nColumnPrefix: "i18nColumnPrefix", i18nColumnSuffix: "i18nColumnSuffix", autoLoad: "autoLoad", readOnly: "readOnly", inlineEdition: "inlineEdition", focusFirstColumn: "focusFirstColumn", confirmBeforeDelete: "confirmBeforeDelete", confirmBeforeCancel: "confirmBeforeCancel", undoableDeletion: "undoableDeletion", saveBeforeDelete: "saveBeforeDelete", keepEditedRowOnSave: "keepEditedRowOnSave", saveBeforeSort: "saveBeforeSort", saveBeforeFilter: "saveBeforeFilter", propagateRowError: "propagateRowError", permanentSelectionAllowed: "permanentSelectionAllowed", openRowThrottleTime: "openRowThrottleTime", defaultSortBy: "defaultSortBy", defaultSortDirection: "defaultSortDirection", defaultPageSize: "defaultPageSize", defaultPageSizeOptions: "defaultPageSizeOptions", focusColumn: "focusColumn", dataSource: "dataSource", filter: "filter", disabled: "disabled", paginator: "paginator" }, outputs: { onRefresh: "onRefresh", onOpenRow: "onOpenRow", onNewRow: "onNewRow", onStartEditingRow: "onStartEditingRow", onConfirmEditCreateRow: "onConfirmEditCreateRow", onCancelOrDeleteRow: "onCancelOrDeleteRow", onBeforeDeleteRows: "onBeforeDeleteRows", onBeforeCancelRows: "onBeforeCancelRows", onBeforeSave: "onBeforeSave", onAfterDeletedRows: "onAfterDeletedRows", onSort: "onSort", onDirty: "onDirty", onError: "onError" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "childPaginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], ngImport: i0 });
|
|
37854
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: AppAsyncTable, inputs: { settingsId: "settingsId", debug: "debug", i18nColumnPrefix: "i18nColumnPrefix", i18nColumnSuffix: "i18nColumnSuffix", autoLoad: "autoLoad", readOnly: "readOnly", inlineEdition: "inlineEdition", focusFirstColumn: "focusFirstColumn", confirmBeforeDelete: "confirmBeforeDelete", confirmBeforeCancel: "confirmBeforeCancel", undoableDeletion: "undoableDeletion", saveBeforeDelete: "saveBeforeDelete", keepEditedRowOnSave: "keepEditedRowOnSave", saveBeforeSort: "saveBeforeSort", saveBeforeFilter: "saveBeforeFilter", propagateRowError: "propagateRowError", permanentSelectionAllowed: "permanentSelectionAllowed", openRowThrottleTime: "openRowThrottleTime", defaultSortBy: "defaultSortBy", defaultSortDirection: "defaultSortDirection", defaultPageSize: "defaultPageSize", defaultPageSizeOptions: "defaultPageSizeOptions", focusColumn: "focusColumn", dataSource: "dataSource", filter: "filter", disabled: "disabled", paginator: "paginator" }, outputs: { onRefresh: "onRefresh", onClickRow: "onClickRow", onOpenRow: "onOpenRow", onNewRow: "onNewRow", onStartEditingRow: "onStartEditingRow", onConfirmEditCreateRow: "onConfirmEditCreateRow", onCancelOrDeleteRow: "onCancelOrDeleteRow", onBeforeDeleteRows: "onBeforeDeleteRows", onBeforeCancelRows: "onBeforeCancelRows", onBeforeSave: "onBeforeSave", onAfterDeletedRows: "onAfterDeletedRows", onSort: "onSort", onDirty: "onDirty", onError: "onError" }, viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "childPaginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], ngImport: i0 });
|
|
37843
37855
|
}
|
|
37844
37856
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppAsyncTable, decorators: [{
|
|
37845
37857
|
type: Directive
|
|
@@ -37895,6 +37907,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
37895
37907
|
type: Input
|
|
37896
37908
|
}], onRefresh: [{
|
|
37897
37909
|
type: Output
|
|
37910
|
+
}], onClickRow: [{
|
|
37911
|
+
type: Output
|
|
37898
37912
|
}], onOpenRow: [{
|
|
37899
37913
|
type: Output
|
|
37900
37914
|
}], onNewRow: [{
|