feat: use BaseStringList for download-data, enhance Stringlist component

This commit is contained in:
Matthias 2024-11-20 20:59:52 +01:00
parent 8e5e56dd67
commit 9231c29058
2 changed files with 16 additions and 13 deletions

View File

@ -55,11 +55,9 @@ async function startDownload() {
<div class="d-flex flex-fill align-items-end gap-2">
<div class="d-flex flex-column flex-shrink">
<h4 class="text-start">Select Pairs</h4>
<div v-for="(pair, index) in pairs" :key="index">
<BFormInput v-model="pairs[index]" placeholder="Pair"></BFormInput>
</div>
<BaseStringList v-model="pairs" placeholder="Pair" size="md" />
</div>
<BButton variant="primary" title="Add Pair" @click="addPair"><i-mdi-plus /></BButton>
<div class="d-flex flex-column gap-1">
<BButton
v-for="pt in pairTemplates"
@ -75,13 +73,8 @@ async function startDownload() {
<div class="d-flex flex-fill align-items-end gap-2">
<div class="d-flex flex-column flex-shrink">
<h4 class="text-start">Select timeframes</h4>
<div v-for="(tf, index) in timeframes" :key="index">
<BFormInput v-model="timeframes[index]" placeholder="Timeframe"></BFormInput>
</div>
<BaseStringList v-model="timeframes" placeholder="Timeframe" size="md" />
</div>
<BButton variant="primary" title="Add timeframe" @click="addTimeframe"
><i-mdi-plus
/></BButton>
</div>
</div>
<div class="mb-2 border rounded-1 p-2 text-start">

View File

@ -1,14 +1,24 @@
<script setup lang="ts">
const values = defineModel<string[]>({ required: true });
withDefaults(
defineProps<{
placeholder?: string;
size?: string;
}>(),
{
placeholder: '',
size: 'sm',
},
);
</script>
<template>
<div class="d-flex flex-row gap-2">
<div class="d-flex gap-1 flex-column w-100">
<div v-for="(val, idx) in values" :key="idx" class="d-flex flex-row gap-1">
<BFormInput v-model="values[idx]" size="sm"></BFormInput>
<BFormInput v-model="values[idx]" size="sm" :placeholder="placeholder"></BFormInput>
<BButton
size="sm"
:size="size"
variant="outline-secondary"
title="Delete this value."
@click="values.splice(idx, 1)"
@ -18,7 +28,7 @@ const values = defineModel<string[]>({ required: true });
</div>
</div>
<BButton
size="sm"
:size="size"
:title="`Add new value`"
variant="secondary"
class="ms-auto mt-auto"