diff --git a/example/src/views/IconView.vue b/example/src/views/IconView.vue index 3625882..5ffd34e 100644 --- a/example/src/views/IconView.vue +++ b/example/src/views/IconView.vue @@ -1,5 +1,5 @@ @@ -24,5 +33,24 @@ const icons = ref([ v-bind="icon" /> + + rotki Logo + + + + + + {{ logo.name }} + + + diff --git a/example/src/views/MenuView.vue b/example/src/views/MenuView.vue index 20e8d74..75cc24a 100644 --- a/example/src/views/MenuView.vue +++ b/example/src/views/MenuView.vue @@ -153,7 +153,7 @@ const menuSelect = ref([ }, { disabled: false, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', value: undefined, @@ -161,7 +161,7 @@ const menuSelect = ref([ }, { disabled: true, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', value: undefined, @@ -186,7 +186,7 @@ const menuSelect = ref([ { dense: true, disabled: false, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', value: undefined, @@ -195,7 +195,7 @@ const menuSelect = ref([ { dense: true, disabled: true, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', value: undefined, @@ -209,36 +209,46 @@ const menuSelectCustom = ref([ keyAttr: 'id', textAttr: 'label', value: undefined, + label: 'Menu with very long name to test and see truncate behaviour', + hint: 'lorem ipsum dolor', options, }, { - disabled: true, keyAttr: 'id', textAttr: 'label', value: undefined, + dense: true, + errorMessages: ['This is required'], + hint: 'lorem ipsum dolor', + showDetails: true, options, }, { disabled: false, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', + successMessages: ['lgtm!'], + showDetails: true, value: undefined, options, }, { disabled: true, - outlined: true, + variant: 'outlined', keyAttr: 'id', textAttr: 'label', value: undefined, options, }, ]); + +const test = ref(null); + ([ ([ ([ class="text-h6 mt-6" data-cy="select-menus-custom" > - Select Menus: custom activator + Select Menus: custom activator content - + - Menu + {{ value ? value.label : 'Choose option' }} @@ -326,5 +339,62 @@ const menuSelectCustom = ref([ + + Select Menus: custom activator inner content + + + + + + {{ value.id }} | {{ value.label }} + + + + + + Select Menus: custom options + + + + + + + + + + diff --git a/src/components/accordions/accordions/Accordions.vue b/src/components/accordions/accordions/Accordions.vue index e86436e..d756a38 100644 --- a/src/components/accordions/accordions/Accordions.vue +++ b/src/components/accordions/accordions/Accordions.vue @@ -31,7 +31,7 @@ const children = computed(() => { const multipleVal = get(multiple); return accordions.map((accordion, index) => { - // @ts-expect-error + // @ts-expect-error the typings throw a false error // The componentOptions.propsData is messed when combined with props from the parent. // So use `initialPropsData`, the original `propsData` that haven't touched by the code below. const propsData = (accordion.componentOptions?.initialPropsData diff --git a/src/components/buttons/button/Button.vue b/src/components/buttons/button/Button.vue index a6ab990..32392ff 100644 --- a/src/components/buttons/button/Button.vue +++ b/src/components/buttons/button/Button.vue @@ -284,6 +284,10 @@ const slots = useSlots(); &.sm { @apply px-3 py-1; } + + .label { + @apply w-full; + } } &.icon { diff --git a/src/components/forms/select/RuiMenuSelect.spec.ts b/src/components/forms/select/RuiMenuSelect.spec.ts index 21372b6..201159c 100644 --- a/src/components/forms/select/RuiMenuSelect.spec.ts +++ b/src/components/forms/select/RuiMenuSelect.spec.ts @@ -34,8 +34,8 @@ describe('menu select', () => { }, }); - expect(wrapper.get('label').classes()).toMatch(/_activator_/); - expect(wrapper.find('label span[class*=label]').exists()).toBeTruthy(); + expect(wrapper.get('div[data-id="activator"]').classes()).toMatch(/_activator_/); + expect(wrapper.find('div[data-id="activator"] span[class*=label]').exists()).toBeTruthy(); expect(wrapper.find('span > svg').exists()).toBeTruthy(); }); @@ -49,7 +49,7 @@ describe('menu select', () => { value: options[4], }, }); - expect(wrapper.find('label[aria-disabled]').exists()).toBeTruthy(); - expect(wrapper.find('label[aria-disabled]').text()).toMatch('Spain'); + expect(wrapper.find('div[aria-disabled]').exists()).toBeTruthy(); + expect(wrapper.find('div[aria-disabled]').text()).toMatch('Spain'); }); }); diff --git a/src/components/forms/select/RuiMenuSelect.stories.ts b/src/components/forms/select/RuiMenuSelect.stories.ts index 9a55f4a..945bb2f 100644 --- a/src/components/forms/select/RuiMenuSelect.stories.ts +++ b/src/components/forms/select/RuiMenuSelect.stories.ts @@ -48,8 +48,12 @@ const meta: Meta = { dense: { control: 'boolean' }, disabled: { control: 'boolean' }, options: { control: 'array', defaultValue: [] }, - outlined: { control: 'boolean' }, value: { control: 'string' }, + variant: { + control: 'select', + defaultValue: 'default', + options: ['default', 'outlined', 'filled'], + }, }, component: RuiMenuSelect as any, parameters: { @@ -84,9 +88,9 @@ export const DefaultDisabled: Story = { export const Outlined: Story = { args: { keyAttr: 'id', - outlined: true, textAttr: 'label', value: null, + variant: 'outlined', }, }; @@ -94,9 +98,9 @@ export const OutlinedDisabled: Story = { args: { disabled: true, keyAttr: 'id', - outlined: true, textAttr: 'label', value: null, + variant: 'outlined', }, }; @@ -105,9 +109,9 @@ export const OutlinedDense: Story = { dense: false, disabled: true, keyAttr: 'id', - outlined: true, textAttr: 'label', value: null, + variant: 'outlined', }, }; @@ -116,9 +120,9 @@ export const OutlinedDisabledDense: Story = { dense: true, disabled: true, keyAttr: 'id', - outlined: true, textAttr: 'label', value: null, + variant: 'outlined', }, }; diff --git a/src/components/forms/select/RuiMenuSelect.vue b/src/components/forms/select/RuiMenuSelect.vue index d91209b..7931fbd 100644 --- a/src/components/forms/select/RuiMenuSelect.vue +++ b/src/components/forms/select/RuiMenuSelect.vue @@ -1,8 +1,8 @@ - + - - - {{ value ? getText(value) : label }} + + + {{ label }} + + + + + + {{ getText(value) }} + + + + + - + + + + - - - - + + + - {{ getText(option) }} - - + + + + + {{ getText(option) }} + + + + + + - + -