@datorama/core 22.6.3 → 22.7.0
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/datorama-core.umd.js +36 -40
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +3 -3
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +2 -2
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +19 -19
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +17 -21
- package/esm2015/lib/version.js +2 -2
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +2 -2
- package/esm5/lib/grid-v2/grid-store/grid.query.js +19 -19
- package/esm5/lib/grid-v2/grid-store/grid.service.js +17 -21
- package/esm5/lib/version.js +2 -2
- package/fesm2015/datorama-core.js +36 -40
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +36 -40
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid-store/grid.query.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10112,26 +10112,26 @@ let GridQuery = class GridQuery extends Query {
|
|
|
10112
10112
|
return settings;
|
|
10113
10113
|
}
|
|
10114
10114
|
getSort() {
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10115
|
+
return this.api.grid.getSortModel().pop();
|
|
10116
|
+
}
|
|
10117
|
+
getExternalSort() {
|
|
10118
|
+
const { sort, colId } = this.getSort() || {};
|
|
10119
|
+
const column = this.api.columns.getColumn(colId);
|
|
10120
|
+
const allColumns = this.api.columns.getAllGridColumns();
|
|
10121
|
+
if (column) {
|
|
10122
|
+
return { colId, sort, field: getColField(column.getColDef()), sortIndex: allColumns.indexOf(column) };
|
|
10123
|
+
}
|
|
10124
|
+
else {
|
|
10125
|
+
const secondaryColumn = this.getSecondaryColumn(colId);
|
|
10126
|
+
if (secondaryColumn) {
|
|
10127
|
+
return {
|
|
10128
|
+
colId,
|
|
10129
|
+
sort,
|
|
10130
|
+
field: getColField(secondaryColumn.getColDef()),
|
|
10131
|
+
sortIndex: allColumns.indexOf(secondaryColumn)
|
|
10132
|
+
};
|
|
10132
10133
|
}
|
|
10133
10134
|
}
|
|
10134
|
-
return this.api.grid.getSortModel().pop();
|
|
10135
10135
|
}
|
|
10136
10136
|
selectSort() {
|
|
10137
10137
|
return this.select(state => state.settings.sort);
|
|
@@ -12722,37 +12722,33 @@ let GridService = class GridService {
|
|
|
12722
12722
|
}
|
|
12723
12723
|
setGridSort(gridSort) {
|
|
12724
12724
|
if (this.api && gridSort) {
|
|
12725
|
-
const { sort, sortIndex
|
|
12725
|
+
const { colId, sort, sortIndex } = gridSort;
|
|
12726
|
+
let sortToApply = gridSort;
|
|
12726
12727
|
if (!isNil(sortIndex)) {
|
|
12727
12728
|
const gridColumns = this.api.columns.getAllGridColumns();
|
|
12728
12729
|
if (gridColumns) {
|
|
12729
|
-
const
|
|
12730
|
-
const
|
|
12731
|
-
if (
|
|
12732
|
-
/** Column is
|
|
12730
|
+
const secondaryColumns = this.api.columns.getSecondaryColumns();
|
|
12731
|
+
const secondaryColumn = secondaryColumns.find((col) => col.getColId() === colId);
|
|
12732
|
+
if (secondaryColumn) {
|
|
12733
|
+
/** Column is pivot value column, sort by index */
|
|
12734
|
+
const columnByIndex = gridColumns[sortIndex];
|
|
12735
|
+
if (columnByIndex) {
|
|
12736
|
+
sortToApply = { colId: columnByIndex.getColId(), sort };
|
|
12737
|
+
}
|
|
12738
|
+
}
|
|
12739
|
+
else {
|
|
12740
|
+
/** Sort by column id */
|
|
12733
12741
|
const columnById = gridColumns.find((col) => {
|
|
12734
12742
|
return (col.getColDef().showRowGroup || col.getColId()) === colId;
|
|
12735
12743
|
});
|
|
12736
12744
|
if (columnById) {
|
|
12737
|
-
|
|
12738
|
-
this.updateSettings({ sort: sortToApply });
|
|
12739
|
-
this.api.grid.setSortModel([sortToApply]);
|
|
12740
|
-
}
|
|
12741
|
-
}
|
|
12742
|
-
else {
|
|
12743
|
-
const columnByIndex = gridColumns[sortIndex];
|
|
12744
|
-
if (columnByIndex) {
|
|
12745
|
-
const sortToApply = { colId: columnByIndex.getColId(), sort };
|
|
12746
|
-
this.updateSettings({ sort: sortToApply });
|
|
12747
|
-
this.api.grid.setSortModel([sortToApply]);
|
|
12745
|
+
sortToApply = { colId: columnById.getColId(), sort };
|
|
12748
12746
|
}
|
|
12749
12747
|
}
|
|
12750
12748
|
}
|
|
12751
12749
|
}
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
this.api.grid.setSortModel([gridSort]);
|
|
12755
|
-
}
|
|
12750
|
+
this.updateSettings({ sort: sortToApply });
|
|
12751
|
+
this.api.grid.setSortModel([sortToApply]);
|
|
12756
12752
|
}
|
|
12757
12753
|
}
|
|
12758
12754
|
updateFilter(column, filter) {
|
|
@@ -13821,7 +13817,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13821
13817
|
const data = this.getGridData();
|
|
13822
13818
|
this.onGridChange.emit({
|
|
13823
13819
|
filter: this.gridQuery.getExternalFilter(),
|
|
13824
|
-
sort: this.gridQuery.
|
|
13820
|
+
sort: this.gridQuery.getExternalSort(),
|
|
13825
13821
|
type,
|
|
13826
13822
|
data
|
|
13827
13823
|
});
|
|
@@ -22694,7 +22690,7 @@ function fixNgLeaks() {
|
|
|
22694
22690
|
};
|
|
22695
22691
|
}
|
|
22696
22692
|
|
|
22697
|
-
window.coreVersion = '22.
|
|
22693
|
+
window.coreVersion = '22.7.0';
|
|
22698
22694
|
|
|
22699
22695
|
/**
|
|
22700
22696
|
* @license
|