2.0.0 • Published 8 months ago

planetcomponents v2.0.0

Weekly downloads
13
License
ISC
Repository
-
Last release
8 months ago

Components

require Bootstrap-vue

Components

AppContainer

Le conteneur de la page

<app-container :appTitle="settings.title">
  <template slot="globalActions">
    <b-button variant="primary"><i class="fab fa-empire" /></b-button>
    // Will appear top right
  </template>
  <div class="container">
    // content
  </div>
</app-container>

ChartContainer

Permet de contenir un graphique Il vaut mieux utiliser un tableau de bords pour cela car chart container attends un format précis

Confirm

Modal de confirmation

<confirm ref="confirmUse" title="Attention">
  Êtes-vous sûre de vouloir utiliser ce composant?
</confirm>
export default {
  methods: {
    async use () {
      await this.$refs.confirmUse.trigger()
    }
  }
}

Dashboard

Permet d'intégrer un tableau de bord. Il faut dans un premier temps le créer sur l'interface de paramétrage. Le rendre global puis utiliser l'id du tableau de bord crée. Dans des soucis d'authentification il faut indiquer le module pour lequel le token est actif

<div class="w-100">
  <dashboard id="idDuTableauDeBord" module="xxx" />
</div>

Datatable

Datatable qui permet de trier, d'avoir un classement par pages et de rechercher.

<template>
  <app-container app-title="Mon titre">
    <datatable ref="_datatable_result" class="mb-1" :colonnes="columns" rowId="id" :rows="rows" :selectable="true" :striped="true" :small="true">
      <template slot="actionsOnAll">
        <b-button size="sm" v-b-tooltip.hover.left @click="fakeAction" title="Action pour du vent" variant="success" class="ml-1 mr-1"><i class="fa fa-jedi" /></b-button>
      </template>
      <template slot-scope="datas">
        <td class="font-weight-bold">{{ datas.line.name }}</td>
        <td>{{ datas.line.age }}</td>
        <td>{{ datas.line.animal }}</td>
        <td>{{ datas.line.account }}</td>
      </template>
    </datatable>
  </app-container>
</template>
import uniqid from 'uniqid'
import Chance from 'chance'
export default {
  data () {
    const chance = new Chance()
    const rows = []
    for (let i = 0; i < 168; i++) {
      rows.push({
        id: uniqid('person-'),
        name: chance.name({ nationality: 'fr' }),
        age: chance.age(),
        animal: chance.animal(),
        account: chance.euro()
      })
    }
    return {
      rows,
      columns: [
        { libelle: 'Nom prénom', id: 'name', sortable: true },
        { libelle: 'Âge', id: 'age', sortable: true },
        { libelle: 'animal', id: 'animal', sortable: false },
        { libelle: 'Fortune', id: 'account', sortable: true }
      ]
    }
  },
  methods: {
    fakeAction () {
      const selection = this.$refs._datatable_result
      console.log(selection.selected)
    }
  }
}

Datepicker

Datepicker au thème de bootstrap

<p-datepicker v-model="today"/>
export default {
  data () {
    return {
      today: new Date() // works with string too eg: '2019-01-01'
    }
  }
}

Loading

Joli loader qui correspond au logiciel et qui s'adapte aux primary / scondary / info de bootstrap

<loading>Chargement...</loading>
<!-- OR -->
<loading />

NavbarSide

Side bar intégrer au template de base. Généralement utilisé de la sorte:

<template>
  <div id="app" class="d-flex flex-grow">
    <navbar-side :routes="routes" app-title="Test" appLogo="fa fa-trash"/>
    <router-view />
  </div>
</template>
export default {
  data () {
    return {
      routes: [
        { path: '/home', libelle: this.$t('message.routes.home'), icon: 'fa-home' },
        { path: '/about', libelle: this.$t('message.routes.about'), icon: 'fa-thumbtack' },
        { path: '/datatable', libelle: this.$t('message.routes.datatable'), icon: 'fa-table' }
      ]
    }
  }
}

PopulationSelection

Sélecteur de population sans jquery. Inclu l'iframe de sélection. Doit être connecté au logiciel pour l'utiliser. Sera remplacer à terme par le nouveau rh

