@abi-software/map-side-bar 2.4.0-alpha-1 → 2.4.0-isan-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 (43) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.postcssrc.json +5 -5
  3. package/LICENSE +201 -201
  4. package/README.md +168 -168
  5. package/cypress.config.js +23 -23
  6. package/dist/map-side-bar.js +9362 -15112
  7. package/dist/map-side-bar.umd.cjs +103 -50
  8. package/dist/style.css +1 -1
  9. package/package.json +77 -77
  10. package/reporter-config.json +9 -9
  11. package/src/App.vue +268 -266
  12. package/src/algolia/algolia.js +256 -255
  13. package/src/algolia/utils.js +105 -100
  14. package/src/assets/_variables.scss +43 -43
  15. package/src/assets/styles.scss +6 -6
  16. package/src/components/BadgesGroup.vue +124 -124
  17. package/src/components/ConnectivityInfo.vue +619 -619
  18. package/src/components/DatasetCard.vue +367 -367
  19. package/src/components/EventBus.js +3 -3
  20. package/src/components/ExternalResourceCard.vue +113 -113
  21. package/src/components/ImageGallery.vue +542 -542
  22. package/src/components/PMRDatasetCard.vue +303 -237
  23. package/src/components/SearchFilters.vue +1023 -1023
  24. package/src/components/SearchHistory.vue +175 -175
  25. package/src/components/SideBar.vue +456 -436
  26. package/src/components/SidebarContent.vue +710 -730
  27. package/src/components/Tabs.vue +145 -145
  28. package/src/components/index.js +8 -8
  29. package/src/components/species-map.js +8 -8
  30. package/src/components.d.ts +0 -1
  31. package/src/exampleConnectivityInput.js +291 -291
  32. package/src/flatmapQueries/flatmapQueries.js +220 -168
  33. package/src/main.js +9 -9
  34. package/src/mixins/S3Bucket.vue +37 -37
  35. package/src/mixins/mixedPageCalculation.vue +102 -78
  36. package/static.json +6 -6
  37. package/vite.config.js +55 -55
  38. package/vuese-generator.js +65 -65
  39. package/dist/data/pmr-sample.json +0 -3181
  40. package/public/data/pmr-sample.json +0 -3181
  41. package/src/components/FlatmapDatasetCard.vue +0 -171
  42. package/src/components/allPaths.js +0 -5928
  43. package/src/components/pmrTest.js +0 -4
