mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
Add missing base components and global alias registrations
Create BaseCustomTag (dynamic tag render), BaseFormatMoney, BaseHeading, BaseScrollPane, BaseDescriptionList/Item, BaseLabel, BaseCustomerSelectInput, BaseSpinner, BaseRating, and status label components. Register all renamed v2 components under their old Base* names (BaseInputGroup->FormGroup, BasePage->Page, BaseTable->DataTable, etc.) so templates resolve correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
resources/scripts-v2/components/base/BaseFormatMoney.vue
Normal file
27
resources/scripts-v2/components/base/BaseFormatMoney.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useCompanyStore } from '@v2/stores/company.store'
|
||||
import { formatMoney } from '../../utils/format-money'
|
||||
import type { CurrencyConfig } from '../../utils/format-money'
|
||||
|
||||
interface Props {
|
||||
amount: number | string
|
||||
currency?: CurrencyConfig | null
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
currency: null,
|
||||
})
|
||||
|
||||
const companyStore = useCompanyStore()
|
||||
|
||||
const formattedAmount = computed<string>(() => {
|
||||
const amountNum = typeof props.amount === 'string' ? Number(props.amount) : props.amount
|
||||
const currencyConfig = props.currency ?? companyStore.selectedCompanyCurrency
|
||||
return formatMoney(amountNum, currencyConfig ?? undefined)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span style="font-family: sans-serif">{{ formattedAmount }}</span>
|
||||
</template>
|
||||
Reference in New Issue
Block a user