<div class="container" v-show="apiReady">
  <population-selection
    :restrictions="restrictions"
    :mergeRestrictions="merge"
    :options="{ filtresDisabled: ['bases', 'agences', 'departements', 'filiales']}"
    :debut="debut"
    :fin="fin"
    ref="selecteur"
    style="width:100%;height:600px;"
    @loaded="apiReady = true"/>
  <div class="pt-1 d-flex justify-content-center">
    <b-button variant="primary" @click="selectPopulation" disabled="!apiReady">Sélectionner</b-button>
  </div>
</div>
export default {
  data () {
    const today = new Date().toISOString().substr(0, 10)
    return {
      restrictions: {
        filtres: [],
        trigrammes: []
      },
      merge: false,
      debut: today,
      fin: today,
      apiReady: false
    }
  },
  methods: {
    async selectPopulation () {
      const selection = this.$refs.selecteur.getApi()
      const selectionDatas = await selection.api('getSelection')
    }
  }
}

Prompt

Un prompt avec une modale bootstrap

<prompt ref="prompt" title="Attention" label="Nouveau nom:" />
export default {
  methods: {
    async launchPrompt () {
      const value = await this.$refs.prompt.trigger()
      console.log(value)
    }
  }
}

RangeSelector

Un composant lié au datepicker permettant d'avoir accès a des dates préselectionnées eg: ce mois-ci, hier etc.

<range-selector v-model="range" />
<range-selector v-model="range2" />
export default {
  data () {
    return {
      range: null, // will go to custome with value to today
      range2: {
        start: null,
        end: null,
        alias: 'yesterday' // will automatically set start and end to yesterday
      }
    }
  }
}

Alias disponibles:

  • yesterday
  • dayBeforeYesterday
  • thisDayLastWeek
  • previousWeek
  • previousMonth
  • previousYear
  • last2Days
  • last7Days
  • last30Days
  • last90Days
  • last6Months
  • last1Year
  • last2Years
  • last5Years
  • all
  • today
  • todaySoFar
  • thisWeek
  • thisMonth
  • thisYear

Spacer

Utile pour les dispositions flex exemple: Le bouton sera à droite carle spacer prendra tout l'espace disponible

<div class="d-flex">
  <spacer />
  <b-button variant="primary">TEST</b-button>
</div>
2.0.0

8 months ago

1.24.0

2 years ago

1.22.0

3 years ago

1.23.0

3 years ago

1.21.0

3 years ago

1.20.0

3 years ago

1.19.0

3 years ago

1.17.15

4 years ago

1.17.14

4 years ago

1.17.13

4 years ago

1.17.11

4 years ago

1.17.10

4 years ago

1.17.12

4 years ago

1.17.9

4 years ago

1.17.8

4 years ago

1.17.7

4 years ago

1.17.6

4 years ago

1.17.3

4 years ago

1.17.2

4 years ago

1.17.1

4 years ago

1.17.0

4 years ago

1.16.27

5 years ago

1.16.26

5 years ago

1.16.25

5 years ago

1.16.24

5 years ago

1.16.22

5 years ago

1.16.21

5 years ago

1.16.20

5 years ago

1.16.19

5 years ago

1.16.18

5 years ago

1.16.17

5 years ago

1.16.16

5 years ago

1.16.15

5 years ago

1.16.14

5 years ago

1.16.13

5 years ago

1.16.12

5 years ago

1.16.11

5 years ago

1.16.10

5 years ago

1.16.9

5 years ago

1.16.8

5 years ago

1.16.7

5 years ago

1.16.5

5 years ago

1.16.4

5 years ago

1.16.3

5 years ago

1.16.2

5 years ago

1.16.1

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.3

5 years ago

1.14.2

5 years ago

1.14.1

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.6

5 years ago

1.11.5

5 years ago

1.11.4

5 years ago

1.11.3

5 years ago

1.11.2

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.7

5 years ago

1.7.6

5 years ago

1.7.5

5 years ago

1.7.4

5 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.10

5 years ago

1.3.9

5 years ago

1.3.8

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago