canvas-datagrid 0.3.15 → 0.3.17
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/CHANGELOG.md +13 -1
- package/dist/canvas-datagrid.debug.js +12 -13
- package/dist/canvas-datagrid.debug.map +1 -1
- package/dist/canvas-datagrid.js +1 -1
- package/dist/canvas-datagrid.module.js +1 -1
- package/dist/canvas-datagrid.module.js.map +1 -1
- package/lib/draw.js +8 -2
- package/lib/publicMethods.js +6 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,19 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
-
## 0.3.
|
|
10
|
+
## 0.3.17 - 2021-11-18
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Do not render row gaps when sorting (ndrsn, #391)
|
|
15
|
+
|
|
16
|
+
## 0.3.16 - 2021-11-18
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Fix string sort when value is null/undefined (faimaklg, #388)
|
|
21
|
+
|
|
22
|
+
## 0.3.15 - 2021-11-18
|
|
11
23
|
|
|
12
24
|
### Fixed
|
|
13
25
|
|
|
@@ -2796,9 +2796,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
2796
2796
|
|
|
2797
2797
|
self.ctx.restore(); // Gaps may occur in row numbers between consecutively rendered rows
|
|
2798
2798
|
// when we are filtering. We draw attention to this by drawing a thick
|
|
2799
|
-
// border overlapping the two consecutive row headers.
|
|
2799
|
+
// border overlapping the two consecutive row headers. If sorting, visible
|
|
2800
|
+
// row numbers stay the same (i.e. they don't correspond to the underlying
|
|
2801
|
+
// data's row number), so we do not show row gaps in that case.
|
|
2800
2802
|
|
|
2801
|
-
|
|
2803
|
+
var isSorting = self.orderings.columns && self.orderings.columns.length > 0;
|
|
2804
|
+
|
|
2805
|
+
if (isRowHeader && self.attributes.showRowNumbers && self.attributes.showRowNumberGaps && isSorting === false) {
|
|
2802
2806
|
var previousRowNumber = self.getBoundRowIndexFromViewRowIndex(rowOrderIndex - 1);
|
|
2803
2807
|
var hasRowGap = previousRowNumber !== undefined && cell.boundRowIndex > 0 && cell.boundRowIndex - previousRowNumber > 1;
|
|
2804
2808
|
|
|
@@ -8734,27 +8738,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8734
8738
|
self.sorters.string = function (columnName, direction) {
|
|
8735
8739
|
var asc = direction === 'asc';
|
|
8736
8740
|
return function (a, b) {
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
}
|
|
8740
|
-
|
|
8741
|
-
if (b[columnName] === undefined || b[columnName] === null) {
|
|
8742
|
-
return 0;
|
|
8743
|
-
}
|
|
8741
|
+
var aValue = a[columnName] || '';
|
|
8742
|
+
var bValue = b[columnName] || '';
|
|
8744
8743
|
|
|
8745
8744
|
if (asc) {
|
|
8746
|
-
if (!
|
|
8745
|
+
if (!aValue.localeCompare) {
|
|
8747
8746
|
return 1;
|
|
8748
8747
|
}
|
|
8749
8748
|
|
|
8750
|
-
return
|
|
8749
|
+
return aValue.localeCompare(bValue);
|
|
8751
8750
|
}
|
|
8752
8751
|
|
|
8753
|
-
if (!
|
|
8752
|
+
if (!bValue.localeCompare) {
|
|
8754
8753
|
return 1;
|
|
8755
8754
|
}
|
|
8756
8755
|
|
|
8757
|
-
return
|
|
8756
|
+
return bValue.localeCompare(aValue);
|
|
8758
8757
|
};
|
|
8759
8758
|
};
|
|
8760
8759
|
|