2021-09-03 13:59:05 +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">
|
|
|
|
import type { IntlString } from '@anticrm/platform'
|
|
|
|
|
|
|
|
import { createEventDispatcher } from 'svelte'
|
2021-09-08 16:16:07 +00:00
|
|
|
import type { Ref, Class, Space } from '@anticrm/core'
|
2021-09-03 13:59:05 +00:00
|
|
|
|
|
|
|
// import Close from './internal/icons/Close.svelte'
|
|
|
|
// import ScrollBox from './ScrollBox.svelte'
|
2021-09-10 14:26:16 +00:00
|
|
|
import { Button, Label } from '@anticrm/ui'
|
2021-09-08 16:16:07 +00:00
|
|
|
import SpaceSelect from './SpaceSelect.svelte'
|
2021-09-03 13:59:05 +00:00
|
|
|
|
2021-09-08 16:16:07 +00:00
|
|
|
export let spaceClass: Ref<Class<Space>>
|
2021-09-09 07:54:52 +00:00
|
|
|
export let space: Ref<Space>
|
2021-09-11 06:38:54 +00:00
|
|
|
export let spaceLabel: IntlString
|
|
|
|
export let spacePlaceholder: IntlString
|
2021-09-03 13:59:05 +00:00
|
|
|
export let label: IntlString
|
|
|
|
export let okLabel: IntlString
|
|
|
|
export let okAction: () => void
|
2021-09-07 12:18:19 +00:00
|
|
|
export let canSave: boolean = false
|
2021-09-03 13:59:05 +00:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
</script>
|
|
|
|
|
2021-09-03 14:38:22 +00:00
|
|
|
<form class="card-container">
|
2021-09-03 13:59:05 +00:00
|
|
|
<div class="card-bg" />
|
|
|
|
<div class="flex-between header">
|
|
|
|
<div class="overflow-label label"><Label {label} /></div>
|
2021-09-07 12:18:19 +00:00
|
|
|
<div class="tool"><Button disabled={!canSave} label={okLabel} size={'small'} transparent on:click={() => { okAction(); dispatch('close') }} /></div>
|
2021-09-03 13:59:05 +00:00
|
|
|
</div>
|
2021-09-22 11:15:25 +00:00
|
|
|
{#if $$slots.error}
|
|
|
|
<div class="flex-center error">
|
|
|
|
<slot name="error" />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2021-09-03 13:59:05 +00:00
|
|
|
<div class="content"><slot /></div>
|
2021-09-10 14:26:16 +00:00
|
|
|
<div class="flex-col pool" class:shrink={$$slots.contacts}>
|
2021-09-03 15:39:10 +00:00
|
|
|
<div class="separator" />
|
2021-09-11 06:38:54 +00:00
|
|
|
<SpaceSelect _class={spaceClass} label={spaceLabel} placeholder={spacePlaceholder} bind:value={space} />
|
2021-09-03 15:39:10 +00:00
|
|
|
</div>
|
2021-09-10 14:26:16 +00:00
|
|
|
{#if $$slots.contacts}
|
2021-09-10 06:41:22 +00:00
|
|
|
<div class="flex-between contacts">
|
2021-09-10 14:26:16 +00:00
|
|
|
<slot name="contacts" />
|
2021-09-10 06:41:22 +00:00
|
|
|
</div>
|
|
|
|
{/if}
|
2021-09-03 13:59:05 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.card-container {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-09-10 14:26:16 +00:00
|
|
|
width: 20rem;
|
2021-09-03 15:39:10 +00:00
|
|
|
min-width: 20rem;
|
2021-09-10 14:26:16 +00:00
|
|
|
max-width: 20rem;
|
2021-09-03 13:59:05 +00:00
|
|
|
border-radius: 1.25rem;
|
|
|
|
|
|
|
|
.header {
|
|
|
|
flex-shrink: 0;
|
|
|
|
padding: 1rem 1.25rem 1rem 1.75rem;
|
|
|
|
.label {
|
|
|
|
font-weight: 500;
|
|
|
|
font-size: 1rem;
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
|
|
|
.tool { margin-left: .75rem; }
|
|
|
|
}
|
|
|
|
|
2021-09-22 11:15:25 +00:00
|
|
|
.error {
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
padding: .75rem 0;
|
|
|
|
color: var(--system-error-color);
|
|
|
|
background-color: var(--theme-card-bg-accent);
|
|
|
|
&:empty {
|
|
|
|
visibility: hidden;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-03 13:59:05 +00:00
|
|
|
.content {
|
|
|
|
flex-shrink: 0;
|
|
|
|
flex-grow: 1;
|
2021-09-03 15:39:10 +00:00
|
|
|
margin: 0 1.75rem;
|
2021-09-03 13:59:05 +00:00
|
|
|
height: fit-content;
|
|
|
|
}
|
|
|
|
|
2021-09-03 15:39:10 +00:00
|
|
|
.pool {
|
|
|
|
margin: 0 1.75rem 1.5rem;
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
.separator {
|
|
|
|
margin: 1rem 0;
|
|
|
|
height: 1px;
|
2021-09-10 06:41:22 +00:00
|
|
|
background-color: var(--theme-card-divider);
|
2021-09-03 15:39:10 +00:00
|
|
|
}
|
2021-09-10 06:41:22 +00:00
|
|
|
&.shrink { margin: 0 1.75rem 1rem; }
|
|
|
|
}
|
|
|
|
|
|
|
|
.contacts {
|
|
|
|
padding: 1.25rem 1.75rem;
|
|
|
|
background-color: var(--theme-card-bg-accent);
|
|
|
|
border-radius: 0 0 1.25rem 1.25rem;
|
2021-09-03 15:39:10 +00:00
|
|
|
}
|
|
|
|
|
2021-09-03 13:59:05 +00:00
|
|
|
.card-bg {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
background-color: var(--theme-card-bg);
|
|
|
|
border-radius: 1.25rem;
|
2021-09-10 06:41:22 +00:00
|
|
|
backdrop-filter: blur(24px);
|
|
|
|
box-shadow: var(--theme-card-shadow);
|
2021-09-03 13:59:05 +00:00
|
|
|
z-index: -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|