@@ -1,175 +1,175 @@
1
- <template>
2
- <div class="history-container">
3
- <!-- <span v-if="reversedSearchHistory.length > 0" class="title"> Search History </span> -->
4
- <template v-for="(item, i) in reversedSearchHistory">
5
- <el-tag
6
- class="search-tag"
7
- v-if="i < 3"
8
- v-bind:key="i"
9
- @click="search(item)"
10
- size="large"
11
- >
12
- {{ item.search }}
13
- </el-tag>
14
- </template>
15
- <el-select
16
- v-if="reversedSearchHistory.length > 0"
17
- :model-value="selectValue"
18
- class="m-2 search-select"
19
- placeholder="Full search History"
20
- popper-class="sidebar-search-select-popper"
21
- @change="selectChange"
22
- :teleported="false"
23
- >
24
- <el-option
25
- v-for="(item, i) in cascaderOptions"
26
- :key="i"
27
- :label="item.label"
28
- :value="item.value"
29
- />
30
- </el-select>
31
- </div>
32
- </template>
33
-
34
- <script>
35
- /* eslint-disable no-alert, no-console */
36
- import {
37
- ElTag as Tag,
38
- ElSelect as Select
39
- } from 'element-plus'
40
-
41
- import EventBus from './EventBus.js'
42
-
43
- // remove duplicates by stringifying the objects
44
- const removeDuplicates = function (arrayOfAnything) {
45
- return [...new Set(arrayOfAnything.map((e) => JSON.stringify(e)))].map((e) =>
46
- JSON.parse(e)
47
- )
48
- }
49
-
50
- export default {
51
- name: 'SearchHistory',
52
- components: {
53
- Tag,
54
- Select
55
- },
56
- data() {
57
- return {
58
- searchHistory: [],
59
- selectValue: 'Full search history',
60
- }
61
- },
62
- computed: {
63
- reversedSearchHistory: function () {
64
- return removeDuplicates(
65
- this.searchHistory
66
- .slice()
67
- .reverse()
68
- .filter((item) => item.search !== '')
69
- )
70
- },
71
- cascaderOptions: function () {
72
- return this.reversedSearchHistory.map((item) => {
73
- return {
74
- value: item.search,
75
- label: item.search,
76
- }
77
- })
78
- },
79
- },
80
- methods: {
81
- getSearchHistory() {
82
- if (localStorage.getItem('sparc.science-sidebar-search-history')) {
83
- this.searchHistory = JSON.parse(
84
- localStorage.getItem('sparc.science-sidebar-search-history')
85
- )
86
- } else {
87
- this.searchHistory = []
88
- }
89
- },
90
- clearSearchHistory() {
91
- localStorage.removeItem('sparc.science-sidebar-search-history')
92
- this.searchHistory = []
93
- },
94
- addSearchToHistory(filters, search) {
95
- filters = [] // disable filters for now
96
- search = search.trim() // remove whitespace
97
- let searchHistory = JSON.parse(
98
- localStorage.getItem('sparc.science-sidebar-search-history')
99
- )
100
- if (searchHistory) {
101
- searchHistory.push({ filters: filters, search: search })
102
- this.searchHistory = removeDuplicates(searchHistory)
103
- localStorage.setItem(
104
- 'sparc.science-sidebar-search-history',
105
- JSON.stringify(searchHistory)
106
- )
107
- } else {
108
- localStorage.setItem(
109
- 'sparc.science-sidebar-search-history',
110
- JSON.stringify([{ filters: filters, search: search }])
111
- )
112
- }
113
- },
114
- search: function (item) {
115
- this.$emit('search', item)
116
- },
117
- selectChange: function (value) {
118
- this.selectValue = value
119
- this.search({ search: value })
120
- },
121
- },
122
- mounted: function () {
123
- this.getSearchHistory()
124
- EventBus.on('search-changed', (data) => {
125
- this.setSearchHistory(data)
126
- })
127
- },
128
- }
129
- </script>
130
-
131
- <style lang="scss" scoped>
132
- .history-container {
133
- padding-bottom: 3px;
134
- }
135
-
136
- .search-tag.el-tag {
137
- margin: 0 5px 5px 0;
138
- cursor: pointer;
139
- max-width: 100px;
140
- overflow: hidden;
141
- text-overflow: ellipsis;
142
- float: left;
143
- background: #f9f2fc!important;
144
- border-color: $app-primary-color!important;
145
- color:$app-primary-color!important;
146
- }
147
-
148
- .title {
149
- font-size: 14px;
150
- font-weight: bold;
151
- margin-right: 5px;
152
- // center text vertically
153
- display: flex;
154
- align-items: center;
155
- }
156
-
157
- .search-select {
158
- float: right;
159
- width: 180px;
160
- }
161
- </style>
162
-
163
- <style lang="scss">
164
- .sidebar-search-select-popper {
165
- font-family: Asap;
166
- font-size: 14px;
167
- font-weight: 500;
168
- font-stretch: normal;
169
- font-style: normal;
170
- line-height: normal;
171
- letter-spacing: normal;
172
- color: #292b66;
173
- max-width: 200px;
174
- }
175
- </style>
1
+ <template>
2
+ <div class="history-container">
3
+ <!-- <span v-if="reversedSearchHistory.length > 0" class="title"> Search History </span> -->
4
+ <template v-for="(item, i) in reversedSearchHistory">
5
+ <el-tag
6
+ class="search-tag"
7
+ v-if="i < 3"
8
+ v-bind:key="i"
9
+ @click="search(item)"
10
+ size="large"
11
+ >
12
+ {{ item.search }}
13
+ </el-tag>
14
+ </template>
15
+ <el-select
16
+ v-if="reversedSearchHistory.length > 0"
17
+ :model-value="selectValue"
18
+ class="m-2 search-select"
19
+ placeholder="Full search History"
20
+ popper-class="sidebar-search-select-popper"
21
+ @change="selectChange"
22
+ :teleported="false"
23
+ >
24
+ <el-option
25
+ v-for="(item, i) in cascaderOptions"
26
+ :key="i"
27
+ :label="item.label"
28
+ :value="item.value"
29
+ />
30
+ </el-select>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ /* eslint-disable no-alert, no-console */
36
+ import {
37
+ ElTag as Tag,
38
+ ElSelect as Select
39
+ } from 'element-plus'
40
+
41
+ import EventBus from './EventBus.js'
42
+
43
+ // remove duplicates by stringifying the objects
44
+ const removeDuplicates = function (arrayOfAnything) {
45
+ return [...new Set(arrayOfAnything.map((e) => JSON.stringify(e)))].map((e) =>
46
+ JSON.parse(e)
47
+ )
48
+ }
49
+
50
+ export default {
51
+ name: 'SearchHistory',
52
+ components: {
53
+ Tag,
54
+ Select
55
+ },
56
+ data() {
57
+ return {
58
+ searchHistory: [],
59
+ selectValue: 'Full search history',
60
+ }
61
+ },
62
+ computed: {
63
+ reversedSearchHistory: function () {
64
+ return removeDuplicates(
65
+ this.searchHistory
66
+ .slice()
67
+ .reverse()
68
+ .filter((item) => item.search !== '')
69
+ )
70
+ },
71
+ cascaderOptions: function () {
72
+ return this.reversedSearchHistory.map((item) => {
73
+ return {
74
+ value: item.search,
75
+ label: item.search,
76
+ }
77
+ })
78
+ },
79
+ },
80
+ methods: {
81
+ getSearchHistory() {
82
+ if (localStorage.getItem('sparc.science-sidebar-search-history')) {
83
+ this.searchHistory = JSON.parse(
84
+ localStorage.getItem('sparc.science-sidebar-search-history')
85
+ )
86
+ } else {
87
+ this.searchHistory = []
88
+ }
89
+ },
90
+ clearSearchHistory() {
91
+ localStorage.removeItem('sparc.science-sidebar-search-history')
92
+ this.searchHistory = []
93
+ },
94
+ addSearchToHistory(filters, search) {
95
+ filters = [] // disable filters for now
96
+ search = search.trim() // remove whitespace
97
+ let searchHistory = JSON.parse(
98
+ localStorage.getItem('sparc.science-sidebar-search-history')
99
+ )
100
+ if (searchHistory) {
101
+ searchHistory.push({ filters: filters, search: search })
102
+ this.searchHistory = removeDuplicates(searchHistory)
103
+ localStorage.setItem(
104
+ 'sparc.science-sidebar-search-history',
105
+ JSON.stringify(searchHistory)
106
+ )
107
+ } else {
108
+ localStorage.setItem(
109
+ 'sparc.science-sidebar-search-history',
110
+ JSON.stringify([{ filters: filters, search: search }])
111
+ )
112
+ }
113
+ },
114
+ search: function (item) {
115
+ this.$emit('search', item)
116
+ },
117
+ selectChange: function (value) {
118
+ this.selectValue = value
119
+ this.search({ search: value })
120
+ },
121
+ },
122
+ mounted: function () {
123
+ this.getSearchHistory()
124
+ EventBus.on('search-changed', (data) => {
125
+ this.setSearchHistory(data)
126
+ })
127
+ },
128
+ }
129
+ </script>
130
+
131
+ <style lang="scss" scoped>
132
+ .history-container {
133
+ padding-bottom: 3px;
134
+ }
135
+
136
+ .search-tag.el-tag {
137
+ margin: 0 5px 5px 0;
138
+ cursor: pointer;
139
+ max-width: 100px;
140
+ overflow: hidden;
141
+ text-overflow: ellipsis;
142
+ float: left;
143
+ background: #f9f2fc!important;
144
+ border-color: $app-primary-color!important;
145
+ color:$app-primary-color!important;
146
+ }
147
+
148
+ .title {
149
+ font-size: 14px;
150
+ font-weight: bold;
151
+ margin-right: 5px;
152
+ // center text vertically
153
+ display: flex;
154
+ align-items: center;
155
+ }
156
+
157
+ .search-select {
158
+ float: right;
159
+ width: 180px;
160
+ }
161
+ </style>
162
+
163
+ <style lang="scss">
164
+ .sidebar-search-select-popper {
165
+ font-family: Asap;
166
+ font-size: 14px;
167
+ font-weight: 500;
168
+ font-stretch: normal;
169
+ font-style: normal;
170
+ line-height: normal;
171
+ letter-spacing: normal;
172
+ color: #292b66;
173
+ max-width: 200px;
174
+ }
175
+ </style>