Skip to content

Commit

Permalink
• use rollup instead of gulp
Browse files Browse the repository at this point in the history
• sourcemap
• npm packages & typescript updated
  • Loading branch information
denis-taran committed Oct 25, 2018
1 parent b36ebbc commit c964961
Show file tree
Hide file tree
Showing 10 changed files with 793 additions and 2,983 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
debug.log
debug.log
.rpt2_cache/
4 changes: 2 additions & 2 deletions autocomplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export interface AutocompleteSettings<T extends AutocompleteItem> {
minLength?: number;
emptyMsg?: string;
onSelect: (item: T, input: HTMLInputElement) => void;
fetch: (text: string, update: (items: Array<T>) => void) => void;
fetch: (text: string, update: (items: T[]) => void) => void;
debounceWaitMs: number | undefined;
}
export interface AutocompleteResult {
destroy: () => void;
}
export declare function autocomplete<T extends AutocompleteItem>(settings: AutocompleteSettings<T>): AutocompleteResult;
declare function autocomplete<T extends AutocompleteItem>(settings: AutocompleteSettings<T>): AutocompleteResult;
export default autocomplete;
347 changes: 346 additions & 1 deletion autocomplete.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions autocomplete.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const enum Keys {
Tab = 9
}

export function autocomplete<T extends AutocompleteItem>(settings: AutocompleteSettings<T>): AutocompleteResult {
function autocomplete<T extends AutocompleteItem>(settings: AutocompleteSettings<T>): AutocompleteResult {

// just an alias to minimize JS file size
const doc = document;
Expand Down Expand Up @@ -404,7 +404,7 @@ export function autocomplete<T extends AutocompleteItem>(settings: AutocompleteS
function destroy(): void {
unloaded = true;
input.removeEventListener("keydown", keydown);
input.removeEventListener(keyUpEventName, keyup);
input.removeEventListener(keyUpEventName, keyup as EventListenerOrEventListenerObject);
input.removeEventListener("blur", blur);
window.removeEventListener("resize", resizeEventHandler);
doc.removeEventListener("scroll", scrollEventHandler, true);
Expand All @@ -414,7 +414,7 @@ export function autocomplete<T extends AutocompleteItem>(settings: AutocompleteS

// setup event handlers
input.addEventListener("keydown", keydown);
input.addEventListener(keyUpEventName, keyup);
input.addEventListener(keyUpEventName, keyup as EventListenerOrEventListenerObject);
input.addEventListener("blur", blur);
window.addEventListener("resize", resizeEventHandler);
doc.addEventListener("scroll", scrollEventHandler, true);
Expand Down
43 changes: 0 additions & 43 deletions gulpfile.js

This file was deleted.

Loading

0 comments on commit c964961

Please sign in to comment.