codevdesign 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <v-menu
3
+ v-if="!isXs"
4
+ location="top start"
5
+ >
6
+ <template #activator="{ props: activatorProps }">
7
+ <v-icon
8
+ v-bind="activatorProps"
9
+ :size="small ? 'small' : 'default'"
10
+ start
11
+ color="grisMoyen"
12
+ :style="monstyle"
13
+ >
14
+ mdi-help-circle
15
+ </v-icon>
16
+ </template>
17
+
18
+ <v-card style="max-width: 1000px">
19
+ <v-card-text class="pa-6">
20
+ <span v-html="props.aide"></span>
21
+ </v-card-text>
22
+ </v-card>
23
+ </v-menu>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import { computed } from 'vue'
28
+ import { useDisplay } from 'vuetify'
29
+
30
+ const props = defineProps<{
31
+ aide: string
32
+ monstyle?: string
33
+ small?: boolean
34
+ }>()
35
+
36
+ const { name } = useDisplay()
37
+
38
+ // on évite d'afficher sur les écrans extra-smalls
39
+ const isXs = computed(() => name.value === 'xs')
40
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="pt-4 pb-4 pl-4">
2
+ <div>
3
3
  <v-row dense>
4
4
  <v-col
5
5
  cols="9"
@@ -15,6 +15,8 @@
15
15
  <v-switch
16
16
  v-model="maValeur"
17
17
  :disabled="desactiver"
18
+ :density="densite"
19
+ :inset="inset"
18
20
  @change="sauvegarder"
19
21
  hide-details
20
22
  />
@@ -31,7 +33,7 @@
31
33
  </div>
32
34
  </template>
33
35
  <script setup lang="ts">
34
- import { ref, watch, defineProps, defineEmits, onMounted } from 'vue'
36
+ import { ref, watch, defineProps, defineEmits, onMounted, type PropType } from 'vue'
35
37
 
36
38
  // Définition des props
37
39
  const props = defineProps({
@@ -43,6 +45,10 @@
43
45
  type: Boolean,
44
46
  default: false,
45
47
  },
48
+ inset: {
49
+ type: Boolean,
50
+ default: true,
51
+ },
46
52
  modelValue: {
47
53
  type: Boolean,
48
54
  required: true,
@@ -55,6 +61,7 @@
55
61
  type: String,
56
62
  required: true,
57
63
  },
64
+ densite: { type: String as PropType<'default' | 'comfortable' | 'compact'>, default: 'compact' },
58
65
  })
59
66
 
60
67
  // Définition de l'événement
@@ -48,6 +48,7 @@
48
48
  v-if="rechercheAvancee"
49
49
  :readonly="chargement || desactiver"
50
50
  expand-icon=""
51
+ @update:modelValue="onPanelChange"
51
52
  >
52
53
  <v-expansion-panel
53
54
  flat
@@ -108,6 +109,7 @@
108
109
 
109
110
  const emit = defineEmits<{
110
111
  (e: 'update:recherche', recherche: string): void
112
+ (e: 'panneau:etat', isOpen: boolean): void // événement pour l'ouverture/fermeture du panneau
111
113
  }>()
112
114
 
113
115
  // Création d'une variable locale pour gérer la recherche
@@ -125,6 +127,16 @@
125
127
  watch(rechercheLocale, nouvelleValeur => {
126
128
  emit('update:recherche', nouvelleValeur!)
127
129
  })
130
+
131
+ // Fonction pour émettre l'événement d'ouverture/fermeture du panneau
132
+ const onPanelChange = (val: unknown) => {
133
+ if (typeof val === 'string' || typeof val === 'number' || val === null) {
134
+ const isOpen = val !== null && val !== ''
135
+ emit('panneau:etat', isOpen)
136
+ } else {
137
+ emit('panneau:etat', false)
138
+ }
139
+ }
128
140
  </script>
129
141
 
130
142
  <style lang="css">
package/index.ts CHANGED
@@ -10,6 +10,7 @@ import csqcMenu from './composants/gabarit/csqcMenu.vue'
10
10
  import csqcConfirmation from './composants/csqcConfirmation.vue'
11
11
  import csqcTable from './composants/csqcTable/csqcTable.vue'
12
12
  import csqcChaise from './composants/csqcChaise/chaiseConteneur.vue'
13
+ import csqcAide from './composants/csqcAide.vue'
13
14
 
14
15
  import Utilisateur from './modeles/utilisateur'
15
16
  import Unite from './modeles/unite'
@@ -43,6 +44,7 @@ export {
43
44
  csqcChaise,
44
45
  pivFooter,
45
46
  pivEntete,
47
+ csqcAide,
46
48
  Utilisateur,
47
49
  Unite,
48
50
  Intervention,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codevdesign",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Composants Vuetify 3 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",