codevdesign 1.0.79 → 2.0.0

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.
@@ -17,7 +17,7 @@
17
17
  v-else
18
18
  class="pt-2"
19
19
  >
20
- <div class="text-overline text-h6 mb-2">{{ texteTitre }}</div>
20
+ <div class="text-label-small text-headline-small mb-2">{{ texteTitre }}</div>
21
21
 
22
22
  <div>
23
23
  <v-list-item
@@ -19,7 +19,6 @@
19
19
  :rules="reglesVuetify"
20
20
  :hint="afficherHint ? placeholder : ''"
21
21
  @blur="sauvegarder"
22
- @keydown.enter="sauvegarder"
23
22
  @keydown="caractereAutorises"
24
23
  @update:model-value="gererChangement"
25
24
  @paste="gererPaste"
@@ -27,8 +26,8 @@
27
26
  <template #item="{ props, item }">
28
27
  <v-list-item
29
28
  v-bind="props"
30
- :title="item.raw.nom || item.raw.code"
31
- :subtitle="item.raw.nom ? item.raw.code : undefined"
29
+ :title="item.nom || item.code"
30
+ :subtitle="item.nom ? item.code : undefined"
32
31
  />
33
32
  </template>
34
33
  </v-combobox>
@@ -136,6 +135,11 @@
136
135
  })
137
136
 
