@abi-software/flatmapvuer 0.6.3-vue.3.9 → 1.0.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 (38) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +120 -120
  3. package/cypress.config.js +23 -23
  4. package/dist/flatmapvuer.js +15894 -16259
  5. package/dist/flatmapvuer.umd.cjs +132 -145
  6. package/dist/index.html +17 -17
  7. package/dist/style.css +1 -1
  8. package/package.json +95 -95
  9. package/public/index.html +17 -17
  10. package/reporter-config.json +9 -9
  11. package/src/App.vue +310 -310
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +5 -5
  14. package/src/components/AnnotationTool.vue +450 -446
  15. package/src/components/EventBus.js +3 -3
  16. package/src/components/ExternalResourceCard.vue +107 -107
  17. package/src/components/FlatmapVuer.vue +2600 -2531
  18. package/src/components/MultiFlatmapVuer.vue +731 -731
  19. package/src/components/ProvenancePopup.vue +503 -495
  20. package/src/components/SelectionsGroup.vue +255 -255
  21. package/src/components/Tooltip.vue +50 -50
  22. package/src/components/TreeControls.vue +231 -231
  23. package/src/components/index.js +7 -7
  24. package/src/components/legends/DynamicLegends.vue +106 -106
  25. package/src/components/legends/SvgLegends.vue +112 -112
  26. package/src/icons/flatmap-marker.js +1 -1
  27. package/src/icons/fonts/mapicon-species.svg +14 -14
  28. package/src/icons/fonts/mapicon-species.ttf +0 -0
  29. package/src/icons/fonts/mapicon-species.woff +0 -0
  30. package/src/icons/mapicon-species-style.css +42 -42
  31. package/src/icons/yellowstar.js +5 -5
  32. package/src/legends/legend.svg +25 -25
  33. package/src/main.js +19 -19
  34. package/src/services/flatmapQueries.js +453 -453
  35. package/src/store/index.js +23 -23
  36. package/vite.config.js +73 -73
  37. package/vite.static-build.js +12 -12
  38. package/vuese-generator.js +64 -64
