diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 6bbd3a0aef..86d741b9c0 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -18,7 +18,7 @@ import { Button, IconClose, Label, Scroller } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import presentation from '..' - import { deviceOptionsStore as deviceInfo, resizeObserver } from '@hcengineering/ui' + import { deviceOptionsStore as deviceInfo, resizeObserver, IconBack } from '@hcengineering/ui' import IconForward from './icons/Forward.svelte' export let label: IntlString @@ -27,10 +27,16 @@ export let canSave: boolean = false export let okLabel: IntlString = presentation.string.Create export let onCancel: Function | undefined = undefined + export let backAction: () => Promise | void = () => {} + export let isBack: boolean = false export let fullSize: boolean = false - export let hideAttachments: boolean = false - export let hideSubheader: boolean = false + export let numberOfBlocks: number = 0 + export let thinHeader: boolean = false export let accentHeader: boolean = false + export let hideSubheader: boolean = false + export let hideContent: boolean = false + export let hideAttachments: boolean = false + export let hideFooter: boolean = false export let gap: string | undefined = undefined export let width: 'large' | 'medium' | 'small' | 'x-small' | 'menu' = 'large' export let noFade = false @@ -38,30 +44,40 @@ const dispatch = createEventDispatcher() let okProcessing = false + $: headerDivide = hideContent && numberOfBlocks > 1
{}} use:resizeObserver={() => { dispatch('changeContent') }} > -
+
{#if $$slots.header} {/if} - + {#if isBack} +
{/if} -
- - - -
+ {#if !hideContent} +
+ + + +
+ {/if} {#if $$slots.pool}
{/if} + {#if $$slots.blocks && numberOfBlocks} + {#if numberOfBlocks === 1} +
+ +
+ {:else} + + {#each [...Array(numberOfBlocks).keys()] as block} +
+ +
+ {/each} +
+ {/if} + {/if} {#if $$slots.attachments && !hideAttachments}
- +
{/if} - -
- - {#if $$slots.error} - - {/if} -
-
+ {/if} diff --git a/packages/presentation/src/components/IndexedDocumentCompare.svelte b/packages/presentation/src/components/IndexedDocumentCompare.svelte index e999d35816..4156e88be9 100644 --- a/packages/presentation/src/components/IndexedDocumentCompare.svelte +++ b/packages/presentation/src/components/IndexedDocumentCompare.svelte @@ -1,7 +1,6 @@ - - -
-
-
-
- -
- {#if right !== undefined} -
- -
- {/if} -
+ + +
+
+
+ {#if right !== undefined} +
+ +
+ {/if}
- +
diff --git a/packages/presentation/src/components/IndexedDocumentContent.svelte b/packages/presentation/src/components/IndexedDocumentContent.svelte index 904ead2d79..982085f059 100644 --- a/packages/presentation/src/components/IndexedDocumentContent.svelte +++ b/packages/presentation/src/components/IndexedDocumentContent.svelte @@ -45,7 +45,7 @@ {#if summary} {#if search.length > 0} - Result: + Result: {#each summary.split('\n').filter((line, idx, arr) => { return line.toLowerCase().includes(search.toLowerCase()) || arr[idx - 1] ?.toLowerCase() @@ -55,7 +55,7 @@ {/each}
{/if} - Summary: + Summary: {#each summary.split('\n') as line} {@const hl = search.length > 0 && line.toLowerCase().includes(search.toLowerCase())} {line} @@ -75,7 +75,7 @@ {#each attr[1] as doc}
1}> {#if search.length > 0} - Result: + Result: {#each doc.filter((line) => line.toLowerCase().includes(search.toLowerCase())) as line} {line} {/each} @@ -93,6 +93,6 @@ diff --git a/packages/presentation/src/components/IndexedDocumentPreview.svelte b/packages/presentation/src/components/IndexedDocumentPreview.svelte index ec74fbcc40..25c160eb22 100644 --- a/packages/presentation/src/components/IndexedDocumentPreview.svelte +++ b/packages/presentation/src/components/IndexedDocumentPreview.svelte @@ -1,7 +1,7 @@ - { @@ -76,19 +74,13 @@ {#if contentType && contentType.startsWith('image/')} -
+
-
{:else} -