|
1 | 1 | <template>
|
2 | 2 | <div class="py-4">
|
3 | 3 | <div v-if="!moduleDetails">
|
4 |
| - <div class="flex items-center"> |
| 4 | + <div class="flex items-center mb-4 gap-2"> |
5 | 5 | <span class="material-icons text-gray-500 text-lg">search</span>
|
6 |
| - <input class="form-input ml-2 border rounded p-2 flex-grow" type="search" v-model="searchQuery" |
7 |
| - placeholder="Search modules" /> |
| 6 | + <input |
| 7 | + class="bg-white dark:bg-gray-700 p-2 rounded text-sm border border-gray-300 shadow focus:outline-none flex-1" |
| 8 | + type="search" v-model="searchQuery" placeholder="Search modules" /> |
8 | 9 | </div>
|
9 | 10 |
|
10 | 11 | <div v-for="(group, groupIndex) in moduleGroups" :key="groupIndex">
|
11 |
| - <h2 class="text-xl font-bold py-4" v-if="groupIndex != 'nested'">Stage "{{ groupIndex }}"</h2> |
12 |
| - <div class="overflow-x-auto"> |
13 |
| - <table class="min-w-full divide-y divide-gray-200"> |
14 |
| - <thead class="bg-gray-50"> |
15 |
| - <tr> |
16 |
| - <th |
17 |
| - class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |
18 |
| - Name</th> |
19 |
| - <th |
20 |
| - class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |
21 |
| - Type</th> |
22 |
| - <th |
23 |
| - class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> |
24 |
| - </th> |
25 |
| - </tr> |
26 |
| - </thead> |
27 |
| - <tbody v-for="(module, index) in group" :key="index" class="bg-white divide-y divide-gray-200"> |
28 |
| - <tr :class="hasNestedModules(module) ? 'bg-gray-100' : ''"> |
29 |
| - <td class="px-6 py-4 whitespace-nowrap"> |
30 |
| - <div class="flex items-center"> |
31 |
| - <span v-if="hasNestedModules(module)" @click="toggleNested(module)"> |
32 |
| - <i class="material-icons cursor-pointer"> |
33 |
| - {{ isNestedExpanded(module) ? 'keyboard_arrow_down' : |
34 |
| - 'keyboard_arrow_right' |
35 |
| - }} |
36 |
| - </i> |
37 |
| - </span> |
38 |
| - {{ module.name }} |
39 |
| - </div> |
40 |
| - </td> |
41 |
| - <td class="px-6 py-4 whitespace-nowrap"> |
42 |
| - <div class="flex items-center"> |
43 |
| - <span |
44 |
| - class="inline-flex items-center text-xs font-medium mr-2 px-2.5 py-0.5 rounded gap-2" |
45 |
| - :class="getModuleTypeColors(module.type)"> |
46 |
| - <span class="material-icons align-middle text-base"> |
47 |
| - {{ getModuleTypeClass(module.type) }} |
48 |
| - </span> |
49 |
| - {{ module.type }} |
50 |
| - </span> |
51 |
| - </div> |
52 |
| - </td> |
53 |
| - <td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> |
54 |
| - <div class="flex items-center space-x-2"> |
55 |
| - <button class="py-2 px-3 rounded" @click="showModuleDetails(module)" |
56 |
| - title="Show module details"> |
57 |
| - <i class="material-icons text-md">list</i> |
58 |
| - </button> |
59 |
| - <copy-btn :textToCopy="getRouteToModule(module)" |
60 |
| - title="Copy link to module"></copy-btn> |
61 |
| - </div> |
62 |
| - </td> |
63 |
| - </tr> |
64 |
| - <tr v-if="hasNestedModules(module) && isNestedExpanded(module)" class="bg-gray-50"> |
65 |
| - <td colspan="3" class="px-6 py-4 whitespace-nowrap"> |
66 |
| - <recipe-modules :recipe="module" :moduleDetails="moduleDetails" |
67 |
| - @showModuleDetails="showModuleDetails" |
68 |
| - @closeModuleDetails="goBack"></recipe-modules> |
69 |
| - </td> |
70 |
| - </tr> |
71 |
| - </tbody> |
72 |
| - </table> |
| 12 | + <h2 class="text-xl font-bold mb-4" v-if="groupIndex != 'nested'">Stage "{{ groupIndex }}"</h2> |
| 13 | + <div class="flex flex-col gap-4"> |
| 14 | + <div v-for="(module, index) in group.filter(module => module.name.toLowerCase().includes(searchQuery.toLowerCase()))" |
| 15 | + :key="index" class="bg-white rounded-lg shadow overflow-hidden transition-all"> |
| 16 | + <div class="py-2 px-6"> |
| 17 | + <div class="flex items-center justify-between"> |
| 18 | + <i class="material-icons cursor-pointer" v-if="hasNestedModules(module)" |
| 19 | + @click="toggleNested(module)" |
| 20 | + :title="isNestedExpanded(module) ? 'Collapse child modules' : 'Expand child modules'"> |
| 21 | + {{ isNestedExpanded(module) ? 'keyboard_arrow_down' : |
| 22 | + 'keyboard_arrow_right' }} |
| 23 | + </i> |
| 24 | + <h3 class="text-lg font-medium text-gray-900 flex-1">{{ module.name }}</h3> |
| 25 | + <span class="inline-flex items-center mr-2 px-2.5 py-0.5 rounded gap-2" |
| 26 | + :class="getModuleTypeColors(module.type)"> |
| 27 | + <span class="material-icons align-middle text-base">{{ |
| 28 | + getModuleTypeClass(module.type) }}</span> |
| 29 | + {{ module.type }} |
| 30 | + </span> |
| 31 | + <button class="py-2 px-3 rounded mr-2" @click="showModuleDetails(module)" |
| 32 | + title="Show module details"> |
| 33 | + <i class="material-icons text-md">list</i> |
| 34 | + </button> |
| 35 | + <copy-btn :textToCopy="getRouteToModule(module)" title="Copy link to module"></copy-btn> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + <div v-if="hasNestedModules(module) && isNestedExpanded(module)" |
| 39 | + class="bg-gray-100 border border-gray-200 p-4 mx-4 mb-4 rounded-lg shadow-md flex-1"> |
| 40 | + <recipe-modules :recipe="module" :moduleDetails="moduleDetails" |
| 41 | + @showModuleDetails="showModuleDetails" @closeModuleDetails="goBack"></recipe-modules> |
| 42 | + </div> |
| 43 | + </div> |
73 | 44 | </div>
|
| 45 | + |
74 | 46 | </div>
|
75 | 47 |
|
76 | 48 | </div>
|
|
0 commit comments