diff --git a/packages/anu-vue/src/components/list/AList.vue b/packages/anu-vue/src/components/list/AList.vue index 82a413d8..681a40cd 100644 --- a/packages/anu-vue/src/components/list/AList.vue +++ b/packages/anu-vue/src/components/list/AList.vue @@ -57,6 +57,9 @@ const handleListItemClick = (item: ListPropItems[number]) => { v-bind="typeof item === 'string' ? {} : item" :avatar-append="props.avatarAppend" :icon-append="props.iconAppend" + :color="props.color" + :variant="props.variant" + :states="props.states" :is-active="options[index].isSelected as unknown as boolean" :value="props.modelValue !== undefined ? options[index] : undefined" v-on="{ diff --git a/packages/anu-vue/src/components/list/props.ts b/packages/anu-vue/src/components/list/props.ts index fcfe2fb9..7896e928 100644 --- a/packages/anu-vue/src/components/list/props.ts +++ b/packages/anu-vue/src/components/list/props.ts @@ -1,9 +1,12 @@ import type { ExtractPropTypes, PropType } from 'vue' import type { ListItemProps } from '@/components/list-item' -import { spacing } from '@/composables/useProps' +import { listItemProps } from '@/components/list-item' export type ListPropItems = (ListItemProps | string | number)[] +// List item props +const { avatarAppend, iconAppend, color, variant, states } = listItemProps + export const listProps = { /** * Items to render in list @@ -23,21 +26,24 @@ export const listProps = { */ 'modelValue': null, + // ℹ️ Workaround for checking if event is present on component instance: https://github.com/vuejs/core/issues/5220#issuecomment-1007488240 + 'onClick:item': Function, + + // ℹ️ Below is list item props that will be passed to each list item + /** * By default when icon props are used icon rendered at start. Use `iconAppend` to render icon at end. */ - 'iconAppend': Boolean, + iconAppend, /** * By default when avatar props are used avatar is added at start. Use `avatarAppend` to render avatar at end. */ - 'avatarAppend': Boolean, - - // ℹ️ Workaround for checking if event is present on component instance: https://github.com/vuejs/core/issues/5220#issuecomment-1007488240 - - 'onClick:item': Function, + avatarAppend, - 'spacing': spacing, + color, + variant, + states, } export type ListProps = ExtractPropTypes