| 1 |
<template> |
| 2 |
<div> |
| 3 |
<h3>IvyPopover Props Controls</h3> |
| 4 |
<div class="popover-controls"> |
| 5 |
<!-- Popper Background --> |
| 6 |
<label> |
| 7 |
Popper Background: |
| 8 |
<select v-model="popperBackground"> |
| 9 |
<option value="level-1-foreground">Level 1 Foreground</option> |
| 10 |
<option value="level-2-foreground">Level 2 Foreground</option> |
| 11 |
<option value="level-3-foreground">Level 3 Foreground</option> |
| 12 |
</select> |
| 13 |
</label> |
| 14 |
|
| 15 |
<!-- Scrollbar --> |
| 16 |
<label> |
| 17 |
<input v-model="isWithScrollbar" type="checkbox" disabled /> |
| 18 |
Enable Scrollbar |
| 19 |
</label> |
| 20 |
|
| 21 |
<!-- Arrow --> |
| 22 |
<label> |
| 23 |
<select v-model="popperArrow"> |
| 24 |
<option value="with-arrow">With Arrow</option> |
| 25 |
<option value="without-arrow">Without Arrow</option> |
| 26 |
</select> |
| 27 |
</label> |
| 28 |
</div> |
| 29 |
<hr /> |
| 30 |
|
| 31 |
<!-- Popover Preview --> |
| 32 |
<div class="popover-preview"> |
| 33 |
<h3>Popover Preview</h3> |
| 34 |
<IvyPopover |
| 35 |
:popper-background="popperBackground" |
| 36 |
:popper-arrow="popperArrow" |
| 37 |
:is-with-scrollbar="isWithScrollbar" |
| 38 |
:popper-class="popperClass" |
| 39 |
width="212" |
| 40 |
> |
| 41 |
<template #reference> |
| 42 |
<button>Click to trigger Popover</button> |
| 43 |
</template> |
| 44 |
<template #default> |
| 45 |
<p>This is a popover content preview.</p> |
| 46 |
</template> |
| 47 |
</IvyPopover> |
| 48 |
<br /> |
| 49 |
<hr /> |
| 50 |
<br /> |
| 51 |
<IvyPopover |
| 52 |
:popper-background="popperBackground" |
| 53 |
:popper-arrow="popperArrow" |
| 54 |
:is-with-scrollbar="isWithScrollbar" |
| 55 |
:popper-class="popperClass" |
| 56 |
> |
| 57 |
<template #reference> |
| 58 |
<button>Click to trigger Popover</button> |
| 59 |
</template> |
| 60 |
<template #default> |
| 61 |
<p>Why do we use it? It is a long established fact that a reader will bes shing p.</p> |
| 62 |
</template> |
| 63 |
</IvyPopover> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
</template> |
| 67 |
|
| 68 |
<script setup lang="ts"> |
| 69 |
import { ref } from 'vue' |
| 70 |
import IvyPopover from '@/views/_components/popover/IvyPopover.vue' |
| 71 |
|
| 72 |
const popperBackground = ref<'level-1-foreground' | 'level-2-foreground' | 'level-3-foreground'>( |
| 73 |
'level-2-foreground', |
| 74 |
) |
| 75 |
const popperArrow = ref<'with-arrow' | 'without-arrow'>('without-arrow') |
| 76 |
const isWithScrollbar = ref(false) |
| 77 |
const popperClass = ref('') |
| 78 |
</script> |
| 79 |
|
| 80 |
<style scoped> |
| 81 |
.popover-controls { |
| 82 |
margin-bottom: 20px; |
| 83 |
padding: 10px; |
| 84 |
border: 1px solid #ddd; |
| 85 |
border-radius: 6px; |
| 86 |
} |
| 87 |
|
| 88 |
.popover-controls label { |
| 89 |
display: block; |
| 90 |
margin-bottom: 10px; |
| 91 |
} |
| 92 |
|
| 93 |
.popover-preview { |
| 94 |
margin-top: 20px; |
| 95 |
} |
| 96 |
|
| 97 |
.popover-preview h3 { |
| 98 |
margin-bottom: 20px; |
| 99 |
} |
| 100 |
|
| 101 |
hr { |
| 102 |
margin: 20px 0; |
| 103 |
border: none; |
| 104 |
border-top: 1px solid #ddd; |
| 105 |
} |
| 106 |
</style> |
| 107 |
|