@abi-software/scaffoldvuer 1.13.1-beta.8 → 1.14.0

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.8",
3
+ "version": "1.14.0",
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.8-beta.2",
44
+ "@abi-software/map-utilities": "1.8.0",
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.7"
56
+ "zincjs": "^1.16.10"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@babel/eslint-parser": "^7.28.0",
@@ -75,7 +75,6 @@ export default {
75
75
  .block {
76
76
  left: 40px;
77
77
  position: absolute;
78
- top: 57px;
79
78
  width: 200px;
80
79
  }
81
80
 
@@ -1,52 +1,39 @@
1
1
  <template>
2
- <div
3
- v-show="hasValidPrimitive"
4
- class="primitive-controls"
5
- :class="{ open: drawerOpen, close: !drawerOpen }"
6
- >
7
- <div class="my-drawer" :class="{ open: drawerOpen, close: !drawerOpen }">
8
- <el-collapse class="collapse" v-model="activeName" accordion>
9
- <el-collapse-item title="Opacity" name="oControls" v-show="!isTextureSlides" >
10
- <opacity-controls
11
- :material="material"
12
- :zincObject="zincObject"
13
- ref="opacityControls" />
14
- </el-collapse-item>
15
- <el-collapse-item v-show="!isEditable" title="Transformation" name="trControls">
16
- <transformation-controls
17
- class="transformation-controls"
18
- ref="transformationControls" />
19
- </el-collapse-item>
20
- <el-collapse-item v-show="isTextureSlides" title="Texture Slides" name="tsControls">
21
- <texture-slides-controls
22
- class="texture-controls"
23
- ref="tSlidesControls" />
24
- </el-collapse-item>
25
- <el-collapse-item v-show="isPointset" title="Points" name="pControls">
26
- <points-controls
27
- class="pointset-controls"
28
- ref="pointsetControls"
29
- @primitivesUpdated="$emit('primitivesUpdated', $event)"
30
- />
31
- </el-collapse-item>
32
- <el-collapse-item v-show="isLines" title="Lines" name="lControls">
33
- <lines-controls
34
- class="lines-controls"
35
- ref="linesControls"
36
- :createData="createData"
37
- :usageConfig="usageConfig"
38
- @primitivesUpdated="$emit('primitivesUpdated', $event)"
39
- />
40
- </el-collapse-item>
41
- </el-collapse>
42
- </div>
43
- <div
44
- class="drawer-button"
45
- :class="{ open: drawerOpen, close: !drawerOpen }"
46
- @click="toggleDrawer"
47
- >
48
- <el-icon><el-icon-arrow-right /></el-icon>
49
- </div>
2
+ <div v-show="hasValidPrimitive" class="my-drawer">
3
+ <el-collapse class="collapse" v-model="activeName" accordion>
4
+ <el-collapse-item title="Opacity" name="oControls" v-show="!isTextureSlides" >
5
+ <opacity-controls
6
+ :material="material"
7
+ :zincObject="zincObject"
8
+ ref="opacityControls" />
9
+ </el-collapse-item>
10
+ <el-collapse-item v-show="!isEditable" title="Transformation" name="trControls">
11
+ <transformation-controls
12
+ class="transformation-controls"
13
+ ref="transformationControls" />
14
+ </el-collapse-item>
15
+ <el-collapse-item v-show="isTextureSlides" title="Texture Slides" name="tsControls">
16
+ <texture-slides-controls
17
+ class="texture-controls"
18
+ ref="tSlidesControls" />
19
+ </el-collapse-item>
20
+ <el-collapse-item v-show="isPointset" title="Points" name="pControls">
21
+ <points-controls
22
+ class="pointset-controls"
23
+ ref="pointsetControls"
24
+ @primitivesUpdated="$emit('primitivesUpdated', $event)"
25
+ />
26
+ </el-collapse-item>
27
+ <el-collapse-item v-show="isLines" title="Lines" name="lControls">
28
+ <lines-controls
29
+ class="lines-controls"
30
+ ref="linesControls"
31
+ :createData="createData"
32
+ :usageConfig="usageConfig"
33
+ @primitivesUpdated="$emit('primitivesUpdated', $event)"
34
+ />
35
+ </el-collapse-item>
36
+ </el-collapse>
50
37
  </div>
51
38
  </template>
52
39
 
@@ -101,7 +88,7 @@ export default {
101
88
  isTextureSlides: false,
102
89
  isPointset: false,
103
90
  isLines: false,
104
- drawerOpen: true,
91
+
105
92
  zincObject: undefined,
106
93
  isEditable: false,
107
94
  displayString: "100%"
@@ -120,9 +107,6 @@ export default {
120
107
  this.displayString = Math.floor(100 * val + 0.5) + "%";
121
108
  return this.displayString;
122
109
  },
123
- toggleDrawer: function() {
124
- this.drawerOpen = !this.drawerOpen;
125
- },
126
110
  setObject: function(object) {
127
111
  if (object) {
128
112
  this.zincObject = markRaw(object);
@@ -143,7 +127,7 @@ export default {
143
127
  this.isPointset = true;
144
128
  this.$refs.pointsetControls.setObject(object);
145
129
  this.activeName = "pControls";
146
- } else if (object.isLines2 || (object.isTubeLines &&
130
+ } else if (object.isLines2 || (object.isTubeLines &&
147
131
  this.usageConfig?.showTubeLinesControls)) {
148
132
  this.isLines = true;
149
133
  this.$refs.linesControls.setObject(object);
@@ -163,72 +147,20 @@ export default {
163
147
 
164
148
  <!-- Add "scoped" attribute to limit CSS to this component only -->
165
149
  <style scoped lang="scss">
166
- .primitive-controls {
167
- position: absolute;
168
- bottom: 30%;
169
- transition: all 1s ease;
170
-
171
- &.open {
172
- right: 0px;
173
- .my-drawer {
174
- opacity: 1;
175
- }
176
- }
177
- &.close {
178
- right: -250px;
179
- .my-drawer {
180
- pointer-events: none;
181
- opacity: 0;
182
- }
183
- }
184
- }
185
150
  .my-drawer {
186
- transition: all 1s ease;
187
- float: right;
188
- max-height: 150px;
189
- text-align: left;
190
- background: #ffffff;
191
- width:250px;
192
151
  .collapse {
193
- border: 1px solid rgb(220, 223, 230);
194
- :deep(.el-collapse-item__header) {
195
- padding-left: 8px;
196
- }
197
- :deep(.el-collapse-item__content) {
198
- padding-bottom: 8px;
199
- }
152
+ border-top: none;
153
+ border-bottom: none;
200
154
  }
201
- }
202
155
 
203
- .drawer-button {
204
- float: right;
205
- width: 20px;
206
- height: 40px;
207
- z-index: 8;
208
- border: solid 1px $app-primary-color;
209
- background-color: #f9f2fc;
210
- text-align: center;
211
- vertical-align: middle;
212
- cursor: pointer;
213
- pointer-events: auto;
214
- margin-top: 25px;
215
-
216
- i {
217
- font-weight: 600;
218
- margin-top: 12px;
219
- color: $app-primary-color;
220
- transition-delay: 0.9s;
221
- }
222
- &.open {
223
- i {
224
- transform: rotate(0deg) scaleY(2.5);
225
- }
156
+ :deep(.el-collapse-item__header) {
157
+ height:36px;
226
158
  }
227
- &.close {
228
- i {
229
- transform: rotate(180deg) scaleY(2.5);
230
- }
159
+
160
+ :deep(.el-collapse-item__content) {
161
+ padding-bottom: 0px;
231
162
  }
232
163
  }
233
164
 
165
+
234
166
  </style>
@@ -32,28 +32,6 @@
32
32
  :annotationEntry="annotationEntry"
33
33
  @annotation="$emit('confirm-comment', $event)"
34
34
  />
35
- <div v-if="createData.toBeDeleted" class="delete-container">
36
- <el-row>
37
- <el-col :span="10">Delete this feature?</el-col>
38
- <el-col :span="7">
39
- <el-button
40
- class="delete-button"
41
- :icon="ElIconDelete"
42
- @click="$emit('confirm-delete')"
43
- >
44
- Delete
45
- </el-button>
46
- </el-col>
47
- <el-col :span="6">
48
- <el-button
49
- class="delete-button"
50
- @click="$emit('cancel-create')"
51
- >
52
- Dismiss
53
- </el-button>
54
- </el-col>
55
- </el-row>
56
- </div>
57
35
  </template>
58
36
  </el-popover>
59
37
  </div>
@@ -68,9 +46,6 @@ import {
68
46
  ElPopover as Popover,
69
47
  ElRow as Row,
70
48
  } from "element-plus";
71
- import {
72
- Delete as ElIconDelete,
73
- } from '@element-plus/icons-vue'
74
49
  import { mapState } from 'pinia';
75
50
  import { useMainStore } from "@/store/index";
76
51
  import { CreateTooltipContent, Tooltip } from '@abi-software/map-utilities'
@@ -84,7 +59,6 @@ export default {
84
59
  components: {
85
60
  Col,
86
61
  CreateTooltipContent,
87
- ElIconDelete,
88
62
  Icon,
89
63
  Popover,
90
64
  Row,
@@ -143,8 +117,7 @@ export default {
143
117
  data: function () {
144
118
  return {
145
119
  display: false,
146
- annotationEntry: [],
147
- ElIconDelete: shallowRef(ElIconDelete),
120
+ annotationEntry: []
148
121
  };
149
122
  },
150
123
  computed: {
@@ -211,7 +184,7 @@ export default {
211
184
  .region-tooltip {
212
185
  position: absolute;
213
186
  height: 50px;
214
- z-index: 2;
187
+ z-index: 3;
215
188
  :deep(.tooltip-popper.el-popover.el-popper) {
216
189
  padding: 2px 6px;
217
190
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
@@ -254,23 +227,5 @@ export default {
254
227
  display:none;
255
228
  }
256
229
  }
257
-
258
- .delete-container {
259
- margin-top: 12px;
260
- margin-bottom: 12px;
261
- font-size: 14px;
262
- .delete-button {
263
- pointer-events: auto;
264
- cursor: pointer;
265
- margin-left:8px;
266
- padding-left: 8px;
267
- padding-right: 8px;
268
- height: 24px !important;
269
- color: $app-primary-color;
270
- &:hover {
271
- background-color: var(--el-color-primary-light-9);
272
- }
273
- }
274
- }
275
230
  }
276
231
  </style>
@@ -1,26 +1,30 @@
1
1
  <template>
2
2
  <div class="tree-controls" :class="{ open: drawerOpen, close: !drawerOpen }">
3
- <div class="traditional-container">
4
- <slot name="treeSlot"></slot>
5
- <TreeControls
6
- mapType="scaffold"
7
- title="Regions"
8
- :isReady="isReady"
9
- :treeData="treeDataEntry"
10
- :active="active"
11
- :hover="hover"
12
- :showColourPicker="showColourPicker"
13
- @setColour="setColour"
14
- @checkChanged="checkChanged"
15
- @changeActive="changeActiveByNode"
16
- @changeHover="changeHoverByNode"
17
- ref="treeControls"
18
- @mouseleave="removeHover(true)"
19
- />
3
+ <div class="tree-controls-scroll">
4
+ <div class="tree-controls-container"
5
+ :style="{ 'max-height': `${maxHeight}px` }">
6
+ <slot name="treeSlot"></slot>
7
+ <TreeControls
8
+ mapType="scaffold"
9
+ title="Regions"
10
+ :isReady="isReady"
11
+ :treeData="treeDataEntry"
12
+ :active="active"
13
+ :hover="hover"
14
+ :showColourPicker="showColourPicker"
15
+ @setColour="setColour"
16
+ @checkChanged="checkChanged"
17
+ @changeActive="changeActiveByNode"
18
+ @changeHover="changeHoverByNode"
19
+ ref="treeControls"
20
+ @mouseleave="removeHover(true)"
21
+ />
22
+ </div>
20
23
  </div>
21
24
  <div
22
25
  class="drawer-button"
23
26
  :class="{ open: drawerOpen, close: !drawerOpen }"
27
+ :style="{ 'bottom': `${drawerBottom}px` }"
24
28
  @click="toggleDrawer"
25
29
  >
26
30
  <el-icon><el-icon-arrow-left /></el-icon>
@@ -63,11 +67,12 @@ export default {
63
67
  TreeControls,
64
68
  },
65
69
  props: {
70
+ containerHeight: Number,
71
+ isReady: Boolean,
66
72
  /**
67
73
  * Enable/disable colour picker
68
74
  */
69
75
  showColourPicker: Boolean,
70
- isReady: Boolean,
71
76
  },
72
77
  data: function () {
73
78
  return {
@@ -83,6 +88,19 @@ export default {
83
88
  };
84
89
  },
85
90
  computed: {
91
+ drawerBottom: function() {
92
+ if (100 > this.maxHeight) {
93
+ return this.maxHeight;
94
+ }
95
+ return 100;
96
+ },
97
+ maxHeight: function() {
98
+ let height = this.containerHeight - 114;
99
+ if (0 > height) {
100
+ height = 0;
101
+ }
102
+ return height;
103
+ },
86
104
  treeDataEntry: function () {
87
105
  return this.treeData[0].children;
88
106
  },
@@ -111,6 +129,40 @@ export default {
111
129
  */
112
130
  },
113
131
  methods: {
132
+ setCheckboxDisabled: function(data, flag, childrenOnly) {
133
+ if (data) {
134
+ if (!childrenOnly) {
135
+ data.disabled = flag;
136
+ }
137
+ if (data.children) {
138
+ data.children.forEach(child =>
139
+ this.setCheckboxDisabled(child, flag, false)
140
+ );
141
+ }
142
+ }
143
+ },
144
+ setRegionCheckboxDisabled: function (region, flag, childrenOnly) {
145
+ if (this.treeData[0] && region?.uuid) {
146
+ const data = this.findDataWithId(this.treeData[0], region?.uuid)
147
+ if (data) {
148
+ this.setCheckboxDisabled(data, flag, childrenOnly);
149
+ }
150
+ }
151
+ },
152
+ findDataWithId: function(data, uuid) {
153
+ if (data) {
154
+ if (data.id === uuid) {
155
+ return data;
156
+ }
157
+ if (data.children) {
158
+ for (let i = 0; i < data.children.length; i++) {
159
+ const found = this.findDataWithId(data.children[i], uuid);
160
+ if (found) return found;
161
+ }
162
+ }
163
+ }
164
+ return;
165
+ },
114
166
  addTreeItem: function (parentContainer, item, object) {
115
167
  //The following block prevent duplicate graphics with the same name
116
168
  if (parentContainer.some((child) => child.label === item.label)) {
@@ -251,6 +303,7 @@ export default {
251
303
  region.hideAllPrimitives();
252
304
  //this.checkedRegions = this.checkedRegions.filter(region => region.label !== node.label);
253
305
  }
306
+ this.$emit("check-changed", {region, isChecked});
254
307
  }
255
308
  if (isPrimitives) {
256
309
  const primitives = region.findObjectsWithGroupName(node.label);
@@ -258,6 +311,7 @@ export default {
258
311
  const visibility = isChecked && !node.disabled;
259
312
  primitive.setVisibility(visibility);
260
313
  });
314
+ this.$emit("check-changed", {zincObjects: primitives, isChecked});
261
315
  }
262
316
  },
263
317
  updateActiveUI: function (primitives) {
@@ -637,45 +691,69 @@ export default {
637
691
  }
638
692
  &.open {
639
693
  left: 0px;
640
- .traditional-container {
694
+ .tree-controls-container {
641
695
  opacity: 1;
642
696
  }
643
697
  }
644
698
  &.close {
645
- left: -298px;
646
- .traditional-container {
699
+ left: -278px;
700
+ .tree-controls-container {
647
701
  pointer-events: none;
648
702
  opacity: 0;
649
703
  }
650
704
  }
651
705
  }
652
706
 
653
- .traditional-container {
707
+ .tree-controls-container {
654
708
  transition: all 1s ease;
655
709
  float: left;
656
- padding-left: 16px;
657
- padding-right: 18px;
658
- max-height: calc(100% - 154px);
710
+ padding-left: 8px;
711
+ padding-right: 8px;
659
712
  text-align: left;
660
- overflow: none;
661
713
  border: 1px solid rgb(220, 223, 230);
662
- padding-top: 7px;
663
714
  padding-bottom: 16px;
664
715
  background: #ffffff;
665
716
  }
666
717
 
718
+ .tree-controls-scroll {
719
+ overflow-y:auto;
720
+ overflow-x:hidden;
721
+ //scrollbar-width: thin;
722
+
723
+ &:hover {
724
+ &::-webkit-scrollbar-track {
725
+ background: #f1f1f1;
726
+ }
727
+ }
728
+
729
+ &::-webkit-scrollbar-track {
730
+ border-radius: 8px; /* Rounded corners for the track */
731
+
732
+ }
733
+ &::-webkit-scrollbar {
734
+ width:4px;
735
+
736
+ }
737
+ &::-webkit-scrollbar-thumb {
738
+ border-radius: 10px;
739
+ box-shadow: inset 0 0 6px #c0c4cc;
740
+ background: #a1a1a1;
741
+ }
742
+ }
743
+
667
744
  .drawer-button {
745
+ position: absolute;
668
746
  float: left;
669
747
  width: 20px;
670
748
  height: 40px;
671
749
  z-index: 8;
672
- margin-top: calc(50% - 52px);
673
750
  border: solid 1px $app-primary-color;
674
751
  background-color: #f9f2fc;
675
752
  text-align: center;
676
753
  vertical-align: middle;
677
754
  cursor: pointer;
678
755
  pointer-events: auto;
756
+ right: -22px;
679
757
  }
680
758
 
681
759
  .drawer-button {