@fluid-topics/ft-search-bar 0.3.6 → 0.3.7
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/README.md +47 -3
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -1,29 +1,73 @@
|
|
|
1
1
|
A search bar component using Fluid Topics public API.
|
|
2
2
|
|
|
3
|
+
The search bar requires the [Fluid Topics public API](https://www.npmjs.com/package/@fluid-topics/public-api)
|
|
4
|
+
and [Material Icon font](https://developers.google.com/fonts/docs/material_icons)
|
|
5
|
+
to be imported independently.
|
|
6
|
+
|
|
3
7
|
## Install
|
|
4
8
|
|
|
9
|
+
### Javascript
|
|
10
|
+
|
|
5
11
|
```shell
|
|
6
12
|
npm install @fluid-topics/ft-search-bar
|
|
7
13
|
yarn add @fluid-topics/ft-search-bar
|
|
8
14
|
```
|
|
9
15
|
|
|
16
|
+
### HTML
|
|
17
|
+
|
|
18
|
+
To be placed at the end of HTML body:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/@fluid-topics/public-api/dist/fluidtopics.min.js"></script>
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/@fluid-topics/ft-search-bar/build/ft-search-bar.min.js"></script>
|
|
23
|
+
```
|
|
24
|
+
|
|
10
25
|
## Usage
|
|
11
26
|
|
|
12
|
-
|
|
27
|
+
### Lit
|
|
13
28
|
|
|
14
29
|
```typescript
|
|
15
30
|
import { html } from "lit"
|
|
16
|
-
import "@fluid-topics/ft-search-bar"
|
|
17
31
|
import "@fluid-topics/public-api/dist/fluidtopics.min.js"
|
|
32
|
+
import "@fluid-topics/ft-search-bar"
|
|
18
33
|
|
|
19
34
|
function render() {
|
|
20
35
|
return html`
|
|
21
36
|
<ft-search-bar
|
|
22
37
|
baseUrl="http://doc.fluidtopics.com"
|
|
23
|
-
.displayedFilters=${["Version_FT", "Category", "Platform", "audience"]}
|
|
38
|
+
.displayedFilters=${ [ "Version_FT", "Category", "Platform", "audience" ] }
|
|
24
39
|
@change=${ (e: SearchStateChangeEvent) => console.log("Search state change:", e.detail) }
|
|
25
40
|
@launch-search=${ (e: LaunchSearchEvent) => console.log("Launch search:", e.detail) }
|
|
26
41
|
></ft-search-bar>
|
|
27
42
|
`
|
|
28
43
|
}
|
|
29
44
|
```
|
|
45
|
+
|
|
46
|
+
### HTML
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
|
|
50
|
+
<html lang="en">
|
|
51
|
+
<head>
|
|
52
|
+
<title>My custom integration</title>
|
|
53
|
+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
54
|
+
</head>
|
|
55
|
+
<body>
|
|
56
|
+
<ft-search-bar
|
|
57
|
+
baseUrl="http://doc.fluidtopics.com"
|
|
58
|
+
displayedfilters="["Version_FT","Category","Platform","audience"]"
|
|
59
|
+
></ft-search-bar>
|
|
60
|
+
|
|
61
|
+
<script src="https://cdn.jsdelivr.net/npm/@fluid-topics/public-api/dist/fluidtopics.min.js"></script>
|
|
62
|
+
<script src="https://cdn.jsdelivr.net/npm/@fluid-topics/ft-search-bar/build/ft-search-bar.min.js"></script>
|
|
63
|
+
<script>
|
|
64
|
+
const searchBar = document.querySelector('ft-search-bar');
|
|
65
|
+
searchBar.setAttribute("labels", JSON.stringify({
|
|
66
|
+
filtersButton: "Refine your search",
|
|
67
|
+
inputPlaceHolder: "Search our documentation"
|
|
68
|
+
}));
|
|
69
|
+
searchBar.addEventListener("launch-search", event => console.log("Launch search:", event.detail));
|
|
70
|
+
</script>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
73
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-bar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Search bar component using Fluid Topics public API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,25 +19,25 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-accordion": "0.3.
|
|
23
|
-
"@fluid-topics/ft-button": "0.3.
|
|
24
|
-
"@fluid-topics/ft-chip": "0.3.
|
|
25
|
-
"@fluid-topics/ft-filter": "0.3.
|
|
26
|
-
"@fluid-topics/ft-icon": "0.3.
|
|
27
|
-
"@fluid-topics/ft-select": "0.3.
|
|
28
|
-
"@fluid-topics/ft-size-watcher": "0.3.
|
|
29
|
-
"@fluid-topics/ft-skeleton": "0.3.
|
|
30
|
-
"@fluid-topics/ft-snap-scroll": "0.3.
|
|
31
|
-
"@fluid-topics/ft-tooltip": "0.3.
|
|
32
|
-
"@fluid-topics/ft-typography": "0.3.
|
|
33
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-accordion": "0.3.7",
|
|
23
|
+
"@fluid-topics/ft-button": "0.3.7",
|
|
24
|
+
"@fluid-topics/ft-chip": "0.3.7",
|
|
25
|
+
"@fluid-topics/ft-filter": "0.3.7",
|
|
26
|
+
"@fluid-topics/ft-icon": "0.3.7",
|
|
27
|
+
"@fluid-topics/ft-select": "0.3.7",
|
|
28
|
+
"@fluid-topics/ft-size-watcher": "0.3.7",
|
|
29
|
+
"@fluid-topics/ft-skeleton": "0.3.7",
|
|
30
|
+
"@fluid-topics/ft-snap-scroll": "0.3.7",
|
|
31
|
+
"@fluid-topics/ft-tooltip": "0.3.7",
|
|
32
|
+
"@fluid-topics/ft-typography": "0.3.7",
|
|
33
|
+
"@fluid-topics/ft-wc-utils": "0.3.7",
|
|
34
34
|
"lit": "2.2.8"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@fluid-topics/public-api": "1.0.
|
|
37
|
+
"@fluid-topics/public-api": "1.0.22"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@fluid-topics/public-api": "1.0.
|
|
40
|
+
"@fluid-topics/public-api": "1.0.22"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "fe65a046ba9d3df70aac994a4e0aac1b550df72f"
|
|
43
43
|
}
|