@abi-software/map-utilities 1.0.0-beta.1 → 1.0.1-beta.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.
@@ -9,6 +9,7 @@ declare module 'vue' {
9
9
  export interface GlobalComponents {
10
10
  AnnotationPopup: typeof import('./components/Tooltip/AnnotationPopup.vue')['default']
11
11
  ConnectionDialog: typeof import('./components/DrawToolbar/ConnectionDialog.vue')['default']
12
+ CopyToClipboard: typeof import('./components/CopyToClipboard/CopyToClipboard.vue')['default']
12
13
  DrawToolbar: typeof import('./components/DrawToolbar/DrawToolbar.vue')['default']
13
14
  ElButton: typeof import('element-plus/es')['ElButton']
14
15
  ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
@@ -19,6 +20,7 @@ declare module 'vue' {
19
20
  ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
20
21
  ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
21
22
  ElIconClose: typeof import('@element-plus/icons-vue')['Close']
23
+ ElIconCopyDocument: typeof import('@element-plus/icons-vue')['CopyDocument']
22
24
  ElIconDelete: typeof import('@element-plus/icons-vue')['Delete']
23
25
  ElIconEdit: typeof import('@element-plus/icons-vue')['Edit']
24
26
  ElIconFinished: typeof import('@element-plus/icons-vue')['Finished']
@@ -29,11 +31,10 @@ declare module 'vue' {
29
31
  ElPopover: typeof import('element-plus/es')['ElPopover']
30
32
  ElRow: typeof import('element-plus/es')['ElRow']
31
33
  ElSelect: typeof import('element-plus/es')['ElSelect']
32
- ElTag: typeof import('element-plus/es')['ElTag']
34
+ ElTooltip: typeof import('element-plus/es')['ElTooltip']
33
35
  ElTree: typeof import('element-plus/es')['ElTree']
34
36
  ExternalResourceCard: typeof import('./components/Tooltip/ExternalResourceCard.vue')['default']
35
37
  HelpModeDialog: typeof import('./components/HelpModeDialog/HelpModeDialog.vue')['default']
36
- ImageGalleryPopup: typeof import('./components/Tooltip/ImageGalleryPopup.vue')['default']
37
38
  ProvenancePopup: typeof import('./components/Tooltip/ProvenancePopup.vue')['default']
38
39
  Tooltip: typeof import('./components/Tooltip/Tooltip.vue')['default']
39
40
  TreeControls: typeof import('./components/TreeControls/TreeControls.vue')['default']
@@ -1,166 +0,0 @@
1
- <template>
2
- <div class="main">
3
- <div v-if="imageEntry">
4
- <el-tag
5
- v-for="(species, index) in speciesFilterTags"
6
- :key="index"
7
- type="info"
8
- class="tag"
9
- :class="{ 'active-tag': species.taxon === activeSpecies.taxon }"
10
- :closable="species.taxon === activeSpecies.taxon"
11
- @close="removeSpeciesFilterTag"
12
- @click="filterBySpecies(species)"
13
- >
14
- {{ species.name }} ({{ species.count }})
15
- </el-tag>
16
- <div class="gallery-container">
17
- <Gallery :items="filteredImages" />
18
- </div>
19
- </div>
20
- </div>
21
- </template>
22
-
23
- <script>
24
- /* eslint-disable no-alert, no-console */
25
- import { ElTag as Tag } from "element-plus";
26
-
27
- import Gallery from "@abi-software/gallery";
28
- import "@abi-software/gallery/dist/style.css";
29
-
30
- export default {
31
- name: "ImagePopup",
32
- components: {
33
- Tag,
34
- Gallery,
35
- },
36
- props: {
37
- imageEntry: {
38
- type: Array,
39
- default: [],
40
- },
41
- },
42
- data: function () {
43
- return {
44
- activeSpecies: { taxon: "", name: "" },
45
- speciesFilterTags: [],
46
- filteredImages: [],
47
- showImageGallery: false,
48
- };
49
- },
50
- watch: {
51
- imageEntry: {
52
- handler: function (value) {
53
- if (value) {
54
- this.populateFilterTags();
55
- this.filteredImages = this.imageEntry;
56
- }
57
- },
58
- deep: true,
59
- },
60
- },
61
- methods: {
62
- removeSpeciesFilterTag: function () {
63
- this.activeSpecies = { taxon: "", name: "" };
64
- this.filteredImages = this.imageEntry;
65
- },
66
- filterBySpecies: function (tagInfo) {
67
- this.activeSpecies = tagInfo;
68
- let imageList = [];
69
- this.imageEntry.forEach((image) => {
70
- if (image.species && image.species.length > 0) {
71
- image.species.forEach((species) => {
72
- if (species.species && species.species.curie === tagInfo.taxon) {
73
- imageList.push(image);
74
- }
75
- });
76
- }
77
- });
78
- this.filteredImages = imageList;
79
- },
80
- populateFilterTags: function () {
81
- let imageObjects = {};
82
- this.imageEntry.forEach((image) => {
83
- if (image.species && image.species.length > 0) {
84
- image.species.forEach((species) => {
85
- if (species.species) {
86
- const speciesInfo = species.species;
87
- if (!(speciesInfo.curie in imageObjects)) {
88
- imageObjects[speciesInfo.curie] = {
89
- taxon: speciesInfo.curie,
90
- name: speciesInfo.name,
91
- count: 0,
92
- };
93
- }
94
- imageObjects[speciesInfo.curie].count++;
95
- }
96
- });
97
- }
98
- });
99
- this.speciesFilterTags = Object.values(imageObjects);
100
- },
101
- },
102
- mounted: function () {
103
- this.populateFilterTags();
104
- this.filteredImages = this.imageEntry;
105
- },
106
- };
107
- </script>
108
-
109
- <style lang="scss" scoped>
110
- .block {
111
- margin-bottom: 0.5em;
112
- }
113
-
114
- .tag {
115
- margin-right: 5px;
116
- margin-bottom: 5px;
117
- cursor: pointer;
118
- }
119
-
120
- .active-tag {
121
- background-color: $app-primary-color;
122
- color: #fff;
123
- }
124
-
125
- .main {
126
- font-size: 14px;
127
- text-align: left;
128
- line-height: 1.5em;
129
- font-family: Asap, sans-serif, Helvetica;
130
- font-weight: 400;
131
- /* outline: thin red solid; */
132
- padding: 1em !important;
133
- overflow: hidden;
134
- min-width: 18rem;
135
- }
136
-
137
- .button {
138
- margin-left: 0px !important;
139
- margin-top: 0px !important;
140
- font-size: 14px !important;
141
- background-color: $app-primary-color;
142
- color: #fff;
143
-
144
- & + .button {
145
- margin-top: 10px !important;
146
- }
147
-
148
- &:hover {
149
- color: #fff !important;
150
- background: #ac76c5 !important;
151
- border: 1px solid #ac76c5 !important;
152
- }
153
- }
154
-
155
- .gallery-container {
156
- :deep(.gallery) {
157
- .gallery-strip {
158
- padding: 1rem 0;
159
- }
160
-
161
- > div {
162
- min-height: max-content !important;
163
- }
164
- }
165
- }
166
- </style>