npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@asdecode/vue-facturation

v0.1.4

Published

Composant Vue 3 pour éditer, imprimer et afficher des factures

Readme

@asdecode/vue-facturation

📦 Vue Invoice Renderer & Editor

Un composant Vue 3 modulaire pour afficher, modifier, imprimer des factures dynamiques, avec prise en charge de la TVA, TPS, CSS, multidevise et QR code. Idéal pour les applications SaaS, ERP ou freelances souhaitant gérer facilement des factures professionnelles.


🚀 Installation

npm install @asdecode/vue-facturation

🧩 Composants inclus

| Composant         | Description                                              |
| ----------------- | -------------------------------------------------------- |
| `InvoiceRenderer` | Affiche une facture stylée avec QR code, logo, signature |
| `InvoiceEditor`   | Permet d’éditer dynamiquement une facture et ses options |

🔧 Utilisation de base

<template>
  <InvoiceEditor v-if="editMode" :invoice="invoice" :options="invoiceOptions" @save="handleSave" />
  <div v-else>
    <InvoiceRenderer
      :key="key"
      :showButtons="showButtons"
      :invoice="invoice"
      :options="invoiceOptions"
      @edit-invoice="openEditMode"
      @print-invoice="printInvoice"
    />
  </div>
</template>

<script>
import { defineComponent } from 'vue'
import { InvoiceRenderer, InvoiceEditor } from '@asdecode/vue-facturation'
import '@asdecode/vue-facturation/dist/vue-facturation.css'

export default defineComponent({
  components: { InvoiceRenderer, InvoiceEditor },
  data() {
    return {
      key: 1,
      invoice: {
        seller: {
          name: 'Asdecode Community',
          logo: 'https://asdecode.com/images/logo.png',
          website: 'https://asdecode.com',
          email: '[email protected]',
          phone: '+241 062 67 32 25',
          signature: 'https://example.com/signature.png'
        },
        client: {
          name: 'Jean Client',
          address: 'Libreville, Gabon',
          phone: '+241 07 654 321'
        },
        items: [
          { title: 'Service A', qty: 2, price: 50000 },
          { title: 'Produit B', qty: 1, price: 20000 }
        ],
        description: [
          { title: 'Services', content: 'Service A effectué avec succès' },
          { title: 'Remarques', content: 'Paiement dû sous 7 jours' }
        ],
        taxes: {
          tva: 18,
          tps: 0,
          css: 2
        },
        issued_at: '2025-07-10',
        due_at: '2025-07-17',
        number: '0023',
        type: 'definitive'
      },
      invoiceOptions: {
        showTaxes: true,
        useTVA: true,
        useTPS: false,
        useCSS: true,
        currency: 'XAF',
        locale: 'fr'
      },
      editMode: false,
      showButtons: true
    }
  },
  methods: {
    openEditMode() {
      this.editMode = true
    },
    handleSave(updatedInvoice) {
      this.invoice = updatedInvoice.invoice
      this.invoiceOptions = updatedInvoice.options
      this.editMode = false
      this.key++
    },
    printInvoice() {
      this.showButtons = false
      this.$nextTick(() => {
        window.print()
        setTimeout(() => (this.showButtons = true), 1000)
      })
    }
  }
})
</script>

⚙️ Props

🔹 InvoiceRenderer
| Prop          | Type      | Description                                       |
| ------------- | --------- | ------------------------------------------------- |
| `invoice`     | `Object`  | Les données complètes de la facture               |
| `options`     | `Object`  | Options d'affichage (TVA, devise, etc.)           |
| `showButtons` | `Boolean` | Affiche ou non les boutons PDF / Print / Modifier |

🔹 InvoiceEditor
| Prop      | Type     | Description                                  |
| --------- | -------- | -------------------------------------------- |
| `invoice` | `Object` | Les données initiales à modifier             |
| `options` | `Object` | Les options initiales de la facture à éditer |

📤 Événements émis

| Événement       | Description                                                    |
| --------------- | -------------------------------------------------------------- |
| `edit-invoice`  | Déclenché depuis `InvoiceRenderer` pour éditer                 |
| `print-invoice` | Déclenche l’impression navigateur                              |
| `save`          | Déclenché depuis `InvoiceEditor` avec les données mises à jour |


Customize configuration

📝 Licence MIT — © 2025 Asdecode