@lavalogic/scoria 0.9.0 → 0.9.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.
|
@@ -280,11 +280,12 @@
|
|
|
280
280
|
value = newValue;
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
+
|
|
283
284
|
function generateOnChangePrimitive(label: string) {
|
|
284
285
|
return (newValue: SelectOption<string | number> | null) => {
|
|
285
|
-
tableContext.paginationRepo?.filterBy(def.id, newValue ?? null);
|
|
286
|
-
tableContext.dataRepo.__queryValues.set(label, newValue);
|
|
287
|
-
value = newValue
|
|
286
|
+
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
287
|
+
tableContext.dataRepo.__queryValues.set(label, newValue?.value ?? null);
|
|
288
|
+
value = newValue?.value ?? null;
|
|
288
289
|
};
|
|
289
290
|
}
|
|
290
291
|
</script>
|
|
@@ -346,25 +347,49 @@
|
|
|
346
347
|
{/if}
|
|
347
348
|
{:else if isSelect}
|
|
348
349
|
{#if hasQuery}
|
|
349
|
-
{
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
350
|
+
{#if customFilter!.valueAsObject == false}
|
|
351
|
+
{@const label =
|
|
352
|
+
customFilter?.id ??
|
|
353
|
+
customFilter?.label ??
|
|
354
|
+
customFilter?.objectName ??
|
|
355
|
+
customFilter?.queryKey ??
|
|
356
|
+
def.id}
|
|
357
|
+
|
|
358
|
+
<!-- TODO: multiselect -->
|
|
359
|
+
|
|
360
|
+
<QuerySelect
|
|
361
|
+
valueAsObject={false}
|
|
362
|
+
clearable
|
|
363
|
+
name={customFilter?.objectName ?? 'Item'}
|
|
364
|
+
valueProp="value"
|
|
365
|
+
labelProp="label"
|
|
366
|
+
value={value as string | number | null}
|
|
367
|
+
query={customFilter!.query!}
|
|
368
|
+
bind:options={lastQueryOptions}
|
|
369
|
+
onchange={generateOnChangePrimitive(label)}
|
|
370
|
+
/>
|
|
371
|
+
{:else}
|
|
372
|
+
{@const label =
|
|
373
|
+
customFilter?.id ??
|
|
374
|
+
customFilter?.label ??
|
|
375
|
+
customFilter?.objectName ??
|
|
376
|
+
customFilter?.queryKey ??
|
|
377
|
+
def.id}
|
|
378
|
+
|
|
379
|
+
<!-- TODO: multiselect -->
|
|
380
|
+
|
|
381
|
+
<QuerySelect
|
|
382
|
+
valueAsObject={true}
|
|
383
|
+
clearable
|
|
384
|
+
name={customFilter?.objectName ?? 'Item'}
|
|
385
|
+
valueProp="value"
|
|
386
|
+
labelProp="label"
|
|
387
|
+
value={value as null}
|
|
388
|
+
query={customFilter!.query!}
|
|
389
|
+
bind:options={lastQueryOptions}
|
|
390
|
+
onchange={generateOnChangeObject(label)}
|
|
391
|
+
/>
|
|
392
|
+
{/if}
|
|
368
393
|
{:else}
|
|
369
394
|
{#await options then options}
|
|
370
395
|
<MultiSelect
|
|
@@ -300,17 +300,16 @@
|
|
|
300
300
|
function generateOnChangeObject(label: string) {
|
|
301
301
|
return (newValue: SelectOption<string | number> | null) => {
|
|
302
302
|
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
303
|
-
tableContext.dataRepo.__queryValues.set(label, newValue);
|
|
304
|
-
|
|
305
|
-
value = newValue;
|
|
303
|
+
tableContext.dataRepo.__queryValues.set(label, newValue ?? null);
|
|
304
|
+
value = newValue ?? null;
|
|
306
305
|
};
|
|
307
306
|
}
|
|
307
|
+
|
|
308
308
|
function generateOnChangePrimitive(label: string) {
|
|
309
309
|
return (newValue: SelectOption<string | number> | null) => {
|
|
310
|
-
tableContext.paginationRepo?.filterBy(def.id, newValue ?? null);
|
|
311
|
-
tableContext.dataRepo.__queryValues.set(label, newValue);
|
|
312
|
-
|
|
313
|
-
value = newValue as string | number | null;
|
|
310
|
+
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
311
|
+
tableContext.dataRepo.__queryValues.set(label, newValue?.value ?? null);
|
|
312
|
+
value = newValue?.value ?? null;
|
|
314
313
|
};
|
|
315
314
|
}
|
|
316
315
|
</script>
|
|
@@ -401,26 +400,51 @@
|
|
|
401
400
|
<div class="contents">
|
|
402
401
|
{#await options then options}
|
|
403
402
|
{#if hasQuery}
|
|
404
|
-
{
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
403
|
+
{#if customFilter!.valueAsObject == false}
|
|
404
|
+
{@const label =
|
|
405
|
+
customFilter?.id ??
|
|
406
|
+
customFilter?.label ??
|
|
407
|
+
customFilter?.objectName ??
|
|
408
|
+
customFilter?.queryKey ??
|
|
409
|
+
def.id}
|
|
411
410
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
<!-- TODO: multiselect -->
|
|
412
|
+
|
|
413
|
+
<QuerySelect
|
|
414
|
+
valueAsObject={false}
|
|
415
|
+
{label}
|
|
416
|
+
clearable
|
|
417
|
+
name={customFilter?.objectName ?? 'Item'}
|
|
418
|
+
valueProp="value"
|
|
419
|
+
labelProp="label"
|
|
420
|
+
value={value as string | number | null}
|
|
421
|
+
query={customFilter!.query!}
|
|
422
|
+
bind:options={lastQueryOptions}
|
|
423
|
+
onchange={generateOnChangePrimitive(label)}
|
|
424
|
+
/>
|
|
425
|
+
{:else}
|
|
426
|
+
{@const label =
|
|
427
|
+
customFilter?.id ??
|
|
428
|
+
customFilter?.label ??
|
|
429
|
+
customFilter?.objectName ??
|
|
430
|
+
customFilter?.queryKey ??
|
|
431
|
+
def.id}
|
|
432
|
+
|
|
433
|
+
<!-- TODO: multiselect -->
|
|
434
|
+
|
|
435
|
+
<QuerySelect
|
|
436
|
+
valueAsObject={true}
|
|
437
|
+
{label}
|
|
438
|
+
clearable
|
|
439
|
+
name={customFilter?.objectName ?? 'Item'}
|
|
440
|
+
valueProp="value"
|
|
441
|
+
labelProp="label"
|
|
442
|
+
value={value as null}
|
|
443
|
+
query={customFilter!.query!}
|
|
444
|
+
bind:options={lastQueryOptions}
|
|
445
|
+
onchange={generateOnChangeObject(label)}
|
|
446
|
+
/>
|
|
447
|
+
{/if}
|
|
424
448
|
{:else}
|
|
425
449
|
<MultiSelect
|
|
426
450
|
label={customFilter?.id ??
|