svelte-typeahead 4.4.1 → 5.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/README.md +8 -11
- package/package.json +21 -19
- package/{types → src}/Typeahead.svelte.d.ts +3 -4
- package/src/index.d.ts +1 -0
- package/CHANGELOG.md +0 -172
- package/lib/index.js +0 -2004
- package/lib/index.mjs +0 -1994
- package/types/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -17,14 +17,17 @@ Try it in the [Svelte REPL](https://svelte.dev/repl/a1b828d80de24f7e995b2365782c
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# Yarn
|
|
21
|
-
yarn add -D svelte-typeahead
|
|
22
|
-
|
|
23
20
|
# npm
|
|
24
|
-
npm i
|
|
21
|
+
npm i svelte-typeahead
|
|
25
22
|
|
|
26
23
|
# pnpm
|
|
27
|
-
pnpm i
|
|
24
|
+
pnpm i svelte-typeahead
|
|
25
|
+
|
|
26
|
+
# Yarn
|
|
27
|
+
yarn add svelte-typeahead
|
|
28
|
+
|
|
29
|
+
# Bun
|
|
30
|
+
bun add svelte-typeahead
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
## Usage
|
|
@@ -216,12 +219,6 @@ The following events are forwarded to the [svelte-search](https://github.com/met
|
|
|
216
219
|
- on:blur
|
|
217
220
|
- on:keydown
|
|
218
221
|
|
|
219
|
-
## TypeScript
|
|
220
|
-
|
|
221
|
-
Svelte version 3.31 or greater is required to use this component with TypeScript.
|
|
222
|
-
|
|
223
|
-
TypeScript definitions are located in the [types folder](./types).
|
|
224
|
-
|
|
225
222
|
## Changelog
|
|
226
223
|
|
|
227
224
|
[Changelog](CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-typeahead",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Accessible, fuzzy search typeahead component",
|
|
6
6
|
"author": "Eric Liu (https://github.com/metonym)",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"svelte": "./src/index.js",
|
|
8
|
-
"main": "./
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
"main": "./src/index.js",
|
|
10
|
+
"types": "./src/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
"./*.svelte": {
|
|
13
|
+
"types": "./src/*.svelte.d.ts",
|
|
14
|
+
"import": "./src/*.svelte"
|
|
15
|
+
},
|
|
16
|
+
"./*.js": {
|
|
17
|
+
"types": "./src/*.d.ts",
|
|
18
|
+
"import": "./src/*.js"
|
|
19
|
+
},
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./src/index.d.ts",
|
|
22
|
+
"import": "./src/index.js",
|
|
23
|
+
"svelte": "./src/index.js"
|
|
24
|
+
}
|
|
15
25
|
},
|
|
16
26
|
"dependencies": {
|
|
17
27
|
"fuzzy": "0.1.3",
|
|
18
|
-
"svelte-search": "^1.1
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@rollup/plugin-commonjs": "^21.0.2",
|
|
22
|
-
"svelte": "^3.52.0",
|
|
23
|
-
"svelte-check": "^2.9.0",
|
|
24
|
-
"svelte-readme": "^3.6.3"
|
|
28
|
+
"svelte-search": "^2.1.1"
|
|
25
29
|
},
|
|
26
30
|
"repository": {
|
|
27
31
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/metonym/svelte-typeahead.git"
|
|
32
|
+
"url": "git+https://github.com/metonym/svelte-typeahead.git"
|
|
29
33
|
},
|
|
30
34
|
"homepage": "https://github.com/metonym/svelte-typeahead",
|
|
31
35
|
"bugs": "https://github.com/metonym/svelte-typeahead/issues",
|
|
@@ -41,8 +45,6 @@
|
|
|
41
45
|
"accessibility"
|
|
42
46
|
],
|
|
43
47
|
"files": [
|
|
44
|
-
"
|
|
45
|
-
"src",
|
|
46
|
-
"types"
|
|
48
|
+
"src"
|
|
47
49
|
]
|
|
48
50
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { SearchProps } from "svelte-search/types/Search";
|
|
1
|
+
import type { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SearchProps } from "svelte-search/src/Search.svelte";
|
|
4
3
|
|
|
5
|
-
export interface TypeaheadProps<TItem> extends SearchProps {
|
|
4
|
+
export interface TypeaheadProps<TItem> extends Omit<SearchProps, "results"> {
|
|
6
5
|
/**
|
|
7
6
|
* @default "typeahead-" + Math.random().toString(36)
|
|
8
7
|
*/
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Typeahead.svelte";
|
package/CHANGELOG.md
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [4.4.1](https://github.com/metonym/svelte-typeahead/releases/tag/v4.4.1) - 2022-11-12
|
|
9
|
-
|
|
10
|
-
- replace `aria-owns` with `aria-controls` to resolve `a11y-role-has-required-aria-props` warning
|
|
11
|
-
|
|
12
|
-
## [4.4.0](https://github.com/metonym/svelte-typeahead/releases/tag/v4.4.0) - 2022-11-08
|
|
13
|
-
|
|
14
|
-
**Features**
|
|
15
|
-
|
|
16
|
-
- add `showAllResultsOnFocus` prop to display all results when focusing an empty input
|
|
17
|
-
|
|
18
|
-
**Fixes**
|
|
19
|
-
|
|
20
|
-
- silence a11y warnings emitted by Svelte@3.52
|
|
21
|
-
- event type for dispatched `clear` event should be `null`
|
|
22
|
-
- unset `ul` margin
|
|
23
|
-
|
|
24
|
-
## [4.3.2](https://github.com/metonym/svelte-typeahead/releases/tag/v4.3.2) - 2022-09-01
|
|
25
|
-
|
|
26
|
-
**Fixes**
|
|
27
|
-
|
|
28
|
-
- allow results to be selected if using `showDropdownOnFocus`
|
|
29
|
-
|
|
30
|
-
## [4.3.1](https://github.com/metonym/svelte-typeahead/releases/tag/v4.3.1) - 2022-08-29
|
|
31
|
-
|
|
32
|
-
**Fixes**
|
|
33
|
-
|
|
34
|
-
- skip disabled results when auto-selecting a result
|
|
35
|
-
|
|
36
|
-
## [4.3.0](https://github.com/metonym/svelte-typeahead/releases/tag/v4.3.0) - 2022-08-29
|
|
37
|
-
|
|
38
|
-
**Features**
|
|
39
|
-
|
|
40
|
-
- add `showDropdownOnFocus` prop to only show dropdown if the search input is focused
|
|
41
|
-
|
|
42
|
-
## [4.2.4](https://github.com/metonym/svelte-typeahead/releases/tag/v4.2.4) - 2022-07-05
|
|
43
|
-
|
|
44
|
-
**Fixes**
|
|
45
|
-
|
|
46
|
-
- set dropdown menu `z-index: 1` when expanded
|
|
47
|
-
|
|
48
|
-
## [4.2.3](https://github.com/metonym/svelte-typeahead/releases/tag/v4.2.3) - 2022-07-04
|
|
49
|
-
|
|
50
|
-
**Fixes**
|
|
51
|
-
|
|
52
|
-
- update selected index when hovering over a result
|
|
53
|
-
|
|
54
|
-
## [4.2.2](https://github.com/metonym/svelte-typeahead/releases/tag/v4.2.2) - 2022-03-20
|
|
55
|
-
|
|
56
|
-
**Fixes**
|
|
57
|
-
|
|
58
|
-
- pressing "ArrowUp" on last item should not reset highlighted index
|
|
59
|
-
|
|
60
|
-
## [4.2.1](https://github.com/metonym/svelte-typeahead/releases/tag/v4.2.1) - 2021-10-30
|
|
61
|
-
|
|
62
|
-
**Fixes**
|
|
63
|
-
|
|
64
|
-
- prevent keyboard selection and navigation of disabled results
|
|
65
|
-
- add missing annotation for `TItem.disabled` to `results` prop
|
|
66
|
-
|
|
67
|
-
**Documentation**
|
|
68
|
-
|
|
69
|
-
- add `pnpm` installation command
|
|
70
|
-
- remove "disabling items after selection" example
|
|
71
|
-
- remove `id` fields from `data` array
|
|
72
|
-
- simplify dispatched events example
|
|
73
|
-
|
|
74
|
-
## [4.2.0](https://github.com/metonym/svelte-typeahead/releases/tag/v4.2.0) - 2021-10-26
|
|
75
|
-
|
|
76
|
-
**Features**
|
|
77
|
-
|
|
78
|
-
- use TypeScript generics so that the item type can be inferred from `data` value
|
|
79
|
-
|
|
80
|
-
## [4.1.0](https://github.com/metonym/svelte-typeahead/releases/tag/v4.1.0) - 2021-10-03
|
|
81
|
-
|
|
82
|
-
**Features**
|
|
83
|
-
|
|
84
|
-
- render a "no-results" slot when the search value does not yield results
|
|
85
|
-
- add `value` to the default slot props
|
|
86
|
-
|
|
87
|
-
## [4.0.0](https://github.com/metonym/svelte-typeahead/releases/tag/v4.0.0) - 2021-09-05
|
|
88
|
-
|
|
89
|
-
**Breaking Changes**
|
|
90
|
-
|
|
91
|
-
- use `.svelte.d.ts` extension for component TypeScript definition
|
|
92
|
-
|
|
93
|
-
## [3.0.0](https://github.com/metonym/svelte-typeahead/releases/tag/v3.0.0) - 2021-03-16
|
|
94
|
-
|
|
95
|
-
**Breaking Changes**
|
|
96
|
-
|
|
97
|
-
- the `ul` element is rendered even without results to preserve the accessibility label
|
|
98
|
-
|
|
99
|
-
**Fixes**
|
|
100
|
-
|
|
101
|
-
- disable form ARIA attributes in `svelte-search`
|
|
102
|
-
- pass the correct `aria-activedescendant` item to `svelte-search`
|
|
103
|
-
|
|
104
|
-
## [2.4.1](https://github.com/metonym/svelte-typeahead/releases/tag/v2.4.1) - 2021-03-14
|
|
105
|
-
|
|
106
|
-
**Fixes**
|
|
107
|
-
|
|
108
|
-
- pass `id` to `Search` to fix `aria-labelledby` references
|
|
109
|
-
|
|
110
|
-
## [2.4.0](https://github.com/metonym/svelte-typeahead/releases/tag/v2.4.0) - 2021-03-04
|
|
111
|
-
|
|
112
|
-
**Features**
|
|
113
|
-
|
|
114
|
-
- add `limit` prop to limit number of results; default value is `Infinity`
|
|
115
|
-
|
|
116
|
-
## [2.3.0](https://github.com/metonym/svelte-typeahead/releases/tag/v2.3.0) - 2021-02-21
|
|
117
|
-
|
|
118
|
-
**Features**
|
|
119
|
-
|
|
120
|
-
- add `disable`, `filter` props to disable and filter items from the result set
|
|
121
|
-
|
|
122
|
-
**Fixes**
|
|
123
|
-
|
|
124
|
-
- bind the input element reference correctly to fix focusing behavior
|
|
125
|
-
- don't pass the Typeahead id to Search
|
|
126
|
-
|
|
127
|
-
## [2.2.0](https://github.com/metonym/svelte-typeahead/releases/tag/v2.2.0) - 2021-02-20
|
|
128
|
-
|
|
129
|
-
**Features**
|
|
130
|
-
|
|
131
|
-
- add `inputAfterSelect` prop to allow user to preserve or clear the input field after selecting a result; possible values are `"update" | "clear" | "keep"` (default is `"update"`)
|
|
132
|
-
- add searched value to dispatched "select" event detail (`e.detail.searched`)
|
|
133
|
-
|
|
134
|
-
## [2.1.0](https://github.com/metonym/svelte-typeahead/releases/tag/v2.1.0) - 2021-02-20
|
|
135
|
-
|
|
136
|
-
**Features**
|
|
137
|
-
|
|
138
|
-
- include `original` item and `originalIndex` in dispatched "select" event
|
|
139
|
-
|
|
140
|
-
## [2.0.0](https://github.com/metonym/svelte-typeahead/releases/tag/v2.0.0) - 2020-12-31
|
|
141
|
-
|
|
142
|
-
**Breaking Changes**
|
|
143
|
-
|
|
144
|
-
- upgrade `svelte-search` to version 1.0.0
|
|
145
|
-
- defer to default `label`, `placeholder` props from `search-svelte`
|
|
146
|
-
- use `SvelteComponentTyped` interface in TypeScript definitions
|
|
147
|
-
|
|
148
|
-
## [1.0.0](https://github.com/metonym/svelte-typeahead/releases/tag/v1.0.0) - 2020-11-28
|
|
149
|
-
|
|
150
|
-
**Features**
|
|
151
|
-
|
|
152
|
-
- export reactive `results` array containing fuzzy results
|
|
153
|
-
- add `focusAfterSelect` to opt in to focusing input after selecting a result
|
|
154
|
-
- keydown default behavior is preventing if pressing "ArrowUp", "ArrowDown", or "Escape"
|
|
155
|
-
|
|
156
|
-
**Breaking changes**
|
|
157
|
-
|
|
158
|
-
- `focusAfterSelect` is `false` by default
|
|
159
|
-
- redesigned default styles
|
|
160
|
-
- if using TS, Svelte version >=3.30 is required
|
|
161
|
-
|
|
162
|
-
## [0.2.0](https://github.com/metonym/svelte-typeahead/releases/tag/v0.2.0) - 2020-11-17
|
|
163
|
-
|
|
164
|
-
- Add TypeScript definitions
|
|
165
|
-
|
|
166
|
-
## [0.1.1](https://github.com/metonym/svelte-typeahead/releases/tag/v0.1.1) - 2020-08-06
|
|
167
|
-
|
|
168
|
-
- Remove `filter` named export
|
|
169
|
-
|
|
170
|
-
## [0.1.0](https://github.com/metonym/svelte-typeahead/releases/tag/v0.1.0) - 2020-04-15
|
|
171
|
-
|
|
172
|
-
- Initial release
|