diff --git a/packages/panel/src/components/Panel.svelte b/packages/panel/src/components/Panel.svelte index fb851133c2..fe892951fb 100644 --- a/packages/panel/src/components/Panel.svelte +++ b/packages/panel/src/components/Panel.svelte @@ -19,18 +19,19 @@ import type { Doc } from '@anticrm/core' import notification from '@anticrm/notification' import type { Asset } from '@anticrm/platform' - import { AnyComponent, AnySvelteComponent, Component, Panel, Icon } from '@anticrm/ui' + import { AnySvelteComponent, Component, Panel, Icon, Scroller } from '@anticrm/ui' export let title: string | undefined = undefined export let subtitle: string | undefined = undefined export let icon: Asset | AnySvelteComponent | undefined = undefined - export let rightSection: AnyComponent | undefined = undefined + export let withoutActivity: boolean = false export let object: Doc export let panelWidth: number = 0 export let innerWidth: number = 0 export let isHeader: boolean = true export let isSub: boolean = true export let isAside: boolean = true + export let isCustomAttr: boolean = true export let minimize: boolean = false let docWidth: number = 0 @@ -39,14 +40,7 @@ - +
{#if $$slots.navigator} @@ -90,7 +84,7 @@
{/if} - {#if $$slots['custom-attributes']} + {#if $$slots['custom-attributes'] && isCustomAttr} {#if isSub}
{/if} {:else if $$slots.attributes && minimize}
@@ -107,18 +101,22 @@
{/if} - {#if $$slots['custom-attributes']} + {#if $$slots['custom-attributes'] && isCustomAttr} {:else if $$slots.attributes}{/if} {#if $$slots.aside}{/if}
- {#if rightSection !== undefined} + {#if withoutActivity} {:else} - - - + +
+ + + +
+
{/if}
diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index 84210dab75..9512045999 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -370,9 +370,11 @@ p:last-child { margin-block-end: 0; } .pb-2 { padding-bottom: .5rem; } .pb-3 { padding-bottom: .75rem; } .pb-4 { padding-bottom: 1rem; } +.pb-6 { padding-bottom: 1.5rem; } .px-2 { padding: 0 .5rem; } .px-3 { padding: 0 .75rem; } .px-4 { padding: 0 1rem; } +.py-10 { padding: 2.5rem 0; } .p-1 { padding: .25rem; } .p-2 { padding: .5rem; } diff --git a/packages/theme/styles/common.scss b/packages/theme/styles/common.scss index f78b0e4756..a615860647 100644 --- a/packages/theme/styles/common.scss +++ b/packages/theme/styles/common.scss @@ -202,6 +202,10 @@ .antiNav-bottomFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } .antiNav-bothFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 2rem), rgba(0, 0, 0, 0) 100%); } .antiNav-noneFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } +.tableFade.antiNav-topFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } +.tableFade.antiNav-bottomFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 4.5rem - 1px), rgba(0, 0, 0, 0) calc(100% - 2.5rem), rgba(0, 0, 0, 1) calc(100% - 2.5rem + .5px)); } +.tableFade.antiNav-bothFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 2rem, rgba(0, 0, 0, 1) calc(100% - 4.5rem - 1px), rgba(0, 0, 0, 0) calc(100% - 2.5rem), rgba(0, 0, 0, 1) calc(100% - 2.5rem + .5px)); } +.tableFade.antiNav-noneFade { mask-image: linear-gradient(0deg, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 1) 1px, rgba(0, 0, 0, 1) calc(100% - 1px), rgba(0, 0, 0, 0) 100%); } /* Basic */ .antiTitle { diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index 224fdefd75..b0a1fffee8 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -324,6 +324,7 @@ /* Table */ .antiTable { + position: relative; width: 100%; th, td { @@ -415,6 +416,13 @@ &.checking { background-color: var(--highlight-select); } // --theme-table-bg-hover &.selected { background-color: var(--highlight-hover); } // --menu-bg-select } + + .scroller-thead { + position: sticky; + top: 0; + z-index: 999; + background-color: var(--body-color); + } } // Hide row menu in Tooltip diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index b7965b218c..e8e1c4edf8 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -127,8 +127,9 @@ width: calc(100% - 5rem); min-width: 0; max-width: 900px; - border-bottom: 1px solid var(--divider-color); + &.bottom-divider { border-bottom: 1px solid var(--divider-color); } + &.top-divider { border-top: 1px solid var(--divider-color); } .header-row { display: flex; align-items: center; diff --git a/packages/ui/src/components/Panel.svelte b/packages/ui/src/components/Panel.svelte index 424053217b..a1e692780b 100644 --- a/packages/ui/src/components/Panel.svelte +++ b/packages/ui/src/components/Panel.svelte @@ -14,9 +14,8 @@ --> @@ -257,7 +178,9 @@
-
diff --git a/packages/ui/src/components/icons/ArrowLeft.svelte b/packages/ui/src/components/icons/ArrowLeft.svelte index 32ecbc16d9..358e0fd5cc 100644 --- a/packages/ui/src/components/icons/ArrowLeft.svelte +++ b/packages/ui/src/components/icons/ArrowLeft.svelte @@ -20,6 +20,6 @@ diff --git a/packages/ui/src/components/icons/ArrowRight.svelte b/packages/ui/src/components/icons/ArrowRight.svelte new file mode 100644 index 0000000000..82f3a47f75 --- /dev/null +++ b/packages/ui/src/components/icons/ArrowRight.svelte @@ -0,0 +1,25 @@ + + + + + + diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 1b67901c83..cf2c609d2b 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -114,6 +114,7 @@ export { default as IconInfo } from './components/icons/Info.svelte' export { default as IconBlueCheck } from './components/icons/BlueCheck.svelte' export { default as IconCheck } from './components/icons/Check.svelte' export { default as IconArrowLeft } from './components/icons/ArrowLeft.svelte' +export { default as IconArrowRight } from './components/icons/ArrowRight.svelte' export { default as IconNavPrev } from './components/icons/NavPrev.svelte' export { default as IconNavNext } from './components/icons/NavNext.svelte' export { default as IconDPCalendar } from './components/calendar/icons/DPCalendar.svelte' diff --git a/packages/ui/src/panelup.ts b/packages/ui/src/panelup.ts index 6fc1a2b2f8..ff1522ab49 100644 --- a/packages/ui/src/panelup.ts +++ b/packages/ui/src/panelup.ts @@ -8,7 +8,6 @@ export interface PanelProps { _class: string element?: PopupAlignment rightSection?: AnyComponent - fullSize?: boolean } export const panelstore = writable<{ panel?: PanelProps | undefined }>({ panel: undefined }) @@ -17,7 +16,13 @@ let currentLocation: string | undefined location.subscribe((loc) => { if (loc.fragment !== currentLocation && loc.fragment !== undefined && loc.fragment.trim().length > 0) { const props = decodeURIComponent(loc.fragment).split('|') - showPanel(props[0] as AnyComponent, props[1], props[2], (props[3] ?? undefined) as PopupAlignment) + showPanel( + props[0] as AnyComponent, + props[1], + props[2], + (props[3] ?? undefined) as PopupAlignment, + (props[4] ?? undefined) as AnyComponent + ) } else if ( (loc.fragment === undefined || (loc.fragment !== undefined && loc.fragment.trim().length === 0)) && currentLocation !== undefined @@ -47,7 +52,7 @@ export function showPanel ( element?: PopupAlignment, rightSection?: AnyComponent ): void { - const newLoc = getPanelURI(component, _id, _class, element) + const newLoc = getPanelURI(component, _id, _class, element, rightSection) if (currentLocation === newLoc) { return } diff --git a/packages/ui/src/popups.ts b/packages/ui/src/popups.ts index f391eca3d8..bf59b71ff8 100644 --- a/packages/ui/src/popups.ts +++ b/packages/ui/src/popups.ts @@ -198,8 +198,8 @@ export function fitPopupElement (modalHTML: HTMLElement, element?: PopupAlignmen } else if (element === 'float') { newProps.top = 'calc(var(--status-bar-height) + .25rem)' newProps.bottom = '.25rem' - newProps.width = '40rem' - newProps.maxWidth = '40%' + newProps.width = '40%' + newProps.maxWidth = '60%' newProps.right = '.25rem' show = true } else if (element === 'account') { diff --git a/plugins/activity-resources/src/components/Activity.svelte b/plugins/activity-resources/src/components/Activity.svelte index 0aff89389d..37c8ae358d 100644 --- a/plugins/activity-resources/src/components/Activity.svelte +++ b/plugins/activity-resources/src/components/Activity.svelte @@ -87,7 +87,7 @@ {/if}
{:else} -
+
diff --git a/plugins/contact-resources/src/components/ChannelEditor.svelte b/plugins/contact-resources/src/components/ChannelEditor.svelte index ce60543bdc..3a2c8711b7 100644 --- a/plugins/contact-resources/src/components/ChannelEditor.svelte +++ b/plugins/contact-resources/src/components/ChannelEditor.svelte @@ -16,7 +16,7 @@ import { createEventDispatcher, onMount } from 'svelte' import type { IntlString } from '@anticrm/platform' import { translate } from '@anticrm/platform' - import { Button, Icon, IconClose, IconBlueCheck } from '@anticrm/ui' + import { Button, Icon, IconClose, IconBlueCheck, IconArrowRight } from '@anticrm/ui' export let value: string = '' export let placeholder: IntlString @@ -60,6 +60,7 @@ >
+
diff --git a/plugins/contact-resources/src/components/ChannelsDropdown.svelte b/plugins/contact-resources/src/components/ChannelsDropdown.svelte index 0ec52358dc..9a0384782a 100644 --- a/plugins/contact-resources/src/components/ChannelsDropdown.svelte +++ b/plugins/contact-resources/src/components/ChannelsDropdown.svelte @@ -25,23 +25,19 @@ import { getChannelProviders } from '../utils' import ChannelEditor from './ChannelEditor.svelte' import { NotificationClientImpl } from '@anticrm/notification-resources' - import { onDestroy } from 'svelte' export let value: AttachedData[] | Channel | null - export let editable = false + export let editable: boolean = false export let kind: ButtonKind = 'no-border' export let size: ButtonSize = 'small' export let length: 'short' | 'full' = 'full' export let shape: 'circle' | undefined = undefined - // export let reverse: boolean = false export let integrations: Set> = new Set>() const notificationClient = NotificationClientImpl.getClient() const lastViews = notificationClient.getLastViews() const dispatch = createEventDispatcher() - let editMode = false - interface Item { label: IntlString icon: Asset @@ -140,8 +136,8 @@ } $: if (providers) updateMenu() - const dropItem = (n: number): void => { - displayItems = displayItems.filter((it, i) => i !== n) + const dropItem = (n: number): Item[] => { + return displayItems.filter((it, i) => i !== n) } const saveItems = (): void => { value = filterUndefined(displayItems) @@ -156,15 +152,10 @@ ev.target as HTMLElement, (result) => { if (result !== undefined) { - if (result == null || result === '') dropItem(n) + if (result === null || result === '') displayItems = dropItem(n) else displayItems[n].value = result - } else if (displayItems[n].value === '') dropItem(n) - saveItems() - if (actions.length > 0 && addBtn) { - if (result !== undefined) addBtn.click() - else disableEdit() - } else { - disableEdit() + saveItems() + if (displayItems.length < providers.size && addBtn) addBtn.click() } }, (result) => { @@ -172,22 +163,26 @@ if (result === 'left') { closePopup() if (displayItems[n].value === '') { - dropItem(n) + displayItems = dropItem(n) saveItems() } - if (n === 0) addBtn.click() - else btns[n - 1].click() + if (n === 0) { + if (addBtn) addBtn.click() + else btns[displayItems.length - 1].click() + } else btns[n - 1].click() } else if (result === 'right') { closePopup() if (displayItems[n].value === '') { - dropItem(n) + displayItems = dropItem(n) saveItems() - if (n === displayItems.length) addBtn.click() - else btns[n + 1].click() - } else { - if (n === displayItems.length - 1) addBtn.click() - else btns[n + 1].click() } + if (n === displayItems.length - 1) { + if (addBtn) addBtn.click() + else btns[0].click() + } else btns[n + 1].click() + } else if (result === 'open') { + closePopup() + dispatch('open', { presenter: channel.presenter }) } } } @@ -198,11 +193,7 @@ Menu, { actions }, ev.target as HTMLElement, - (result) => { - if (result === undefined) { - disableEdit() - } - }, + () => {}, (result) => { if (result !== undefined && displayItems.length > 0) { if (result === 'left') { @@ -217,31 +208,9 @@ ) } let copied: boolean = false - let div: HTMLDivElement - - function listener (e: MouseEvent): void { - if (e.target !== null && !div.contains(e.target as Node)) { - disableEdit() - } - } - - function enableEdit () { - window.addEventListener('click', listener) - editMode = true - } - - function disableEdit () { - window.removeEventListener('click', listener) - editMode = false - } - - onDestroy(() => { - window.removeEventListener('click', listener) - })
{ - if (editMode) editChannel(item, i, ev) + if (editable) editChannel(item, i, ev) }} /> {:else} @@ -270,12 +239,12 @@ {kind} {size} {shape} - highlight={item.integration || item.notification || editMode} + highlight={item.integration || item.notification} on:click={(ev) => { - if (editMode) { + if (editable) { editChannel(item, i, ev) } else { - dispatch('click', item) + dispatch('open', item) if (!copied) { navigator.clipboard.writeText(item.value) copied = true @@ -293,12 +262,11 @@
@@ -334,6 +302,7 @@ transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none; + z-index: 1000; } &:hover .tooltip { transform: translate(-50%, -0.5rem) scale(1); diff --git a/plugins/contact-resources/src/components/ChannelsEditor.svelte b/plugins/contact-resources/src/components/ChannelsEditor.svelte index f0bcb66311..c6fbe5ebd5 100644 --- a/plugins/contact-resources/src/components/ChannelsEditor.svelte +++ b/plugins/contact-resources/src/components/ChannelsEditor.svelte @@ -20,7 +20,6 @@ import { ChannelProvider, Channel } from '@anticrm/contact' import { showPanel } from '@anticrm/ui' - import view from '@anticrm/view' import contact from '../plugin' import ChannelsDropdown from './ChannelsDropdown.svelte' @@ -105,11 +104,11 @@ Promise.all(promises) } - function click (ev: any) { + function _open (ev: any) { if (ev.detail.presenter !== undefined && Array.isArray(channels)) { const channel = channels[0] if (channel !== undefined) { - showPanel(view.component.EditDoc, channel.attachedTo, channel.attachedToClass, 'content', ev.detail.presenter) + showPanel(ev.detail.presenter, channel.attachedTo, channel.attachedToClass, 'float') } } } @@ -126,5 +125,5 @@ on:change={(e) => { if (editable) save(e.detail) }} - on:click={click} + on:open={_open} /> diff --git a/plugins/contact-resources/src/components/ChannelsPresenter.svelte b/plugins/contact-resources/src/components/ChannelsPresenter.svelte index 2c6d48f954..cead3403a1 100644 --- a/plugins/contact-resources/src/components/ChannelsPresenter.svelte +++ b/plugins/contact-resources/src/components/ChannelsPresenter.svelte @@ -27,14 +27,14 @@ export let length: 'short' | 'full' = 'short' export let shape: 'circle' | undefined = 'circle' - function click (ev: any) { + function _open (ev: any) { if (ev.detail.presenter !== undefined && Array.isArray(value)) { const channel = value[0] if (channel !== undefined) { - showPanel(ev.detail.presenter, channel.attachedTo, channel.attachedToClass, 'float', ev.detail.presenter) + showPanel(ev.detail.presenter, channel.attachedTo, channel.attachedToClass, 'float') } } } - + diff --git a/plugins/contact-resources/src/components/Contacts.svelte b/plugins/contact-resources/src/components/Contacts.svelte index cfd05cc2fc..568d6a9247 100644 --- a/plugins/contact-resources/src/components/Contacts.svelte +++ b/plugins/contact-resources/src/components/Contacts.svelte @@ -66,7 +66,7 @@ />
- + {#await tableDescriptor then descr} {#if descr} diff --git a/plugins/gmail-resources/src/components/Main.svelte b/plugins/gmail-resources/src/components/Main.svelte index 88df2ee34e..99e715fd37 100644 --- a/plugins/gmail-resources/src/components/Main.svelte +++ b/plugins/gmail-resources/src/components/Main.svelte @@ -14,7 +14,6 @@ // limitations under the License. --> -
{ - dispatch('select', message) - }} -> -
- {#if selectable}{/if} -
-
-
- {#if showName} -
{formatName(message.sender)}
- {/if} - {#if attachments} - - {/if} -
-
-
- {new Date(message.sendOn).toLocaleString('default', { hour: 'numeric', minute: 'numeric' })} +
+
{ + dispatch('select', message) + }} + > +
+ {#if selectable}{/if} +
+
+
+ {#if showName} +
{formatName(message.sender)}
+ {/if} + {#if attachments} + + {/if} +
+
+
+ {new Date(message.sendOn).toLocaleString('default', { hour: 'numeric', minute: 'numeric' })} +
@@ -62,36 +64,51 @@
diff --git a/plugins/view-resources/src/components/TableView.svelte b/plugins/view-resources/src/components/TableView.svelte index 9c52f051b7..29db07b9cf 100644 --- a/plugins/view-resources/src/components/TableView.svelte +++ b/plugins/view-resources/src/components/TableView.svelte @@ -35,6 +35,6 @@ mode: 'browser' }} /> - + diff --git a/tests/sanity/tests/settings.spec.ts b/tests/sanity/tests/settings.spec.ts index 3b9818b04f..84f2cad8ff 100644 --- a/tests/sanity/tests/settings.spec.ts +++ b/tests/sanity/tests/settings.spec.ts @@ -27,14 +27,13 @@ test.describe('contact tests', () => { await page.fill('[placeholder="Location"]', 'LoPlaza') // Click .flex-center.icon-button await page.click('text=Edit profile John Appleseed LoPlaza >> button') - await page.click('text=Edit profile John Appleseed LoPlaza >> button') // await page.click('button:has-text("Add social links")') // Click [placeholder="john\.appleseed\@apple\.com"] await page.click('button:has-text("Email")') // Fill [placeholder="john\.appleseed\@apple\.com"] await page.fill('[placeholder="john\\.appleseed\\@apple\\.com"]', 'wer@qwe.com') // Click text=Apply - await page.click('.button.transparent') + await page.click('button:nth-child(3)') }) test('create-template', async ({ page }) => { // Go to http://localhost:8083/workbench%3Acomponent%3AWorkbenchApp