import type { Meta, StoryObj } from '@storybook/vue3' import { UTableProps } from '../components/UTable/UTable' import { UTable, UTableCell, UTableHeaderCell, UAvatarGroup, UBadge, UTableCellSupText, UButton, UPagination, UTableRow, } from '../components' import { ExtractPropTypes } from 'vue' import { reactive } from 'vue' const meta: Meta = { title: 'Example/Table', component: UTable, tags: ['autodocs'], argTypes: { // }, } export default meta type Story = StoryObj const headerItems: any[] = [ { isChecked: false, text: 'Name', prependIcon: undefined, appendIcon: undefined, }, { isChecked: undefined, text: 'Status', prependIcon: undefined, appendIcon: '$arrowDown', }, { isChecked: undefined, text: 'Role', prependIcon: '$helpCircle', appendIcon: undefined, }, { isChecked: undefined, text: 'Email address', prependIcon: undefined, appendIcon: undefined, }, { isChecked: undefined, text: 'Teams', prependIcon: undefined, appendIcon: undefined, }, { isChecked: undefined, text: undefined, prependIcon: undefined, appendIcon: undefined, }, ] const coworkers: any[] = reactive([ { Name: { profileName: 'Olivia Rhye', profileText: '@olivia', imagePath: '@/components/Table/avatars/Avatar1.svg', avatarNote: '', }, Status: { status: 'Active', color: 'success', }, Email: 'olivia@untitledui.com', Role: 'Product Designer', }, { Name: { profileName: 'Phoenix Baker', profileText: '@phoenix', imagePath: '@/components/Table/avatars/Avatar2.svg', avatarNote: '', }, Status: { status: 'Active', color: 'success', }, Email: 'phoenix@untitledui.com', Role: 'Product Manager', }, { Name: { profileName: 'Lana Steiner', profileText: '@lana', imagePath: '@/components/Table/avatars/Avatar3.svg', avatarNote: '', }, Status: { status: 'Active', color: 'success', }, Email: 'lana@untitledui.com', Role: 'Frontend Developer', }, { Name: { profileName: 'Demi Wilkinson', profileText: '@demi', imagePath: '@/components/Table/avatars/Avatar4.svg', avatarNote: '', }, Status: { status: 'Active', color: 'success', }, Email: 'demi@untitledui.com', Role: 'Backend Developer', }, { Name: { profileName: 'Candice Wu', profileText: '@candice', imagePath: '', avatarNote: 'CW', }, Status: { status: 'Active', color: 'success', }, Email: 'candice@untitledui.com', Role: 'Fullstack Developer', }, ]) const badges: any[] = [ { text: 'Design', color: 'primary', size: 'sm' }, { text: 'Product', color: 'blue', size: 'sm' }, { text: 'Marketing', color: 'indigo', size: 'sm' }, { text: 'Label', color: 'indigo', size: 'sm' }, { text: 'Label', color: 'indigo', size: 'sm' }, { text: 'Label', color: 'indigo', size: 'sm' }, { text: 'Label', color: 'indigo', size: 'sm' }, ] export const AlternatingFillsTable: Story = { render: (args: ExtractPropTypes) => ({ components: { UTable, UTableRow, UPagination, UTableCell, UTableHeaderCell, UAvatarGroup, UBadge, UTableCellSupText, UButton, }, setup() { return { args, headerItems, coworkers, badges } }, template: ` `, methods: { switchCheckbox() { if (args.isChecked !== undefined) { args.isChecked = !args.isChecked } }, }, }), args: {} as UTableProps, }