diff --git a/packages/presentation/src/components/Card.svelte b/packages/presentation/src/components/Card.svelte index 94a7ab707e..497ee6da2e 100644 --- a/packages/presentation/src/components/Card.svelte +++ b/packages/presentation/src/components/Card.svelte @@ -22,10 +22,8 @@ // import Close from './internal/icons/Close.svelte' // import ScrollBox from './ScrollBox.svelte' - import { Button, Label, CircleButton } from '@anticrm/ui' + import { Button, Label } from '@anticrm/ui' import SpaceSelect from './SpaceSelect.svelte' - import Edit from './icons/Edit.svelte' - import Mail from './icons/Mail.svelte' export let spaceClass: Ref> export let space: Ref @@ -33,7 +31,6 @@ export let okLabel: IntlString export let okAction: () => void export let canSave: boolean = false - export let contacts: boolean = true const dispatch = createEventDispatcher() @@ -45,17 +42,13 @@
-
+
- {#if contacts} + {#if $$slots.contacts}
-
- - -
- +
{/if} @@ -65,7 +58,9 @@ position: relative; display: flex; flex-direction: column; + width: 20rem; min-width: 20rem; + max-width: 20rem; border-radius: 1.25rem; .header { diff --git a/packages/presentation/src/components/Channels.svelte b/packages/presentation/src/components/Channels.svelte new file mode 100644 index 0000000000..72397a02a5 --- /dev/null +++ b/packages/presentation/src/components/Channels.svelte @@ -0,0 +1,188 @@ + + + + +
{}}> + {#each displayItems as item} +
+
+ +
+
+
+
+
+
+
+
{item.label}
+
{item.value}
+
+
{ alert('Copied: ' + item.value) }}> + +
+
+ {/each} +
+ + diff --git a/plugins/contact-resources/src/components/icons/Copy.svelte b/packages/presentation/src/components/icons/Copy.svelte similarity index 100% rename from plugins/contact-resources/src/components/icons/Copy.svelte rename to packages/presentation/src/components/icons/Copy.svelte diff --git a/packages/presentation/src/index.ts b/packages/presentation/src/index.ts index d53a87dd23..d5cccbc911 100644 --- a/packages/presentation/src/index.ts +++ b/packages/presentation/src/index.ts @@ -22,3 +22,4 @@ export { default as Avatar } from './components/Avatar.svelte' export { default as MessageViewer } from './components/MessageViewer.svelte' export { default as AttributeEditor } from './components/AttributeEditor.svelte' export { default as Card } from './components/Card.svelte' +export { default as Channels } from './components/Channels.svelte' diff --git a/packages/ui/src/components/CircleButton.svelte b/packages/ui/src/components/CircleButton.svelte index 6b580c909f..788d023868 100644 --- a/packages/ui/src/components/CircleButton.svelte +++ b/packages/ui/src/components/CircleButton.svelte @@ -48,7 +48,7 @@ transform: scale(.75); pointer-events: none; } - &:hover { background-color: var(--theme-bg-accent-hover); } + &:hover { border-color: var(--theme-bg-focused-border); } &:active { background-color: var(--theme-bg-accent-color); } } diff --git a/plugins/contact-resources/src/components/ChannelsPresenter.svelte b/plugins/contact-resources/src/components/ChannelsPresenter.svelte index 53bd7588f0..e7e314b902 100644 --- a/plugins/contact-resources/src/components/ChannelsPresenter.svelte +++ b/plugins/contact-resources/src/components/ChannelsPresenter.svelte @@ -15,164 +15,10 @@ --> -
{}}> - {#each displayItems as item} -
-
-
-
-
-
-
-
-
{item.label}
-
{item.value}
-
-
{ alert('Copied: ' + item.value) }}> - -
-
- {/each} -
- - + diff --git a/plugins/recruit-resources/src/components/CreateCandidate.svelte b/plugins/recruit-resources/src/components/CreateCandidate.svelte index 216bd81f1a..42be8e2293 100644 --- a/plugins/recruit-resources/src/components/CreateCandidate.svelte +++ b/plugins/recruit-resources/src/components/CreateCandidate.svelte @@ -17,21 +17,25 @@ import { createEventDispatcher } from 'svelte' import type { Ref, Space, Doc } from '@anticrm/core' - import { getClient, Card } from '@anticrm/presentation' + import { getClient, Card, Channels } from '@anticrm/presentation' import recruit from '../plugin' import chunter from '@anticrm/chunter' import type { Candidate } from '@anticrm/recruit' import type { Attachment } from '@anticrm/chunter' - import { EditBox, Link, showPopup, IconFile as FileIcon } from '@anticrm/ui' + import { EditBox, Link, showPopup, Component, CircleButton, IconFile as FileIcon } from '@anticrm/ui' import FileUpload from './icons/FileUpload.svelte' import Avatar from './icons/Avatar.svelte' + import Edit from './icons/Edit.svelte' + import SocialEditor from './SocialEditor.svelte' import PDFViewer from './PDFViewer.svelte' import Girl from '../../img/girl.png' import Elon from '../../img/elon.png' import Bond from '../../img/bond.png' + import equals from 'deep-equal' + export let space: Ref const object: Candidate = { @@ -86,6 +90,17 @@ let inputFile: HTMLInputElement let kl: number = 0 + let changed = false + + function isChanged(): void { + for (const key in newValue) { + if (!equals((newValue as any)[key], (object as any)[key])) { + changed = true + return + } + } + changed = false + } @@ -111,9 +126,9 @@
-
-
-
+
+
+
+ + + showPopup(SocialEditor, { values: newValue.channels ?? [] }, ev.target, (result) => { newValue.channels = result; isChanged() })} /> +