Skip to content

Commit f65f21b

Browse files
committed
UserOptions atom - Add offsetX prop
1 parent e9dc65c commit f65f21b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/atoms/UserOptions.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ const props = defineProps({
109109
position: {
110110
type: String,
111111
default: 'right'
112+
},
113+
offsetX: {
114+
type: Number,
115+
default: 0
112116
}
113117
});
114118
@@ -241,10 +245,10 @@ const isInfo = ref({
241245
class="vue-ui-user-options"
242246
:style="`z-index: ${zIndex}; height: 34px; position: ${isFullscreen ? 'fixed' : 'absolute'}; top: 0; ${position === 'right' ? `right:${isFullscreen ? '12px': '0'}` : `left:${isFullscreen ? '12px' : '0'}`}; padding: 4px; background:transparent;`">
243247

244-
<div tabindex="0" :title="isOpen ? titles.close || '' : titles.open || ''" data-cy="user-options-summary" :style="`width:32px; position: absolute; top: 0;${position === 'right' ? `right: ${noOffset ? 0 : 4}px` : `left: ${noOffset ? 0 : 4}px`}; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; cursor:pointer; background:transparent`" @click.stop="toggle" @keypress.enter="toggle">
248+
<div tabindex="0" :title="isOpen ? titles.close || '' : titles.open || ''" data-cy="user-options-summary" :style="`width:32px; position: absolute; top: 0;${position === 'right' ? `right: ${offsetX ? offsetX : noOffset ? 0 : 4}px` : `left: ${noOffset ? 0 : 4}px`}; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; cursor:pointer; background:transparent`" @click.stop="toggle" @keypress.enter="toggle">
245249
<BaseIcon :name="isOpen ? 'close' : 'menu'" :stroke="color" :stroke-width="2" />
246250
</div>
247-
<div data-cy="user-options-drawer" :data-open="isOpen" :class="{'vue-ui-user-options-drawer': true}" :style="`background:${backgroundColor}; ${position === 'right' ? `right: ${noOffset ? 0 : 4}px` : `left: ${noOffset ? 0 : 4}px`}`">
251+
<div data-cy="user-options-drawer" :data-open="isOpen" :class="{'vue-ui-user-options-drawer': true}" :style="`background:${backgroundColor}; ${position === 'right' ? `right: ${offsetX ? offsetX : noOffset ? 0 : 4}px` : `left: ${noOffset ? 0 : 4}px`}`">
248252

249253
<button tabindex="0" v-if="hasTooltip" data-cy="user-options-tooltip" class="vue-ui-user-options-button" @click="toggleTooltip" @mouseenter="isInfo.tooltip = true" @mouseout="isInfo.tooltip = false">
250254
<template v-if="$slots.optionTooltip">

0 commit comments

Comments
 (0)