@lavalogic/scoria 0.9.1 → 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.
|
@@ -273,6 +273,14 @@
|
|
|
273
273
|
let showFromDateModal = $state(false);
|
|
274
274
|
let showToDateModal = $state(false);
|
|
275
275
|
|
|
276
|
+
function generateOnChangeObject(label: string) {
|
|
277
|
+
return (newValue: SelectOption<string | number> | null) => {
|
|
278
|
+
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
279
|
+
tableContext.dataRepo.__queryValues.set(label, newValue);
|
|
280
|
+
value = newValue;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
276
284
|
function generateOnChangePrimitive(label: string) {
|
|
277
285
|
return (newValue: SelectOption<string | number> | null) => {
|
|
278
286
|
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
@@ -339,25 +347,49 @@
|
|
|
339
347
|
{/if}
|
|
340
348
|
{:else if isSelect}
|
|
341
349
|
{#if hasQuery}
|
|
342
|
-
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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}
|
|
361
393
|
{:else}
|
|
362
394
|
{#await options then options}
|
|
363
395
|
<MultiSelect
|
|
@@ -297,11 +297,18 @@
|
|
|
297
297
|
let showFromDateModal = $state(false);
|
|
298
298
|
let showToDateModal = $state(false);
|
|
299
299
|
|
|
300
|
+
function generateOnChangeObject(label: string) {
|
|
301
|
+
return (newValue: SelectOption<string | number> | null) => {
|
|
302
|
+
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
303
|
+
tableContext.dataRepo.__queryValues.set(label, newValue ?? null);
|
|
304
|
+
value = newValue ?? null;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
300
308
|
function generateOnChangePrimitive(label: string) {
|
|
301
309
|
return (newValue: SelectOption<string | number> | null) => {
|
|
302
310
|
tableContext.paginationRepo?.filterBy(def.id, newValue?.value ?? null);
|
|
303
311
|
tableContext.dataRepo.__queryValues.set(label, newValue?.value ?? null);
|
|
304
|
-
// FIXME <T> is lost when autoformatting. why?
|
|
305
312
|
value = newValue?.value ?? null;
|
|
306
313
|
};
|
|
307
314
|
}
|
|
@@ -393,26 +400,51 @@
|
|
|
393
400
|
<div class="contents">
|
|
394
401
|
{#await options then options}
|
|
395
402
|
{#if hasQuery}
|
|
396
|
-
{
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
+
{#if customFilter!.valueAsObject == false}
|
|
404
|
+
{@const label =
|
|
405
|
+
customFilter?.id ??
|
|
406
|
+
customFilter?.label ??
|
|
407
|
+
customFilter?.objectName ??
|
|
408
|
+
customFilter?.queryKey ??
|
|
409
|
+
def.id}
|
|
403
410
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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}
|
|
416
448
|
{:else}
|
|
417
449
|
<MultiSelect
|
|
418
450
|
label={customFilter?.id ??
|