@abi-software/map-utilities 1.7.7 → 1.7.8-beta.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-utilities",
3
- "version": "1.7.7",
3
+ "version": "1.7.8-beta.1",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <el-container class="create-container">
3
3
  <el-header height="30px" class="header">
4
- <div>Create {{ createData.shape }}</div>
4
+ <div>{{ dialogTitle }}</div>
5
5
  </el-header>
6
6
  <el-main class="slides-block">
7
- <span class="create-text">
8
- Primitives will be created in the __annotation region
7
+ <span class="create-text" v-if="createData.editingIndex === -1 && targetRegion">
8
+ {{ `Primitives will be created in the ${targetRegion} region` }}
9
9
  </span>
10
10
  <el-row class="row" v-show="showPoint">
11
11
  <el-col :offset="0" :span="8">
@@ -22,11 +22,21 @@
22
22
  Region:
23
23
  </el-col>
24
24
  <el-col :offset="0" :span="16">
25
- <el-input
25
+ <el-autocomplete
26
+ class="autocomplete-box"
27
+ :fit-input-width="true"
26
28
  v-model="region"
27
- placeholder="__annotation"
28
- size="small"
29
- />
29
+ :placeholder="targetRegion"
30
+ :fetch-suggestions="fetchRegionSuggestions"
31
+ :teleported="true"
32
+ popper-class="autocomplete-popper"
33
+ >
34
+ <template #default="{ item }">
35
+ <div class="suggested-value">
36
+ {{ item.value }}
37
+ </div>
38
+ </template>
39
+ </el-autocomplete>
30
40
  </el-col>
31
41
  </el-row>
32
42
  <el-row class="row">
@@ -34,11 +44,21 @@
34
44
  Group:
35
45
  </el-col>
36
46
  <el-col :offset="0" :span="16">
37
- <el-input
47
+ <el-autocomplete
48
+ class="autocomplete-box"
49
+ :fit-input-width="true"
38
50
  v-model="group"
39
51
  :placeholder="createData.shape"
40
- size="small"
41
- />
52
+ :fetch-suggestions="fetchGroupSuggestions"
53
+ :teleported="true"
54
+ popper-class="autocomplete-popper"
55
+ >
56
+ <template #default="{ item }">
57
+ <div class="suggested-value">
58
+ {{ item.value }}
59
+ </div>
60
+ </template>
61
+ </el-autocomplete>
42
62
  </el-col>
43
63
  </el-row>
44
64
  <el-row>
@@ -67,8 +87,8 @@
67
87
 
68
88
  <script>
69
89
  /* eslint-disable no-alert, no-console */