@@ -1,255 +1,255 @@
1
- <template>
2
- <div class="selections-container">
3
- <el-row>
4
- <el-col :span="12">
5
- <div class="checkall-display-text">{{ title }}</div>
6
- </el-col>
7
- <el-col :span="12">
8
- <el-checkbox
9
- v-if="selections && selections.length > 1"
10
- class="all-checkbox"
11
- :indeterminate="isIndeterminate"
12
- v-model="checkAll"
13
- @change="handleCheckAllChange"
14
- >Display all</el-checkbox
15
- >
16
- </el-col>
17
- </el-row>
18
- <el-checkbox-group
19
- v-model="checkedItems"
20
- size="small"
21
- class="checkbox-group"
22
- @change="handleCheckedItemsChange"
23
- >
24
- <div class="checkbox-group-inner">
25
- <el-row
26
- v-for="item in selections"
27
- :key="item[identifierKey]"
28
- :label="item[identifierKey]"
29
- >
30
- <div class="checkbox-container">
31
- <el-checkbox
32
- class="my-checkbox"
33
- :label="item[identifierKey]"
34
- @change="visibilityToggle(item[identifierKey], $event)"
35
- :checked="!('enabled' in item) || item.enabled === true"
36
- >
37
- <el-row class="checkbox-row">
38
- <el-col :span="4" v-if="hasLineStyles(item)">
39
- <div class="path-visual" :style="getLineStyles(item)"></div>
40
- </el-col>
41
- <el-col :span="20">
42
- <div :style="getBackgroundStyles(item)">
43
- {{ item[labelKey] }}
44
- </div>
45
- </el-col>
46
- </el-row>
47
- </el-checkbox>
48
- </div>
49
- </el-row>
50
- </div>
51
- </el-checkbox-group>
52
- </div>
53
- </template>
54
-
55
- <script>
56
- /* eslint-disable no-alert, no-console */
57
- import {
58
- ElCheckbox as Checkbox,
59
- ElCheckboxGroup as CheckboxGroup,
60
- ElCol as Col,
61
- ElRow as Row,
62
- } from 'element-plus'
63
-
64
- export default {
65
- name: 'SelectionsGroup',
66
- components: {
67
- Checkbox,
68
- CheckboxGroup,
69
- Col,
70
- Row,
71
- },
72
- methods: {
73
- /**
74
- * Function to toggle paths to default.
75
- * Also called when the associated button is pressed.
76
- */
77
- reset: function () {
78
- this.checkAll = true
79
- this.checkedItems = []
80
- this.selections.forEach((item) => {
81
- if (!('enabled' in item) || item.enabled === true) {
82
- this.checkedItems.push(item[this.identifierKey])
83
- } else {
84
- this.checkAll = false
85
- }
86
- })
87
- },
88
- visibilityToggle: function (key, value) {
89
- this.$emit('changed', { key, value })
90
- },
91
- handleCheckedItemsChange: function (value) {
92
- let checkedCount = value.length
93
- this.checkAll = checkedCount === this.selections.length
94
- },
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
- })
103
- },
104
- getBackgroundStyles: function (item) {
105
- if ('colour' in item && this.colourStyle === 'background') {
106
- return { background: item.colour }
107
- }
108
- return {}
109
- },
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 }
120
- }
121
- }
122
- return { display: 'None' }
123
- },
124
- },
125
- props: {
126
- colourStyle: {
127
- type: String,
128
- default: 'line',
129
- },
130
- identifierKey: {
131
- type: String,
132
- default: 'id',
133
- },
134
- labelKey: {
135
- type: String,
136
- default: 'label',
137
- },
138
- title: {
139
- type: String,
140
- default: '',
141
- },
142
- selections: {
143
- type: Array,
144
- default: function () {
145
- return []
146
- },
147
- },
148
- },
149
- computed: {
150
- isIndeterminate: function () {
151
- const count = this.checkedItems.length
152
- if (count === 0 || this.checkAll) {
153
- return false
154
- }
155
- return true
156
- },
157
- },
158
- data: function () {
159
- return {
160
- checkedItems: [],
161
- checkAll: true,
162
- }
163
- },
164
- mounted: function () {
165
- this.reset()
166
- },
167
- }
168
- </script>
169
-
170
- <style lang="scss" scoped>
171
-
172
- .path-visual {
173
- margin: 3px 0;
174
- height: 3px;
175
- width: 25px;
176
- margin-right: 5px;
177
- display: inline-block;
178
- }
179
-
180
- .selections-container {
181
- padding-top: 5px;
182
- }
183
-
184
- .checkall-display-text {
185
- width: 59px;
186
- height: 20px;
187
- color: rgb(48, 49, 51);
188
- font-size: 14px;
189
- font-weight: normal;
190
- line-height: 20px;
191
- margin-left: 8px;
192
- white-space: nowrap;
193
- }
194
-
195
- .all-checkbox {
196
- height:20px;
197
- float: right;
198
- }
199
-
200
- .checkbox-container {
201
- display: flex;
202
- cursor: pointer;
203
- width: 100%;
204
- }
205
-
206
- .checkbox-group {
207
- width: 260px;
208
- border: 1px solid rgb(144, 147, 153);
209
- border-radius: 4px;
210
- background: #ffffff;
211
- }
212
-
213
- .my-checkbox {
214
- background-color: #fff;
215
- width: 100%;
216
- }
217
-
218
- .checkbox-group-inner {
219
- padding: 18px;
220
- }
221
-
222
- :deep(.el-checkbox__label) {
223
- padding-left: 5px;
224
- color: $app-primary-color;
225
- font-size: 12px;
226
- font-weight: 500;
227
- letter-spacing: 0px;
228
- line-height: 14px;
229
- width: 100%;
230
- }
231
-
232
- :deep(.el-checkbox__input) {
233
- &.is-indeterminate,
234
- &.is-checked {
235
- .el-checkbox__inner {
236
- background-color: $app-primary-color;
237
- border-color: $app-primary-color;
238
- }
239
- }
240
- }
241
-
242
- :deep(.el-row) {
243
- height:20px;
244
- margin-bottom: 0;
245
- }
246
-
247
- :deep(.el-checkbox__label) {
248
- color: $app-primary-color !important;
249
- }
250
-
251
- .checkbox-row {
252
- width: 100%;
253
- top: 2px;
254
- }
255
- </style>
1
+ <template>
2
+ <div class="selections-container">
3
+ <el-row>
4
+ <el-col :span="12">
5
+ <div class="checkall-display-text">{{ title }}</div>
6
+ </el-col>
7
+ <el-col :span="12">
8
+ <el-checkbox
9
+ v-if="selections && selections.length > 1"
10
+ class="all-checkbox"
11
+ :indeterminate="isIndeterminate"
12
+ v-model="checkAll"
13
+ @change="handleCheckAllChange"
14
+ >Display all</el-checkbox
15
+ >
16
+ </el-col>
17
+ </el-row>
18
+ <el-checkbox-group
19
+ v-model="checkedItems"
20
+ size="small"
21
+ class="checkbox-group"
22
+ @change="handleCheckedItemsChange"
23
+ >
24
+ <div class="checkbox-group-inner">
25
+ <el-row
26
+ v-for="item in selections"
27
+ :key="item[identifierKey]"
28
+ :label="item[identifierKey]"
29
+ >
30
+ <div class="checkbox-container">
31
+ <el-checkbox
32
+ class="my-checkbox"
33
+ :label="item[identifierKey]"
34
+ @change="visibilityToggle(item[identifierKey], $event)"
35
+ :checked="!('enabled' in item) || item.enabled === true"
36
+ >
37
+ <el-row class="checkbox-row">
38
+ <el-col :span="4" v-if="hasLineStyles(item)">
39
+ <div class="path-visual" :style="getLineStyles(item)"></div>
40
+ </el-col>
41
+ <el-col :span="20">
42
+ <div :style="getBackgroundStyles(item)">
43
+ {{ item[labelKey] }}
44
+ </div>
45
+ </el-col>
46
+ </el-row>
47
+ </el-checkbox>
48
+ </div>
49
+ </el-row>
50
+ </div>
51
+ </el-checkbox-group>
52
+ </div>
53
+ </template>
54
+
55
+ <script>
56
+ /* eslint-disable no-alert, no-console */
57
+ import {
58
+ ElCheckbox as Checkbox,
59
+ ElCheckboxGroup as CheckboxGroup,
60
+ ElCol as Col,
61
+ ElRow as Row,
62
+ } from 'element-plus'
63
+
64
+ export default {
65
+ name: 'SelectionsGroup',
66
+ components: {
67
+ Checkbox,
68
+ CheckboxGroup,
69
+ Col,
70
+ Row,
71
+ },
72
+ methods: {
73
+ /**
74
+ * Function to toggle paths to default.
75
+ * Also called when the associated button is pressed.
76
+ */
77
+ reset: function () {
78
+ this.checkAll = true
79
+ this.checkedItems = []
80
+ this.selections.forEach((item) => {
81
+ if (!('enabled' in item) || item.enabled === true) {
82
+ this.checkedItems.push(item[this.identifierKey])
83
+ } else {
84
+ this.checkAll = false
85
+ }
86
+ })
87
+ },
88
+ visibilityToggle: function (key, value) {
89
+ this.$emit('changed', { key, value })
90
+ },
91
+ handleCheckedItemsChange: function (value) {
92
+ let checkedCount = value.length
93
+ this.checkAll = checkedCount === this.selections.length
94
+ },
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
+ })
103
+ },
104
+ getBackgroundStyles: function (item) {
105
+ if ('colour' in item && this.colourStyle === 'background') {
106
+ return { background: item.colour }
107
+ }
108
+ return {}
109
+ },
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 }
120
+ }
121
+ }
122
+ return { display: 'None' }
123
+ },
124
+ },
125
+ props: {
126
+ colourStyle: {
127
+ type: String,
128
+ default: 'line',
129
+ },
130
+ identifierKey: {
131
+ type: String,
132
+ default: 'id',
133
+ },
134
+ labelKey: {
135
+ type: String,
136
+ default: 'label',
137
+ },
138
+ title: {
139
+ type: String,
140
+ default: '',
141
+ },
142
+ selections: {
143
+ type: Array,
144
+ default: function () {
145
+ return []
146
+ },
147
+ },
148
+ },
149
+ computed: {
150
+ isIndeterminate: function () {
151
+ const count = this.checkedItems.length
152
+ if (count === 0 || this.checkAll) {
153
+ return false
154
+ }
155
+ return true
156
+ },
157
+ },
158
+ data: function () {
159
+ return {
160
+ checkedItems: [],
161
+ checkAll: true,
162
+ }
163
+ },
164
+ mounted: function () {
165
+ this.reset()
166
+ },
167
+ }
168
+ </script>
169
+
170
+ <style lang="scss" scoped>
171
+
172
+ .path-visual {
173
+ margin: 3px 0;
174
+ height: 3px;
175
+ width: 25px;
176
+ margin-right: 5px;
177
+ display: inline-block;
178
+ }
179
+
180
+ .selections-container {
181
+ padding-top: 5px;
182
+ }
183
+
184
+ .checkall-display-text {
185
+ width: 59px;
186
+ height: 20px;
187
+ color: rgb(48, 49, 51);
188
+ font-size: 14px;
189
+ font-weight: normal;
190
+ line-height: 20px;
191
+ margin-left: 8px;
192
+ white-space: nowrap;
193
+ }
194
+
195
+ .all-checkbox {
196
+ height:20px;
197
+ float: right;
198
+ }
199
+
200
+ .checkbox-container {
201
+ display: flex;
202
+ cursor: pointer;
203
+ width: 100%;
204
+ }
205
+
206
+ .checkbox-group {
207
+ width: 260px;
208
+ border: 1px solid rgb(144, 147, 153);
209
+ border-radius: 4px;
210
+ background: #ffffff;
211
+ }
212
+
213
+ .my-checkbox {
214
+ background-color: #fff;
215
+ width: 100%;
216
+ }
217
+
218
+ .checkbox-group-inner {
219
+ padding: 18px;
220
+ }
221
+
222
+ :deep(.el-checkbox__label) {
223
+ padding-left: 5px;
224
+ color: $app-primary-color;
225
+ font-size: 12px;
226
+ font-weight: 500;
227
+ letter-spacing: 0px;
228
+ line-height: 14px;
229
+ width: 100%;
230
+ }
231
+
232
+ :deep(.el-checkbox__input) {
233
+ &.is-indeterminate,
234
+ &.is-checked {
235
+ .el-checkbox__inner {
236
+ background-color: $app-primary-color;
237
+ border-color: $app-primary-color;
238
+ }
239
+ }
240
+ }
241
+
242
+ :deep(.el-row) {
243
+ height:20px;
244
+ margin-bottom: 0;
245
+ }
246
+
247
+ :deep(.el-checkbox__label) {
248
+ color: $app-primary-color !important;
249
+ }
250
+
251
+ .checkbox-row {
252
+ width: 100%;
253
+ top: 2px;
254
+ }
255
+ </style>
@@ -1,50 +1,50 @@
1
- <template>
2
- <div class="tooltip-container" id="tooltip-container">
3
- <template v-if="annotationDisplay">
4
- <annotation-tool :annotationEntry="annotationEntry" />
5
- </template>
6
- <template v-else>
7
- <provenance-popup :entry="entry" />
8
- </template>
9
- </div>
10
- </template>
11
-
12
- <script>
13
- /* eslint-disable no-alert, no-console */
14
- import AnnotationTool from './AnnotationTool.vue'
15
- import ProvenancePopup from './ProvenancePopup.vue'
16
-
17
- export default {
18
- name: 'Tooltip',
19
- components: {
20
- AnnotationTool,
21
- ProvenancePopup,
22
- },
23
- props: {
24
- entry: {
25
- type: Object,
26
- },
27
- annotationDisplay: {
28
- type: Boolean,
29
- default: false,
30
- },
31
- annotationEntry: {
32
- type: Object,
33
- }
34
- },
35
- }
36
- </script>
37
-
38
- <style lang="scss" scoped>
39
- .tooltip-container {
40
- text-align: justify;
41
- border-radius: 4px;
42
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
43
- pointer-events: auto;
44
- background: #fff;
45
- border: 1px solid $app-primary-color;
46
- display: flex;
47
- justify-content: center;
48
- align-items: center;
49
- }
50
- </style>
1
+ <template>
2
+ <div class="tooltip-container" id="tooltip-container">
3
+ <template v-if="annotationDisplay">
4
+ <annotation-tool :annotationEntry="annotationEntry" />
5
+ </template>
6
+ <template v-else>
7
+ <provenance-popup :entry="entry" />
8
+ </template>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ /* eslint-disable no-alert, no-console */
14
+ import AnnotationTool from './AnnotationTool.vue'
15
+ import ProvenancePopup from './ProvenancePopup.vue'
16
+
17
+ export default {
18
+ name: 'Tooltip',
19
+ components: {
20
+ AnnotationTool,
21
+ ProvenancePopup,
22
+ },
23
+ props: {
24
+ entry: {
25
+ type: Object,
26
+ },
27
+ annotationDisplay: {
28
+ type: Boolean,
29
+ default: false,
30
+ },
31
+ annotationEntry: {
32
+ type: Object,
33
+ }
34
+ },
35
+ }
36
+ </script>
37
+
38
+ <style lang="scss" scoped>
39
+ .tooltip-container {
40
+ text-align: justify;
41
+ border-radius: 4px;
42
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
43
+ pointer-events: auto;
44
+ background: #fff;
45
+ border: 1px solid $app-primary-color;
46
+ display: flex;
47
+ justify-content: center;
48
+ align-items: center;
49
+ }
50
+ </style>