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

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.8-beta.1",
3
+ "version": "1.7.8-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,7 +4,8 @@
4
4
  <div>{{ dialogTitle }}</div>
5
5
  </el-header>
6
6
  <el-main class="slides-block">
7
- <span class="create-text" v-if="createData.editingIndex === -1 && targetRegion">
7
+ <span class="create-text"
8
+ v-if="creating && targetRegion">
8
9
  {{ `Primitives will be created in the ${targetRegion} region` }}
9
10
  </span>
10
11
  <el-row class="row" v-show="showPoint">
@@ -46,6 +47,7 @@
46
47
  <el-col :offset="0" :span="16">
47
48
  <el-autocomplete
48
49
  class="autocomplete-box"
50
+ :disabled="createData.editingIndex > -1 || createData.toBeDeleted"
49
51
  :fit-input-width="true"
50
52
  v-model="group"
51
53
  :placeholder="createData.shape"
@@ -61,12 +63,18 @@
61
63
  </el-autocomplete>
62
64
  </el-col>
63
65
  </el-row>
66
+ <el-row v-if="!canBeConfirmed" class="row">
67
+ <div class="warning-message">
68
+ Group must be enterd before this action can be confirmed.
69
+ </div>
70
+ </el-row>
64
71
  <el-row>
65
72
  <el-col :offset="0" :span="12">
66
73
  <el-button
67
74
  type="primary"
68
75
  plain
69
76
  @click="confirm"
77
+ :disabled="!canBeConfirmed"
70
78
  >
71
79
  {{ confirmText }}
72
80
  </el-button>
@@ -115,12 +123,26 @@ export default {
115
123
  props: {
116
124
  createData: {
117
125
  type: Object,
126
+ default:{
127
+ drawingBox: false,
128
+ renaming: false,
129
+ toBeConfirmed: false,
130
+ points: [],
131
+ tempGroupName: undefined,
132
+ shape: "",
133
+ x: 0,
134
+ y: 0,
135
+ editingIndex: -1,
136
+ faceIndex: -1,
137
+ toBeDeleted: false,
138
+ regionPrefix: "__annotation"
139
+ },
118
140
  },
119
141
  },
120
142
  watch: {
121
143
  "createData.shape": {
122
144
  handler: function (newValue, oldValue) {
123
- this.group = this.createData.tempGroupName ? this.createData.tempGroupName : newValue;
145
+ this.group = (this.createData.tempGroupName) ? this.createData.tempGroupName : "";
124
146
  if (oldValue !== undefined) {
125
147
  this.$emit("cancel-create");
126
148
  }
@@ -128,25 +150,49 @@ export default {
128
150
  immediate: true,
129
151
  },
130
152
  "createData.tempGroupName": {
131
- handler: function (newValue, oldValue) {
132
- this.group = newValue ? newValue : this.createData.shape;
153
+ handler: function (newValue) {
154
+ this.group = newValue ? newValue : "";
133
155
  },
134
156
  immediate: true,
135
157
  },
136
158
  },
137
159
  computed: {
160
+ canBeConfirmed: function() {
161
+ if (this.createData.editingIndex > -1) {
162
+ return true;
163
+ } else if (this.group) {
164
+ if (!this.renaming) {
165
+ return true;
166
+ } else if (this.group !== this.createData.tempGroupName) {
167
+ return true;
168
+ }
169
+ }
170
+ return false;
171
+ },
138
172
  confirmText: function () {
139
173
  if (this.createData.editingIndex > -1) {
140
174
  return "Edit";
175
+ } else if (this.createData.renaming) {
176
+ return "Rename";
177
+ } else if (this.createData.toBeDeleted) {
178
+ return "Delete";
141
179
  }
142
180
  return "Confirm";
143
181
  },
182
+ creating: function() {
183
+ if (this.createData.editingIndex > -1 ||
184
+ this.createData.renaming ||
185
+ this.createData.toBeDeleted) {
186
+ return false;
187
+ }
188
+ return true;
189
+ },
144
190
  dialogTitle: function() {
145
- if (this.createData.editingIndex > -1) {
146
- return `Edit ${this.createData.shape}`;
147
- } else {
148
- return `Create ${this.createData.shape}`;
191
+ const mode = this.confirmText;
192
+ if (this.createData.toBeDeleted || this.createData.renaming) {
193
+ return mode;
149
194
  }
195
+ return `${mode} ${this.createData.shape}`;
150
196
  },
151
197
  targetRegion: function() {
152
198
  if ('regionPrefix' in this.createData) {
@@ -171,6 +217,8 @@ export default {
171
217
  group: this.group,
172
218
  shape: this.createData.shape,
173
219
  editingIndex: this.createData.editingIndex,
220
+ renaming: this.createData.renaming,
221
+ deleting: this.createData.toBeDeleted,
174
222
  }
175
223
  );
176
224
  this.group = this.createData.shape;
@@ -253,6 +301,11 @@ export default {
253
301
  }
254
302
  }
255
303
 
304
+ .warning-message {
305
+ font-size: 10px;
306
+ color: #FF8400;
307
+ }
308
+
256
309
  .value {
257
310
  font-size: 12px;
258
311
  }