Added start of hints for form controls.
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
This commit is contained in:
parent
44ead22c4f
commit
9763fd7abe
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineProps<{
|
defineProps<{
|
||||||
label: string
|
label: string
|
||||||
|
hint?: string
|
||||||
}>()
|
}>()
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -9,6 +10,9 @@ defineProps<{
|
||||||
{{ label }}
|
{{ label }}
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</label>
|
</label>
|
||||||
|
<p v-if="hint" style="margin-top: 0.1rem; margin-bottom: 0;" class="font-size-small text-muted">
|
||||||
|
{{ hint }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="css">
|
<style lang="css">
|
||||||
|
|
|
||||||
|
|
@ -281,46 +281,20 @@ function getLocalDateTimeStringFromUTCTimestamp(timestamp: string) {
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<!-- Basic properties -->
|
<!-- Basic properties -->
|
||||||
<FormControl label="Timestamp">
|
<FormControl label="Timestamp">
|
||||||
<input
|
<input type="datetime-local" v-model="timestamp" step="1" :disabled="loading" style="min-width: 250px" />
|
||||||
type="datetime-local"
|
|
||||||
v-model="timestamp"
|
|
||||||
step="1"
|
|
||||||
:disabled="loading"
|
|
||||||
style="min-width: 250px"
|
|
||||||
/>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl label="Amount">
|
<FormControl label="Amount">
|
||||||
<input
|
<input type="number" v-model="amount" step="0.01" min="0.01" :disabled="loading" style="max-width: 100px" />
|
||||||
type="number"
|
|
||||||
v-model="amount"
|
|
||||||
step="0.01"
|
|
||||||
min="0.01"
|
|
||||||
:disabled="loading"
|
|
||||||
style="max-width: 100px"
|
|
||||||
/>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl label="Currency">
|
<FormControl label="Currency">
|
||||||
<select
|
<select v-model="currency" :disabled="loading || availableCurrencies.length === 1">
|
||||||
v-model="currency"
|
<option v-for="currency in availableCurrencies" :key="currency.code" :value="currency">
|
||||||
:disabled="loading || availableCurrencies.length === 1"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="currency in availableCurrencies"
|
|
||||||
:key="currency.code"
|
|
||||||
:value="currency"
|
|
||||||
>
|
|
||||||
{{ currency.code }}
|
{{ currency.code }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl
|
<FormControl label="Description" style="min-width: 200px">
|
||||||
label="Description"
|
<textarea v-model="description" :disabled="loading"></textarea>
|
||||||
style="min-width: 200px"
|
|
||||||
>
|
|
||||||
<textarea
|
|
||||||
v-model="description"
|
|
||||||
:disabled="loading"
|
|
||||||
></textarea>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
|
@ -337,30 +311,16 @@ function getLocalDateTimeStringFromUTCTimestamp(timestamp: string) {
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<!-- Accounts -->
|
<!-- Accounts -->
|
||||||
<FormControl label="Credited Account">
|
<FormControl label="Credited Account">
|
||||||
<select
|
<select v-model="creditedAccountId" :disabled="loading">
|
||||||
v-model="creditedAccountId"
|
<option v-for="account in availableAccounts" :key="account.id" :value="account.id">
|
||||||
:disabled="loading"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="account in availableAccounts"
|
|
||||||
:key="account.id"
|
|
||||||
:value="account.id"
|
|
||||||
>
|
|
||||||
{{ account.name }} ({{ account.numberSuffix }})
|
{{ account.name }} ({{ account.numberSuffix }})
|
||||||
</option>
|
</option>
|
||||||
<option :value="null">None</option>
|
<option :value="null">None</option>
|
||||||
</select>
|
</select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl label="Debited Account">
|
<FormControl label="Debited Account">
|
||||||
<select
|
<select v-model="debitedAccountId" :disabled="loading">
|
||||||
v-model="debitedAccountId"
|
<option v-for="account in availableAccounts" :key="account.id" :value="account.id">
|
||||||
:disabled="loading"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="account in availableAccounts"
|
|
||||||
:key="account.id"
|
|
||||||
:value="account.id"
|
|
||||||
>
|
|
||||||
{{ account.name }} ({{ account.numberSuffix }})
|
{{ account.name }} ({{ account.numberSuffix }})
|
||||||
</option>
|
</option>
|
||||||
<option :value="null">None</option>
|
<option :value="null">None</option>
|
||||||
|
|
@ -368,12 +328,8 @@ function getLocalDateTimeStringFromUTCTimestamp(timestamp: string) {
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<LineItemsEditor
|
<LineItemsEditor v-if="currency" v-model="lineItems" :currency="currency"
|
||||||
v-if="currency"
|
:transaction-amount="floatMoneyToInteger(amount, currency)" />
|
||||||
v-model="lineItems"
|
|
||||||
:currency="currency"
|
|
||||||
:transaction-amount="floatMoneyToInteger(amount, currency)"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
|
|
@ -384,18 +340,12 @@ function getLocalDateTimeStringFromUTCTimestamp(timestamp: string) {
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
<h5>Attachments</h5>
|
<h5>Attachments</h5>
|
||||||
<FileSelector
|
<FileSelector :initial-files="existingTransaction?.attachments ?? []"
|
||||||
:initial-files="existingTransaction?.attachments ?? []"
|
v-model:uploaded-files="attachmentsToUpload" v-model:removed-files="removedAttachmentIds" />
|
||||||
v-model:uploaded-files="attachmentsToUpload"
|
|
||||||
v-model:removed-files="removedAttachmentIds"
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<FormActions
|
<FormActions @cancel="doCancel()" :disabled="loading || !formValid || !unsavedEdits"
|
||||||
@cancel="doCancel()"
|
:submit-text="editing ? 'Save' : 'Add'" />
|
||||||
:disabled="loading || !formValid || !unsavedEdits"
|
|
||||||
:submit-text="editing ? 'Save' : 'Add'"
|
|
||||||
/>
|
|
||||||
</AppForm>
|
</AppForm>
|
||||||
</AppPage>
|
</AppPage>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue