@lavalogic/scoria 0.37.28 → 0.37.30

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.
@@ -294,7 +294,18 @@ export function createColumnFactory() {
294
294
  .query(queryString, item)
295
295
  .then((res) => res),
296
296
  getDisplayValue: opts.getDisplayValue ?? ((row) => String(row[opts.id] ?? '')),
297
- filterValueType: FilterValueType.Select,
297
+ // Query columns have no static option set (the dropdown
298
+ // is built per-keystroke via the consumer's `query`
299
+ // callback), so the quick-filter row cannot render a
300
+ // `Select`-shaped chip with a fixed option list - that
301
+ // produced "def <id> is declared as a select filter but
302
+ // has no getOptions() function" in dev. Use a `String`
303
+ // filter shape so the quick-filter row renders a free
304
+ // text input; for remote-pagination tables the typed
305
+ // value is forwarded to the server filter, and for
306
+ // local data it falls through to substring matching on
307
+ // the `getDisplayValue` result.
308
+ filterValueType: FilterValueType.String,
298
309
  });
299
310
  return makeSpec('query', def, {
300
311
  onEdit: opts.onEdit,
@@ -276,9 +276,24 @@ export class TableContext {
276
276
  if (current !== latest_sortedRowModel) {
277
277
  throw new Error(`stale data`);
278
278
  }
279
- if (originalIndex == null) {
280
- throw new Error(`Sorted Data not found in Original Row Indices: original index ${originalIndex}, index ${index}`);
281
- }
279
+ // Do NOT throw when `originalIndex` is missing. The
280
+ // `originalRowIndices` effect and this one both
281
+ // re-derive asynchronously on `dataRepo.data`
282
+ // changes; when a row is added (e.g. the
283
+ // auto-pushed empty pod line that fires after a
284
+ // user picks an SKU), the sortedRowModel rebuild
285
+ // can win the race and run against a still-stale
286
+ // `ori` map that does not yet contain the new
287
+ // row's key. The previous `throw` rejected the
288
+ // `Promise.all` for the entire rebuild, which
289
+ // left `_sortedRowModel` pinned to the pre-edit
290
+ // snapshot and stopped editable cells from
291
+ // reflecting their post-edit state - the visible
292
+ // symptom on Receipt's SKU cell. Falling back to
293
+ // `unsortedIndex = index` is a fine approximation
294
+ // for the missing entry; the next reactive pass
295
+ // (after `originalRowIndices` catches up) refines
296
+ // it.
282
297
  return this.createRow(item, index, unsortedIndex);
283
298
  }))
284
299
  .then((rows) => {
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.37.28",
4
+ "version": "0.37.30",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },