Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`OcBreadcrumb > displays all items 1`] = `
</li>
<li data-v-5914b352="" data-key="1" data-item-id="oc-breadcrumb-truncation-5" class="oc-breadcrumb-list-item flex items-center sr-only">
<oc-button-stub data-v-5914b352="" arialabel="Show collapsed breadcrumb items" appearance="raw-inverse" colorrole="surface" disabled="false" gapsize="medium" justifycontent="center" showspinner="false" size="medium" submit="button" type="button" nohover="true" id="oc-breadcrumb-contextmenu-truncation-trigger" class="hover:underline">...</oc-button-stub>
<oc-drop-stub data-v-5914b352="" title="Collapsed items" closeonclick="true" dropid="oc-drop-6" mode="click" offset="5" paddingsize="small" position="bottom-start" toggle="#oc-breadcrumb-contextmenu-truncation-trigger" enforcedroponmobile="false" teleport="" ismenu="true">
<oc-drop-stub data-v-5914b352="" title="Collapsed items" closeonclick="true" dropid="oc-drop-6" mode="click" offset="5" paddingsize="small" maxwidth="400" position="bottom-start" toggle="#oc-breadcrumb-contextmenu-truncation-trigger" enforcedroponmobile="false" teleport="" ismenu="true">
<div data-v-5914b352="" class="flex flex-col"></div>
</oc-drop-stub>
<oc-icon-stub data-v-5914b352="" accessiblelabel="" color="var(--oc-role-on-surface)" filltype="line" name="arrow-right-s" sizeclass="size-5" type="span" uniqueids="false" class="mx-1 align-sub"></oc-icon-stub>
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`OcBreadcrumb > sets correct variation 1`] = `
</li>
<li data-v-5914b352="" data-key="1" data-item-id="oc-breadcrumb-truncation-2" class="oc-breadcrumb-list-item flex items-center sr-only">
<oc-button-stub data-v-5914b352="" arialabel="Show collapsed breadcrumb items" appearance="raw-inverse" colorrole="surface" disabled="false" gapsize="medium" justifycontent="center" showspinner="false" size="medium" submit="button" type="button" nohover="true" id="oc-breadcrumb-contextmenu-truncation-trigger" class="hover:underline">...</oc-button-stub>
<oc-drop-stub data-v-5914b352="" title="Collapsed items" closeonclick="true" dropid="oc-drop-3" mode="click" offset="5" paddingsize="small" position="bottom-start" toggle="#oc-breadcrumb-contextmenu-truncation-trigger" enforcedroponmobile="false" teleport="" ismenu="true">
<oc-drop-stub data-v-5914b352="" title="Collapsed items" closeonclick="true" dropid="oc-drop-3" mode="click" offset="5" paddingsize="small" maxwidth="400" position="bottom-start" toggle="#oc-breadcrumb-contextmenu-truncation-trigger" enforcedroponmobile="false" teleport="" ismenu="true">
<div data-v-5914b352="" class="flex flex-col"></div>
</oc-drop-stub>
<oc-icon-stub data-v-5914b352="" accessiblelabel="" color="var(--oc-role-on-surface)" filltype="line" name="arrow-right-s" sizeclass="size-5" type="span" uniqueids="false" class="mx-1 align-sub"></oc-icon-stub>
Expand Down
10 changes: 8 additions & 2 deletions packages/design-system/src/components/OcDrop/OcDrop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ export interface Props {
* @default 'medium'
*/
paddingSize?: SizeType | 'remove'
/**
* @docs The maximum width of the drop in pixels. It never grows beyond the available space.
* @default 400
*/
maxWidth?: number
/**
* @docs The position of the drop. Check the floating-ui documentation for more details on the type.
* @default 'bottom-start'
Expand Down Expand Up @@ -143,6 +148,7 @@ export interface Slots {
const {
closeOnClick = false,
dropId = uniqueId('oc-drop-'),
maxWidth = 400,
mode = 'click',
offset = 5,
paddingSize = 'medium',
Expand Down Expand Up @@ -238,7 +244,7 @@ const update = async ({
size({
apply({ availableWidth, availableHeight, elements }) {
Object.assign(elements.floating.style, {
maxWidth: `${Math.min(400, availableWidth - 10)}px`,
maxWidth: `${Math.min(maxWidth, availableWidth - 10)}px`,
maxHeight: `${Math.max(0, availableHeight - 10)}px`
})
}
Expand Down Expand Up @@ -309,7 +315,7 @@ const showDrop = async ({
size({
apply({ availableWidth, availableHeight, elements }) {
Object.assign(elements.floating.style, {
maxWidth: `${Math.min(400, availableWidth - 10)}px`,
maxWidth: `${Math.min(maxWidth, availableWidth - 10)}px`,
maxHeight: `${Math.max(0, availableHeight - 10)}px`
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`SharesNavigation component > renders a shares navigation for both mobil
<oc-button-stub appearance="raw" colorrole="secondary" disabled="false" gapsize="medium" justifycontent="center" showspinner="false" size="medium" submit="button" type="button" nohover="false" id="shares_navigation_mobile" class="p-1"><span>Shared with me</span>
<oc-icon-stub accessiblelabel="" color="" filltype="fill" name="arrow-drop-down" sizeclass="size-5" type="span" uniqueids="false"></oc-icon-stub>
</oc-button-stub>
<oc-drop-stub title="Navigation" closeonclick="true" dropid="oc-drop-1" mode="click" offset="5" paddingsize="small" position="bottom-start" toggle="#shares_navigation_mobile" enforcedroponmobile="false" teleport="" ismenu="true">
<oc-drop-stub title="Navigation" closeonclick="true" dropid="oc-drop-1" mode="click" offset="5" paddingsize="small" maxwidth="400" position="bottom-start" toggle="#shares_navigation_mobile" enforcedroponmobile="false" teleport="" ismenu="true">
<oc-list-stub raw="false">
<li>
<oc-button-stub to="/files/shares/with-me/" appearance="raw" colorrole="secondary" disabled="false" gapsize="medium" justifycontent="left" showspinner="false" size="medium" submit="button" type="router-link" nohover="false" class="bg-role-secondary-container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`CreateOrUploadMenu component > action buttons > should show and be enabled if file creation is possible 1`] = `
"<oc-drop-stub title="New" closeonclick="true" dropid="create-or-upload-drop" mode="click" offset="5" paddingsize="small" position="bottom-start" toggle="#test-toggle" enforcedroponmobile="false" teleport="" ismenu="true" class="w-auto min-w-3xs">
"<oc-drop-stub title="New" closeonclick="true" dropid="create-or-upload-drop" mode="click" offset="5" paddingsize="small" maxwidth="400" position="bottom-start" toggle="#test-toggle" enforcedroponmobile="false" teleport="" ismenu="true" class="w-auto min-w-3xs">
<oc-list-stub raw="false" id="create-list" class="py-2 sm:first:pt-0 sm:last:pb-0">
<li>
<oc-button-stub appearance="raw" colorrole="secondary" disabled="false" gapsize="medium" justifycontent="left" showspinner="false" size="medium" submit="button" type="button" nohover="false" id="new-folder-btn" class="w-full">
Expand Down Expand Up @@ -44,7 +44,7 @@ exports[`CreateOrUploadMenu component > action buttons > should show and be enab
`;

exports[`CreateOrUploadMenu component > file handlers > should show entries for all new file handlers 1`] = `
"<oc-drop-stub title="New" closeonclick="true" dropid="create-or-upload-drop" mode="click" offset="5" paddingsize="small" position="bottom-start" toggle="#test-toggle" enforcedroponmobile="false" teleport="" ismenu="true" class="w-auto min-w-3xs">
"<oc-drop-stub title="New" closeonclick="true" dropid="create-or-upload-drop" mode="click" offset="5" paddingsize="small" maxwidth="400" position="bottom-start" toggle="#test-toggle" enforcedroponmobile="false" teleport="" ismenu="true" class="w-auto min-w-3xs">
<oc-list-stub raw="false" id="create-list" class="py-2 sm:first:pt-0 sm:last:pb-0">
<li>
<oc-button-stub appearance="raw" colorrole="secondary" disabled="false" gapsize="medium" justifycontent="left" showspinner="false" size="medium" submit="button" type="button" nohover="false" id="new-folder-btn" class="w-full">
Expand Down
Loading