| 1 |
<template> |
| 2 |
<div class="ivyforms-search"> |
| 3 |
<IvyTextInput |
| 4 |
ref="elInputRef" |
| 5 |
:model-value="modelValue" |
| 6 |
:clearable="true" |
| 7 |
:placeholder="placeholder" |
| 8 |
icon-start="search" |
| 9 |
icon-start-type="outline" |
| 10 |
:class="{ 'is-secondary': isSecondary }" |
| 11 |
@update:model-value="onInput" |
| 12 |
/> |
| 13 |
</div> |
| 14 |
</template> |
| 15 |
|
| 16 |
<script setup lang="ts"> |
| 17 |
withDefaults( |
| 18 |
defineProps<{ |
| 19 |
modelValue: string |
| 20 |
placeholder?: string |
| 21 |
isSecondary?: boolean |
| 22 |
}>(), |
| 23 |
{ |
| 24 |
modelValue: '', |
| 25 |
placeholder: '', |
| 26 |
isSecondary: false, |
| 27 |
}, |
| 28 |
) |
| 29 |
|
| 30 |
const emit = defineEmits(['update:modelValue']) |
| 31 |
|
| 32 |
function onInput(value: string) { |
| 33 |
emit('update:modelValue', value) |
| 34 |
} |
| 35 |
</script> |
| 36 |
<style lang="scss"> |
| 37 |
@use 'sass:list' as *; |
| 38 |
@use 'sass:meta' as *; |
| 39 |
|
| 40 |
.ivyforms-search { |
| 41 |
.ivyforms-input { |
| 42 |
width: 100%; |
| 43 |
&.el-input { |
| 44 |
.el-input__wrapper { |
| 45 |
.ivyforms-input__clear { |
| 46 |
cursor: pointer; |
| 47 |
width: 24px; |
| 48 |
height: 24px; |
| 49 |
transform: scale(1); |
| 50 |
margin: 0; |
| 51 |
} |
| 52 |
} |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
</style> |
| 57 |
|