2021-04-13 11:02:41 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2020-06-22 11:11:50 +02:00
|
|
|
<script lang="typescript">
|
2020-12-27 02:04:45 +01:00
|
|
|
import type { SvelteComponent } from "svelte/internal";
|
2021-03-22 02:44:08 +01:00
|
|
|
import { writable } from "svelte/store";
|
2021-03-26 11:23:43 +01:00
|
|
|
|
2021-04-22 19:55:26 +02:00
|
|
|
import { bridgeCommand } from "lib/bridgecommand";
|
2020-06-22 11:11:50 +02:00
|
|
|
|
2021-03-21 22:35:53 +01:00
|
|
|
import WithGraphData from "./WithGraphData.svelte";
|
|
|
|
|
2020-06-30 08:23:46 +02:00
|
|
|
export let nightMode: boolean;
|
2020-12-26 14:40:55 +01:00
|
|
|
export let graphs: SvelteComponent[];
|
2020-06-27 11:24:49 +02:00
|
|
|
|
2021-03-22 00:04:24 +01:00
|
|
|
export let initialSearch: string;
|
|
|
|
export let initialDays: number;
|
2020-12-29 06:19:21 +01:00
|
|
|
export let controller: SvelteComponent | null;
|
2020-12-22 22:25:47 +01:00
|
|
|
|
2021-03-22 02:44:08 +01:00
|
|
|
const search = writable(initialSearch);
|
|
|
|
const days = writable(initialDays);
|
2021-03-22 01:07:15 +01:00
|
|
|
|
2021-03-22 02:44:08 +01:00
|
|
|
function browserSearch(event: CustomEvent) {
|
|
|
|
bridgeCommand(`browserSearch: ${$search} ${event.detail.query}`);
|
|
|
|
}
|
2020-06-22 11:11:50 +02:00
|
|
|
</script>
|
|
|
|
|
2021-03-22 01:07:15 +01:00
|
|
|
<div>
|
2021-03-21 22:35:53 +01:00
|
|
|
<WithGraphData
|
2021-03-22 02:44:08 +01:00
|
|
|
{search}
|
|
|
|
{days}
|
2021-03-21 22:35:53 +01:00
|
|
|
let:loading
|
|
|
|
let:sourceData
|
|
|
|
let:preferences
|
2021-05-26 01:21:33 +02:00
|
|
|
let:revlogRange
|
|
|
|
>
|
2021-03-21 22:35:53 +01:00
|
|
|
{#if controller}
|
2021-03-26 11:23:43 +01:00
|
|
|
<svelte:component this={controller} {search} {days} {loading} />
|
2021-03-21 22:35:53 +01:00
|
|
|
{/if}
|
|
|
|
|
2021-03-22 00:40:19 +01:00
|
|
|
{#if sourceData && preferences && revlogRange}
|
2021-03-21 22:35:53 +01:00
|
|
|
{#each graphs as graph}
|
|
|
|
<svelte:component
|
|
|
|
this={graph}
|
|
|
|
{sourceData}
|
|
|
|
{preferences}
|
|
|
|
{revlogRange}
|
|
|
|
{nightMode}
|
2021-05-26 01:21:33 +02:00
|
|
|
on:search={browserSearch}
|
|
|
|
/>
|
2021-03-21 22:35:53 +01:00
|
|
|
{/each}
|
|
|
|
{/if}
|
|
|
|
</WithGraphData>
|
2021-03-21 13:47:52 +01:00
|
|
|
</div>
|
2021-05-26 01:21:33 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
div {
|
|
|
|
@media only screen and (max-width: 600px) {
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|