@abi-software/flatmapvuer 0.5.9 → 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/babel.config.js +0 -14
  2. package/dist/favicon.ico +0 -0
  3. package/dist/flatmapvuer.js +69542 -0
  4. package/dist/flatmapvuer.umd.cjs +1021 -0
  5. package/dist/index.html +17 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +29 -21
  8. package/src/App.vue +180 -105
  9. package/src/assets/styles.scss +2 -3
  10. package/src/components/AnnotationTool.vue +193 -153
  11. package/src/components/EventBus.js +3 -3
  12. package/src/components/ExternalResourceCard.vue +39 -30
  13. package/src/components/FlatmapVuer.vue +734 -676
  14. package/src/components/MultiFlatmapVuer.vue +313 -246
  15. package/src/components/ProvenancePopup.vue +195 -121
  16. package/src/components/SelectionsGroup.vue +93 -84
  17. package/src/components/Tooltip.vue +11 -13
  18. package/src/components/TreeControls.vue +67 -64
  19. package/src/components/index.js +4 -7
  20. package/src/components/legends/DynamicLegends.vue +13 -19
  21. package/src/components/legends/SvgLegends.vue +72 -27
  22. package/src/components.d.ts +46 -0
  23. package/src/icons/flatmap-marker.js +1 -1
  24. package/src/icons/fonts/mapicon-species.eot +0 -0
  25. package/src/icons/fonts/mapicon-species.svg +0 -0
  26. package/src/icons/yellowstar.js +2 -2
  27. package/src/legends/legend.svg +0 -0
  28. package/src/main.js +2 -6
  29. package/src/services/flatmapQueries.js +175 -139
  30. package/vite.config.js +76 -0
  31. package/vue.config.js +14 -0
  32. package/CHANGELOG.md +0 -402
  33. package/dist/demo.html +0 -10
  34. package/dist/flatmapvuer.common.js +0 -22741
  35. package/dist/flatmapvuer.common.js.map +0 -1
  36. package/dist/flatmapvuer.css +0 -1
  37. package/dist/flatmapvuer.umd.js +0 -22751
  38. package/dist/flatmapvuer.umd.js.map +0 -1
  39. package/dist/flatmapvuer.umd.min.js +0 -4
  40. package/dist/flatmapvuer.umd.min.js.map +0 -1
  41. package/package-lock.json +0 -18473
@@ -2,7 +2,7 @@
2
2
  <div class="selections-container">
3
3
  <el-row>
4
4
  <el-col :span="12">
5
- <div class="checkall-display-text">{{title}}</div>
5
+ <div class="checkall-display-text">{{ title }}</div>
6
6
  </el-col>
7
7
  <el-col :span="12">
8
8
  <el-checkbox
@@ -11,7 +11,8 @@
11
11
  :indeterminate="isIndeterminate"
12
12
  v-model="checkAll"
13
13
  @change="handleCheckAllChange"
14
- >Display all</el-checkbox>
14
+ >Display all</el-checkbox
15
+ >
15
16
  </el-col>
16
17
  </el-row>
17
18
  <el-checkbox-group
@@ -21,20 +22,25 @@
21
22
  @change="handleCheckedItemsChange"
22
23
  >
23
24
  <div class="checkbox-group-inner">
24
- <el-row v-for="item in selections" :key="item[identifierKey]" :label="item[identifierKey]">
25
+ <el-row
26
+ v-for="item in selections"
27
+ :key="item[identifierKey]"
28
+ :label="item[identifierKey]"
29
+ >
25
30
  <div class="checkbox-container">
26
31
  <el-checkbox
27
32
  class="my-checkbox"
28
33
  :label="item[identifierKey]"
29
34
  @change="visibilityToggle(item[identifierKey], $event)"
30
- :checked="!('enabled' in item) || (item.enabled === true)">
35
+ :checked="!('enabled' in item) || item.enabled === true"
36
+ >
31
37
  <el-row class="checkbox-row">
32
- <el-col :span="4">
33
- <div class="path-visual" :style="getLineStyles(item)"></div>
38
+ <el-col :span="4" v-if="hasLineStyles(item)">
39
+ <div class="path-visual" :style="getLineStyles(item)"></div>
34
40
  </el-col>
35
41
  <el-col :span="20">
36
42
  <div :style="getBackgroundStyles(item)">
37
- {{item[labelKey]}}
43
+ {{ item[labelKey] }}
38
44
  </div>
39
45
  </el-col>
40
46
  </el-row>
@@ -48,125 +54,123 @@
48
54
 
