|
1 | 1 | <template>
|
2 |
| - <tbody> |
| 2 | + <tbody class="feature-group"> |
3 | 3 | <tr @click.stop="open = !open" @keydown.enter="open = !open" class="clickable group-header" tabindex="0">
|
4 | 4 | <td class="selection">
|
5 | 5 | <div class="fr-checkbox-group single-checkbox">
|
6 | 6 | <input type="checkbox" :id="'radio-'+ featureGroup.key" :checked="allSelected" @click="toggleFeatureGroup" />
|
7 |
| - <label class="fr-label" :for="'radio-'+ featureGroup.key" /> |
| 7 | + <label class="fr-label" :for="'radio-'+ featureGroup.key" :aria-label="allSelected ? `Désélectionner les parcelles ${featureGroup.label.toLocaleLowerCase()}` : `Sélectionner les parcelles ${featureGroup.label.toLocaleLowerCase()}`" /> |
8 | 8 | </div>
|
9 | 9 | </td>
|
10 | 10 | <td class="accordion"><span class="fr-icon fr-icon-arrow-down-s-line" :aria-checked="open" aria-role="button" /></td>
|
|
29 | 29 | </tr>
|
30 | 30 | <tr>
|
31 | 31 | <td colspan="7">
|
32 |
| - <table class="fr-table group-table"> |
| 32 | + <table class="fr-table group-table fr-table--no-caption" :aria-describedby="`operator-features-summary-${featureGroup.key}`"> |
| 33 | + <caption> |
| 34 | + Parcelles {{ featureGroup.label.toLocaleLowerCase() }} |
| 35 | + </caption> |
33 | 36 | <colgroup>
|
34 | 37 | <col class="selection" />
|
35 | 38 | <col class="labels" />
|
36 | 39 | <col class="certification" />
|
37 | 40 | <col class="surface" />
|
38 | 41 | <col class="actions" />
|
39 | 42 | </colgroup>
|
40 |
| - <tr :hidden="!open" class="intermediate-header"> |
41 |
| - <th scope="col"></th> |
42 |
| - <th scope="col" v-if="isGroupedByCulture">Nom</th> |
43 |
| - <th scope="col" v-else>Culture</th> |
44 |
| - <th scope="col" class="certification"> |
45 |
| - <span class=" fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl">Certification</span> |
46 |
| - </th> |
47 |
| - <th scope="col" class="surface"> |
48 |
| - <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl">Surface</span> |
49 |
| - </th> |
50 |
| - <th scope="col" class="actions">Actions</th> |
51 |
| - </tr> |
52 |
| - <tr class="parcelle clickable" :class="{'parcelle--is-new': feature.id === Number(route.query?.new)}" :id="'parcelle-' + feature.id" :hidden="!open" v-for="feature in featureGroup.features" :key="feature.id" @mouseover="hoveredId = feature.id" :aria-current="feature.id === hoveredId ? 'location' : null"> |
53 |
| - <th scope="row"> |
54 |
| - <div class="fr-checkbox-group single-checkbox"> |
55 |
| - <input type="checkbox" :id="'radio-' + feature.id" :checked="selectedIds.includes(feature.id)" @click="toggleSingleSelected(feature.id)" /> |
56 |
| - <label class="fr-label" :for="'radio-' + feature.id" /> |
57 |
| - </div> |
58 |
| - </th> |
59 |
| - <td @click="isOnline && toggleEditForm(feature.id)" v-if="isGroupedByCulture"> |
60 |
| - <span class="culture-name">{{ featureName(feature) }}</span> |
61 |
| - <small class="feature-precision" v-if="feature.properties.cultures.length > 1">Multi-culture</small> |
62 |
| - <small class="feature-precision fr-hidden-sm fr-hidden-md fr-hidden-lg fr-hidden-xl"> |
63 |
| - <ConversionLevel :feature="feature" with-date /><br /> |
64 |
| - {{ inHa(legalProjectionSurface(feature)) }} ha |
65 |
| - </small> |
66 |
| - </td> |
67 |
| - <td @click="isOnline && toggleEditForm(feature.id)" v-else> |
68 |
| - <span class="culture-type" v-if="feature.properties.cultures.length > 1"> |
69 |
| - Multi-cultures<span class="fr-sr-only"> : </span> |
70 |
| - <small class="feature-precision" v-for="(culture, i) in feature.properties.cultures" :key="i"> |
71 |
| - <span v-if="i" class="fr-sr-only">, </span>{{ cultureLabel(culture) }} |
| 43 | + <tbody> |
| 44 | + <tr :hidden="!open" class="intermediate-header"> |
| 45 | + <th scope="col" aria-hidden></th> |
| 46 | + <th scope="col" v-if="isGroupedByCulture">Nom</th> |
| 47 | + <th scope="col" v-else>Culture</th> |
| 48 | + <th scope="col" class="certification"> |
| 49 | + <span class=" fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl">Certification</span> |
| 50 | + </th> |
| 51 | + <th scope="col" class="surface"> |
| 52 | + <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl">Surface</span> |
| 53 | + </th> |
| 54 | + <th scope="col" class="actions">Actions</th> |
| 55 | + </tr> |
| 56 | + <tr class="parcelle clickable" :class="{'parcelle--is-new': feature.id === Number(route.query?.new)}" :id="'parcelle-' + feature.id" :hidden="!open" v-for="feature in featureGroup.features" :key="feature.id" @mouseover="hoveredId = feature.id" :aria-current="feature.id === hoveredId ? 'location' : null"> |
| 57 | + <th scope="row"> |
| 58 | + <div class="fr-checkbox-group single-checkbox"> |
| 59 | + <input type="checkbox" :id="'radio-' + feature.id" :checked="selectedIds.includes(feature.id)" @click="toggleSingleSelected(feature.id)" /> |
| 60 | + <label class="fr-label" :for="'radio-' + feature.id" :aria-label="selectedIds.includes(feature.id) ? `Désélectionner ${featureName(feature)}` : `Sélectionner ${featureName(feature)}`" /> |
| 61 | + </div> |
| 62 | + </th> |
| 63 | + <td @click="isOnline && toggleEditForm(feature.id)" v-if="isGroupedByCulture"> |
| 64 | + <span class="culture-name">{{ featureName(feature) }}</span> |
| 65 | + <small class="feature-precision" v-if="feature.properties.cultures.length > 1">Multi-culture</small> |
| 66 | + <small class="feature-precision fr-hidden-sm fr-hidden-md fr-hidden-lg fr-hidden-xl"> |
| 67 | + <ConversionLevel :feature="feature" with-date /><br /> |
| 68 | + {{ inHa(legalProjectionSurface(feature)) }} ha |
72 | 69 | </small>
|
73 |
| - </span> |
74 |
| - <span class="culture-name" v-else>{{ cultureLabel(feature.properties.cultures[0]) }}</span> |
75 |
| - <small class="feature-precision">{{ featureName(feature) }}</small> |
76 |
| - </td> |
77 |
| - <td @click="isOnline && toggleEditForm(feature.id)"> |
78 |
| - <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl"> |
79 |
| - <ConversionLevel :feature="feature" with-date /> |
80 |
| - </span> |
81 |
| - </td> |
82 |
| - <td @click="isOnline && toggleEditForm(feature.id)" class="numeric"> |
83 |
| - <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl"> |
84 |
| - {{ inHa(legalProjectionSurface(feature)) }} ha |
85 |
| - </span> |
86 |
| - </td> |
87 |
| - <td class="actions"> |
88 |
| - <button |
89 |
| - type="button" |
90 |
| - class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl" |
91 |
| - :class="{'fr-btn': true, 'fr-btn--tertiary-no-outline': true, 'fr-icon-edit-line': true }" |
92 |
| - @click="toggleEditForm(feature.id)" aria-label="Modifier" |
93 |
| - /> |
94 |
| - |
95 |
| - <ActionDropdown with-icons> |
96 |
| - <li v-if="permissions.canChangeGeometry && isOnline"> |
97 |
| - <router-link :to="`/exploitations/${operatorStore.operator.numeroBio}/${recordStore.record.record_id}/modifier/${feature.id}`" type="button" class="fr-btn fr-btn--tertiary-no-outline fr-icon-geometry fr-text--sm"> |
98 |
| - Modifier le contour |
99 |
| - </router-link> |
100 |
| - </li> |
101 |
| - <li v-else> |
102 |
| - <button type="button" disabled class="fr-btn fr-btn--tertiary-no-outline fr-icon-geometry fr-text--sm"> |
| 70 | + </td> |
| 71 | + <td @click="isOnline && toggleEditForm(feature.id)" v-else> |
| 72 | + <span class="culture-type" v-if="feature.properties.cultures.length > 1"> |
| 73 | + Multi-cultures<span class="fr-sr-only"> : </span> |
| 74 | + <small class="feature-precision" v-for="(culture, i) in feature.properties.cultures" :key="i"> |
| 75 | + <span v-if="i" class="fr-sr-only">, </span>{{ cultureLabel(culture) }} |
| 76 | + </small> |
| 77 | + </span> |
| 78 | + <span class="culture-name" v-else>{{ cultureLabel(feature.properties.cultures[0]) }}</span> |
| 79 | + <small class="feature-precision">{{ featureName(feature) }}</small> |
| 80 | + </td> |
| 81 | + <td @click="isOnline && toggleEditForm(feature.id)"> |
| 82 | + <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl"> |
| 83 | + <ConversionLevel :feature="feature" with-date /> |
| 84 | + </span> |
| 85 | + </td> |
| 86 | + <td @click="isOnline && toggleEditForm(feature.id)" class="numeric"> |
| 87 | + <span class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl"> |
| 88 | + {{ inHa(legalProjectionSurface(feature)) }} ha |
| 89 | + </span> |
| 90 | + </td> |
| 91 | + <td class="actions"> |
| 92 | + <button |
| 93 | + type="button" |
| 94 | + class="fr-hidden fr-unhidden-sm fr-unhidden-md fr-unhidden-lg fr-unhidden-xl" |
| 95 | + :class="{'fr-btn': true, 'fr-btn--tertiary-no-outline': true, 'fr-icon-edit-line': true }" |
| 96 | + @click="toggleEditForm(feature.id)" aria-label="Modifier" |
| 97 | + /> |
| 98 | + |
| 99 | + <ActionDropdown with-icons> |
| 100 | + <li v-if="permissions.canChangeGeometry && isOnline"> |
| 101 | + <router-link :to="`/exploitations/${operatorStore.operator.numeroBio}/${recordStore.record.record_id}/modifier/${feature.id}`" type="button" class="fr-btn fr-btn--tertiary-no-outline fr-icon-geometry fr-text--sm"> |
103 | 102 | Modifier le contour
|
104 |
| - </button> |
105 |
| - </li> |
106 |
| - <li> |
107 |
| - <button |
108 |
| - type="button" |
109 |
| - @click.prevent="toggleDeleteForm(feature.id)" |
110 |
| - :disabled="!permissions.canDeleteFeature" |
111 |
| - class="fr-btn fr-btn--tertiary-no-outline fr-icon-delete-line btn--error fr-text--sm" |
112 |
| - > |
113 |
| - Supprimer la parcelle |
114 |
| - </button> |
115 |
| - </li> |
116 |
| - </ActionDropdown> |
117 |
| - </td> |
118 |
| - </tr> |
| 103 | + </router-link> |
| 104 | + </li> |
| 105 | + <li v-else> |
| 106 | + <button type="button" disabled class="fr-btn fr-btn--tertiary-no-outline fr-icon-geometry fr-text--sm"> |
| 107 | + Modifier le contour |
| 108 | + </button> |
| 109 | + </li> |
| 110 | + <li> |
| 111 | + <button |
| 112 | + type="button" |
| 113 | + @click.prevent="toggleDeleteForm(feature.id)" |
| 114 | + :disabled="!permissions.canDeleteFeature" |
| 115 | + class="fr-btn fr-btn--tertiary-no-outline fr-icon-delete-line btn--error fr-text--sm" |
| 116 | + > |
| 117 | + Supprimer la parcelle |
| 118 | + </button> |
| 119 | + </li> |
| 120 | + </ActionDropdown> |
| 121 | + </td> |
| 122 | + </tr> |
| 123 | + </tbody> |
119 | 124 | </table>
|
| 125 | + |
| 126 | + <p :id="`operator-features-summary-${featureGroup.key}`" class="fr-sr-only"> |
| 127 | + Liste de {{ featureGroup.features.length }} parcelles cultivées en {{ featureGroup.label.toLocaleLowerCase() }}. |
| 128 | + La première colonne contient le nom de la parcelle ; |
| 129 | + la seconde, son statut de certification et éventuelle date de début de conversion ; |
| 130 | + la troisième, sa surface en hectares ; |
| 131 | + la quatrième et dernière colonne, des boutons d'action. |
| 132 | + </p> |
120 | 133 | </td>
|
121 | 134 | </tr>
|
122 | 135 | </tbody>
|
@@ -209,6 +222,8 @@ watch(selectedIds, (selectedIds, prevSelectedIds) => {
|
209 | 222 | --hover: transparent;
|
210 | 223 | --active: transparent;
|
211 | 224 |
|
| 225 | + padding-left: 0; |
| 226 | + padding-right: 0; /* to text align buttons/texts in this column, and because actions are already padded */ |
212 | 227 | position: relative;
|
213 | 228 | text-align: left;
|
214 | 229 | white-space: nowrap;
|
|
0 commit comments