@abi-software/scaffoldvuer 1.13.1-beta.0 → 1.13.1-beta.11

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/scaffoldvuer",
3
- "version": "1.13.1-beta.0",
3
+ "version": "1.13.1-beta.11",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,7 +41,7 @@
41
41
  "*.js"
42
42
  ],
43
43
  "dependencies": {
44
- "@abi-software/map-utilities": "^1.7.6",
44
+ "@abi-software/map-utilities": "^1.7.8-beta.2",
45
45
  "@abi-software/sparc-annotation": "^0.3.2",
46
46
  "@abi-software/svg-sprite": "1.0.3",
47
47
  "@element-plus/icons-vue": "^2.3.1",
@@ -53,7 +53,7 @@
53
53
  "unplugin-vue-components": "^0.26.0",
54
54
  "vue": "^3.4.21",
55
55
  "vue-router": "^4.2.5",
56
- "zincjs": "^1.16.2"
56
+ "zincjs": "^1.16.8"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/eslint-parser": "^7.28.0",
package/src/App.vue CHANGED
@@ -38,7 +38,8 @@
38
38
  @zinc-object-added="objectAdded"
39
39
  @vue:mounted="viewerMounted"
40
40
  :usageConfig="usageConfig"
41
- />
41
+ >
42
+ </ScaffoldVuer>
42
43
  </drop-zone>
43
44
 
44
45
  <HelpModeDialog
@@ -150,7 +151,7 @@
150
151
  id="annotations-upload"
151
152
  type="file"
152
153
  accept="application/json"
153
- @change="importOfflineAnnotations"
154
+ @change="importOfflineAnnotations"
154
155
  />
155
156
  </el-button>
156
157
  </el-col>
@@ -357,7 +358,7 @@ const writeTextFile = (filename, data) => {
357
358
  hrefElement.href = dataStr;
358
359
  hrefElement.click();
359
360
  hrefElement.remove();
360
- }
361
+ }
361
362
 
362
363
  export default {
363
364
  name: "app",
@@ -231,6 +231,11 @@ export default {
231
231
  color:black;
232
232
  opacity:0.5;
233
233
  top: 50%;
234
+ text-shadow:
235
+ -1px -1px 0 white,
236
+ 1px -1px 0 white,
237
+ -1px 1px 0 white,
238
+ 1px 1px 0 white; /* White outline */
234
239
  }
235
240
  }
236
241
 
@@ -13,12 +13,16 @@
13
13
  >
14
14
  <template #default>
15
15
  <div class="tooltip-text">{{ label }}</div>
16
- <div class="tooltip-text" v-if="region">Region: {{ region }}</div>
16
+ <div class="tooltip-text" v-if="region && region != '/'">
17
+ Region: {{ region }}
18
+ </div>
17
19
  <CreateTooltipContent
18
20
  v-show="createData.toBeConfirmed"
19
21
  :createData="createData"
20
22
  @confirm-create="$emit('confirm-create', $event)"
21
23
  @cancel-create="$emit('cancel-create')"
24
+ @create-region-suggestions="$emit('create-region-suggestions', $event)"
25
+ @create-group-suggestions="$emit('create-group-suggestions', $event)"
22
26
  />
23
27
  <Tooltip
24
28
  class="p-tooltip"
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div class="tree-controls" :class="{ open: drawerOpen, close: !drawerOpen }">
3
3
  <div class="traditional-container">
4
+ <slot name="treeSlot"></slot>
4
5
  <TreeControls
5
6
  mapType="scaffold"
6
7
  title="Regions"
@@ -110,6 +111,40 @@ export default {
110
111
  */
111
112
  },
112
113
  methods: {
114
+ setCheckboxDisabled: function(data, flag, childrenOnly) {
115
+ if (data) {
116
+ if (!childrenOnly) {
117
+ data.disabled = flag;
118
+ }
119
+ if (data.children) {
120
+ data.children.forEach(child =>
121
+ this.setCheckboxDisabled(child, flag, false)
122
+ );
123
+ }
124
+ }
125
+ },
126
+ setRegionCheckboxDisabled: function (region, flag, childrenOnly) {
127
+ if (this.treeData[0] && region?.uuid) {
128
+ const data = this.findDataWithId(this.treeData[0], region?.uuid)
129
+ if (data) {
130
+ this.setCheckboxDisabled(data, flag, childrenOnly);
131
+ }
132
+ }
133
+ },
134
+ findDataWithId: function(data, uuid) {
135
+ if (data) {
136
+ if (data.id === uuid) {
137
+ return data;
138
+ }
139
+ if (data.children) {
140
+ for (let i = 0; i < data.children.length; i++) {
141
+ const found = this.findDataWithId(data.children[i], uuid);
142
+ if (found) return found;
143
+ }
144
+ }
145
+ }
146
+ return;
147
+ },
113
148
  addTreeItem: function (parentContainer, item, object) {
114
149
  //The following block prevent duplicate graphics with the same name
115
150
  if (parentContainer.some((child) => child.label === item.label)) {
@@ -210,21 +245,29 @@ export default {
210
245
  }
211
246
  }
212
247
  },
248
+ removeGroupFromRegionTreeData: function(region, groupName) {
249
+ const paths = region.getFullSeparatedPath();
250
+ const regionData = this.findOrCreateRegion(this.treeData[0], paths, "");
251
+ for (let i = 0; i < regionData.children.length; i++) {
252
+ if (regionData.children[i].label === groupName) {
253
+ regionData.children.splice(i, 1);
254
+ this.nodeNumbers--;
255
+ return;
256
+ }
257
+ }
258
+ },
259
+ zincObjectRenamed: function(zincObject, oldName) {
260
+ const objects = zincObject.region.findObjectsWithGroupName(oldName, false);
261
+ if (objects.length < 1) {
262
+ this.removeGroupFromRegionTreeData(zincObject.region, oldName);
263
+ }
264
+ this.zincObjectAdded(zincObject);
265
+ },
213
266
  zincObjectRemoved: function(zincObject) {
214
267
  const group = zincObject.groupName;
215
268
  const objects = zincObject.region.findObjectsWithGroupName(group, false);
216
269
  if (objects.length === 0) {
217
- const paths = zincObject.region.getFullSeparatedPath();
218
- const regionData = this.findOrCreateRegion(this.treeData[0], paths, "");
219
- if (regionData.children) {
220
- for (let i = 0; i < regionData.children.length; i++) {
221
- if (regionData.children[i].label === group) {
222
- regionData.children.splice(i, 1);
223
- this.nodeNumbers--;
224
- return;
225
- }
226
- }
227
- }
270
+ this.removeGroupFromRegionTreeData(zincObject.region, group);
228
271
  }
229
272
  },
230
273
  checkChanged: function (node, data) {
@@ -242,6 +285,7 @@ export default {
242
285
  region.hideAllPrimitives();
243
286
  //this.checkedRegions = this.checkedRegions.filter(region => region.label !== node.label);
244
287
  }
288
+ this.$emit("check-changed", {region, isChecked});
245
289
  }
246
290
  if (isPrimitives) {
247
291
  const primitives = region.findObjectsWithGroupName(node.label);
@@ -249,6 +293,7 @@ export default {
249
293
  const visibility = isChecked && !node.disabled;
250
294
  primitive.setVisibility(visibility);
251
295
  });
296
+ this.$emit("check-changed", {zincObjects: primitives, isChecked});
252
297
  }
253
298
  },
254
299
  updateActiveUI: function (primitives) {