49
55
  <script>
50
56
  /* eslint-disable no-alert, no-console */
51
- import Vue from "vue";
52
57
  import {
53
- Checkbox,
54
- CheckboxGroup,
55
- Col,
56
- Row
57
- } from "element-ui";
58
- import lang from "element-ui/lib/locale/lang/en";
59
- import locale from "element-ui/lib/locale";
60
-
61
- locale.use(lang);
62
- Vue.use(Checkbox);
63
- Vue.use(CheckboxGroup);
64
- Vue.use(Col);
65
- Vue.use(Row);
66
-
58
+ ElCheckbox as Checkbox,
59
+ ElCheckboxGroup as CheckboxGroup,
60
+ ElCol as Col,
61
+ ElRow as Row,
62
+ } from 'element-plus'
67
63
 
68
64
  export default {
69
- name: "SelectionsGroup",
65
+ name: 'SelectionsGroup',
66
+ components: {
67
+ Checkbox,
68
+ CheckboxGroup,
69
+ Col,
70
+ Row,
71
+ },
70
72
  methods: {
71
73
  /**
72
74
  * Function to toggle paths to default.
73
75
  * Also called when the associated button is pressed.
74
76
  */
75
- reset: function() {
76
- this.checkAll = true;
77
- this.checkedItems = [];
78
- this.selections.forEach(item => {
77
+ reset: function () {
78
+ this.checkAll = true
79
+ this.checkedItems = []
80
+ this.selections.forEach((item) => {
79
81
  if (!('enabled' in item) || item.enabled === true) {
80
- this.checkedItems.push(item[this.identifierKey]);
82
+ this.checkedItems.push(item[this.identifierKey])
81
83
  } else {
82
- this.checkAll = false;
84
+ this.checkAll = false
83
85
  }
84
- });
86
+ })
85
87
  },
86
- visibilityToggle: function(key, value) {
87
- this.$emit("changed", {key, value});
88
+ visibilityToggle: function (key, value) {
89
+ this.$emit('changed', { key, value })
88
90
  },
89
- handleCheckedItemsChange: function(value) {
90
- let checkedCount = value.length;
91
- this.checkAll = checkedCount === this.selections.length;
91
+ handleCheckedItemsChange: function (value) {
92
+ let checkedCount = value.length
93
+ this.checkAll = checkedCount === this.selections.length
92
94
  },
93
- handleCheckAllChange: function(val) {
94
- this.checkedItems = val ? this.selections.map(a => a[this.identifierKey]) : [];
95
- this.$emit("checkAll",
96
- {
97
- keys: this.selections.map(a => a[this.identifierKey]),
98
- value: val
99
- });
95
+ handleCheckAllChange: function (val) {
96
+ this.checkedItems = val
97
+ ? this.selections.map((a) => a[this.identifierKey])
98
+ : []
99
+ this.$emit('checkAll', {
100
+ keys: this.selections.map((a) => a[this.identifierKey]),
101
+ value: val,
102
+ })
100
103
  },
101
- getBackgroundStyles: function(item) {
102
- if ('colour' in item && this.colourStyle === "background") {
103
- return { background: item.colour };
104
+ getBackgroundStyles: function (item) {
105
+ if ('colour' in item && this.colourStyle === 'background') {
106
+ return { background: item.colour }
104
107
  }
105
- return {};
108
+ return {}
106
109
  },
107
- getLineStyles: function(item) {
108
- if ('colour' in item && this.colourStyle === "line") {
109
- if (('dashed' in item) && (item.dashed === true)) {
110
- const background = `repeating-linear-gradient(90deg,${item.colour},${item.colour} 6px,transparent 0,transparent 9px)`;
111
- return { background };
112
- }
113
- else {
114
- return { background: item.colour };
110
+ hasLineStyles: function(item) {
111
+ return 'colour' in item && this.colourStyle === 'line'
112
+ },
113
+ getLineStyles: function (item) {
114
+ if ('colour' in item && this.colourStyle === 'line') {
115
+ if ('dashed' in item && item.dashed === true) {
116
+ const background = `repeating-linear-gradient(90deg,${item.colour},${item.colour} 6px,transparent 0,transparent 9px)`
117
+ return { background }
118
+ } else {
119
+ return { background: item.colour }
115
120
  }
116
121
  }
117
- return { display: "None"};
118
- }
122
+ return { display: 'None' }
123
+ },
119
124
  },
120
125
  props: {
121
126
  colourStyle: {
122
127
  type: String,
123
- default: "line"
128
+ default: 'line',
124
129
  },
125
130
  identifierKey: {
126
131
  type: String,
127
- default: "id"
132
+ default: 'id',
128
133
  },
129
134
  labelKey: {
130
135
  type: String,
131
- default: "label"
136
+ default: 'label',
132
137
  },
133
138
  title: {
134
139
  type: String,
135
- default: ""
140
+ default: '',
136
141
  },
137
142
  selections: {
138
143
  type: Array,
139
- default: function() {
140
- return [];
144
+ default: function () {
145
+ return []
141
146
  },
142
147
  },
143
148
  },
144
149
  computed: {
145
- isIndeterminate: function() {
146
- const count = this.checkedItems.length;
147
- if ((count === 0) || this.checkAll){
148
- return false;
150
+ isIndeterminate: function () {
151
+ const count = this.checkedItems.length
152
+ if (count === 0 || this.checkAll) {
153
+ return false
149
154
  }
150
- return true;
151
- }
155
+ return true
156
+ },
152
157
  },
153
- data: function() {
158
+ data: function () {
154
159
  return {
155
160
  checkedItems: [],
156
161
  checkAll: true,
157
- };
162
+ }
158
163
  },
159
- mounted: function() {
160
- this.reset();
161
- }
162
- };
164
+ mounted: function () {
165
+ this.reset()
166
+ },
167
+ }
163
168
  </script>
164
169
 
165
- <!-- Add "scoped" attribute to limit CSS to this component only -->
166
- <style scoped lang="scss">
167
- @import "~element-ui/packages/theme-chalk/src/checkbox";
168
- @import "~element-ui/packages/theme-chalk/src/checkbox-group";
169
- @import "~element-ui/packages/theme-chalk/src/row";
170
+ <style lang="scss" scoped>
171
+ @use 'element-plus/theme-chalk/src/checkbox';
172
+ @use 'element-plus/theme-chalk/src/checkbox-group';
173
+ @use 'element-plus/theme-chalk/src/row';
170
174
 
171
175
  .path-visual {
172
176
  margin: 3px 0;
@@ -192,12 +196,14 @@ export default {
192
196
  }
193
197
 
194
198
  .all-checkbox {
199
+ height:20px;
195
200
  float: right;
196
201
  }
197
202
 
198
203
  .checkbox-container {
199
204
  display: flex;
200
205
  cursor: pointer;
206
+ width: 100%;
201
207
  }
202
208
 
203
209
  .checkbox-group {
@@ -216,7 +222,7 @@ export default {
216
222
  padding: 18px;
217
223
  }
218
224
 
219
- ::v-deep .el-checkbox__label {
225
+ :deep(.el-checkbox__label) {
220
226
  padding-left: 5px;
221
227
  color: $app-primary-color;
222
228
  font-size: 12px;
@@ -226,7 +232,7 @@ export default {
226
232
  width: 100%;
227
233
  }
228
234
 
229
- ::v-deep .el-checkbox__input {
235
+ :deep(.el-checkbox__input) {
230
236
  &.is-indeterminate,
231
237
  &.is-checked {
232
238
  .el-checkbox__inner {
@@ -236,7 +242,12 @@ export default {
236
242
  }
237
243
  }
238
244
 
239
- ::v-deep .el-checkbox__label {
245
+ :deep(.el-row) {
246
+ height:20px;
247
+ margin-bottom: 0;
248
+ }
249
+
250
+ :deep(.el-checkbox__label) {
240
251
  color: $app-primary-color !important;
241
252
  }
242
253
 
@@ -244,6 +255,4 @@ export default {
244
255
  width: 100%;
245
256
  top: 2px;
246
257
  }
247
-
248
258
  </style>
249
-
@@ -1,47 +1,45 @@
1
1
  <template>
2
2
  <div class="tooltip-container">
3
3
  <template v-if="annotationDisplay">
4
- <annotation-tool :annotationEntry="annotationEntry"/>
4
+ <annotation-tool :annotationEntry="annotationEntry" />
5
5
  </template>
6
6
  <template v-else>
7
- <provenance-popup :entry="entry"/>
7
+ <provenance-popup :entry="entry" />
8
8
  </template>
9
9
  </div>
10
10
  </template>
11
11
 
12
-
13
12
  <script>
14
13
  /* eslint-disable no-alert, no-console */
15
- import AnnotationTool from "./AnnotationTool";
16
- import ProvenancePopup from "./ProvenancePopup";
14
+ import AnnotationTool from './AnnotationTool.vue'
15
+ import ProvenancePopup from './ProvenancePopup.vue'
17
16
 
18
17
  export default {
19
- name: "Tooltip",
18
+ name: 'Tooltip',
20
19
  components: {
21
20
  AnnotationTool,
22
21
  ProvenancePopup,
23
22
  },
24
- props: {
23
+ props: {
25
24
  entry: {
26
25
  type: Object,
27
26
  },
28
27
  annotationDisplay: {
29
28
  type: Boolean,
30
- default: false
29
+ default: false,
31
30
  },
32
31
  annotationEntry: {
33
32
  type: Object,
34
33
  },
35
34
  },
36
- };
35
+ }
37
36
  </script>
38
37
 
39
- <style scoped lang="scss">
40
-
38
+ <style lang="scss" scoped>
41
39
  .tooltip-container {
42
- text-align:justify;
40
+ text-align: justify;
43
41
  border-radius: 4px;
44
- box-shadow: 0 1px 2px rgba(0,0,0,.1);
42
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
45
43
  pointer-events: auto;
46
44
  background: #fff;
47
45
  border: 1px solid $app-primary-color;
@@ -2,9 +2,7 @@
2
2
  <div class="container">
3
3
  <el-row>
4
4
  <el-col :span="12">
5
- <div class="title-text">
6
- Systems
7
- </div>
5
+ <div class="title-text">Systems</div>
8
6
  </el-col>
9
7
  </el-row>
10
8
  <div class="tree-container">
@@ -18,20 +16,21 @@
18
16
  :default-expanded-keys="defaultExpandedKeys"
19
17
  @check="checkChanged"
20
18
  >
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>
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>
35
34
  </el-tree>
36
35
  </div>
37
36
  </div>
@@ -39,86 +38,89 @@
39
38
 
40
39
  <script>
41
40
  /* 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);
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'
52
48
 
53
49
  /**
54
50
  * A vue component for toggling visibility of various regions.
55
51
  */
56
52
  export default {
57
- name: "TreeControls",
53
+ name: 'TreeControls',
54
+ components: {
55
+ Checkbox,
56
+ CheckboxGroup,
57
+ ColorPicker,
58
+ Row,
59
+ Tree,
60
+ },
58
61
  props: {
59
62
  treeData: {
60
63
  type: Array,
61
64
  default: function () {
62
- return [];
63
- }
65
+ return []
66
+ },
64
67
  },
65
68
  active: {
66
69
  type: String,
67
- default: ""
70
+ default: '',
68
71
  },
69
72
  hover: {
70
73
  type: String,
71
- default: ""
72
- }
74
+ default: '',
75
+ },
73
76
  },
74
77
  data: function () {
75
78
  return {
76
- defaultExpandedKeys: ["All"],
77
- };
79
+ defaultExpandedKeys: ['All'],
80
+ }
78
81
  },
79
82
  destroyed: function () {
80
- this.sortedPrimitiveGroups = undefined;
83
+ this.sortedPrimitiveGroups = undefined
81
84
  },
82
85
  methods: {
83
- nodeIsActive: function(data) {
84
- return this.active === data.models;
86
+ nodeIsActive: function (data) {
87
+ return this.active === data.models
85
88
  },
86
- nodeIsHover: function(data) {
87
- return this.hover === data.models;
89
+ nodeIsHover: function (data) {
90
+ return this.hover === data.models
88
91
  },
89
- changeActiveByNode: function(data) {
92
+ changeActiveByNode: function (data) {
90
93
  if (data.models) {
91
- this.$emit("change-active", data.models);
94
+ this.$emit('change-active', data.models)
92
95
  }
93
96
  },
94
- changeHoverByNode: function() {
97
+ changeHoverByNode: function () {
95
98
  //if (data.models) {
96
99
  // this.$emit("change-active", data.models);
97
100
  //}
98
101
  },
99
102
  checkChanged: function (node, data) {
100
- const isChecked = data.checkedKeys.includes(node.key);
101
- if (node.key === "All") {
102
- this.$emit("checkAll", isChecked);
103
+ const isChecked = data.checkedKeys.includes(node.key)
104
+ if (node.key === 'All') {
105
+ this.$emit('checkAll', isChecked)
103
106
  } else {
104
- this.$emit("changed", {key: node.key, value: isChecked});
107
+ this.$emit('changed', { key: node.key, value: isChecked })
105
108
  }
106
109
  },
107
- getBackgroundStyles: function(node) {
110
+ getBackgroundStyles: function (node) {
108
111
  if ('colour' in node) {
109
- return { background: node.colour };
112
+ return { background: node.colour }
110
113
  }
111
- return {};
114
+ return {}
112
115
  },
113
116
  },
114
- };
117
+ }
115
118
  </script>
116
119
 
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";
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';
122
124
 
123
125
  .checkbox-container {
124
126
  display: flex;
@@ -165,7 +167,7 @@ export default {
165
167
  margin-top: 6px;
166
168
  scrollbar-width: thin;
167
169
 
168
- ::v-deep .el-tree {
170
+ :deep(.el-tree) {
169
171
  max-height: 240px;
170
172
  min-height: 130px;
171
173
  overflow: auto;
@@ -179,12 +181,12 @@ export default {
179
181
  }
180
182
  }
181
183
 
182
- ::v-deep .el-tree-node__content {
184
+ :deep(.el-tree-node__content) {
183
185
  height: 22px;
184
186
  }
185
187
  }
186
188
 
187
- ::v-deep .el-checkbox__input {
189
+ :deep(.el-checkbox__input) {
188
190
  &.is-indeterminate,
189
191
  &.is-checked {
190
192
  .el-checkbox__inner {
@@ -194,11 +196,15 @@ export default {
194
196
  }
195
197
  }
196
198
 
197
- ::v-deep .el-tree-node__children .el-tree-node__children .el-tree-node__content > label.el-checkbox {
199
+ :deep(
200
+ .el-tree-node__children
201
+ .el-tree-node__children
202
+ .el-tree-node__content
203
+ > label.el-checkbox) {
198
204
  display: none;
199
205
  }
200
206
 
201
- ::v-deep .el-checkbox__label {
207
+ :deep(.el-checkbox__label) {
202
208
  padding-left: 5px;
203
209
  color: $app-primary-color !important;
204
210
  font-size: 12px;
@@ -220,12 +226,9 @@ export default {
220
226
  padding-left: 0px;
221
227
  background-color: #fff;
222
228
  width: 100%;
223
-
224
229
  }
225
230
 
226
231
  .hoverItem {
227
232
  background-color: #eee !important;
228
233
  }
229
-
230
234
  </style>
231
-
@@ -1,9 +1,6 @@
1
1
  // The Vue build version to load with the `import` command
2
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
- };
3
+ import FlatmapVuer from './FlatmapVuer.vue'
4
+ import MultiFlatmapVuer from './MultiFlatmapVuer.vue'
5
+
6
+ export { FlatmapVuer, MultiFlatmapVuer }
@@ -27,48 +27,43 @@
27
27
 
28
28
  <script>
29
29
  /* eslint-disable no-alert, no-console */
30
- import Vue from "vue";
31
- import { Col, Row } from "element-ui";
32
- import lang from "element-ui/lib/locale/lang/en";
33
- import locale from "element-ui/lib/locale";
34
-
35
- locale.use(lang);
36
- Vue.use(Col);
37
- Vue.use(Row);
30
+ import Vue from 'vue'
31
+ import { ElCol as Col, ElRow as Row } from 'element-plus'
32
+ Vue.use(Col)
33
+ Vue.use(Row)
38
34
 
39
35
  export default {
40
- name: "DynamicLegends",
36
+ name: 'DynamicLegends',
41
37
  props: {
42
38
  identifierKey: {
43
39
  type: String,
44
- default: "id",
40
+ default: 'id',
45
41
  },
46
42
  colourKey: {
47
43
  type: String,
48
- default: "colour",
44
+ default: 'colour',
49
45
  },
50
46
  title: {
51
47
  type: String,
52
- default: "",
48
+ default: '',
53
49
  },
54
50
  lists: {
55
51
  type: Array,
56
52
  default: function () {
57
- return [];
53
+ return []
58
54
  },
59
55
  },
60
56
  },
61
57
  methods: {
62
58
  capitalise: function (label) {
63
- return label.charAt(0).toUpperCase() + label.slice(1).toLowerCase();
59
+ return label.charAt(0).toUpperCase() + label.slice(1).toLowerCase()
64
60
  },
65
61
  },
66
- };
62
+ }
67
63
  </script>
68
64
 
69
- <!-- Add "scoped" attribute to limit CSS to this component only -->
70
- <style scoped lang="scss">
71
- @import "~element-ui/packages/theme-chalk/src/row";
65
+ <style lang="scss" scoped>
66
+ @use 'element-plus/theme-chalk/src/row';
72
67
 
73
68
  .legends-visual {
74
69
  margin: 2px;
@@ -109,4 +104,3 @@ export default {
109
104
  padding: 18px;
110
105
  }
111
106
  </style>
112
-