Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
J0ris-K committed Dec 16, 2024
1 parent 07f3834 commit 271e1ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
17 changes: 4 additions & 13 deletions @xen-orchestra/web-core/lib/components/ui/input/UiInput.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<!-- v5 -->
<template>
<div class="ui-input" :class="toVariants({ accent })">
<UiLabel v-if="slots.default || label" :accent="labelAccent" :required :icon="labelIcon" :href :html-for="inputId">
<UiLabel v-if="slots.default || label" :accent="labelAccent" :required :icon="labelIcon" :href :for="id">
<slot>{{ label }}</slot>
</UiLabel>
<div>
<VtsIcon :icon accent="current" class="before" />
<input
:id="inputId"
v-model.trim="modelValue"
class="typo p1-regular input text-ellipsis"
:type
:disabled
v-bind="attrs"
/>
<input :id v-model.trim="modelValue" class="typo p1-regular input text-ellipsis" :type :disabled v-bind="attrs" />
<VtsIcon
v-if="!attrs.disabled && modelValue && clearable"
:icon="faXmark"
Expand All @@ -38,13 +31,13 @@ import { faXmark } from '@fortawesome/free-solid-svg-icons'
import { computed, useAttrs, useId } from 'vue'

type InputAccent = 'info' | 'warning' | 'danger'
type InputType = 'text' | 'number' | 'password | search'
type InputType = 'text' | 'number' | 'password' | 'search'

defineOptions({
inheritAttrs: false,
})

const { accent, id } = defineProps<{
const { accent, id = useId() } = defineProps<{
accent: InputAccent
label?: string
info?: string
Expand All @@ -65,8 +58,6 @@ const slots = defineSlots<{
info?(): any
}>()

const inputId = computed(() => id || useId())

const attrs = useAttrs()

const labelAccent = computed(() => (accent === 'info' ? 'neutral' : accent))
Expand Down
1 change: 1 addition & 0 deletions @xen-orchestra/web/src/components/SidebarSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:aria-label="$t('sidebar.search-tree-view')"
:icon="faMagnifyingGlass"
:placeholder="$t('sidebar.search-tree-view')"
accent="info"
/>
</div>
</template>
Expand Down

0 comments on commit 271e1ba

Please sign in to comment.