| 1 |
<template> |
| 2 |
<IvyFormItem |
| 3 |
:error="props.comingSoonPosition === 'bottom'" |
| 4 |
:coming-soon-position="props.comingSoonPosition" |
| 5 |
:class="[ |
| 6 |
'ivyforms-coming-soon__label-' + props.comingSoonPosition, |
| 7 |
'ivyforms-coming-soon-input', |
| 8 |
]" |
| 9 |
> |
| 10 |
<template #label> |
| 11 |
<div v-if="props.comingSoonPosition === 'left'"> |
| 12 |
<span>Label</span> |
| 13 |
<ComingSoonBadge |
| 14 |
v-if="props.comingSoonPosition === 'left'" |
| 15 |
:image="'coming-soon-arrow'" |
| 16 |
:size="'s'" |
| 17 |
:coming-soon-position="props.comingSoonPosition" |
| 18 |
/> |
| 19 |
</div> |
| 20 |
<div v-else-if="props.comingSoonPosition === 'right'"> |
| 21 |
<ComingSoonBadge |
| 22 |
v-if="props.comingSoonPosition === 'right'" |
| 23 |
:coming-soon-position="props.comingSoonPosition" |
| 24 |
/> |
| 25 |
</div> |
| 26 |
</template> |
| 27 |
<template #default> |
| 28 |
<IvyTextInput v-model="inputValue" disabled /> |
| 29 |
</template> |
| 30 |
<template #error> |
| 31 |
<div v-if="props.comingSoonPosition === 'bottom'" class="ivyforms-coming-soon__input-badge"> |
| 32 |
<ComingSoonBadge |
| 33 |
v-if="props.comingSoonPosition === 'bottom'" |
| 34 |
image="coming-soon-arrow" |
| 35 |
size="s" |
| 36 |
/> |
| 37 |
<p>Coming Soon</p> |
| 38 |
</div> |
| 39 |
</template> |
| 40 |
</IvyFormItem> |
| 41 |
</template> |
| 42 |
|
| 43 |
<script setup lang="ts"> |
| 44 |
import { ref } from 'vue' |
| 45 |
interface Props { |
| 46 |
comingSoonPosition?: 'left' | 'right' | 'bottom' |
| 47 |
} |
| 48 |
|
| 49 |
const props = withDefaults(defineProps<Props>(), { |
| 50 |
comingSoonPosition: 'right', |
| 51 |
}) |
| 52 |
|
| 53 |
const inputValue = ref('') |
| 54 |
</script> |
| 55 |
|
| 56 |
<style lang="scss"> |
| 57 |
.ivyforms-form-item { |
| 58 |
&.ivyforms-coming-soon-input { |
| 59 |
.ivyforms-coming-soon__input-badge { |
| 60 |
display: flex; |
| 61 |
padding: var(--Spacing-2xs, 4px) var(--Spacing-sm, 8px); |
| 62 |
align-items: center; |
| 63 |
gap: var(--Spacing-2xs, 4px); |
| 64 |
align-self: stretch; |
| 65 |
border-radius: var(--Radius-radius-md, 8px); |
| 66 |
background: var(--map-accent-maroon-fill--4); |
| 67 |
max-height: 28px; |
| 68 |
// TODO Define the color to use here |
| 69 |
color: var(--map-accent-maroon-symbol-0); |
| 70 |
//color: var(--map-accent-maroon-symbol-1); |
| 71 |
|
| 72 |
p { |
| 73 |
font-size: 14px; |
| 74 |
font-style: normal; |
| 75 |
font-weight: 400; |
| 76 |
line-height: 20px; |
| 77 |
margin: 0; |
| 78 |
} |
| 79 |
} |
| 80 |
|
| 81 |
&.ivyforms-coming-soon__label-right { |
| 82 |
label { |
| 83 |
flex-direction: row-reverse; |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
.el-form-item__label { |
| 88 |
div { |
| 89 |
display: flex; |
| 90 |
align-items: center; |
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
// Hide the error message when the coming soon badge is displayed |
| 95 |
.el-form-item__error { |
| 96 |
display: none !important; |
| 97 |
} |
| 98 |
|
| 99 |
// Remove border for error coming soon input |
| 100 |
.el-input { |
| 101 |
.el-input__wrapper { |
| 102 |
border: none !important; |
| 103 |
} |
| 104 |
} |
| 105 |
} |
| 106 |
} |
| 107 |
</style> |
| 108 |
|