2023-01-14 10:54:54 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Employee } from '@hcengineering/contact'
|
|
|
|
import { Ref } from '@hcengineering/core'
|
|
|
|
import { ButtonKind } from '@hcengineering/ui'
|
|
|
|
import { PersonLabelTooltip } from '..'
|
2023-04-05 07:04:08 +00:00
|
|
|
import EmployeeAttributePresenter from './EmployeeAttributePresenter.svelte'
|
2023-01-14 10:54:54 +00:00
|
|
|
|
2023-04-05 07:04:08 +00:00
|
|
|
export let value: Ref<Employee> | Ref<Employee>[] | null | undefined
|
2023-01-14 10:54:54 +00:00
|
|
|
export let kind: ButtonKind = 'link'
|
|
|
|
export let tooltipLabels: PersonLabelTooltip | undefined = undefined
|
2023-02-07 04:52:34 +00:00
|
|
|
export let onChange: ((value: Ref<Employee>) => void) | undefined = undefined
|
2023-04-23 17:37:24 +00:00
|
|
|
export let colorInherit: boolean = false
|
|
|
|
export let accent: boolean = false
|
2023-04-05 07:04:08 +00:00
|
|
|
export let inline = false
|
2023-01-14 10:54:54 +00:00
|
|
|
</script>
|
|
|
|
|
2023-04-05 07:04:08 +00:00
|
|
|
{#if Array.isArray(value)}
|
|
|
|
<div class="inline-content">
|
|
|
|
{#each value as employee}
|
2023-04-23 17:37:24 +00:00
|
|
|
<EmployeeAttributePresenter value={employee} {kind} {tooltipLabels} {onChange} {inline} {colorInherit} {accent} />
|
2023-04-05 07:04:08 +00:00
|
|
|
{/each}
|
|
|
|
</div>
|
2023-02-07 04:52:34 +00:00
|
|
|
{:else}
|
2023-04-23 17:37:24 +00:00
|
|
|
<EmployeeAttributePresenter {value} {kind} {tooltipLabels} {onChange} {inline} {colorInherit} {accent} />
|
2023-02-07 04:52:34 +00:00
|
|
|
{/if}
|
2023-04-05 07:04:08 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.inline-content {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
min-width: 0;
|
|
|
|
gap: 0.5rem;
|
|
|
|
}
|
|
|
|
</style>
|