@abi-software/flatmapvuer 0.5.10 → 0.6.0-vue3-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.
Files changed (41) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +105 -105
  3. package/babel.config.js +0 -14
  4. package/dist/favicon.ico +0 -0
  5. package/dist/flatmapvuer.js +69542 -0
  6. package/dist/flatmapvuer.umd.cjs +1021 -0
  7. package/dist/index.html +17 -0
  8. package/dist/style.css +1 -0
  9. package/package.json +87 -79
  10. package/public/index.html +17 -17
  11. package/src/App.vue +303 -228
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +6 -7
  14. package/src/components/AnnotationTool.vue +443 -403
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +108 -99
  17. package/src/components/FlatmapVuer.vue +2117 -2070
  18. package/src/components/MultiFlatmapVuer.vue +603 -535
  19. package/src/components/ProvenancePopup.vue +496 -422
  20. package/src/components/SelectionsGroup.vue +258 -249
  21. package/src/components/Tooltip.vue +50 -52
  22. package/src/components/TreeControls.vue +234 -231
  23. package/src/components/index.js +6 -9
  24. package/src/components/legends/DynamicLegends.vue +106 -112
  25. package/src/components/legends/SvgLegends.vue +112 -67
  26. package/src/components.d.ts +46 -0
  27. package/src/icons/flatmap-marker.js +1 -1
  28. package/src/icons/fonts/mapicon-species.eot +0 -0
  29. package/src/icons/fonts/mapicon-species.svg +14 -14
  30. package/src/icons/fonts/mapicon-species.ttf +0 -0
  31. package/src/icons/fonts/mapicon-species.woff +0 -0
  32. package/src/icons/mapicon-species-style.css +42 -42
  33. package/src/icons/yellowstar.js +5 -5
  34. package/src/legends/legend.svg +25 -25
  35. package/src/main.js +4 -8
  36. package/src/services/flatmapQueries.js +451 -415
  37. package/vite.config.js +76 -0
  38. package/vue.config.js +45 -31
  39. package/CHANGELOG.md +0 -402
  40. package/package-lock.json +0 -18473
  41. package/src/nerve-map.js +0 -99
