-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sgobotta/feature/add-cedears-calculator
feature/add cedears calculator
- Loading branch information
Showing
32 changed files
with
1,938 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import LineChart from './line_chart_hook' | ||
import SearchBar from './search_bar' | ||
|
||
export default { | ||
LineChart | ||
LineChart, | ||
SearchBar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This is optional phoenix client hook. It allows to use key down and up to select results. | ||
|
||
export default { | ||
mounted() { | ||
const searchBarContainer = (this as any).el as HTMLDivElement | ||
document.addEventListener('keydown', (event) => { | ||
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') { | ||
return | ||
} | ||
|
||
const focusElemnt = document.querySelector(':focus') as HTMLElement | ||
|
||
if (!focusElemnt) { | ||
return | ||
} | ||
|
||
if (!searchBarContainer.contains(focusElemnt)) { | ||
return | ||
} | ||
|
||
event.preventDefault() | ||
|
||
const tabElements = document.querySelectorAll( | ||
'#search-input, #searchbox__results_list a', | ||
) as NodeListOf<HTMLElement> | ||
const focusIndex = Array.from(tabElements).indexOf(focusElemnt) | ||
const tabElementsCount = tabElements.length - 1 | ||
|
||
if (event.key === 'ArrowUp') { | ||
tabElements[focusIndex > 0 ? focusIndex - 1 : tabElementsCount].focus() | ||
} | ||
|
||
if (event.key === 'ArrowDown') { | ||
tabElements[focusIndex < tabElementsCount ? focusIndex + 1 : 0].focus() | ||
} | ||
}) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.