@@ -25,8 +25,12 @@ const props = defineProps({
25
25
type: Boolean ,
26
26
required: true ,
27
27
},
28
+ disable: {
29
+ type: Boolean ,
30
+ required: true ,
31
+ },
28
32
});
29
- const currentMode = ref (props .mode );
33
+ const currentMode = ref (! props .disable ? props . mode : " " );
30
34
const windowWidth = useWindowWidth ();
31
35
32
36
const selectModif = () => {
@@ -72,6 +76,7 @@ const redo = () => {
72
76
title =" Modifier"
73
77
aria-label =" Modifier"
74
78
@click =" selectModif()"
79
+ :disabled =" disable"
75
80
>
76
81
<span class =" ri-shape-line" aria-hidden =" true" style =" font-size : 1.2em " ></span >
77
82
<span v-if =" windowWidth > 780" class =" button-text" >Modifier</span >
@@ -83,6 +88,7 @@ const redo = () => {
83
88
title =" Diviser"
84
89
aria-label =" Diviser"
85
90
@click =" selectDivid()"
91
+ :disabled =" disable"
86
92
>
87
93
<span class =" ri-scissors-cut-line" aria-hidden =" true" style =" font-size : 1.2em " ></span >
88
94
<span v-if =" windowWidth > 780" class =" button-text" >Diviser</span >
@@ -95,6 +101,7 @@ const redo = () => {
95
101
title =" Découper les bordures"
96
102
aria-label =" Découper les bordures"
97
103
@click =" selectCutBorders()"
104
+ :disabled =" disable"
98
105
>
99
106
<span class =" fr-icon-crop-line" aria-hidden =" true" ></span >
100
107
<span v-if =" windowWidth > 780" class =" button-text" >{{
@@ -111,25 +118,32 @@ const redo = () => {
111
118
:class =" mesureActive ? 'selected-button' : ''"
112
119
@click =" selectMesure()"
113
120
aria-label =" Mesurer"
121
+ :disabled =" disable"
114
122
>
115
123
<span class =" ri-ruler-line" aria-hidden =" true" style =" font-size : 1.5em " ></span >
116
124
</button >
117
125
<div class =" separator" ></div >
118
- <button type =" button" title =" Supprimer" aria-label =" Supprimer" :disabled =" !canDelete" @click =" supprimer()" >
126
+ <button
127
+ type =" button"
128
+ title =" Supprimer"
129
+ aria-label =" Supprimer"
130
+ :disabled =" !canDelete || disable"
131
+ @click =" supprimer()"
132
+ >
119
133
<span class =" fr-icon-delete-line" aria-hidden =" true" style =" font-size : 1.2em " ></span >
120
134
</button >
121
- <button type =" button" title =" Annuler" aria-label =" Annuler" :disabled =" !canUndo" @click =" undo()" >
135
+ <button type =" button" title =" Annuler" aria-label =" Annuler" :disabled =" !canUndo || disable " @click =" undo()" >
122
136
<span class =" fr-icon-arrow-go-back-line" aria-hidden =" true" style =" font-size : 1.2em " ></span >
123
137
</button >
124
- <button type =" button" title =" Rétablir" aria-label =" Rétablir" :disabled =" !canRedo" @click =" redo()" >
138
+ <button type =" button" title =" Rétablir" aria-label =" Rétablir" :disabled =" !canRedo || disable " @click =" redo()" >
125
139
<span class =" fr-icon-arrow-go-forward-line" aria-hidden =" true" style =" font-size : 1.2em " ></span >
126
140
</button >
127
141
</div >
128
142
</div >
129
143
</Teleport >
130
144
</template >
131
145
132
- <style >
146
+ <style scoped >
133
147
.command-modif-parcellaire {
134
148
display : inline-flex ;
135
149
justify-content : space-between ;
@@ -177,6 +191,10 @@ button:hover {
177
191
background-color : #f5f5f5 ;
178
192
}
179
193
194
+ button :disabled .button-text {
195
+ color : gray ;
196
+ }
197
+
180
198
.button-text {
181
199
margin-left : 4px ;
182
200
color : #000091 ;
0 commit comments