@lavalogic/scoria 0.7.0 → 0.7.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.
@@ -55,26 +55,28 @@
55
55
  let asyncCounter = 0;
56
56
  $effect(() => {
57
57
  void editableAsync;
58
- const localCounter = (asyncCounter = asyncCounter + 1);
59
- (async () => {
60
- try {
61
- const isEditable = await editableAsync;
62
- if (asyncCounter === localCounter) {
63
- editable = isEditable;
64
- } else if (dev) {
65
- console.log('skipping async editable because it is stale');
66
- }
67
- } catch (e) {
68
- if (dev) {
69
- console.error(e);
70
- }
71
- if (asyncCounter === localCounter) {
72
- editable = false;
73
- } else if (dev) {
74
- console.log('skipping async editable because it is stale');
58
+ untrack(() => {
59
+ const localCounter = (asyncCounter = asyncCounter + 1);
60
+ (async () => {
61
+ try {
62
+ const isEditable = await editableAsync;
63
+ if (asyncCounter === localCounter) {
64
+ editable = isEditable;
65
+ } else if (dev) {
66
+ console.log('skipping async editable because it is stale');
67
+ }
68
+ } catch (e) {
69
+ if (dev) {
70
+ console.error(e);
71
+ }
72
+ if (asyncCounter === localCounter) {
73
+ editable = false;
74
+ } else if (dev) {
75
+ console.log('skipping async editable because it is stale');
76
+ }
75
77
  }
76
- }
77
- })();
78
+ })();
79
+ });
78
80
  });
79
81
 
80
82
  const focusDetails: TableFocusDetails<T> = $derived(
@@ -600,7 +600,13 @@ export class TableContext {
600
600
  const rows = sortedData.map((item, index) => {
601
601
  const unsortedIndex = this.originalRowIndices.get(item) ?? index;
602
602
  const row = {
603
- getValue: (key) => this.columnDefsById.get(key).accessorFn?.(item, index) ?? item[key],
603
+ getValue: (key) => {
604
+ const gotValue = this.columnDefsById.get(key).accessorFn?.(item, index);
605
+ if (gotValue !== undefined) {
606
+ return gotValue;
607
+ }
608
+ return item[key];
609
+ },
604
610
  original: item,
605
611
  visibleIndex: index,
606
612
  originalIndex: unsortedIndex,
@@ -633,7 +639,13 @@ export class TableContext {
633
639
  },
634
640
  id: `${index}_${def.id}`,
635
641
  row: row,
636
- getValue: () => def.accessorFn?.(item, index) ?? item[def.id] // TODO
642
+ getValue: () => {
643
+ const gotValue = def.accessorFn?.(item, index);
644
+ if (gotValue !== undefined) {
645
+ return gotValue;
646
+ }
647
+ return item[def.id];
648
+ }
637
649
  };
638
650
  };
639
651
  const makeCellFromId = (columnId) => {
@@ -1585,7 +1597,13 @@ export class TableContext {
1585
1597
  // #region private methods
1586
1598
  createRow(item, index, unsortedIndex) {
1587
1599
  const row = {
1588
- getValue: (key) => this.columnDefsById.get(key).accessorFn?.(item, unsortedIndex) ?? item[key],
1600
+ getValue: (key) => {
1601
+ const gotValue = this.columnDefsById.get(key).accessorFn?.(item, unsortedIndex);
1602
+ if (gotValue !== undefined) {
1603
+ return gotValue;
1604
+ }
1605
+ return item[key];
1606
+ },
1589
1607
  original: item,
1590
1608
  visibleIndex: index,
1591
1609
  originalIndex: unsortedIndex,
@@ -1618,7 +1636,13 @@ export class TableContext {
1618
1636
  },
1619
1637
  id: `${index}_${def.id}`,
1620
1638
  row: row,
1621
- getValue: () => def.accessorFn?.(item, index) ?? item[def.id] // TODO
1639
+ getValue: () => {
1640
+ const gotValue = def.accessorFn?.(item, index);
1641
+ if (gotValue !== undefined) {
1642
+ return gotValue;
1643
+ }
1644
+ return item[def.id];
1645
+ }
1622
1646
  };
1623
1647
  };
1624
1648
  const makeCellFromId = (columnId) => {
package/dist/index.d.ts CHANGED
@@ -123,7 +123,7 @@ export { TooltipContext } from './Contexts/TooltipContext.svelte.js';
123
123
  export { UntypedInputContext } from './Contexts/UntypedInputContext.svelte.js';
124
124
  export { Delay } from './Delay/Delay.js';
125
125
  export { DATAMatrix } from './Helpers/Datamatrix.js';
126
- export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
126
+ export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels, asyncSleep } from './Helpers/Helpers.svelte.js';
127
127
  export { type INamed } from './Helpers/INamed.js';
128
128
  export { AttributeOperation } from './Types/Internal/AttributeOperation.js';
129
129
  export { type BigRadioOption } from './Types/Internal/BigRadioOption.js';
package/dist/index.js CHANGED
@@ -130,7 +130,7 @@ export { TooltipContext } from './Contexts/TooltipContext.svelte.js';
130
130
  export { UntypedInputContext } from './Contexts/UntypedInputContext.svelte.js';
131
131
  export { Delay } from './Delay/Delay.js';
132
132
  export { DATAMatrix } from './Helpers/Datamatrix.js';
133
- export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels } from './Helpers/Helpers.svelte.js';
133
+ export { gridItem, autoPluralise, generateUUID, generateShortUUID, refWrapper, SQLFriendly, SQLFriendlyWithLocalTime, passthrough, getCanvasContext, getErrorMessage, isValidEmailAddress, localTimeFormat, vowels, asyncSleep } from './Helpers/Helpers.svelte.js';
134
134
  export {} from './Helpers/INamed.js';
135
135
  export { AttributeOperation } from './Types/Internal/AttributeOperation.js';
136
136
  export {} from './Types/Internal/BigRadioOption.js';
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.7.0",
4
+ "version": "0.7.2",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },