@abi-software/map-side-bar 2.0.0-response.0 → 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.
Files changed (44) hide show
  1. package/.eslintrc.js +12 -0
  2. package/.postcssrc.json +6 -0
  3. package/README.md +49 -27
  4. package/dist/favicon.ico +0 -0
  5. package/dist/map-side-bar.js +21139 -0
  6. package/dist/map-side-bar.umd.cjs +462 -0
  7. package/dist/style.css +1 -0
  8. package/package.json +48 -43
  9. package/src/App.vue +123 -57
  10. package/src/algolia/algolia.js +36 -9
  11. package/src/algolia/utils.js +45 -13
  12. package/src/assets/_variables.scss +43 -0
  13. package/src/assets/styles.scss +6 -0
  14. package/src/components/BadgesGroup.vue +56 -78
  15. package/src/components/DatasetCard.vue +147 -144
  16. package/src/components/EventBus.js +2 -2
  17. package/src/components/ImageGallery.vue +184 -229
  18. package/src/components/SearchFilters.vue +679 -292
  19. package/src/components/SearchHistory.vue +175 -0
  20. package/src/components/SideBar.vue +185 -97
  21. package/src/components/SidebarContent.vue +282 -257
  22. package/src/components/Tabs.vue +25 -25
  23. package/src/components.d.ts +35 -0
  24. package/src/main.js +6 -5
  25. package/src/mixins/S3Bucket.vue +6 -0
  26. package/vite.config.js +56 -0
  27. package/vuese-generator.js +65 -0
  28. package/babel.config.js +0 -14
  29. package/dist/demo.html +0 -10
  30. package/dist/img/missing-image.1878d8b8.svg +0 -1
  31. package/dist/map-side-bar.common.js +0 -7798
  32. package/dist/map-side-bar.common.js.map +0 -1
  33. package/dist/map-side-bar.css +0 -1
  34. package/dist/map-side-bar.umd.js +0 -7808
  35. package/dist/map-side-bar.umd.js.map +0 -1
  36. package/dist/map-side-bar.umd.min.js +0 -2
  37. package/dist/map-side-bar.umd.min.js.map +0 -1
  38. package/package-lock.json +0 -13716
  39. package/public/index.html +0 -17
  40. package/src/components/Cascader.vue +0 -49
  41. package/src/components/ContextCard.vue +0 -391
  42. package/src/components/hardcoded-context-info.js +0 -80
  43. package/src/demo/AlternateResponse.js +0 -141
  44. package/vue.config.js +0 -11
package/.eslintrc.js ADDED
@@ -0,0 +1,12 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true,
5
+ es2022: true,
6
+ },
7
+ extends: [
8
+ "plugin:vue/essential",
9
+ "eslint:recommended"
10
+ ],
11
+ rules: {}
12
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "map": true,
3
+ "plugins": {
4
+ "autoprefixer": {}
5
+ }
6
+ }
package/README.md CHANGED
@@ -2,44 +2,57 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar.svg)](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar)
4
4
 
5
- This project aims to provide a sidebar for searching capability for
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
- ## Project installation
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
- ### Compiles and minifies for production
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
- Include the package in your script.
37
+
38
+ Import the component and the style from the package.
39
+
27
40
  ```javascript
28
- import '@abi-software/map-side-bar'
29
- import '@abi-software/map-side-bar/dist/map-side-bar.css'
41
+ import { SideBar } from "@abi-software/map-side-bar";
42
+ import "@abi-software/map-side-bar/dist/style.css";
30
43
  ```
31
44
 
32
- #Template
33
- The code should looks like this
45
+ The code in template should looks like this
34
46
 
35
47
  ```html
36
- <SideBar :envVars="envVars"
37
- :visible="sideBarVisibility"
38
- @actionClick="actionClick">
39
- </SideBar>
48
+ <SideBar
49
+ :envVars="envVars"
50
+ :visible="sideBarVisibility"
51
+ @actionClick="actionClick"
52
+ />
40
53
  ```
41
54
 
42
- envVars contains environment varibables like so:
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 benn clicked on.
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
- 'pennsieve.publishDate', // optional
65
- 'pennsieve.updatedAt', // optional
66
- 'Item.curie', //contains the DOI for the dataset (required)
67
- 'Item.name', // dataset title (required)
68
- 'Item.description', // dataset description (required)
69
- 'objectID', // Pennsieve discover ID (required)
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": requried,
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
 
Binary file