@@ -44,7 +44,8 @@ const sections = ref<Sections>({
44
44
// Add separate state for nested items
45
45
const expandedItems = ref <Record <string , boolean >>({
46
46
' /cloud' : false ,
47
- ' /queue' : false
47
+ ' #queue' : false ,
48
+ ' #commerce' : false
48
49
})
49
50
50
51
// Create an ordered array of sections that we can reorder
@@ -149,13 +150,31 @@ const sectionContent: Record<string, SectionContent> = {
149
150
{ to: ' /actions' , icon: ' i-hugeicons-function-of-x' , text: ' Actions' },
150
151
{ to: ' /commands' , icon: ' i-hugeicons-command-line' , text: ' Commands' },
151
152
{
152
- to: ' / queue' ,
153
+ to: ' # queue' ,
153
154
icon: ' i-hugeicons-queue-02' ,
154
155
text: ' Queue' ,
155
156
children: [
157
+ { to: ' /queue' , icon: ' i-hugeicons-dashboard-speed-01' , text: ' Dashboard' },
156
158
{ to: ' /jobs' , icon: ' i-hugeicons-briefcase-01' , text: ' Jobs' }
157
159
]
158
160
},
161
+ {
162
+ to: ' #commerce' ,
163
+ icon: ' i-hugeicons-shopping-cart-02' ,
164
+ text: ' Commerce' ,
165
+ children: [
166
+ { to: ' /commerce' , icon: ' i-hugeicons-dashboard-speed-01' , text: ' Dashboard' },
167
+ { to: ' /commerce/products' , icon: ' i-hugeicons-package' , text: ' Products' },
168
+ { to: ' /commerce/categories' , icon: ' i-hugeicons-tags' , text: ' Categories' },
169
+ { to: ' /commerce/orders' , icon: ' i-hugeicons-search-list-01' , text: ' Orders' },
170
+ { to: ' /commerce/customers' , icon: ' i-hugeicons-user-account' , text: ' Customers' },
171
+ { to: ' /commerce/coupons' , icon: ' i-hugeicons-coupon-01' , text: ' Coupons' },
172
+ { to: ' /commerce/gift-cards' , icon: ' i-hugeicons-gift-card' , text: ' Gift Cards' },
173
+ { to: ' /commerce/payments' , icon: ' i-hugeicons-invoice-01' , text: ' Payments' },
174
+ { to: ' /commerce/shipping' , icon: ' i-hugeicons-shipping-truck-01' , text: ' Shipping' },
175
+ { to: ' /commerce/analytics' , icon: ' i-hugeicons-analytics-01' , text: ' Analytics' }
176
+ ]
177
+ },
159
178
{ to: ' /notifications' , icon: ' i-hugeicons-notification-square' , text: ' Notifications' }
160
179
]
161
180
},
@@ -217,7 +236,7 @@ const sectionContent: Record<string, SectionContent> = {
217
236
draggable =" true"
218
237
:style =" {
219
238
transform: calculateTransform(sectionKey),
220
- transition: dragTarget?.value && dragTarget.value === sectionKey ? 'transform 150ms cubic-bezier(0.4, 0, 0.2, 1)' : 'none',
239
+ transition: dragTarget && dragTarget === sectionKey ? 'transform 150ms cubic-bezier(0.4, 0, 0.2, 1)' : 'none',
221
240
position: 'relative',
222
241
zIndex: draggedItem === sectionKey ? 20 : 10
223
242
}"
@@ -260,7 +279,7 @@ const sectionContent: Record<string, SectionContent> = {
260
279
class =" mt-2 -mx-2 space-y-1 section-content"
261
280
:class =" sections[sectionKey] ? 'expanded' : 'collapsed'"
262
281
>
263
- <li v-for =" item in sectionContent[sectionKey].items" :key =" item.to" >
282
+ <li v-for =" item in sectionContent[sectionKey]? .items || [] " :key =" item.to" >
264
283
<div >
265
284
<RouterLink
266
285
:to =" item.to"
@@ -287,7 +306,11 @@ const sectionContent: Record<string, SectionContent> = {
287
306
v-if =" item.children"
288
307
role =" list"
289
308
class =" mt-1 space-y-1 overflow-hidden transition-all duration-200"
290
- :class =" { 'max-h-0': !expandedItems[item.to], 'max-h-40': expandedItems[item.to] }"
309
+ :class =" {
310
+ 'max-h-0': !expandedItems[item.to],
311
+ 'max-h-40': expandedItems[item.to] && item.children.length <= 3,
312
+ 'max-h-[500px]': expandedItems[item.to] && item.children.length > 3
313
+ }"
291
314
>
292
315
<li v-for =" child in item.children" :key =" child.to" >
293
316
<RouterLink :to =" child.to" class =" sidebar-child-link group" >
0 commit comments