138
137
  const caractereAutorises = (e: KeyboardEvent) => {
138
+ if (e.key === 'Enter') {
139
+ sauvegarder()
140
+ return
141
+ }
142
+
139
143
  if (e.ctrlKey || e.metaKey) return
140
144
 
141
145
  const touchesSpecifiques = ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Home', 'End']
@@ -16,7 +16,6 @@
16
16
 
17
17
  <script setup lang="ts">
18
18
  import { computed, ref } from 'vue'
19
- import { VDateInput } from 'vuetify/labs/VDateInput'
20
19
 
21
20
  type Model = string | Date | null
22
21
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-row
4
- dense
4
+ density="compact"
5
5
  class="pt-0 mt-0"
6
6
  >
7
7
  <v-col
@@ -59,7 +59,7 @@
59
59
  </v-col>
60
60
  </v-row>
61
61
  <v-row
62
- dense
62
+ density="compact"
63
63
  class="pt-0 mt-0"
64
64
  >
65
65
  <v-col
@@ -11,7 +11,7 @@
11
11
  :style="props.styleCss"
12
12
  :color="colorAffiche"
13
13
  :location="locationAffiche"
14
- multi-line
14
+ min-height="68"
15
15
  v-bind="attrsAffiches"
16
16
  @update:model-value="
17
17
  v => {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-row
3
- dense
3
+ density="compact"
4
4
  class="align-center"
5
5
  >
6
6
  <!-- Texte + détails -->
@@ -304,7 +304,7 @@
304
304
  // Helpers "unwrap" (évite item.raw dans le template + évite génériques TS dans template)
305
305
  // ─────────────────────────────────────────────────────────────────────────────
306
306
  function asRaw<T>(item: T | DataTableItemLike<T>): T {
307
- return (item as any)?.raw ?? (item as T)
307
+ return (item as any) ?? (item as T)
308
308
  }
309
309
 
310
310
  const choixOf = (x: any) => asRaw<ChoixVue>(x)
@@ -1,175 +1,175 @@
1
- <template>
2
- <v-row dense>
3
- <v-col
4
- v-if="afficherChampFr"
5
- cols="12"
6
- >
7
- <label
8
- v-if="!libelleInterieur"
9
- :for="`saisieChampFr-${cleTradFr}`"
10
- :class="{ libelle: true, required: estRequis }"
11
- >{{ $t(cleTradFr) }}
12
- </label>
13
- <csqcAide
14
- v-if="props.aide && !libelleInterieur"
15
- :aide="props.aide"
16
- hover
17
- :style-css="'padding-bottom:6px;padding-left:8px;'"
18
- />
19
- <v-textarea
20
- v-if="textarea"
21
- :id="`saisieChampFr-${cleTradFr}`"
22
- v-model="model[champs.Francais]"
23
- density="comfortable"
24
- v-bind="$attrs"
25
- rows="1"
26
- :label="libelleInterieur ? $t(cleTradFr) : ''"
27
- :rules="reglesInterne"
28
- :autofocus="autofocus && afficherChampFr"
29
- />
30
- <v-text-field
31
- v-else
32
- :id="`saisieChampFr-${cleTradFr}`"
33
- v-model="model[champs.Francais]"
34
- density="comfortable"
35
- v-bind="$attrs"
36
- :label="libelleInterieur ? $t(cleTradFr) : ''"
37
- :rules="reglesInterne"
38
- :autofocus="autofocus && afficherChampFr"
39
- />
40
- </v-col>
41
- <v-col
42
- v-if="afficherChampEn"
43
- cols="12"
44
- >
45
- <label
46
- v-if="!libelleInterieur"
47
- :for="`saisieChampEn-${cleTradEn}`"
48
- :class="{ libelle: true, required: estRequis }"
49
- >{{ $t(cleTradEn) }}</label
50
- ><csqcAide
51
- v-if="props.aide && !libelleInterieur"
52
- :aide="props.aide"
53
- hover
54
- :style-css="'padding-bottom:6px;padding-left:8px;'"
55
- />
56
- <v-textarea
57
- v-if="textarea"
58
- :id="`saisieChampEn-${cleTradEn}`"
59
- v-model="model[champs.Anglais]"
60
- rows="1"
61
- v-bind="$attrs"
62
- density="comfortable"
63
- :label="libelleInterieur ? $t(cleTradEn) : ''"
64
- :rules="reglesInterne"
65
- :autofocus="autofocus && !afficherChampFr"
66
- />
67
- <v-text-field
68
- v-else
69
- :id="`saisieChampEn-${cleTradEn}`"
70
- v-model="model[champs.Anglais]"
71
- density="comfortable"
72
- v-bind="$attrs"
73
- :label="libelleInterieur ? $t(cleTradEn) : ''"
74
- :rules="reglesInterne"
75
- :autofocus="autofocus && !afficherChampFr"
76
- />
77
- </v-col>
78
- </v-row>
79
- </template>
80
-
81
- <script setup lang="ts" generic="T extends { id: number }">
82
- import { estRequis as estRequisRegle, estUniqueBilingue, estMinimumLongueur, estMaximumLongueur } from './validateurs'
83
- import { ChoixLangue } from '@/enums/choixLangue'
84
- import csqcAide from './csqcAide.vue'
85
- import { computed, type PropType, toRefs } from 'vue'
86
- import { useI18n } from 'vue-i18n'
87
- const { t } = useI18n({ useScope: 'global' })
88
-
89
- const props = defineProps<{
90
- aide?: string
91
- textarea?: boolean
92
- libelleInterieur?: boolean
93
- estRequis?: boolean
94
- autofocus?: boolean
95
- estUniqueValeurs?: T[]
96
- minimumLongueur?: number
97
- maximumLongueur?: number
98
- regles?: ((v: string) => string | true)[]
99
- langue: ChoixLangue
100
- i18nLibelleRacine: string
101
- champs: { ['Francais']: keyof T; ['Anglais']: keyof T }
102
- }>()
103
-
104
- const { textarea, libelleInterieur, autofocus, estUniqueValeurs, regles, langue, i18nLibelleRacine, champs } =
105
- toRefs(props)
106
-
107
- const minimumLongueur = computed(() => props.minimumLongueur)
108
- const maximumLongueur = computed(() => props.maximumLongueur)
109
- const estRequis = computed(() => props.estRequis)
110
-
111
- const model = defineModel({
112
- type: Object as PropType<T>,
113
- required: true,
114
- })
115
-
116
- const reglesInterne = computed(() => {
117
- const _regles: ((v: string) => string | true)[] = regles.value ?? []
118
-
119
- if (minimumLongueur.value && maximumLongueur.value && minimumLongueur.value > maximumLongueur.value) {
120
- console.error(
121
- `CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
122
- )
123
- throw Error(
124
- `CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
125
- )
126
- }
127
-
128
- if (estRequis.value) _regles.push(v => estRequisRegle(v, t))
129
-
130
- if (estUniqueValeurs.value) {
131
- _regles.push(v =>
132
- estUniqueBilingue(
133
- v,
134
- model.value,
135
- {
136
- champs: { Anglais: champs.value.Anglais, Francais: champs.value.Francais },
137
- valeurs: estUniqueValeurs.value!,
138
- langueCss: langue.value,
139
- },
140
- t,
141
- ),
142
- )
143
- }
144
-
145
- if (minimumLongueur.value !== undefined) _regles.push(v => estMinimumLongueur(v, minimumLongueur.value!, t))
146
-
147
- if (maximumLongueur.value !== undefined) _regles.push(v => estMaximumLongueur(v, maximumLongueur.value!, t))
148
-
149
- return _regles
150
- })
151
-
152
- // Clés i18n
153
- const cleTradEn = computed(() => {
154
- switch (langue.value) {
155
- case ChoixLangue.Bilingue:
156
- case ChoixLangue.Anglais:
157
- return `${i18nLibelleRacine.value}.${String(champs.value.Anglais)}`
158
- default:
159
- return 'cle_manquante'
160
- }
161
- })
162
-
163
- const cleTradFr = computed(() => {
164
- switch (langue.value) {
165
- case ChoixLangue.Bilingue:
166
- case ChoixLangue.Francais:
167
- return `${i18nLibelleRacine.value}.${String(champs.value.Francais)}`
168
- default:
169
- return 'cle_manquante'
170
- }
171
- })
172
-
173
- const afficherChampFr = computed(() => langue.value === ChoixLangue.Francais || langue.value === ChoixLangue.Bilingue)
174
- const afficherChampEn = computed(() => langue.value === ChoixLangue.Anglais || langue.value === ChoixLangue.Bilingue)
175
- </script>
1
+ <template>
2
+ <v-row density="compact">
3
+ <v-col
4
+ v-if="afficherChampFr"
5
+ cols="12"
6
+ >
7
+ <label
8
+ v-if="!libelleInterieur"
9
+ :for="`saisieChampFr-${cleTradFr}`"
10
+ :class="{ libelle: true, required: estRequis }"
11
+ >{{ $t(cleTradFr) }}
12
+ </label>
13
+ <csqcAide
14
+ v-if="props.aide && !libelleInterieur"
15
+ :aide="props.aide"
16
+ hover
17
+ :style-css="'padding-bottom:6px;padding-left:8px;'"
18
+ />
19
+ <v-textarea
20
+ v-if="textarea"
21
+ :id="`saisieChampFr-${cleTradFr}`"
22
+ v-model="model[champs.Francais]"
23
+ density="comfortable"
24
+ v-bind="$attrs"
25
+ rows="1"
26
+ :label="libelleInterieur ? $t(cleTradFr) : ''"
27
+ :rules="reglesInterne"
28
+ :autofocus="autofocus && afficherChampFr"
29
+ />
30
+ <v-text-field
31
+ v-else
32
+ :id="`saisieChampFr-${cleTradFr}`"
33
+ v-model="model[champs.Francais]"
34
+ density="comfortable"
35
+ v-bind="$attrs"
36
+ :label="libelleInterieur ? $t(cleTradFr) : ''"
37
+ :rules="reglesInterne"
38
+ :autofocus="autofocus && afficherChampFr"
39
+ />
40
+ </v-col>
41
+ <v-col
42
+ v-if="afficherChampEn"
43
+ cols="12"
44
+ >
45
+ <label
46
+ v-if="!libelleInterieur"
47
+ :for="`saisieChampEn-${cleTradEn}`"
48
+ :class="{ libelle: true, required: estRequis }"
49
+ >{{ $t(cleTradEn) }}</label
50
+ ><csqcAide
51
+ v-if="props.aide && !libelleInterieur"
52
+ :aide="props.aide"
53
+ hover
54
+ :style-css="'padding-bottom:6px;padding-left:8px;'"
55
+ />
56
+ <v-textarea
57
+ v-if="textarea"
58
+ :id="`saisieChampEn-${cleTradEn}`"
59
+ v-model="model[champs.Anglais]"
60
+ rows="1"
61
+ v-bind="$attrs"
62
+ density="comfortable"
63
+ :label="libelleInterieur ? $t(cleTradEn) : ''"
64
+ :rules="reglesInterne"
65
+ :autofocus="autofocus && !afficherChampFr"
66
+ />
67
+ <v-text-field
68
+ v-else
69
+ :id="`saisieChampEn-${cleTradEn}`"
70
+ v-model="model[champs.Anglais]"
71
+ density="comfortable"
72
+ v-bind="$attrs"
73
+ :label="libelleInterieur ? $t(cleTradEn) : ''"
74
+ :rules="reglesInterne"
75
+ :autofocus="autofocus && !afficherChampFr"
76
+ />
77
+ </v-col>
78
+ </v-row>
79
+ </template>
80
+
81
+ <script setup lang="ts" generic="T extends { id: number }">
82
+ import { estRequis as estRequisRegle, estUniqueBilingue, estMinimumLongueur, estMaximumLongueur } from './validateurs'
83
+ import { ChoixLangue } from '@/enums/choixLangue'
84
+ import csqcAide from './csqcAide.vue'
85
+ import { computed, type PropType, toRefs } from 'vue'
86
+ import { useI18n } from 'vue-i18n'
87
+ const { t } = useI18n({ useScope: 'global' })
88
+
89
+ const props = defineProps<{
90
+ aide?: string
91
+ textarea?: boolean
92
+ libelleInterieur?: boolean
93
+ estRequis?: boolean
94
+ autofocus?: boolean
95
+ estUniqueValeurs?: T[]
96
+ minimumLongueur?: number
97
+ maximumLongueur?: number
98
+ regles?: ((v: string) => string | true)[]
99
+ langue: ChoixLangue
100
+ i18nLibelleRacine: string
101
+ champs: { ['Francais']: keyof T; ['Anglais']: keyof T }
102
+ }>()
103
+
104
+ const { textarea, libelleInterieur, autofocus, estUniqueValeurs, regles, langue, i18nLibelleRacine, champs } =
105
+ toRefs(props)
106
+
107
+ const minimumLongueur = computed(() => props.minimumLongueur)
108
+ const maximumLongueur = computed(() => props.maximumLongueur)
109
+ const estRequis = computed(() => props.estRequis)
110
+
111
+ const model = defineModel({
112
+ type: Object as PropType<T>,
113
+ required: true,
114
+ })
115
+
116
+ const reglesInterne = computed(() => {
117
+ const _regles: ((v: string) => string | true)[] = regles.value ?? []
118
+
119
+ if (minimumLongueur.value && maximumLongueur.value && minimumLongueur.value > maximumLongueur.value) {
120
+ console.error(
121
+ `CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
122
+ )
123
+ throw Error(
124
+ `CsqcTexteBilingue - Longueur min > max. (Min ${minimumLongueur.value} > Max ${maximumLongueur.value})`,
125
+ )
126
+ }
127
+
128
+ if (estRequis.value) _regles.push(v => estRequisRegle(v, t))
129
+
130
+ if (estUniqueValeurs.value) {
131
+ _regles.push(v =>
132
+ estUniqueBilingue(
133
+ v,
134
+ model.value,
135
+ {
136
+ champs: { Anglais: champs.value.Anglais, Francais: champs.value.Francais },
137
+ valeurs: estUniqueValeurs.value!,
138
+ langueCss: langue.value,
139
+ },
140
+ t,
141
+ ),
142
+ )
143
+ }
144
+
145
+ if (minimumLongueur.value !== undefined) _regles.push(v => estMinimumLongueur(v, minimumLongueur.value!, t))
146
+
147
+ if (maximumLongueur.value !== undefined) _regles.push(v => estMaximumLongueur(v, maximumLongueur.value!, t))
148
+
149
+ return _regles
150
+ })
151
+
152
+ // Clés i18n
153
+ const cleTradEn = computed(() => {
154
+ switch (langue.value) {
155
+ case ChoixLangue.Bilingue:
156
+ case ChoixLangue.Anglais:
157
+ return `${i18nLibelleRacine.value}.${String(champs.value.Anglais)}`
158
+ default:
159
+ return 'cle_manquante'
160
+ }
161
+ })
162
+
163
+ const cleTradFr = computed(() => {
164
+ switch (langue.value) {
165
+ case ChoixLangue.Bilingue:
166
+ case ChoixLangue.Francais:
167
+ return `${i18nLibelleRacine.value}.${String(champs.value.Francais)}`
168
+ default:
169
+ return 'cle_manquante'
170
+ }
171
+ })
172
+
173
+ const afficherChampFr = computed(() => langue.value === ChoixLangue.Francais || langue.value === ChoixLangue.Bilingue)
174
+ const afficherChampEn = computed(() => langue.value === ChoixLangue.Anglais || langue.value === ChoixLangue.Bilingue)
175
+ </script>
@@ -5,8 +5,7 @@
5
5
  elevation="1"
6
6
  >
7
7
  <v-row
8
- class="pl-6 pr-6"
9
- align="center"
8
+ class="pl-6 pr-6 align-center"
10
9
  no-gutters
11
10
  >
12
11
  <!-- Première colonne : Logo -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codevdesign",
3
- "version": "1.0.79",
4
- "description": "Composants Vuetify 3 pour les projets Codev",
3
+ "version": "2.0.0",
4
+ "description": "Composants Vuetify 4 pour les projets Codev",
5
5
  "files": [
6
6
  "./**/*.vue",
7
7
  "./**/*.ts",
@@ -13,8 +13,8 @@
13
13
  "build": "vite build"
14
14
  },
15
15
  "dependencies": {
16
- "tinymce-i18n": "^26.1.12",
17
- "sortablejs": "^1.15.6",
16
+ "tinymce-i18n": "^26.6.0",
17
+ "sortablejs": "^1.15.7",
18
18
  "@e965/xlsx": "^0.20.3"
19
19
  },
20
20
  "peerDependencies": {
@@ -25,14 +25,14 @@
25
25
  "tinymce": "^8.3.2"
26
26
  },
27
27
  "devDependencies": {
28
- "vue": "^3.5.18",
29
- "vuetify": "^3.11.2",
30
- "vue-i18n": "^11.2.1",
28
+ "vue": "^3.5.30",
29
+ "vuetify": "^4.1.1",
30
+ "vue-i18n": "^11.4.1",
31
31
  "@tinymce/tinymce-vue": "^6.3.0",
32
- "tinymce": "^8.3.2",
33
- "@types/node": "^22.13.5",
34
- "@vitejs/plugin-vue": "^5.2.1",
35
- "typescript": "^5.8.3",
36
- "vite": "^7.0.0"
32
+ "tinymce": "^8.6.0",
33
+ "@types/node": "^25.9.2",
34
+ "@vitejs/plugin-vue": "^6.0.1",
35
+ "typescript": "^6.0.1",
36
+ "vite": "^8.0.10"
37
37
  }
38
- }
38
+ }