@ni/nimble-components 20.5.3 → 20.5.4

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.
@@ -16288,7 +16288,7 @@
16288
16288
 
16289
16289
  /**
16290
16290
  * Do not edit directly
16291
- * Generated on Fri, 22 Sep 2023 13:55:43 GMT
16291
+ * Generated on Tue, 26 Sep 2023 20:58:04 GMT
16292
16292
  */
16293
16293
 
16294
16294
  const Information100DarkUi = "#a46eff";
@@ -65664,11 +65664,11 @@ img.ProseMirror-separator {
65664
65664
  function getTanStackSortingFunction(sortOperation) {
65665
65665
  switch (sortOperation) {
65666
65666
  case TableColumnSortOperation.basic:
65667
- return sortingFns.basic;
65667
+ return basicSortFunction;
65668
65668
  case TableColumnSortOperation.localeAwareCaseSensitive:
65669
65669
  return localeAwareCaseSensitiveSortFunction;
65670
65670
  default:
65671
- return sortingFns.basic;
65671
+ return basicSortFunction;
65672
65672
  }
65673
65673
  }
65674
65674
  /**
@@ -65690,6 +65690,40 @@ img.ProseMirror-separator {
65690
65690
  }
65691
65691
  return 1;
65692
65692
  }
65693
+ /**
65694
+ * A function to perform a basic sort of two rows from TanStack for a given column.
65695
+ * The function sorts `undefined` followed by `null` before all other values.
65696
+ */
65697
+ function basicSortFunction(rowA, rowB, columnId) {
65698
+ const valueA = rowA.getValue(columnId);
65699
+ const valueB = rowB.getValue(columnId);
65700
+ if (Object.is(valueA, valueB)) {
65701
+ return 0;
65702
+ }
65703
+ if (valueA === undefined) {
65704
+ return -1;
65705
+ }
65706
+ if (valueB === undefined) {
65707
+ return 1;
65708
+ }
65709
+ if (valueA === null) {
65710
+ return -1;
65711
+ }
65712
+ if (valueB === null) {
65713
+ return 1;
65714
+ }
65715
+ if (Number.isNaN(valueA)) {
65716
+ return -1;
65717
+ }
65718
+ if (Number.isNaN(valueB)) {
65719
+ return 1;
65720
+ }
65721
+ if (valueA === 0 && valueB === 0) {
65722
+ // Both values equal 0, but one is -0 and one is +0 because Object.is(valueA, valueB) returned false.
65723
+ return Object.is(valueA, -0) ? -1 : 1;
65724
+ }
65725
+ return valueA > valueB ? 1 : -1;
65726
+ }
65693
65727
 
65694
65728
  /**
65695
65729
  * This class manages the layout of columns within a Table.