2022-03-31 08:32:42 +00:00
|
|
|
|
<!--
|
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
|
// Copyright © 2021 Hardcore Engineering Inc.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
|
//
|
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
//
|
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
|
// limitations under the License.
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-04-02 04:06:48 +00:00
|
|
|
|
import type { Asset, IntlString } from '@anticrm/platform'
|
2022-03-31 08:32:42 +00:00
|
|
|
|
|
|
|
|
|
import { createEventDispatcher } from 'svelte'
|
|
|
|
|
import type { Ref, Class, Space, DocumentQuery } from '@anticrm/core'
|
|
|
|
|
|
2022-04-02 04:06:48 +00:00
|
|
|
|
import { Button, Label, IconAttachment, IconExpand, IconClose, MiniToggle } from '@anticrm/ui'
|
2022-03-31 08:32:42 +00:00
|
|
|
|
import SpaceSelect from './SpaceSelect.svelte'
|
|
|
|
|
import presentation from '@anticrm/presentation'
|
2022-04-02 04:06:48 +00:00
|
|
|
|
import tracker from '../plugin'
|
2022-03-31 08:32:42 +00:00
|
|
|
|
|
|
|
|
|
export let spaceClass: Ref<Class<Space>> | undefined = undefined
|
|
|
|
|
export let space: Ref<Space> | undefined = undefined
|
|
|
|
|
export let spaceQuery: DocumentQuery<Space> | undefined = { archived: false }
|
|
|
|
|
export let spaceLabel: IntlString | undefined = undefined
|
|
|
|
|
export let spacePlaceholder: IntlString | undefined = undefined
|
|
|
|
|
export let label: IntlString
|
|
|
|
|
export let labelProps: any | undefined = undefined
|
2022-04-02 04:06:48 +00:00
|
|
|
|
export let icon: Asset | undefined = undefined
|
2022-03-31 08:32:42 +00:00
|
|
|
|
export let okAction: () => void
|
|
|
|
|
export let canSave: boolean = false
|
2022-04-02 04:06:48 +00:00
|
|
|
|
export let createMore: boolean | undefined = undefined
|
2022-03-31 08:32:42 +00:00
|
|
|
|
|
|
|
|
|
export let okLabel: IntlString = presentation.string.Create
|
|
|
|
|
export let cancelLabel: IntlString = presentation.string.Cancel
|
|
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-04-02 04:06:48 +00:00
|
|
|
|
<form class="antiCard dialog" on:submit|preventDefault={ () => {} }>
|
2022-03-31 08:32:42 +00:00
|
|
|
|
<div class="antiCard-header">
|
2022-04-02 04:06:48 +00:00
|
|
|
|
<div class="antiCard-header__title-wrap">
|
|
|
|
|
<Button icon={icon} label={presentation.string.Save} size={'small'} kind={'no-border'} disabled on:click={() => { }} />
|
|
|
|
|
<span class="antiCard-header__divider">›</span>
|
|
|
|
|
<span class="antiCard-header__title"><Label {label} params={labelProps ?? {}} /></span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="buttons-group small-gap">
|
|
|
|
|
<Button icon={IconExpand} kind={'transparent'} on:click={() => { }} />
|
|
|
|
|
<Button icon={IconClose} kind={'transparent'} on:click={() => { dispatch('close') }} />
|
|
|
|
|
</div>
|
2022-03-31 08:32:42 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="antiCard-content"><slot /></div>
|
|
|
|
|
{#if spaceClass && spaceLabel && spacePlaceholder}
|
|
|
|
|
<div class="antiCard-pool">
|
2022-04-02 04:06:48 +00:00
|
|
|
|
<slot name="pool" />
|
2022-03-31 08:32:42 +00:00
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
2022-04-02 04:06:48 +00:00
|
|
|
|
<div class="antiCard-footer reverse">
|
|
|
|
|
<div class="buttons-group text-sm">
|
|
|
|
|
{#if createMore !== undefined}
|
|
|
|
|
<MiniToggle label={tracker.string.CreateMore} bind:on={createMore} />
|
|
|
|
|
{/if}
|
|
|
|
|
<Button disabled={!canSave} label={okLabel} kind={'primary'} on:click={() => { okAction(); dispatch('close') }} />
|
|
|
|
|
</div>
|
|
|
|
|
<Button icon={IconAttachment} kind={'transparent'} on:click={() => { }} />
|
2022-03-31 08:32:42 +00:00
|
|
|
|
</div>
|
|
|
|
|
</form>
|