diff --git a/src/components/Select/WSelect.stories.ts b/src/components/Select/WSelect.stories.ts index f364038..42904bd 100644 --- a/src/components/Select/WSelect.stories.ts +++ b/src/components/Select/WSelect.stories.ts @@ -1,6 +1,11 @@ import type { Meta, StoryObj } from '@storybook/vue3' import WSelect from './WSelect.vue' -import { dropdownPostions } from './WSelect' +import { + DropdownXPosition, + dropdownXPositions, + DropdownYPosition, + dropdownYPositions +} from './WSelect' import { ref } from 'vue' import 'vue-select/dist/vue-select.css' import Icon from '@/assets/svg/navigation-cursor.svg?component' @@ -10,9 +15,12 @@ const meta: any = { component: WSelect, tags: ['autodocs'], argTypes: { - dropdownPosition: { control: 'select', options: dropdownPostions } + dropdownYPosition: { control: 'select', options: dropdownYPositions }, + dropdownXPosition: { control: 'select', options: dropdownXPositions } }, args: { + dropdownXPosition: DropdownXPosition.Right, + dropdownYPosition: DropdownYPosition.Bottom, options: [ { key: 'en', @@ -47,8 +55,10 @@ export const Default: Story = { return { args, model, update } }, - template: ``, + template: `
`, args: { + dropdownXPosition: DropdownXPosition.Right, + dropdownYPosition: DropdownYPosition.Bottom, options: [ { key: 'en', diff --git a/src/components/Select/WSelect.ts b/src/components/Select/WSelect.ts index a9ef07c..eddac86 100644 --- a/src/components/Select/WSelect.ts +++ b/src/components/Select/WSelect.ts @@ -1,6 +1,11 @@ export type Option = { key: string; label: string; icon: string | null } -export enum DropdownPosition { +export enum DropdownYPosition { Top = 'top', Bottom = 'bottom' } -export const dropdownPostions = Object.values(DropdownPosition) +export enum DropdownXPosition { + Right = 'right', + Left = 'left' +} +export const dropdownYPositions = Object.values(DropdownYPosition) +export const dropdownXPositions = Object.values(DropdownXPosition) diff --git a/src/components/Select/WSelect.vue b/src/components/Select/WSelect.vue index 25e249c..b6195af 100644 --- a/src/components/Select/WSelect.vue +++ b/src/components/Select/WSelect.vue @@ -8,6 +8,7 @@ :filterable="false" :searchable="false" class="language-selector" + :class="xPosition" >