diff --git a/packages/vlossom/src/components/vs-input/VsInput.vue b/packages/vlossom/src/components/vs-input/VsInput.vue
index eceaf25b4..e25b11fdd 100644
--- a/packages/vlossom/src/components/vs-input/VsInput.vue
+++ b/packages/vlossom/src/components/vs-input/VsInput.vue
@@ -19,18 +19,8 @@
:class="['vs-input', `vs-${computedColorScheme}`, { ...classObj }, boxGlowByState]"
:style="computedStyleSet"
>
-
-
-
-
+
+
-
@@ -106,6 +93,7 @@ export default defineComponent({
props: {
...getInputProps(),
...getResponsiveProps(),
+ autocomplete: { type: Boolean, default: false },
colorScheme: { type: String as PropType },
styleSet: { type: [String, Object] as PropType },
dense: { type: Boolean, default: false },
@@ -152,7 +140,7 @@ export default defineComponent({
state,
} = toRefs(props);
- const { slots, emit } = context;
+ const { emit } = context;
const inputValue: Ref = ref(modelValue.value);
@@ -210,12 +198,6 @@ export default defineComponent({
inputValue.value = target.value || '';
}
- const hasPrependButton = computed(() => !!slots['prepend-button']);
- const hasAppendButton = computed(() => !!slots['append-button']);
-
- const hasPrependContent = computed(() => !!slots['prepend-content']);
- const hasAppendContent = computed(() => !!slots['append-content']);
-
const inputRef: Ref = ref(null);
function focus() {
@@ -240,14 +222,6 @@ export default defineComponent({
function onEnter() {
emit('enter');
-
- if (hasPrependButton.value) {
- emit('prepend');
- }
-
- if (hasAppendButton.value) {
- emit('append');
- }
}
function clearWithFocus() {
@@ -264,10 +238,6 @@ export default defineComponent({
inputValue,
updateValue,
inputRef,
- hasPrependButton,
- hasAppendButton,
- hasPrependContent,
- hasAppendContent,
computedMessages,
shake,
focus,
diff --git a/packages/vlossom/src/components/vs-input/__tests__/vs-input.test.ts b/packages/vlossom/src/components/vs-input/__tests__/vs-input.test.ts
index ae34a21c4..a8ceb0487 100644
--- a/packages/vlossom/src/components/vs-input/__tests__/vs-input.test.ts
+++ b/packages/vlossom/src/components/vs-input/__tests__/vs-input.test.ts
@@ -292,67 +292,11 @@ describe('vs-input', () => {
});
describe('prepend / append', () => {
- it('prepend button slot을 설정할 수 있다', async () => {
- // given
- const wrapper: ReturnType = mount(VsInput, {
- slots: {
- 'prepend-button': 'this is button content',
- },
- });
-
- // then
- expect(wrapper.find('button.prepend').exists()).toBe(true);
- expect(wrapper.html()).toContain('this is button content');
- });
-
- it('append button slot을 설정할 수 있다', async () => {
- // given
- const wrapper: ReturnType = mount(VsInput, {
- slots: {
- 'append-button': 'this is button content',
- },
- });
-
- // then
- expect(wrapper.find('button.append').exists()).toBe(true);
- expect(wrapper.html()).toContain('this is button content');
- });
-
- it('prepend button을 클릭하면 prepend 이벤트를 발생시킨다', async () => {
- // given
- const wrapper: ReturnType = mount(VsInput, {
- slots: {
- 'prepend-button': 'this is button content',
- },
- });
-
- // when
- await wrapper.find('button.prepend').trigger('click');
-
- // then
- expect(wrapper.emitted('prepend')).toHaveLength(1);
- });
-
- it('append button을 클릭하면 append 이벤트를 발생시킨다', async () => {
- // given
- const wrapper: ReturnType = mount(VsInput, {
- slots: {
- 'append-button': 'this is button content',
- },
- });
-
- // when
- await wrapper.find('button.append').trigger('click');
-
- // then
- expect(wrapper.emitted('append')).toHaveLength(1);
- });
-
it('prepend content slot을 설정할 수 있다', async () => {
// given
const wrapper: ReturnType = mount(VsInput, {
slots: {
- 'prepend-content': 'this is content',
+ prepend: 'this is content',
},
});
@@ -365,7 +309,7 @@ describe('vs-input', () => {
// given
const wrapper: ReturnType = mount(VsInput, {
slots: {
- 'append-content': 'this is content',
+ append: 'this is content',
},
});
@@ -410,24 +354,6 @@ describe('vs-input', () => {
// then
expect(wrapper.emitted('enter')).toHaveLength(1);
});
-
- it('prepend button과 append button이 있을 경우 prepend, append 이벤트도 함께 발생시킨다', async () => {
- // given
- const wrapper: ReturnType = mount(VsInput, {
- slots: {
- 'prepend-button': 'this is button content',
- 'append-button': 'this is button content',
- },
- });
-
- // when
- await wrapper.find('input').trigger('keyup.enter');
-
- // then
- expect(wrapper.emitted('enter')).toHaveLength(1);
- expect(wrapper.emitted('prepend')).toHaveLength(1);
- expect(wrapper.emitted('append')).toHaveLength(1);
- });
});
describe('rules', () => {
diff --git a/packages/vlossom/src/components/vs-input/stories/VsInput.stories.ts b/packages/vlossom/src/components/vs-input/stories/VsInput.stories.ts
index d0db9ef62..cc3338808 100644
--- a/packages/vlossom/src/components/vs-input/stories/VsInput.stories.ts
+++ b/packages/vlossom/src/components/vs-input/stories/VsInput.stories.ts
@@ -9,7 +9,6 @@ import {
} from '@/storybook';
import { UIState } from '@/declaration';
import { VsIcon } from '@/icons';
-import VsContainer from '@/components/vs-container/VsContainer.vue';
import { InputType } from '../types';
import VsInput from '../VsInput.vue';
@@ -54,7 +53,7 @@ export const ColorScheme: Story = {
template: `
${getColorSchemeTemplate(`
-
+
`)}
`,
@@ -76,7 +75,7 @@ export const State: Story = {
template: `
${getStateTemplate(`
-
+
`)}
`,
@@ -137,9 +136,9 @@ export const Type: Story = {
return { types };
},
template: `
-
+
+
`,
}),
};
@@ -163,31 +162,7 @@ export const Required: Story = {
},
};
-export const PrependButton: Story = {
- render: (args: any) => ({
- components: { VsInput },
- setup() {
- return { args };
- },
- template: `
-
-
-
-
-
- `,
- }),
- args: {
- placeholder: 'email',
- },
- parameters: {
- chromatic: chromaticParameters.theme,
- },
-};
-
-export const AppendButton: Story = {
+export const Prepend: Story = {
render: (args: any) => ({
components: { VsInput, VsIcon },
setup() {
@@ -195,30 +170,10 @@ export const AppendButton: Story = {
},
template: `
-
-
-
-
- `,
- }),
- args: {
- placeholder: 'email',
- },
- parameters: {
- chromatic: chromaticParameters.theme,
- },
-};
-
-export const PrependContent: Story = {
- render: (args: any) => ({
- components: { VsInput },
- setup() {
- return { args };
- },
- template: `
-
-
- prepend
+
+
`,
@@ -231,7 +186,7 @@ export const PrependContent: Story = {
},
};
-export const AppendContent: Story = {
+export const Append: Story = {
render: (args: any) => ({
components: { VsInput, VsIcon },
setup() {
@@ -239,8 +194,10 @@ export const AppendContent: Story = {
},
template: `
-
- append
+
+
`,
@@ -253,42 +210,6 @@ export const AppendContent: Story = {
},
};
-export const Width: Story = {
- render: (args: any) => ({
- components: { VsInput, VsContainer },
- setup() {
- return { args };
- },
- template: `
-
-
-
-
- `,
- }),
- args: {
- width: { sm: '200px', md: '300px', lg: '400px', xl: '500px' },
- },
-};
-
-export const Grid: Story = {
- render: (args: any) => ({
- components: { VsInput, VsContainer },
- setup() {
- return { args };
- },
- template: `
-
-
-
-
- `,
- }),
- args: {
- grid: { sm: 6, md: 4, lg: 3 },
- },
-};
-
export const StyleSet: Story = {
args: {
styleSet: {