2022-08-22 22:59:28 -04:00
|
|
|
<script>
|
2022-08-29 07:29:38 -04:00
|
|
|
import { slide } from 'svelte/transition'
|
|
|
|
export let big = false
|
2022-08-22 22:59:28 -04:00
|
|
|
export let jsFilter
|
|
|
|
export let mutableObjects
|
|
|
|
export let queryCode
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="query-input-header">
|
|
|
|
<div on:click={() => jsFilter = !jsFilter}>
|
|
|
|
Use JavaScript to filter messages
|
|
|
|
<input type=checkbox bind:checked={jsFilter}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-29 07:29:38 -04:00
|
|
|
<div class={"query-input-display" + (big ? ' big' : '')}>
|
|
|
|
{#if jsFilter}
|
|
|
|
<div class="query-input-hideable" transition:slide|local>
|
|
|
|
<div title="If enabled, mutations made by the below code will be displayed in the result data.">
|
|
|
|
Allow JavaScript to mutate objects
|
|
|
|
<input type=checkbox bind:checked={mutableObjects}>
|
|
|
|
</div>
|
|
|
|
<textarea class='query-input' bind:value={queryCode}></textarea>
|
2022-08-22 22:59:28 -04:00
|
|
|
</div>
|
2022-08-29 07:29:38 -04:00
|
|
|
{/if}
|
|
|
|
</div>
|
2022-08-22 22:59:28 -04:00
|
|
|
|
2022-08-26 18:46:21 -04:00
|
|
|
<!--suppress CssUnusedSymbol -->
|
2022-08-22 22:59:28 -04:00
|
|
|
<style>
|
2022-08-29 07:29:38 -04:00
|
|
|
.query-input-header {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-input-display {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-input-hideable {
|
|
|
|
margin-top: 1em;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
/* For some reason, using flex-grow: 1; broke the slide in transition */
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-input-display.big {
|
|
|
|
height: 60vh;
|
|
|
|
width: 60vw;
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-input {
|
|
|
|
min-height: 5vw;
|
|
|
|
resize: vertical;
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
textarea {
|
|
|
|
margin-top: 1em;
|
|
|
|
margin-bottom: 0;
|
|
|
|
overflow: hidden;
|
|
|
|
z-index: 1;
|
|
|
|
margin-left: 0;
|
|
|
|
|
|
|
|
background-color: #222222;
|
|
|
|
color: #d0dde9;
|
|
|
|
|
|
|
|
border: none;
|
|
|
|
font-size: 14px;
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
padding: 1em;
|
|
|
|
overflow-x: auto;
|
|
|
|
min-width: 20vw;
|
|
|
|
}
|
2022-08-22 22:59:28 -04:00
|
|
|
</style>
|