@phila/phila-ui-nav-link 0.0.9 → 0.0.11

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/dist/NavLink.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as i, resolveComponent as c, openBlock as n, createElementBlock as s, mergeProps as o, toHandlers as l, toDisplayString as r, createBlock as p, withCtx as k, createElementVNode as f } from "vue";
2
- const h = ["href"], m = ["href", "onClick"], y = /* @__PURE__ */ i({
1
+ import { defineComponent as a, resolveComponent as s, openBlock as t, createElementBlock as i, mergeProps as o, toHandlers as l, toDisplayString as r, createBlock as c, withCtx as p, createTextVNode as k } from "vue";
2
+ const u = ["href"], v = /* @__PURE__ */ a({
3
3
  __name: "NavLink",
4
4
  props: {
5
5
  type: {},
@@ -10,29 +10,25 @@ const h = ["href"], m = ["href", "onClick"], y = /* @__PURE__ */ i({
10
10
  attrs: {},
11
11
  submenu: {}
12
12
  },
13
- setup(u) {
14
- return (e, v) => {
15
- const a = c("router-link");
16
- return e.type === "native" ? (n(), s("a", o({ key: 0 }, e.attrs, {
13
+ setup(f) {
14
+ return (e, m) => {
15
+ const n = s("router-link");
16
+ return e.type === "native" ? (t(), i("a", o({ key: 0 }, e.attrs, {
17
17
  href: e.href,
18
18
  class: { "is-active": e.active }
19
- }, l(e.click ? { click: e.click } : {}, !0)), r(e.text), 17, h)) : (n(), p(a, {
19
+ }, l(e.click ? { click: e.click } : {}, !0)), r(e.text), 17, u)) : (t(), c(n, o({
20
20
  key: 1,
21
- to: { name: e.href }
22
- }, {
23
- default: k((t) => [
24
- f("a", o({
25
- href: t.href
26
- }, e.attrs, {
27
- class: { "is-active": t.isExactActive },
28
- onClick: t.navigate
29
- }), r(e.text), 17, m)
21
+ to: e.href,
22
+ class: { "is-active": e.active }
23
+ }, e.attrs), {
24
+ default: p(() => [
25
+ k(r(e.text), 1)
30
26
  ]),
31
27
  _: 1
32
- }, 8, ["to"]));
28
+ }, 16, ["to", "class"]));
33
29
  };
34
30
  }
35
31
  });
36
32
  export {
37
- y as default
33
+ v as default
38
34
  };
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.NavLink=n(e.Vue))})(this,function(e){"use strict";const n=["href"],o=["href","onClick"];return e.defineComponent({__name:"NavLink",props:{type:{},href:{},text:{},active:{type:Boolean},click:{type:[Function,null]},attrs:{},submenu:{}},setup(c){return(t,a)=>{const r=e.resolveComponent("router-link");return t.type==="native"?(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0},t.attrs,{href:t.href,class:{"is-active":t.active}},e.toHandlers(t.click?{click:t.click}:{},!0)),e.toDisplayString(t.text),17,n)):(e.openBlock(),e.createBlock(r,{key:1,to:{name:t.href}},{default:e.withCtx(i=>[e.createElementVNode("a",e.mergeProps({href:i.href},t.attrs,{class:{"is-active":i.isExactActive},onClick:i.navigate}),e.toDisplayString(t.text),17,o)]),_:1},8,["to"]))}}})});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.NavLink=n(e.Vue))})(this,function(e){"use strict";const n=["href"];return e.defineComponent({__name:"NavLink",props:{type:{},href:{},text:{},active:{type:Boolean},click:{type:[Function,null]},attrs:{},submenu:{}},setup(r){return(t,s)=>{const o=e.resolveComponent("router-link");return t.type==="native"?(e.openBlock(),e.createElementBlock("a",e.mergeProps({key:0},t.attrs,{href:t.href,class:{"is-active":t.active}},e.toHandlers(t.click?{click:t.click}:{},!0)),e.toDisplayString(t.text),17,n)):(e.openBlock(),e.createBlock(o,e.mergeProps({key:1,to:t.href,class:{"is-active":t.active}},t.attrs),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text),1)]),_:1},16,["to","class"]))}}})});
package/dist/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import NavLink from './NavLink.vue';
2
- declare module "@vue/runtime-core" {
2
+ import { type RouteLocationRaw } from "vue-router";
3
+ declare module "vue" {
3
4
  interface GlobalComponents {
4
5
  NavLink: typeof NavLink;
5
6
  }
@@ -7,11 +8,11 @@ declare module "@vue/runtime-core" {
7
8
  type ClickFunction = (event: MouseEvent) => void;
8
9
  export interface NavLinkProps {
9
10
  type?: string;
10
- href?: string;
11
+ href?: RouteLocationRaw;
11
12
  text?: string;
12
13
  active?: boolean;
13
14
  click?: ClickFunction | null;
14
- attrs?: Record<PropertyKey, never>;
15
+ attrs?: Record<PropertyKey, unknown>;
15
16
  submenu?: NavLinkProps[];
16
17
  }
17
- export {};
18
+ export default NavLink;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-nav-link",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -31,5 +31,5 @@
31
31
  "registry": "https://registry.npmjs.com/",
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "ca708d7c878cba1b8bc2be57ad3615b7111e395d"
34
+ "gitHead": "f44a17993f71b06291f8033c3ef152732215a270"
35
35
  }