mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 08:02:19 +00:00
app pdf nits (#4756)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte'
|
||||
import { findGridItem, initOutput } from '../../editor/appUtils'
|
||||
import { initOutput } from '../../editor/appUtils'
|
||||
import type { AppViewerContext, ComponentCustomCSS, RichConfigurations } from '../../types'
|
||||
import { initCss } from '../../utils'
|
||||
import InputValue from '../helpers/InputValue.svelte'
|
||||
@@ -13,8 +13,7 @@
|
||||
export let customCss: ComponentCustomCSS<'pdfcomponent'> | undefined = undefined
|
||||
export let render: boolean
|
||||
|
||||
const { app, mode, worldStore, selectedComponent } =
|
||||
getContext<AppViewerContext>('AppViewerContext')
|
||||
const { app, worldStore } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
const outputs = initOutput($worldStore, id, {
|
||||
loading: false
|
||||
@@ -22,17 +21,6 @@
|
||||
|
||||
let source: string | ArrayBuffer | undefined = undefined
|
||||
let zoom: number | undefined = undefined
|
||||
function syncZoomValue() {
|
||||
const gridItem = findGridItem($app, id)
|
||||
|
||||
//@ts-ignore
|
||||
if (gridItem && gridItem.data.configuration.zoom.value !== zoom) {
|
||||
//@ts-ignore
|
||||
gridItem.data.configuration.zoom.value = zoom
|
||||
}
|
||||
|
||||
$app = $app
|
||||
}
|
||||
|
||||
let css = initCss($app.css?.pdfcomponent, customCss)
|
||||
</script>
|
||||
@@ -65,18 +53,6 @@
|
||||
on:loaded={() => {
|
||||
outputs.loading.set(false)
|
||||
}}
|
||||
>
|
||||
<svelte:fragment slot="extra-button">
|
||||
{#if $mode !== 'preview' && $selectedComponent?.includes(id)}
|
||||
<button
|
||||
class="fixed z-10 bottom-0 left-0 px-2 py-0.5 bg-indigo-500/90
|
||||
hover:bg-indigo-500 focus:bg-indigo-500 duration-200 text-white text-2xs"
|
||||
on:click={() => syncZoomValue()}
|
||||
>
|
||||
Sync zoom value
|
||||
</button>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</PdfViewer>
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -254,34 +254,34 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex justify-end items-center px-2 text-secondary text-sm gap-1">
|
||||
{#if allowFullscreen}
|
||||
<Button
|
||||
on:click={downloadPdf}
|
||||
disabled={!doc}
|
||||
size="xs"
|
||||
color="light"
|
||||
title="Download PDF"
|
||||
aria-label="Download PDF"
|
||||
btnClasses="!font-medium !px-2"
|
||||
>
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
{/if}
|
||||
<Button
|
||||
on:click={() => (fullscreen = !fullscreen)}
|
||||
on:click={downloadPdf}
|
||||
disabled={!doc}
|
||||
size="xs"
|
||||
color="light"
|
||||
title="Toggle fullscreen"
|
||||
aria-label="Toggle fullscreen"
|
||||
title="Download PDF"
|
||||
aria-label="Download PDF"
|
||||
btnClasses="!font-medium !px-2"
|
||||
>
|
||||
{#if fullscreen}
|
||||
<Shrink size={14} />
|
||||
{:else}
|
||||
<Expand size={14} />
|
||||
{/if}
|
||||
<Download size={14} />
|
||||
</Button>
|
||||
{#if allowFullscreen}
|
||||
<Button
|
||||
on:click={() => (fullscreen = !fullscreen)}
|
||||
disabled={!doc}
|
||||
size="xs"
|
||||
color="light"
|
||||
title="Toggle fullscreen"
|
||||
aria-label="Toggle fullscreen"
|
||||
btnClasses="!font-medium !px-2"
|
||||
>
|
||||
{#if fullscreen}
|
||||
<Shrink size={14} />
|
||||
{:else}
|
||||
<Expand size={14} />
|
||||
{/if}
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user