diff --git a/packages/theme/styles/panel.scss b/packages/theme/styles/panel.scss index 91c285df3e..a639804e1a 100644 --- a/packages/theme/styles/panel.scss +++ b/packages/theme/styles/panel.scss @@ -143,12 +143,10 @@ &-content { display: flex; flex-direction: column; - flex-grow: 1; flex-shrink: 0; margin-left: auto; margin-right: auto; width: calc(100% - 7.5rem); - height: 100%; max-width: 860px; } } diff --git a/packages/ui/src/components/Component.svelte b/packages/ui/src/components/Component.svelte index d528a7a35f..697e54a366 100644 --- a/packages/ui/src/components/Component.svelte +++ b/packages/ui/src/components/Component.svelte @@ -23,7 +23,7 @@ export let is: AnyComponent export let props = {} - export let shrink: boolean = true + export let shrink: boolean = false $: component = is != null ? getResource(is) : Promise.reject(new Error('is not defined')) diff --git a/packages/ui/src/components/Loading.svelte b/packages/ui/src/components/Loading.svelte index 7e527742fc..ebf8effcc4 100644 --- a/packages/ui/src/components/Loading.svelte +++ b/packages/ui/src/components/Loading.svelte @@ -17,9 +17,14 @@ import Spinner from './Spinner.svelte' export let shrink: boolean = false + export let label: string = '' -
+
+
+ +
+
diff --git a/packages/ui/src/components/PanelInstance.svelte b/packages/ui/src/components/PanelInstance.svelte index f655861187..82eb1cd7dc 100644 --- a/packages/ui/src/components/PanelInstance.svelte +++ b/packages/ui/src/components/PanelInstance.svelte @@ -181,7 +181,7 @@ background-color: transparent; &.anim { - will-change: top, bottom, left, right; + will-change: transform; transition-property: top, bottom, left, right, width, height; transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); diff --git a/packages/ui/src/components/PopupInstance.svelte b/packages/ui/src/components/PopupInstance.svelte index 41e8896fd8..e8d5177d23 100644 --- a/packages/ui/src/components/PopupInstance.svelte +++ b/packages/ui/src/components/PopupInstance.svelte @@ -71,10 +71,10 @@ if ((fullSize || docSize) && (element === 'float' || element === 'content')) { options = fitPopupElement(modalHTML, 'full') options.props.maxHeight = '100vh' - modalHTML.classList.add('fullsize') + if (!modalHTML.classList.contains('fullsize')) modalHTML.classList.add('fullsize') } else { options = fitPopupElement(modalHTML, element) - modalHTML.classList.remove('fullsize') + if (modalHTML.classList.contains('fullsize')) modalHTML.classList.remove('fullsize') } options.fullSize = fullSize } @@ -142,7 +142,7 @@ background-color: transparent; &.anim { - will-change: top, bottom, left, right; + will-change: transform; transition-property: top, bottom, left, right, width, height; transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); diff --git a/packages/ui/src/components/calendar/DateRangePopup.svelte b/packages/ui/src/components/calendar/DateRangePopup.svelte index 254d07ae04..068a6ee245 100644 --- a/packages/ui/src/components/calendar/DateRangePopup.svelte +++ b/packages/ui/src/components/calendar/DateRangePopup.svelte @@ -87,7 +87,7 @@ flex-direction: column; padding: 0.5rem; top: 1rem; - right: calc(100% - 3.5rem); + right: calc(100% - 0.5rem); bottom: 1rem; width: fit-content; width: 12rem; @@ -97,14 +97,11 @@ border-radius: 0.5rem; box-shadow: var(--popup-shadow); z-index: -1; - transition: right 0.1s ease-in-out; .btn { flex-shrink: 0; margin-right: 0.75rem; padding: 0.25rem 0.5rem; - // font-weight: 500; - // color: var(--dark-color); background-color: transparent; border-radius: 0.25rem; cursor: pointer; @@ -115,10 +112,6 @@ } } - &:hover { - right: calc(100% - 0.5rem); - } - .divider { margin: 0.25rem 0.75rem 0.25rem 0; height: 1px; diff --git a/packages/ui/src/popups.ts b/packages/ui/src/popups.ts index c2a0187aa2..f7fbcd1b0f 100644 --- a/packages/ui/src/popups.ts +++ b/packages/ui/src/popups.ts @@ -129,6 +129,7 @@ export function fitPopupPositionedElement ( let direction: string = '' const rect = alignment.getBoundingClientRect() const rectPopup = modalHTML.getBoundingClientRect() + const docWidth = document.body.clientWidth newProps.left = newProps.right = newProps.top = newProps.bottom = '' newProps.maxHeight = newProps.height = '' newProps.maxWidth = newProps.width = '' @@ -159,12 +160,15 @@ export function fitPopupPositionedElement ( } // Horizontal - if (rect.left + rectPopup.width + 16 > document.body.clientWidth) { - newProps.right = `${document.body.clientWidth - rect.right}px` - direction += '|left' - } else { + if (rect.left + rectPopup.width + 16 <= docWidth) { newProps.left = `${rect.left}px` direction += '|right' + } else if (rect.right - rectPopup.width - 16 >= 0) { + newProps.right = `${docWidth - rect.right}px` + direction += '|left' + } else { + newProps.left = '1rem' + direction += '|center' } } return { props: newProps, showOverlay: false, direction } diff --git a/plugins/attachment-resources/src/components/FileBrowser.svelte b/plugins/attachment-resources/src/components/FileBrowser.svelte index 82efaa3aa8..dc4ed8760f 100644 --- a/plugins/attachment-resources/src/components/FileBrowser.svelte +++ b/plugins/attachment-resources/src/components/FileBrowser.svelte @@ -24,7 +24,7 @@ IconSearch, Label, navigate, - Spinner, + Loading, Tooltip } from '@anticrm/ui' import view from '@anticrm/view' @@ -156,8 +156,8 @@ {#if isLoading} -
- +
+
{:else if attachments?.length} {#if isListDisplayMode} @@ -174,8 +174,11 @@