ms-data-grid 0.0.72 → 0.0.73
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.
|
@@ -2141,10 +2141,10 @@ class DataGridComponent {
|
|
|
2141
2141
|
this.selectedTableLayout = 'medium';
|
|
2142
2142
|
this.bodyTextFontsSize = 14;
|
|
2143
2143
|
this.globalSearchText = '';
|
|
2144
|
-
|
|
2144
|
+
this.autosizeAllColumns();
|
|
2145
2145
|
}
|
|
2146
2146
|
this.cdr.detectChanges();
|
|
2147
|
-
},
|
|
2147
|
+
}, 0);
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
2150
|
async setColumnsColumnDropdownValus() {
|
|
@@ -2338,13 +2338,27 @@ class DataGridComponent {
|
|
|
2338
2338
|
this.cdr.detectChanges();
|
|
2339
2339
|
}
|
|
2340
2340
|
cleanColumns(columns) {
|
|
2341
|
-
|
|
2341
|
+
return columns.map((col) => {
|
|
2342
|
+
const { __typename, _id, column_dropdown_value, filterValue, expandedFilter, query, isRowGrouped, ...rest } = col;
|
|
2343
|
+
// Clean dropdown values (__typename removed)
|
|
2344
|
+
const cleanedDropdown = Array.isArray(column_dropdown_value)
|
|
2345
|
+
? column_dropdown_value.map(({ __typename, ...dRest }) => dRest)
|
|
2346
|
+
: column_dropdown_value
|
|
2347
|
+
? (({ __typename, ...dRest }) => dRest)(column_dropdown_value)
|
|
2348
|
+
: null;
|
|
2349
|
+
// Clean query (__typename removed)
|
|
2350
|
+
const cleanedQuery = Array.isArray(query)
|
|
2351
|
+
? query.map(({ __typename, ...qRest }) => qRest)
|
|
2352
|
+
: query
|
|
2353
|
+
? (({ __typename, _ids, ...qRest }) => qRest)(query)
|
|
2354
|
+
: null;
|
|
2342
2355
|
return {
|
|
2343
2356
|
...rest,
|
|
2357
|
+
column_dropdown_value: cleanedDropdown,
|
|
2358
|
+
query: cleanedQuery,
|
|
2344
2359
|
is_groupable: rest.type !== 'image',
|
|
2345
2360
|
};
|
|
2346
2361
|
});
|
|
2347
|
-
return cleanedColumns;
|
|
2348
2362
|
}
|
|
2349
2363
|
onResizeColumn(event, col) {
|
|
2350
2364
|
event.preventDefault();
|
|
@@ -2950,6 +2964,15 @@ class DataGridComponent {
|
|
|
2950
2964
|
this.cdr.detectChanges();
|
|
2951
2965
|
}, 100);
|
|
2952
2966
|
}, 100);
|
|
2967
|
+
setTimeout(() => {
|
|
2968
|
+
const sendData = {
|
|
2969
|
+
columns: this.cleanColumns(this.columns),
|
|
2970
|
+
filters: this.cleanFilterdColumns(),
|
|
2971
|
+
no_of_records: this.paginationConfig.pageSize,
|
|
2972
|
+
type: this.tableType,
|
|
2973
|
+
};
|
|
2974
|
+
this.createUpdateConfigListing.emit(sendData);
|
|
2975
|
+
}, 500);
|
|
2953
2976
|
}
|
|
2954
2977
|
visibleColumns() {
|
|
2955
2978
|
const flatten = this.flattenColumns(this.columns);
|
|
@@ -3762,7 +3785,7 @@ class DataGridComponent {
|
|
|
3762
3785
|
this.currentFilterSelectedIds.clear();
|
|
3763
3786
|
const savedIds = col?.query?._ids || [];
|
|
3764
3787
|
savedIds.forEach((id) => this.currentFilterSelectedIds.add(id));
|
|
3765
|
-
this.selectedFilterOptions = this.selectedColumnForFilter?.column_dropdown_value
|
|
3788
|
+
this.selectedFilterOptions = this.selectedColumnForFilter?.column_dropdown_value?.filter((option) => this.currentFilterSelectedIds.has(option?.id || option?._id || option));
|
|
3766
3789
|
setTimeout(() => {
|
|
3767
3790
|
if (this.filterMenueSearchInput) {
|
|
3768
3791
|
this.filterMenueSearchInput.nativeElement.focus();
|