Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
J0ris-K committed Dec 11, 2024
1 parent 7c14d16 commit 96fd09c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ComponentStory
v-slot="{ properties, settings }"
:params="[
model().type('string').preset(''),
model().type('string | number').preset(''),
prop('accent').enum('info', 'warning', 'danger').required().preset('info').widget(),
prop('type').enum('text', 'number', 'password').required().preset('text').widget(),
prop('disabled').bool().widget(),
Expand Down
14 changes: 4 additions & 10 deletions @xen-orchestra/web-core/lib/components/ui/input/UiInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</UiLabel>
<div>
<VtsIcon :icon="iconBefore" accent="current" class="before" />
<input v-model.trim="modelValue" class="typo p1-regular input text-truncate" :type :disabled v-bind="attrs" />
<input 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 @@ -31,12 +31,12 @@ import { faXmark } from '@fortawesome/free-solid-svg-icons'
import { computed, useAttrs } from 'vue'

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

defineOptions({
inheritAttrs: false,
})
const props = defineProps<{
const { accent } = defineProps<{
type: InputType
accent: InputTextAccent
disabled?: boolean
Expand All @@ -56,7 +56,7 @@ const slots = defineSlots<{

const attrs = useAttrs()

const labelAccent = computed(() => (props.accent === 'info' ? 'neutral' : props.accent))
const labelAccent = computed(() => (accent === 'info' ? 'neutral' : accent))
</script>

<style lang="postcss" scoped>
Expand All @@ -79,12 +79,6 @@ const labelAccent = computed(() => (props.accent === 'info' ? 'neutral' : props.
padding-block: 0.8rem;
padding-inline: 1.6rem;

&.text-truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

&::placeholder {
color: var(--color-neutral-txt-secondary);
}
Expand Down

0 comments on commit 96fd09c

Please sign in to comment.