Bubble up days and search to caller
This commit is contained in:
parent
008940026e
commit
5d117cf1a0
@ -11,6 +11,9 @@
|
|||||||
export let nightMode: boolean;
|
export let nightMode: boolean;
|
||||||
export let graphs: any[];
|
export let graphs: any[];
|
||||||
|
|
||||||
|
export let search: string;
|
||||||
|
export let days: number;
|
||||||
|
|
||||||
let sourceData: pb.BackendProto.GraphsOut | null = null;
|
let sourceData: pb.BackendProto.GraphsOut | null = null;
|
||||||
|
|
||||||
enum SearchRange {
|
enum SearchRange {
|
||||||
@ -21,10 +24,8 @@
|
|||||||
|
|
||||||
let searchRange: SearchRange = SearchRange.Deck;
|
let searchRange: SearchRange = SearchRange.Deck;
|
||||||
let revlogRange: RevlogRange = RevlogRange.Year;
|
let revlogRange: RevlogRange = RevlogRange.Year;
|
||||||
let days: number = 31;
|
|
||||||
let refreshing = false;
|
let refreshing = false;
|
||||||
|
|
||||||
let search = "deck:current";
|
|
||||||
let displayedSearch = search;
|
let displayedSearch = search;
|
||||||
|
|
||||||
const refresh = async () => {
|
const refresh = async () => {
|
||||||
|
@ -16,7 +16,13 @@ export { default as FutureDue } from "./FutureDue.svelte";
|
|||||||
export { default as ReviewsGraph } from "./ReviewsGraph.svelte";
|
export { default as ReviewsGraph } from "./ReviewsGraph.svelte";
|
||||||
export { default as CalendarGraph } from "./CalendarGraph.svelte";
|
export { default as CalendarGraph } from "./CalendarGraph.svelte";
|
||||||
|
|
||||||
export function graphs(target: HTMLDivElement, graphs: any[]): void {
|
export function graphs(
|
||||||
|
target: HTMLDivElement,
|
||||||
|
graphs: any[], {
|
||||||
|
search = "deck:current",
|
||||||
|
days = 31,
|
||||||
|
} = {},
|
||||||
|
): void {
|
||||||
const nightMode = checkNightMode();
|
const nightMode = checkNightMode();
|
||||||
|
|
||||||
setupI18n().then((i18n) => {
|
setupI18n().then((i18n) => {
|
||||||
@ -26,6 +32,8 @@ export function graphs(target: HTMLDivElement, graphs: any[]): void {
|
|||||||
i18n,
|
i18n,
|
||||||
graphs,
|
graphs,
|
||||||
nightMode,
|
nightMode,
|
||||||
|
search,
|
||||||
|
days,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user