@abi-software/map-side-bar 2.0.0-response.1 → 2.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.
- package/.eslintrc.js +12 -0
- package/.postcssrc.json +6 -0
- package/README.md +49 -27
- package/dist/favicon.ico +0 -0
- package/dist/map-side-bar.js +21139 -0
- package/dist/map-side-bar.umd.cjs +462 -0
- package/dist/style.css +1 -0
- package/package.json +48 -45
- package/src/App.vue +121 -55
- package/src/algolia/algolia.js +36 -9
- package/src/algolia/utils.js +45 -13
- package/src/assets/styles.scss +0 -1
- package/src/components/BadgesGroup.vue +56 -80
- package/src/components/DatasetCard.vue +143 -143
- package/src/components/EventBus.js +2 -2
- package/src/components/ImageGallery.vue +184 -228
- package/src/components/SearchFilters.vue +674 -289
- package/src/components/SearchHistory.vue +175 -0
- package/src/components/SideBar.vue +183 -97
- package/src/components/SidebarContent.vue +233 -241
- package/src/components/Tabs.vue +24 -24
- package/src/components.d.ts +35 -0
- package/src/main.js +6 -5
- package/src/mixins/S3Bucket.vue +6 -0
- package/vite.config.js +56 -0
- package/vuese-generator.js +65 -0
- package/babel.config.js +0 -14
- package/dist/demo.html +0 -10
- package/dist/fonts/element-icons.535877f5.woff +0 -0
- package/dist/fonts/element-icons.732389de.ttf +0 -0
- package/dist/img/missing-image.1878d8b8.svg +0 -1
- package/dist/map-side-bar.common.js +0 -7794
- package/dist/map-side-bar.common.js.map +0 -1
- package/dist/map-side-bar.css +0 -1
- package/dist/map-side-bar.umd.js +0 -7804
- package/dist/map-side-bar.umd.js.map +0 -1
- package/dist/map-side-bar.umd.min.js +0 -2
- package/dist/map-side-bar.umd.min.js.map +0 -1
- package/package-lock.json +0 -14428
- package/public/index.html +0 -17
- package/src/components/Cascader.vue +0 -49
- package/src/components/ContextCard.vue +0 -397
- package/src/components/hardcoded-context-info.js +0 -80
- package/src/demo/AlternateResponse.js +0 -141
- package/vue.config.js +0 -21
package/.eslintrc.js
ADDED
package/.postcssrc.json
ADDED
package/README.md
CHANGED
|
@@ -2,44 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The project is developed based on Vite-Vue3. Aims to provide a sidebar for searching capability for
|
|
6
6
|
SPARC portal.
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Customize configuration
|
|
9
|
+
|
|
10
|
+
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
11
|
+
|
|
12
|
+
## Package installation
|
|
13
|
+
|
|
9
14
|
```
|
|
10
15
|
npm i @abi-software/map-side-bar
|
|
11
16
|
```
|
|
12
17
|
|
|
18
|
+
## Project Setup
|
|
13
19
|
|
|
14
|
-
## Project setup
|
|
15
20
|
```
|
|
16
21
|
npm install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Compile and Hot-Reload for Development
|
|
25
|
+
|
|
26
|
+
```
|
|
17
27
|
npm run serve
|
|
18
28
|
```
|
|
19
29
|
|
|
20
|
-
###
|
|
30
|
+
### Compile and Minify for Production
|
|
31
|
+
|
|
21
32
|
```
|
|
22
33
|
npm run build-bundle
|
|
23
34
|
```
|
|
24
35
|
|
|
25
36
|
## How to use
|
|
26
|
-
|
|
37
|
+
|
|
38
|
+
Import the component and the style from the package.
|
|
39
|
+
|
|
27
40
|
```javascript
|
|
28
|
-
import
|
|
29
|
-
import
|
|
41
|
+
import { SideBar } from "@abi-software/map-side-bar";
|
|
42
|
+
import "@abi-software/map-side-bar/dist/style.css";
|
|
30
43
|
```
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
The code should looks like this
|
|
45
|
+
The code in template should looks like this
|
|
34
46
|
|
|
35
47
|
```html
|
|
36
|
-
<SideBar
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
<SideBar
|
|
49
|
+
:envVars="envVars"
|
|
50
|
+
:visible="sideBarVisibility"
|
|
51
|
+
@actionClick="actionClick"
|
|
52
|
+
/>
|
|
40
53
|
```
|
|
41
54
|
|
|
42
|
-
envVars contains environment
|
|
55
|
+
envVars contains environment variables like so:
|
|
43
56
|
|
|
44
57
|
```yaml
|
|
45
58
|
{
|
|
@@ -50,8 +63,7 @@ envVars contains environment varibables like so:
|
|
|
50
63
|
}
|
|
51
64
|
```
|
|
52
65
|
|
|
53
|
-
actionClick event is called when an action button has
|
|
54
|
-
|
|
66
|
+
actionClick event is called when an action button has been clicked on.
|
|
55
67
|
|
|
56
68
|
## Sidebar Data formats
|
|
57
69
|
### Algolia
|
|
@@ -60,14 +72,14 @@ Data retrieved from Algolia can be found here:
|
|
|
60
72
|
https://github.com/ABI-Software/map-sidebar/blob/3310b165489b10901f50a21e5689ef046251dbd9/src/algolia/algolia.js#L136
|
|
61
73
|
|
|
62
74
|
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
[
|
|
76
|
+
'pennsieve.publishDate', // optional
|
|
77
|
+
'pennsieve.updatedAt', // optional
|
|
78
|
+
'Item.curie', //contains the DOI for the dataset (required)
|
|
79
|
+
'Item.name', // dataset title (required)
|
|
80
|
+
'Item.description', // dataset description (required)
|
|
81
|
+
'objectID', // Pennsieve discover ID (required)
|
|
82
|
+
],
|
|
71
83
|
```
|
|
72
84
|
|
|
73
85
|
### Scicrunch
|
|
@@ -100,7 +112,7 @@ README = 'readme'
|
|
|
100
112
|
TITLE = 'title'
|
|
101
113
|
```
|
|
102
114
|
|
|
103
|
-
Note: All are optional except for ‘name’
|
|
115
|
+
Note: All are optional except for ‘name’
|
|
104
116
|
|
|
105
117
|
### Sidebar input processing
|
|
106
118
|
Sidebar input processing can be viewed here:
|
|
@@ -130,11 +142,11 @@ All fields are strings:
|
|
|
130
142
|
{
|
|
131
143
|
"annotation": optional,
|
|
132
144
|
"description": required,
|
|
133
|
-
"id":
|
|
145
|
+
"id": required,
|
|
134
146
|
"path": required // relative path to the view file, eg "derivative\\Scaffolds\\scaffoldMap_tenial_view.json",
|
|
135
147
|
"sample": optional // used to link to views to samples
|
|
136
148
|
"thumbnail": optional // technically optional but it won’t look great
|
|
137
|
-
}
|
|
149
|
+
}
|
|
138
150
|
]
|
|
139
151
|
}
|
|
140
152
|
```
|
|
@@ -143,4 +155,14 @@ An example context card file can be viewed here:
|
|
|
143
155
|
https://drive.google.com/file/d/15NVRBny7WGltpMSRbsgMglXo0xOC3-Q9/view?usp=sharing
|
|
144
156
|
|
|
145
157
|
|
|
158
|
+
## API Documentation
|
|
159
|
+
|
|
160
|
+
The API documentation is developed with `vitepress` and `vuese`. Documentation pages are in the `docs` folder.
|
|
161
|
+
|
|
162
|
+
### To run in local development mode
|
|
163
|
+
```bash
|
|
164
|
+
npm run docs:watch
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
This will start the documentation server with `vitepress` on port `:5173` and watch the components' changes.
|
|
146
168
|
|
package/dist/favicon.ico
ADDED
|
Binary file
|