@neovici/cosmoz-autocomplete 10.9.0 → 10.10.1

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.
@@ -30,7 +30,6 @@ export default css `
30
30
  white-space: nowrap;
31
31
  flex: auto;
32
32
  min-width: 16px;
33
- text-align: center;
34
33
  }
35
34
 
36
35
  .clear {
@@ -1,7 +1,7 @@
1
- type Source<I> = (opts: {
1
+ export type Source<I> = (opts: {
2
2
  query?: string;
3
3
  active?: boolean;
4
- }) => PromiseLike<I[]>;
4
+ }) => PromiseLike<I[]> | undefined;
5
5
  interface Base<I> {
6
6
  value?: I | I[];
7
7
  limit?: number;
@@ -84,6 +84,6 @@ export const useAutocomplete = ({ value: _value, text, onChange: _onChange, onTe
84
84
  }, [meta]),
85
85
  onDeselect: useCallback((val) => meta.onChange(without(val)(meta.value)), [meta]),
86
86
  // whenever there is a query, override defaultIndex to 0, so the first result gets selected
87
- defaultIndex: (query !== undefined && query?.length > 0) ? 0 : defaultIndex,
87
+ defaultIndex: query !== undefined && query?.length > 0 ? 0 : defaultIndex,
88
88
  };
89
89
  };
@@ -1,5 +1,5 @@
1
1
  export declare const search: <I>(source: I[], query: string | undefined, textual: (i: I) => string) => I[];
2
- export declare const normalize: <I>(source: I[] | false | null) => I[];
2
+ export declare const normalize: <I>(source: I[] | false | null | undefined) => I[];
3
3
  export declare const notify: <T>(host: EventTarget, name: string, detail: T) => boolean;
4
4
  export declare const useNotify: <V>(host: EventTarget, fn: undefined | ((v: V) => void), name: string) => (val: V) => void;
5
5
  export declare const EMPTY: never[];
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  import './autocomplete/';
2
+ export type { Source } from './autocomplete/use-autocomplete';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-autocomplete",
3
- "version": "10.9.0",
3
+ "version": "10.10.1",
4
4
  "description": "A autocomplete input web component",
5
5
  "keywords": [
6
6
  "lit-html",