ketekny-ui-kit 1.0.64 → 1.0.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/layout/twoColLayout.vue +33 -18
package/package.json
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
<component
|
|
84
84
|
v-for="item in normalizedMainMenu"
|
|
85
85
|
:key="item.key"
|
|
86
|
-
:is="item
|
|
86
|
+
:is="menuItemTag(item)"
|
|
87
87
|
v-bind="item.bindings"
|
|
88
88
|
class="flex w-full items-start gap-3 rounded-2xl border px-4 py-4 text-left transition-all duration-200"
|
|
89
89
|
:class="item.classes"
|
|
@@ -203,6 +203,7 @@
|
|
|
203
203
|
</template>
|
|
204
204
|
|
|
205
205
|
<script>
|
|
206
|
+
import { h } from 'vue'
|
|
206
207
|
import kButton from '../ui/kButton.vue'
|
|
207
208
|
import kIcon from '../ui/kIcon.vue'
|
|
208
209
|
import { RouterLink } from 'vue-router'
|
|
@@ -226,23 +227,32 @@ const SidebarIconLink = {
|
|
|
226
227
|
if (this.onClick) this.onClick(event)
|
|
227
228
|
},
|
|
228
229
|
},
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
230
|
+
render() {
|
|
231
|
+
const isLink = Boolean(this.to)
|
|
232
|
+
const tag = isLink ? RouterLink : this.isExternal ? 'a' : 'button'
|
|
233
|
+
|
|
234
|
+
return h(
|
|
235
|
+
tag,
|
|
236
|
+
{
|
|
237
|
+
to: this.to,
|
|
238
|
+
href: this.href,
|
|
239
|
+
target: this.isExternal ? this.target : null,
|
|
240
|
+
rel: this.isExternal ? this.rel : null,
|
|
241
|
+
type: isLink || this.isExternal ? null : 'button',
|
|
242
|
+
title: this.title,
|
|
243
|
+
class: [
|
|
244
|
+
'group relative flex h-14 w-14 items-center justify-center rounded-xl border border-white/15 transition',
|
|
245
|
+
this.active
|
|
246
|
+
? 'bg-slate-950 text-white'
|
|
247
|
+
: this.warning
|
|
248
|
+
? 'bg-[#d97706] text-white hover:bg-[#b45309]'
|
|
249
|
+
: 'bg-white/5 text-white hover:border-cyan-400/40 hover:bg-white/10',
|
|
250
|
+
],
|
|
251
|
+
onClick: this.handleClick,
|
|
252
|
+
},
|
|
253
|
+
[h(kIcon, { name: this.icon, size: '20', color: '#ffffff' })]
|
|
254
|
+
)
|
|
255
|
+
},
|
|
246
256
|
}
|
|
247
257
|
|
|
248
258
|
const DEFAULT_STORAGE_KEY = 'two-col-layout-sidebar-collapsed'
|
|
@@ -325,6 +335,11 @@ export default {
|
|
|
325
335
|
this.isSidebarCollapsed = !this.isSidebarCollapsed
|
|
326
336
|
this.persistSidebarState()
|
|
327
337
|
},
|
|
338
|
+
menuItemTag(item) {
|
|
339
|
+
if (item?.isLink) return 'RouterLink'
|
|
340
|
+
if (item?.isExternal) return 'a'
|
|
341
|
+
return 'button'
|
|
342
|
+
},
|
|
328
343
|
},
|
|
329
344
|
computed: {
|
|
330
345
|
normalizedMainMenu() {
|