@@ -1,231 +1,234 @@
1
- <template>
2
- <div class="container">
3
- <el-row>
4
- <el-col :span="12">
5
- <div class="title-text">
6
- Systems
7
- </div>
8
- </el-col>
9
- </el-row>
10
- <div class="tree-container">
11
- <el-tree
12
- ref="tree"
13
- node-key="key"
14
- show-checkbox
15
- :check-strictly="false"
16
- :data="treeData"
17
- :render-after-expand="false"
18
- :default-expanded-keys="defaultExpandedKeys"
19
- @check="checkChanged"
20
- >
21
- <span
22
- slot-scope="{ node, data }"
23
- class="region-tree-node"
24
- :class="{
25
- activeItem: nodeIsActive(data),
26
- hoverItem: nodeIsHover(data),
27
- }"
28
- @click="changeActiveByNode(data)"
29
- @mouseover="changeHoverByNode(data)"
30
- >
31
- <div :style="getBackgroundStyles(data)">
32
- {{ node.label }}
33
- </div>
34
- </span>
35
- </el-tree>
36
- </div>
37
- </div>
38
- </template>
39
-
40
- <script>
41
- /* eslint-disable no-alert, no-console */
42
- import Vue from "vue";
43
- import { Checkbox, CheckboxGroup, ColorPicker, Row, Tree } from "element-ui";
44
- import lang from "element-ui/lib/locale/lang/en";
45
- import locale from "element-ui/lib/locale";
46
- locale.use(lang);
47
- Vue.use(Checkbox);
48
- Vue.use(CheckboxGroup);
49
- Vue.use(ColorPicker);
50
- Vue.use(Row);
51
- Vue.use(Tree);
52
-
53
- /**
54
- * A vue component for toggling visibility of various regions.
55
- */
56
- export default {
57
- name: "TreeControls",
58
- props: {
59
- treeData: {
60
- type: Array,
61
- default: function () {
62
- return [];
63
- }
64
- },
65
- active: {
66
- type: String,
67
- default: ""
68
- },
69
- hover: {
70
- type: String,
71
- default: ""
72
- }
73
- },
74
- data: function () {
75
- return {
76
- defaultExpandedKeys: ["All"],
77
- };
78
- },
79
- destroyed: function () {
80
- this.sortedPrimitiveGroups = undefined;
81
- },
82
- methods: {
83
- nodeIsActive: function(data) {
84
- return this.active === data.models;
85
- },
86
- nodeIsHover: function(data) {
87
- return this.hover === data.models;
88
- },
89
- changeActiveByNode: function(data) {
90
- if (data.models) {
91
- this.$emit("change-active", data.models);
92
- }
93
- },
94
- changeHoverByNode: function() {
95
- //if (data.models) {
96
- // this.$emit("change-active", data.models);
97
- //}
98
- },
99
- checkChanged: function (node, data) {
100
- const isChecked = data.checkedKeys.includes(node.key);
101
- if (node.key === "All") {
102
- this.$emit("checkAll", isChecked);
103
- } else {
104
- this.$emit("changed", {key: node.key, value: isChecked});
105
- }
106
- },
107
- getBackgroundStyles: function(node) {
108
- if ('colour' in node) {
109
- return { background: node.colour };
110
- }
111
- return {};
112
- },
113
- },
114
- };
115
- </script>
116
-
117
- <!-- Add "scoped" attribute to limit CSS to this component only -->
118
- <style scoped lang="scss">
119
- @import "~element-ui/packages/theme-chalk/src/checkbox";
120
- @import "~element-ui/packages/theme-chalk/src/row";
121
- @import "~element-ui/packages/theme-chalk/src/tree";
122
-
123
- .checkbox-container {
124
- display: flex;
125
- cursor: pointer;
126
- }
127
-
128
- .tree-controls {
129
- position: absolute;
130
- bottom: 0px;
131
- transition: all 1s ease;
132
-
133
- &:focus {
134
- outline: none;
135
- }
136
- }
137
-
138
- .container {
139
- text-align: left;
140
- overflow: none;
141
- padding-top: 7px;
142
- padding-bottom: 16px;
143
- background: #ffffff;
144
- }
145
-
146
- .title-text {
147
- width: 59px;
148
- height: 20px;
149
- color: rgb(48, 49, 51);
150
- font-size: 14px;
151
- font-weight: normal;
152
- line-height: 20px;
153
- margin-left: 8px;
154
- }
155
-
156
- .all-checkbox {
157
- float: right;
158
- }
159
-
160
- .tree-container {
161
- width: 260px;
162
- border: 1px solid rgb(144, 147, 153);
163
- border-radius: 4px;
164
- background: #ffffff;
165
- margin-top: 6px;
166
- scrollbar-width: thin;
167
-
168
- ::v-deep .el-tree {
169
- max-height: 240px;
170
- min-height: 130px;
171
- overflow: auto;
172
- &::-webkit-scrollbar {
173
- width: 4px;
174
- }
175
-
176
- &::-webkit-scrollbar-thumb {
177
- border-radius: 10px;
178
- box-shadow: inset 0 0 6px #c0c4cc;
179
- }
180
- }
181
-
182
- ::v-deep .el-tree-node__content {
183
- height: 22px;
184
- }
185
- }
186
-
187
- ::v-deep .el-checkbox__input {
188
- &.is-indeterminate,
189
- &.is-checked {
190
- .el-checkbox__inner {
191
- background-color: $app-primary-color;
192
- border-color: $app-primary-color;
193
- }
194
- }
195
- }
196
-
197
- ::v-deep .el-tree-node__children .el-tree-node__children .el-tree-node__content > label.el-checkbox {
198
- display: none;
199
- }
200
-
201
- ::v-deep .el-checkbox__label {
202
- padding-left: 5px;
203
- color: $app-primary-color !important;
204
- font-size: 12px;
205
- font-weight: 500;
206
- letter-spacing: 0px;
207
- line-height: 14px;
208
- }
209
-
210
- .activeItem {
211
- background-color: #bbb !important;
212
- }
213
-
214
- .region-tree-node {
215
- flex: 1;
216
- color: $app-primary-color !important;
217
- display: flex;
218
- font-size: 12px;
219
- line-height: 14px;
220
- padding-left: 0px;
221
- background-color: #fff;
222
- width: 100%;
223
-
224
- }
225
-
226
- .hoverItem {
227
- background-color: #eee !important;
228
- }
229
-
230
- </style>
231
-
1
+ <template>
2
+ <div class="container">
3
+ <el-row>
4
+ <el-col :span="12">
5
+ <div class="title-text">Systems</div>
6
+ </el-col>
7
+ </el-row>
8
+ <div class="tree-container">
9
+ <el-tree
10
+ ref="tree"
11
+ node-key="key"
12
+ show-checkbox
13
+ :check-strictly="false"
14
+ :data="treeData"
15
+ :render-after-expand="false"
16
+ :default-expanded-keys="defaultExpandedKeys"
17
+ @check="checkChanged"
18
+ >
19
+ <template #default="{ node, data }">
20
+ <span
21
+ class="region-tree-node"
22
+ :class="{
23
+ activeItem: nodeIsActive(data),
24
+ hoverItem: nodeIsHover(data),
25
+ }"
26
+ @click="changeActiveByNode(data)"
27
+ @mouseover="changeHoverByNode(data)"
28
+ >
29
+ <div :style="getBackgroundStyles(data)">
30
+ {{ node.label }}
31
+ </div>
32
+ </span>
33
+ </template>
34
+ </el-tree>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ /* eslint-disable no-alert, no-console */
41
+ import {
42
+ ElCheckbox as Checkbox,
43
+ ElCheckboxGroup as CheckboxGroup,
44
+ ElColorPicker as ColorPicker,
45
+ ElRow as Row,
46
+ ElTree as Tree,
47
+ } from 'element-plus'
48
+
49
+ /**
50
+ * A vue component for toggling visibility of various regions.
51
+ */
52
+ export default {
53
+ name: 'TreeControls',
54
+ components: {
55
+ Checkbox,
56
+ CheckboxGroup,
57
+ ColorPicker,
58
+ Row,
59
+ Tree,
60
+ },
61
+ props: {
62
+ treeData: {
63
+ type: Array,
64
+ default: function () {
65
+ return []
66
+ },
67
+ },
68
+ active: {
69
+ type: String,
70
+ default: '',
71
+ },
72
+ hover: {
73
+ type: String,
74
+ default: '',
75
+ },
76
+ },
77
+ data: function () {
78
+ return {
79
+ defaultExpandedKeys: ['All'],
80
+ }
81
+ },
82
+ destroyed: function () {
83
+ this.sortedPrimitiveGroups = undefined
84
+ },
85
+ methods: {
86
+ nodeIsActive: function (data) {
87
+ return this.active === data.models
88
+ },
89
+ nodeIsHover: function (data) {
90
+ return this.hover === data.models
91
+ },
92
+ changeActiveByNode: function (data) {
93
+ if (data.models) {
94
+ this.$emit('change-active', data.models)
95
+ }
96
+ },
97
+ changeHoverByNode: function () {
98
+ //if (data.models) {
99
+ // this.$emit("change-active", data.models);
100
+ //}
101
+ },
102
+ checkChanged: function (node, data) {
103
+ const isChecked = data.checkedKeys.includes(node.key)
104
+ if (node.key === 'All') {
105
+ this.$emit('checkAll', isChecked)
106
+ } else {
107
+ this.$emit('changed', { key: node.key, value: isChecked })
108
+ }
109
+ },
110
+ getBackgroundStyles: function (node) {
111
+ if ('colour' in node) {
112
+ return { background: node.colour }
113
+ }
114
+ return {}
115
+ },
116
+ },
117
+ }
118
+ </script>
119
+
120
+ <style lang="scss" scoped>
121
+ @use 'element-plus/theme-chalk/src/checkbox';
122
+ @use 'element-plus/theme-chalk/src/row';
123
+ @use 'element-plus/theme-chalk/src/tree';
124
+
125
+ .checkbox-container {
126
+ display: flex;
127
+ cursor: pointer;
128
+ }
129
+
130
+ .tree-controls {
131
+ position: absolute;
132
+ bottom: 0px;
133
+ transition: all 1s ease;
134
+
135
+ &:focus {
136
+ outline: none;
137
+ }
138
+ }
139
+
140
+ .container {
141
+ text-align: left;
142
+ overflow: none;
143
+ padding-top: 7px;
144
+ padding-bottom: 16px;
145
+ background: #ffffff;
146
+ }
147
+
148
+ .title-text {
149
+ width: 59px;
150
+ height: 20px;
151
+ color: rgb(48, 49, 51);
152
+ font-size: 14px;
153
+ font-weight: normal;
154
+ line-height: 20px;
155
+ margin-left: 8px;
156
+ }
157
+
158
+ .all-checkbox {
159
+ float: right;
160
+ }
161
+
162
+ .tree-container {
163
+ width: 260px;
164
+ border: 1px solid rgb(144, 147, 153);
165
+ border-radius: 4px;
166
+ background: #ffffff;
167
+ margin-top: 6px;
168
+ scrollbar-width: thin;
169
+
170
+ :deep(.el-tree) {
171
+ max-height: 240px;
172
+ min-height: 130px;
173
+ overflow: auto;
174
+ &::-webkit-scrollbar {
175
+ width: 4px;
176
+ }
177
+
178
+ &::-webkit-scrollbar-thumb {
179
+ border-radius: 10px;
180
+ box-shadow: inset 0 0 6px #c0c4cc;
181
+ }
182
+ }
183
+
184
+ :deep(.el-tree-node__content) {
185
+ height: 22px;
186
+ }
187
+ }
188
+
189
+ :deep(.el-checkbox__input) {
190
+ &.is-indeterminate,
191
+ &.is-checked {
192
+ .el-checkbox__inner {
193
+ background-color: $app-primary-color;
194
+ border-color: $app-primary-color;
195
+ }
196
+ }
197
+ }
198
+
199
+ :deep(
200
+ .el-tree-node__children
201
+ .el-tree-node__children
202
+ .el-tree-node__content
203
+ > label.el-checkbox) {
204
+ display: none;
205
+ }
206
+
207
+ :deep(.el-checkbox__label) {
208
+ padding-left: 5px;
209
+ color: $app-primary-color !important;
210
+ font-size: 12px;
211
+ font-weight: 500;
212
+ letter-spacing: 0px;
213
+ line-height: 14px;
214
+ }
215
+
216
+ .activeItem {
217
+ background-color: #bbb !important;
218
+ }
219
+
220
+ .region-tree-node {
221
+ flex: 1;
222
+ color: $app-primary-color !important;
223
+ display: flex;
224
+ font-size: 12px;
225
+ line-height: 14px;
226
+ padding-left: 0px;
227
+ background-color: #fff;
228
+ width: 100%;
229
+ }
230
+
231
+ .hoverItem {
232
+ background-color: #eee !important;
233
+ }
234
+ </style>
@@ -1,9 +1,6 @@
1
- // The Vue build version to load with the `import` command
2
- // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
- import FlatmapVuer from "./FlatmapVuer.vue";
4
- import MultiFlatmapVuer from "./MultiFlatmapVuer.vue";
5
-
6
- export {
7
- FlatmapVuer,
8
- MultiFlatmapVuer
9
- };
1
+ // The Vue build version to load with the `import` command
2
+ // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
+ import FlatmapVuer from './FlatmapVuer.vue'
4
+ import MultiFlatmapVuer from './MultiFlatmapVuer.vue'
5
+
6
+ export { FlatmapVuer, MultiFlatmapVuer }