@lavalogic/scoria 0.5.2 → 0.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.
@@ -125,7 +125,12 @@
125
125
  // as unknown as string | number | undefined;
126
126
 
127
127
  if (gotValue != undefined) {
128
- const key = customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey;
128
+ const key =
129
+ customFilter?.id ??
130
+ customFilter?.label ??
131
+ customFilter?.objectName ??
132
+ customFilter?.queryKey ??
133
+ def.id;
129
134
  const x = key == null ? null : tableContext.dataRepo.__queryValues.get(key);
130
135
  value = (x ?? null) as SelectOption<unknown> | null;
131
136
  }
@@ -286,7 +291,11 @@
286
291
  {#if hasQuery}
287
292
  {#if typeof value == 'object'}
288
293
  {@const label =
289
- customFilter!.label ?? customFilter?.objectName ?? customFilter!.queryKey!}
294
+ customFilter?.id ??
295
+ customFilter?.label ??
296
+ customFilter?.objectName ??
297
+ customFilter?.queryKey ??
298
+ def.id}
290
299
  <!-- TODO: multiselect -->
291
300
 
292
301
  <QuerySelect
@@ -163,7 +163,11 @@
163
163
  if (filteringStateValue != undefined) {
164
164
  console.log(`query values:`, tableContext.dataRepo.__queryValues);
165
165
  const x = tableContext.dataRepo.__queryValues.get(
166
- customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey ?? _uuid
166
+ customFilter?.id ?? customFilter?.label ??
167
+ customFilter?.objectName ??
168
+ customFilter?.queryKey ??
169
+ def.id ??
170
+ _uuid
167
171
  );
168
172
 
169
173
  if (def.debug) {
@@ -351,7 +355,10 @@
351
355
  <div class="maxwidth">
352
356
  {#await optionsPromise then options}
353
357
  <MultiSelect
354
- label={customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey}
358
+ label={customFilter?.id ?? customFilter?.label ??
359
+ customFilter?.objectName ??
360
+ customFilter?.queryKey ??
361
+ def.id}
355
362
  labelProp="label"
356
363
  valueProp="value"
357
364
  name={customFilter?.objectName ?? 'Item'}
@@ -376,8 +383,8 @@
376
383
  {#await options then options}
377
384
  {#if hasQuery}
378
385
  {#if typeof value == 'object'}
379
- {@const label =
380
- customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey}
386
+ {@const label = customFilter?.id ??
387
+ customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey ?? def.id}
381
388
  <!-- TODO: multiselect -->
382
389
 
383
390
  <QuerySelect
@@ -402,7 +409,10 @@
402
409
  {/if}
403
410
  {:else}
404
411
  <MultiSelect
405
- label={customFilter?.label ?? customFilter?.objectName ?? customFilter?.queryKey}
412
+ label={customFilter?.id ?? customFilter?.label ??
413
+ customFilter?.objectName ??
414
+ customFilter?.queryKey ??
415
+ def.id}
406
416
  labelProp="label"
407
417
  valueProp="value"
408
418
  name={customFilter?.objectName ?? 'Item'}
@@ -3,6 +3,7 @@ import type { CustomFilterType } from './CustomFilterType.js';
3
3
  export interface CustomFilter {
4
4
  queryKey: string;
5
5
  type: CustomFilterType;
6
+ id: string;
6
7
  valueAsObject?: boolean;
7
8
  options?: Array<SelectOption<string | number>> | Promise<Array<SelectOption<string | number>>>;
8
9
  multiSelect?: boolean;
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.5.2",
4
+ "version": "0.5.4",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },