@terraware/web-components 3.1.1 → 3.1.2-rc.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.
@@ -1 +1 @@
1
- {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/components/table/sort.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAgC9F;AAqBD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,wBAAgB,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,EACjD,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,KAAK,MAAM,GAClE,CAAC,CAAC,EAAE;KAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE;CAAE,EAAE,CAAC,EAAE;KAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE;CAAE,KAAK,MAAM,CAEpG;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,EAAE,CAYjF"}
1
+ {"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../../src/components/table/sort.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAoC9F;AAqBD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,wBAAgB,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,EACjD,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,KAAK,MAAM,GAClE,CAAC,CAAC,EAAE;KAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE;CAAE,EAAE,CAAC,EAAE;KAAG,GAAG,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,EAAE;CAAE,KAAK,MAAM,CAEpG;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,GAAG,CAAC,EAAE,CAYjF"}
@@ -11,7 +11,11 @@ function descendingComparator(a, b, orderBy, order) {
11
11
  // first attempt to parse into a numeric value and compare
12
12
  const numCompare = descendingNumComparator(a, b, orderBy);
13
13
  if (numCompare !== null) {
14
- return order === 'desc' ? numCompare : numCompare * -1;
14
+ if (numCompare === 0) {
15
+ return numCompare;
16
+ } else {
17
+ return order === 'desc' ? numCompare * -1 : numCompare;
18
+ }
15
19
  }
16
20
 
17
21
  // if non-numeric, compare using the javascript built-in compare for this type
@@ -25,11 +25,11 @@ test('compare equal string fields', () => {
25
25
  });
26
26
  test('compare unequal number fields with same whole number digits', () => {
27
27
  const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number1', 'desc');
28
- expect(Math.sign(cmp)).toEqual(1);
28
+ expect(Math.sign(cmp)).toEqual(-1);
29
29
  });
30
30
  test('compare unequal number fields with differing whole number digits', () => {
31
31
  const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number2', 'desc');
32
- expect(Math.sign(cmp)).toEqual(-1);
32
+ expect(Math.sign(cmp)).toEqual(1);
33
33
  });
34
34
  test('compare equal number fields', () => {
35
35
  const cmp = (0, _sort.descendingComparator)(rowA, rowB, 'number3', 'desc');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraware/web-components",
3
- "version": "3.1.1",
3
+ "version": "3.1.2-rc.0",
4
4
  "author": "Terraformation Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {