feat(lite): new FormInputGroup component (#6740)
This commit is contained in:
committed by
GitHub
parent
deeb399046
commit
c576114dad
41
@xen-orchestra/lite/src/components/form/FormInputGroup.vue
Normal file
41
@xen-orchestra/lite/src/components/form/FormInputGroup.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div class="form-input-group">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="postcss" scoped>
|
||||
.form-input-group {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
:slotted(.form-input),
|
||||
:slotted(.form-select) {
|
||||
&:hover {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&:focus-within {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-left: -1px;
|
||||
|
||||
.input,
|
||||
.select {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:not(:last-child) {
|
||||
.input,
|
||||
.select {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
11
@xen-orchestra/lite/src/stories/form-input-group.story.md
Normal file
11
@xen-orchestra/lite/src/stories/form-input-group.story.md
Normal file
@@ -0,0 +1,11 @@
|
||||
```vue-template
|
||||
<FormInputGroup>
|
||||
<FormInput />
|
||||
<FormInput />
|
||||
<FormSelect>
|
||||
<option>Option 1</option>
|
||||
<option>Option 2</option>
|
||||
<option>Option 3</option>
|
||||
</FormSelect>
|
||||
</FormInputGroup>
|
||||
```
|
||||
23
@xen-orchestra/lite/src/stories/form-input-group.story.vue
Normal file
23
@xen-orchestra/lite/src/stories/form-input-group.story.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<ComponentStory
|
||||
:params="[slot().help('Can contains multiple FormInput and FormSelect')]"
|
||||
>
|
||||
<FormInputGroup>
|
||||
<FormInput />
|
||||
<FormInput />
|
||||
<FormSelect>
|
||||
<option>Option 1</option>
|
||||
<option>Option 2</option>
|
||||
<option>Option 3</option>
|
||||
</FormSelect>
|
||||
</FormInputGroup>
|
||||
</ComponentStory>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ComponentStory from "@/components/component-story/ComponentStory.vue";
|
||||
import FormInput from "@/components/form/FormInput.vue";
|
||||
import FormInputGroup from "@/components/form/FormInputGroup.vue";
|
||||
import FormSelect from "@/components/form/FormSelect.vue";
|
||||
import { slot } from "@/libs/story/story-param";
|
||||
</script>
|
||||
Reference in New Issue
Block a user