70
-
71
90
  import {
91
+ ElAutocomplete as Autocomplete,
72
92
  ElButton as Button,
73
93
  ElCol as Col,
74
94
  ElContainer as Container,
@@ -84,6 +104,7 @@ import {
84
104
  export default {
85
105
  name: "CreateTooltipContent",
86
106
  components: {
107
+ Autocomplete,
87
108
  Button,
88
109
  Col,
89
110
  Container,
@@ -99,13 +120,19 @@ export default {
99
120
  watch: {
100
121
  "createData.shape": {
101
122
  handler: function (newValue, oldValue) {
102
- this.group = newValue;
123
+ this.group = this.createData.tempGroupName ? this.createData.tempGroupName : newValue;
103
124
  if (oldValue !== undefined) {
104
125
  this.$emit("cancel-create");
105
126
  }
106
127
  },
107
128
  immediate: true,
108
129
  },
130
+ "createData.tempGroupName": {
131
+ handler: function (newValue, oldValue) {
132
+ this.group = newValue ? newValue : this.createData.shape;
133
+ },
134
+ immediate: true,
135
+ },
109
136
  },
110
137
  computed: {
111
138
  confirmText: function () {
@@ -114,6 +141,19 @@ export default {
114
141
  }
115
142
  return "Confirm";
116
143
  },
144
+ dialogTitle: function() {
145
+ if (this.createData.editingIndex > -1) {
146
+ return `Edit ${this.createData.shape}`;
147
+ } else {
148
+ return `Create ${this.createData.shape}`;
149
+ }
150
+ },
151
+ targetRegion: function() {
152
+ if ('regionPrefix' in this.createData) {
153
+ return this.createData.regionPrefix;
154
+ }
155
+ return "";
156
+ },
117
157
  },
118
158
  data: function () {
119
159
  return {
@@ -125,9 +165,9 @@ export default {
125
165
  methods: {
126
166
  confirm: function () {
127
167
  this.$emit(
128
- "confirm-create",
129
- {
130
- region: "__annotation/" + this.region,
168
+ "confirm-create",
169
+ {
170
+ region: this.targetRegion + this.region,
131
171
  group: this.group,
132
172
  shape: this.createData.shape,
133
173
  editingIndex: this.createData.editingIndex,
@@ -138,6 +178,14 @@ export default {
138
178
  cancel: function () {
139
179
  this.$emit("cancel-create");
140
180
  },
181
+ fetchRegionSuggestions: function(term, cb) {
182
+ cb([]);
183
+ this.$emit("create-region-suggestions", {term, cb});
184
+ },
185
+ fetchGroupSuggestions: function(term, cb) {
186
+ cb([]);
187
+ this.$emit("create-group-suggestions", {term, cb, region: this.region});
188
+ },
141
189
  },
142
190
  };
143
191
  </script>
@@ -152,20 +200,20 @@ export default {
152
200
  font-size: 14px;
153
201
  }
154
202
 
155
- .row {
156
- margin: 4px;
157
- text-align: left;
158
- }
159
-
160
203
  :deep(.create-text) {
161
204
  max-width: 220px;
162
- height:35px;
205
+ height: 35px;
163
206
  font-size: 12px;
164
207
  }
165
208
 
209
+ .row {
210
+ margin: 4px;
211
+ text-align: left;
212
+ }
166
213
 
167
214
  .create-container {
168
- width: 100%;
215
+ width: 320px;
216
+
169
217
  height: auto;
170
218
  border-radius: 4px;
171
219
  border: solid 1px #d8dce6;
@@ -175,27 +223,39 @@ export default {
175
223
  pointer-events: auto;
176
224
  }
177
225
 
178
- .value {
226
+ :deep(.autocomplete-box) {
227
+ position: relative;
179
228
  font-size: 12px;
229
+ display: inline-flex;
230
+ width: var(--el-input-width);
231
+ line-height: var(--el-input-height);
232
+ box-sizing: border-box;
233
+ vertical-align: middle;
234
+ .el-input__inner {
235
+ height: 24px;
236
+ }
180
237
  }
181
238
 
182
- .input-box {
183
- width: 42px;
184
- border-radius: 4px;
185
- border: 1px solid rgb(144, 147, 153);
186
- background-color: var(--white);
187
- font-weight: 500;
188
- color: rgb(48, 49, 51);
189
- margin-left: 8px;
190
- height: 24px;
239
+ .autocomplete-popper {
240
+ li {
241
+ line-height: normal;
242
+ padding: 7px;
243
+
244
+ .suggested-value {
245
+ font-family: "Asap", sans-serif;
246
+ text-align: left;
247
+ white-space: initial;
248
+ }
191
249
 
192
- &.number-input {
193
- width: 42px;
194
- :deep(.el-input__wrapper) {
195
- padding-left: 0px;
196
- padding-right: 0px;
250
+ .el-input__inner {
251
+ font-size: 12px;
197
252
  }
198
253
  }
199
254
  }
200
255
 
256
+ .value {
257
+ font-size: 12px;
258
+ }
259
+
260
+
201
261
  </style>
@@ -14,6 +14,7 @@ declare module 'vue' {
14
14
  CopyToClipboard: typeof import('./components/CopyToClipboard/CopyToClipboard.vue')['default']
15
15
  CreateTooltipContent: typeof import('./components/Tooltip/CreateTooltipContent.vue')['default']
16
16
  DrawToolbar: typeof import('./components/DrawToolbar/DrawToolbar.vue')['default']
17
+ ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
17
18
  ElButton: typeof import('element-plus/es')['ElButton']
18
19
  ElCard: typeof import('element-plus/es')['ElCard']
19
20
  ElCol: typeof import('element-plus/es')['ElCol']