|
16 | 16 |
|
17 | 17 | --> |
18 | 18 | <template> |
19 | | - <div class="labelingWidgetContainer"> |
20 | | - <div class="__selections-div"> |
21 | | - <div> |
22 | | - <h4>{{ i18n.selectionTitle }}</h4> |
| 19 | + <div class="ct-labeling-widget"> |
| 20 | + <div class="ct-labeling-widget__selections"> |
| 21 | + <v-sheet class="mb-1"> |
| 22 | + <h3>{{ i18n.selectionTitle }}</h3> |
23 | 23 | <v-autocomplete |
24 | 24 | v-model="selectedLayer" |
25 | 25 | :items="layers" |
|
31 | 31 | hide-details |
32 | 32 | class="pt-0 mt-0 pb-2" |
33 | 33 | /> |
34 | | - </div> |
35 | | - <div> |
36 | | - <div v-show="edit"> |
37 | | - <v-sheet elevation="12"> |
38 | | - <v-btn |
39 | | - id="iconRight" |
40 | | - icon |
41 | | - small |
42 | | - @click="edit = !edit" |
43 | | - > |
44 | | - <v-icon>close</v-icon> |
45 | | - </v-btn> |
46 | | - <div id="editText"> |
47 | | - <v-text-field |
48 | | - v-model="editedField.prefix" |
49 | | - :label="i18n.prefix" |
50 | | - /> |
51 | | - <v-text-field |
52 | | - v-model="editedField.postfix" |
53 | | - :label="i18n.postfix" |
54 | | - /> |
55 | | - </div> |
56 | | - </v-sheet> |
| 34 | + </v-sheet> |
| 35 | + <v-sheet |
| 36 | + v-show="edit" |
| 37 | + class="my-1 ct-labeling-widget__edit-section" |
| 38 | + > |
| 39 | + <div class="align-right"> |
| 40 | + <v-tooltip |
| 41 | + top |
| 42 | + open-delay="800" |
| 43 | + > |
| 44 | + <template #activator="{ on }"> |
| 45 | + <v-btn |
| 46 | + class="ct-labeling-widget__edit-close-section mr-2" |
| 47 | + icon |
| 48 | + small |
| 49 | + :aria-label="i18n.finishEditingAttributeLabel" |
| 50 | + v-on="on" |
| 51 | + @click="edit = !edit" |
| 52 | + > |
| 53 | + <!--TODO: maybe change Icon!--> |
| 54 | + <v-icon>close</v-icon> |
| 55 | + </v-btn> |
| 56 | + </template> |
| 57 | + <span>{{ i18n.finishEditingAttributeLabel }}</span> |
| 58 | + </v-tooltip> |
| 59 | + </div> |
| 60 | + <div class="ct-labeling-widget__edit-inputs"> |
| 61 | + <v-text-field |
| 62 | + v-model="editedField.prefix" |
| 63 | + :label="i18n.prefix" |
| 64 | + /> |
| 65 | + <v-text-field |
| 66 | + v-model="editedField.postfix" |
| 67 | + :label="i18n.postfix" |
| 68 | + /> |
57 | 69 | </div> |
58 | | - <h4>{{ i18n.selectionFields }}</h4> |
| 70 | + </v-sheet> |
| 71 | + <v-sheet class="my-1"> |
| 72 | + <h3>{{ i18n.selectionFields }}</h3> |
| 73 | + <!--TODO: Element not focusable with keyboard, even when not disabled--> |
59 | 74 | <v-select |
60 | | - id="autocomplete" |
61 | 75 | v-model="selectedFields" |
62 | 76 | :items="fields" |
63 | 77 | rounded |
|
66 | 80 | :label="i18n.selectionFields" |
67 | 81 | item-text="name" |
68 | 82 | return-object |
69 | | - class="draggableSelect pt-1 mt-0" |
| 83 | + class="ct-labeling-widget__draggable-select pt-1 mt-0" |
70 | 84 | clearable |
71 | 85 | :disabled="!selectedLayer" |
72 | 86 | > |
73 | 87 | <template #selection="data"> |
74 | 88 | <draggable |
75 | | - :id="data.index" |
| 89 | + :id="`ct-labeling-attribute-${data.index}`" |
76 | 90 | :list="selectedFields" |
77 | 91 | v-bind="dragOptionsChips" |
78 | 92 | :move="move" |
|
91 | 105 |
|
92 | 106 | <span>{{ data.item.name }}</span> |
93 | 107 | <span> |
94 | | - <v-btn |
95 | | - icon |
96 | | - @click="setEdit(data.item)" |
| 108 | + <v-tooltip |
| 109 | + top |
| 110 | + open-delay="800" |
97 | 111 | > |
98 | | - <v-icon small>edit</v-icon> |
99 | | - </v-btn> |
100 | | - <v-btn |
101 | | - icon |
102 | | - @click="remove(data.item)" |
| 112 | + <template #activator="{ on }"> |
| 113 | + <v-btn |
| 114 | + icon |
| 115 | + :aria-label="i18n.editAttributeLabel" |
| 116 | + v-on="on" |
| 117 | + @click="setEdit(data.item)" |
| 118 | + > |
| 119 | + <v-icon small>edit</v-icon> |
| 120 | + </v-btn> |
| 121 | + </template> |
| 122 | + <span>{{ i18n.editAttributeLabel }}</span> |
| 123 | + </v-tooltip> |
| 124 | + <v-tooltip |
| 125 | + top |
| 126 | + open-delay="800" |
103 | 127 | > |
104 | | - <v-icon small>close</v-icon> |
105 | | - </v-btn> |
| 128 | + <template #activator="{ on }"> |
| 129 | + <v-btn |
| 130 | + icon |
| 131 | + :aria-label="i18n.deleteAttributeLabel" |
| 132 | + v-on="on" |
| 133 | + @click="remove(data.item)" |
| 134 | + > |
| 135 | + <v-icon small>close</v-icon> |
| 136 | + </v-btn> |
| 137 | + </template> |
| 138 | + <span>{{ i18n.deleteAttributeLabel }}</span> |
| 139 | + </v-tooltip> |
106 | 140 | </span> |
107 | 141 | </v-chip> |
108 | 142 | </draggable> |
109 | 143 | </template> |
110 | 144 | </v-select> |
111 | | - </div> |
| 145 | + </v-sheet> |
112 | 146 | </div> |
113 | | - <div class="__controls-div"> |
114 | | - <div> |
| 147 | + <v-divider /> |
| 148 | + <div class="ct-labeling-widget__controls-div"> |
| 149 | + <div class="my-1"> |
115 | 150 | <v-switch |
116 | 151 | v-model="showFeatureEdgeLengths" |
117 | 152 | class="controls circumference-switch" |
|
122 | 157 | </div> |
123 | 158 | <div> |
124 | 159 | <v-btn |
125 | | - v-if="!active" |
126 | | - color="primary" |
127 | | - @click.native="setLabeling" |
128 | | - > |
129 | | - <v-icon>icon-play</v-icon> |
130 | | - {{ i18n.labeling.start }} |
131 | | - </v-btn> |
132 | | - <v-btn |
133 | | - v-else |
134 | 160 | color="primary" |
| 161 | + :aria-pressed="active" |
| 162 | + :disabled="selectedFields.length === 0" |
135 | 163 | @click.native="setLabeling" |
136 | 164 | > |
137 | | - <v-icon>icon-pause</v-icon> |
138 | | - {{ i18n.labeling.stop }} |
| 165 | + <v-icon>{{ !active ? "icon-play" : "icon-pause" }}</v-icon> |
| 166 | + {{ !active ? i18n.labeling.start : i18n.labeling.stop }} |
139 | 167 | </v-btn> |
140 | 168 | <v-btn |
141 | | - color="secondary" |
| 169 | + color="error" |
| 170 | + outline |
| 171 | + :disabled="!selectedLayer || (selectedLayer && selectedFields.length === 0)" |
142 | 172 | @click.native="deleteLabel" |
143 | 173 | > |
144 | 174 | <v-icon>icon-trashcan-detailed</v-icon> |
|
0 commit comments