refactor: added slots for table header and body
This commit is contained in:
@@ -22,13 +22,10 @@ declare module '@vue/runtime-core' {
|
|||||||
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
|
HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']
|
||||||
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
|
HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']
|
||||||
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
|
HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']
|
||||||
HoppSmartPlaceholder: typeof import('@hoppscotch/ui')['HoppSmartPlaceholder']
|
|
||||||
HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
|
HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']
|
||||||
HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab']
|
|
||||||
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
|
HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable']
|
||||||
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
|
IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']
|
||||||
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
|
IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
|
||||||
IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default']
|
|
||||||
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
|
IconLucideInbox: typeof import('~icons/lucide/inbox')['default']
|
||||||
IconLucideUser: typeof import('~icons/lucide/user')['default']
|
IconLucideUser: typeof import('~icons/lucide/user')['default']
|
||||||
TeamsAdd: typeof import('./components/teams/Add.vue')['default']
|
TeamsAdd: typeof import('./components/teams/Add.vue')['default']
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<div v-else-if="error">{{ t('users.load_list_error') }}</div>
|
<div v-else-if="error">{{ t('users.load_list_error') }}</div>
|
||||||
|
|
||||||
<div v-else-if="usersList.length >= 1" class="m-5">
|
<div v-else-if="usersList.length > 0" class="m-5">
|
||||||
<HoppSmartTable
|
<HoppSmartTable
|
||||||
cell-styles="px-6 py-1"
|
cell-styles="px-6 py-1"
|
||||||
:list="newUsersList"
|
:list="newUsersList"
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
<div class="overflow-auto rounded-md border border-dividerDark shadow-md">
|
<div class="overflow-auto rounded-md border border-dividerDark shadow-md">
|
||||||
<table class="w-full">
|
<table class="w-full">
|
||||||
<thead class="bg-primaryLight">
|
<thead class="bg-primaryLight">
|
||||||
|
<slot v-if="!headings" name="head" />
|
||||||
<tr
|
<tr
|
||||||
|
v-else
|
||||||
class="text-secondary border-b border-dividerDark text-sm text-left"
|
class="text-secondary border-b border-dividerDark text-sm text-left"
|
||||||
>
|
>
|
||||||
<th v-for="th in headings" scope="col" class="px-6 py-3">
|
<th v-for="th in headings" scope="col" class="px-6 py-3">
|
||||||
@@ -12,7 +14,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="divide-y divide-divider">
|
<tbody class="divide-y divide-divider">
|
||||||
|
<slot v-if="!list" name="body" />
|
||||||
<tr
|
<tr
|
||||||
|
v-else
|
||||||
v-for="(rowData, rowIndex) in list"
|
v-for="(rowData, rowIndex) in list"
|
||||||
:key="rowIndex"
|
:key="rowIndex"
|
||||||
class="text-secondaryDark hover:bg-divider hover:cursor-pointer rounded-xl"
|
class="text-secondaryDark hover:bg-divider hover:cursor-pointer rounded-xl"
|
||||||
|
|||||||
Reference in New Issue
Block a user