ketekny-ui-kit 1.0.72 → 1.0.73
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 +32 -17
package/package.json
CHANGED
|
@@ -72,13 +72,7 @@
|
|
|
72
72
|
:key="item.key"
|
|
73
73
|
:icon="item.icon"
|
|
74
74
|
:active="item.active"
|
|
75
|
-
|
|
76
|
-
:href="item.href"
|
|
77
|
-
:title="item.title"
|
|
78
|
-
:is-external="item.isExternal"
|
|
79
|
-
:target="item.target"
|
|
80
|
-
:rel="item.rel"
|
|
81
|
-
:on-click="item.onClick"
|
|
75
|
+
v-bind="item.bindings"
|
|
82
76
|
v-tooltip.right="item.label"
|
|
83
77
|
/>
|
|
84
78
|
</div>
|
|
@@ -266,10 +260,11 @@
|
|
|
266
260
|
</div>
|
|
267
261
|
</template>
|
|
268
262
|
|
|
269
|
-
<script>
|
|
263
|
+
<script>
|
|
270
264
|
import { h } from "vue";
|
|
271
265
|
import kButton from "../ui/kButton.vue";
|
|
272
266
|
import kIcon from "../ui/kIcon.vue";
|
|
267
|
+
import { RouterLink } from "vue-router";
|
|
273
268
|
|
|
274
269
|
const SidebarIconLink = {
|
|
275
270
|
props: {
|
|
@@ -288,24 +283,20 @@ const SidebarIconLink = {
|
|
|
288
283
|
methods: {
|
|
289
284
|
handleClick(event) {
|
|
290
285
|
if (this.onClick) this.onClick(event);
|
|
291
|
-
|
|
292
|
-
if (this.to && this.$router) {
|
|
293
|
-
event?.preventDefault?.();
|
|
294
|
-
this.$router.push(this.to);
|
|
295
|
-
}
|
|
296
286
|
},
|
|
297
287
|
},
|
|
298
288
|
render() {
|
|
299
289
|
const isLink = Boolean(this.to);
|
|
300
|
-
const tag = this.isExternal ? "a" : "button";
|
|
290
|
+
const tag = isLink ? RouterLink : this.isExternal ? "a" : "button";
|
|
301
291
|
|
|
302
292
|
return h(
|
|
303
293
|
tag,
|
|
304
294
|
{
|
|
295
|
+
to: isLink ? this.to : undefined,
|
|
305
296
|
href: this.href,
|
|
306
297
|
target: this.isExternal ? this.target : null,
|
|
307
298
|
rel: this.isExternal ? this.rel : null,
|
|
308
|
-
type: this.isExternal ? null : "button",
|
|
299
|
+
type: isLink || this.isExternal ? null : "button",
|
|
309
300
|
title: this.title,
|
|
310
301
|
class: [
|
|
311
302
|
"group relative flex h-14 w-14 items-center justify-center rounded-xl border border-white/15 transition",
|
|
@@ -329,6 +320,7 @@ export default {
|
|
|
329
320
|
components: {
|
|
330
321
|
kButton,
|
|
331
322
|
kIcon,
|
|
323
|
+
RouterLink,
|
|
332
324
|
SidebarIconLink,
|
|
333
325
|
},
|
|
334
326
|
emits: ["logo-click", "signin", "signup", "signout", "edit-profile"],
|
|
@@ -418,8 +410,8 @@ export default {
|
|
|
418
410
|
this.persistSidebarState();
|
|
419
411
|
},
|
|
420
412
|
menuItemTag(item) {
|
|
421
|
-
if (item?.
|
|
422
|
-
if (item?.
|
|
413
|
+
if (item?.to) return RouterLink;
|
|
414
|
+
if (item?.href) return "a";
|
|
423
415
|
return "button";
|
|
424
416
|
},
|
|
425
417
|
},
|
|
@@ -461,6 +453,29 @@ export default {
|
|
|
461
453
|
};
|
|
462
454
|
});
|
|
463
455
|
},
|
|
456
|
+
menuItemBindings(item) {
|
|
457
|
+
if (item?.to) {
|
|
458
|
+
return {
|
|
459
|
+
to: item.to,
|
|
460
|
+
title: item.title || item.label,
|
|
461
|
+
"aria-current": item.active ? "page" : null,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (item?.href) {
|
|
466
|
+
return {
|
|
467
|
+
href: item.href,
|
|
468
|
+
target: item.target || "_blank",
|
|
469
|
+
rel: item.rel || "noreferrer",
|
|
470
|
+
title: item.title || item.label,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return {
|
|
475
|
+
type: "button",
|
|
476
|
+
title: item?.title || item?.label,
|
|
477
|
+
};
|
|
478
|
+
},
|
|
464
479
|
accountDisplayName() {
|
|
465
480
|
if (!this.account) return "";
|
|
466
481
|
return (
|