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-datatable

v1.1.11

Published

DataTable en vue js 3 fonctionnant avec une api laravel 10 - pagination (backend) - filtre (backend) - trie (backend) - recherche (backend) - vue carte / tableau - selection multiple

Readme

asdecode-datatable

DataTable en vue js 3 fonctionnant avec une api laravel 10

  • pagination (backend)
  • filtre (backend)
  • trie (backend)
  • recherche (backend)
  • vue carte / tableau
  • selection multiple

Installation via npm

npm i asdecode-datatable

Importer le composant asdecode-datatable

import 'asdecode-datatable/theme/css/asdecode-datatable-bs4.css';
import AsdecodeTable from 'asdecode-datatable/src/components/AsdecodeTable.vue';

export default defineComponent({
  components: {
    AsdecodeTable
  },
})

Props disponible

table (obligatoire): Le titre du tableau;
columns (obligatoire): listes des colonnes à afficher dans le tableau;
selection: Permet d'afficher les checkbox de selection;
useSearch: Mettre la valeur à "false" pour masquer le champs de recherche;
theader: Mettre la valeur à "false" pour masquer la barre superieur du tableau comprenant les boutons et la recherche;
key-word: Mettre la valeur du mot clé à rechercher si vous utilisez votre propre formulaire de recherche;
view-mode: Possibilité d'utiliser votre propre design pour basculer de la vue "table" à la vue "card"

Evenements disponibles

set-total-records : Recuperer le nombre total des ligne;
row-click : Recuperer l'objet de la ligne sur laquelle vous avez cliqué;
set-selected-rows : Recuperer la liste des lignes selectionnés pour effectuer des actions groupés;

Formats des colonnes

"state" : Afficher dans un badge light;
"date" : Afficher au format date Fr dd/mm/yyyy;
"datetime" : Afficher au format datetime Fr dd/mm/yyyy hh:ss;
"money": Afficher au format money exp: 50.000;

Exemple d'utilisation pour afficher vos données

<template>
    <!-- Afficher le nombre de lignes du tableau -->
    <h1>{{ lines }} lignes</h1>

    <!-- Utilisation du composant -->
    <AsdecodeTable class="mb-4" :columns="columns"
      url="http://localhost:9003/api/vehicules" table="Vehicules" @set-total-records="updateLines" selection
      @row-click="rowclick" @set-selected-rows="getSelection">

      <!-- Modifier l'affichage par defaut d'une colonne -->
      <template #statut="slotProps">
        <span class="p-2 rounded-pill badge badge-primary">{{ slotProps.data.statut }}</span>
      </template>
    </AsdecodeTable>

    !-- Liste des ids des lignes selectionnes -->
    <p>
      lignes selectionnes <br>
      {{ selection }}
    </p>
</template>

<script>
import { defineComponent } from 'vue';
import AsdecodeTable from './components/AsdecodeTable.vue';

export default defineComponent({
  name: 'App',
  components: {
    AsdecodeTable
  },
  data() {
    return {
      lines: 0,
      selection: [],
      columns: [
        {
          key: 'plaque',
          label: 'Immatriculation',
          sortable: true,
          exportable: true,
        },
        {
          key: 'marque',
          label: 'Marque',
          sortable: true,
          exportable: true,
        },
        {
          key: 'type_vehicule',
          label: 'Type / Tonnage',
        },
        {
          key: 'proprietaire',
          label: 'Proprietaire',
        },
        {
          key: 'statut',
          label: 'Etat',
          sortable: true,
          exportable: true,
        }
      ]
    }
  },
  methods: {
    rowclick(line) {
      console.log('row', line)
    },
    updateLines(nb) {
      this.lines = nb
    },
    getSelection(selection) {
      this.selection = selection
    }
  },
});
</script>

Emplacements disponibles

header_action_btns : Ajouter des elements dans l'entete du tableau

<AsdecodeTable class="mb-4" :columns="columns" url="http://localhost:9003/api/vehicules" >
  <template #header_action_btns>
    <button class="mr-2"> Partager </button>
  </template>
</AsdecodeTable>

Personnalisations disponibles


Pour personnaliser il suffit d'ajouter ces class dans votre fichier style et les personnaliser
  card-perso : Agir sur le card de la vue carte
  card-body-perso : Agir sur le card-body de la vue carte

Utilisation de Axios


Si vous utilisez deja Axios dans votre projet, vous devez injecter l'instance de Axios que vous utilisé apres l'avoir importé dans le main.ts/main.js.

exp: 
const app = createApp(App);
app.provide('axios', axios);
app.mount('#app');