Migrates every component from class-based vue-property-decorator to
<script setup> + Composition API. Replaces Vuex 3 + vuex-class with a
single Pinia store (persisted via pinia-plugin-persistedstate). Swaps
Bulma + bulma-{checkradio,switch,pricingtable} for DaisyUI 5 utilities
on Tailwind 4. Replaces register-service-worker with vite-plugin-pwa
(workbox, skipWaiting/clientsClaim preserved).
Plugins replaced:
- vue-class-component / vue-property-decorator -> <script setup>
- vuex / vuex-class / vuex-persist -> pinia + persistedstate
- vue-i18n 8 -> vue-i18n 11 (composition mode, legacy: false)
- vue-click-outside -> @vueuse/core onClickOutside
- @xkeshi/vue-qrcode -> qrcode.vue
- vue-currency-input 1 -> vue-currency-input 3 (composable wrapper)
- bus-event (Vue instance) -> mitt
- Vue filters -> plain functions imported per component
BREAKING: drops Stripe / pricing entirely (Payment, PricingTable,
/pricing route, vue-stripe-checkout, bulma-pricingtable).
Clears unused Cypress and Jest test scaffolding; leaves a Vitest
harness behind for future tests.
29 lines
707 B
TypeScript
29 lines
707 B
TypeScript
import IPoint from '@/models/IPoint'
|
|
import { money } from '@/utils/format'
|
|
import ICurrency from '@/models/ICurrency'
|
|
|
|
class ChartService {
|
|
public valueToPoint(value: number, index: number, total: number): IPoint {
|
|
const x = 0
|
|
const y = -value * 1.6
|
|
const angle = ((Math.PI * 2) / total) * index
|
|
const cos = Math.cos(angle)
|
|
const sin = Math.sin(angle)
|
|
const tx = x * cos - y * sin + 200
|
|
const ty = x * sin + y * cos + 200
|
|
return {
|
|
x: tx,
|
|
y: ty
|
|
}
|
|
}
|
|
|
|
public getLabel(user: string, cost: number, currency: ICurrency): string {
|
|
if (!user) {
|
|
return ''
|
|
}
|
|
return `${user} (${money(cost, currency)})`
|
|
}
|
|
}
|
|
|
|
export default new ChartService()
|