@lavalogic/scoria 0.11.1 → 0.11.2

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.
@@ -660,7 +660,13 @@ export class TableContext {
660
660
  });
661
661
  sortedRowModel = $derived.by(() => {
662
662
  const rows = this.sortedData.map((item, index) => {
663
- const unsortedIndex = this.originalRowIndices.get(item) ?? index;
663
+ const originalIndex = this.originalRowIndices.get(item);
664
+ const unsortedIndex = originalIndex ?? index;
665
+ if (originalIndex == null) {
666
+ console.log($state.snapshot(this.sortedData));
667
+ console.log($state.snapshot(this.originalRowIndices));
668
+ throw new Error(`Sorted Data not found in Original Row Indices: original index ${originalIndex}, index ${index}`);
669
+ }
664
670
  return this.createRow(item, index, unsortedIndex);
665
671
  });
666
672
  return {
@@ -677,7 +683,9 @@ export class TableContext {
677
683
  const rows = sortedData.map((item, index) => {
678
684
  const unsortedIndex = this.originalRowIndices.get(item) ?? index;
679
685
  if (!item) {
680
- throw new Error('No Item was found');
686
+ console.log($state.snapshot(sortedData));
687
+ console.log($state.snapshot(this.originalRowIndices));
688
+ throw new Error(`No Item was found at index ${index}`);
681
689
  }
682
690
  const row = {
683
691
  getValue: async (key) => {
@@ -1677,7 +1685,8 @@ export class TableContext {
1677
1685
  // #region private methods
1678
1686
  createRow(item, index, unsortedIndex) {
1679
1687
  if (!item) {
1680
- throw new Error('No Item was found');
1688
+ console.log($state.snapshot(this.originalRowIndices));
1689
+ throw new Error(`No Item was found at index ${index} (unsorted index ${unsortedIndex})`);
1681
1690
  }
1682
1691
  const row = {
1683
1692
  getValue: async (key) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.11.1",
4
+ "version": "0.11.2",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },