|
24 | 24 | <aside class="flex items-center gap-2"> |
25 | 25 | <ItemActions |
26 | 26 | :url="collection.actions_url" |
27 | | - :actions="collection.actions" |
28 | 27 | :item="collection.id" |
29 | 28 | @started="actionStarted" |
30 | 29 | @completed="actionCompleted" |
31 | | - v-slot="{ actions }" |
| 30 | + v-slot="{ actions, loadActions, shouldShowSkeleton }" |
32 | 31 | > |
33 | | - <Dropdown placement="left-start"> |
| 32 | + <Dropdown |
| 33 | + placement="left-start" |
| 34 | + @mouseover="loadActions" |
| 35 | + @focus="loadActions" |
| 36 | + @click="loadActions" |
| 37 | + > |
34 | 38 | <DropdownMenu> |
35 | 39 | <DropdownItem v-if="collection.available_in_selected_site" :text="__('View')" icon="eye" :href="collection.entries_url" /> |
36 | 40 | <DropdownItem v-if="collection.available_in_selected_site && collection.url" :text="__('Visit URL')" icon="external-link" target="_blank" :href="collection.url" /> |
37 | 41 | <DropdownItem v-if="collection.editable" :text="__('Configure')" icon="cog" :href="collection.edit_url" /> |
38 | 42 | <DropdownItem v-if="collection.blueprint_editable" :text="__('Edit Blueprints')" icon="blueprint-edit" :href="collection.blueprints_url" /> |
39 | 43 | <DropdownItem v-if="collection.editable" :text="__('Scaffold Views')" icon="scaffold" :href="collection.scaffold_url" /> |
40 | | - <DropdownSeparator v-if="actions.length" /> |
41 | | - <DropdownItem |
42 | | - v-for="action in actions" |
43 | | - :key="action.handle" |
44 | | - :text="__(action.title)" |
45 | | - :icon="action.icon" |
46 | | - :variant="action.dangerous ? 'destructive' : 'default'" |
47 | | - @click="action.run" |
48 | | - /> |
| 44 | + <DropdownSeparator v-if="shouldShowSkeleton || actions.length" /> |
| 45 | + <template v-if="shouldShowSkeleton"> |
| 46 | + <div v-for="index in 3" :key="index" class="contents"> |
| 47 | + <ui-skeleton class="m-1 size-5" /> |
| 48 | + <ui-skeleton |
| 49 | + class="mx-2 my-1.5 h-5" |
| 50 | + :class="index === 1 ? 'w-28' : index === 2 ? 'w-36' : 'w-24'" |
| 51 | + /> |
| 52 | + </div> |
| 53 | + </template> |
| 54 | + <template v-else> |
| 55 | + <DropdownItem |
| 56 | + v-for="action in actions" |
| 57 | + :key="action.handle" |
| 58 | + :text="__(action.title)" |
| 59 | + :icon="action.icon" |
| 60 | + :variant="action.dangerous ? 'destructive' : 'default'" |
| 61 | + @click="action.run" |
| 62 | + /> |
| 63 | + </template> |
49 | 64 | </DropdownMenu> |
50 | 65 | </Dropdown> |
51 | 66 | </ItemActions> |
|
0 commit comments