@knitify/vue 0.0.1 → 0.0.3
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/index.es.js +130 -87
- package/dist/index.umd.js +1 -1
- package/dist/types/components/Container/KContainer.vue.d.ts +14 -0
- package/dist/types/components/Container/types.d.ts +3 -0
- package/dist/types/components/Navbar/KNavbar.vue.d.ts +14 -2
- package/dist/types/components/Navbar/KNavbarMenu.vue.d.ts +13 -1
- package/dist/types/components/Navbar/types.d.ts +8 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/types.d.ts +1 -0
- package/package.json +5 -2
- package/playground/App.vue +0 -30
- package/playground/index.html +0 -11
- package/playground/main.ts +0 -23
- package/playground/views/MainView.vue +0 -13
- package/src/components/Icon/KIcon.vue +0 -11
- package/src/components/Icon/types.ts +0 -3
- package/src/components/Navbar/KNavbar.vue +0 -25
- package/src/components/Navbar/KNavbarMenu.vue +0 -47
- package/src/components/Navbar/types.ts +0 -22
- package/src/components/index.ts +0 -3
- package/src/components/types.ts +0 -2
- package/src/index.ts +0 -16
- package/tsconfig.json +0 -16
- package/vite.config.ts +0 -25
package/dist/index.es.js
CHANGED
|
@@ -1,124 +1,167 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as f, openBlock as o, createElementBlock as s, normalizeClass as l, renderSlot as i, createElementVNode as n, resolveComponent as K, Fragment as C, renderList as $, createVNode as d, unref as y, withCtx as k, toDisplayString as x, createCommentVNode as p, createBlock as M, useModel as I, useSlots as B, mergeModels as h } from "vue";
|
|
2
|
+
import { RouterLink as S } from "vue-router";
|
|
3
|
+
const L = /* @__PURE__ */ f({
|
|
4
|
+
__name: "KContainer",
|
|
5
|
+
props: {
|
|
6
|
+
glassy: { type: Boolean }
|
|
7
|
+
},
|
|
8
|
+
setup(t) {
|
|
9
|
+
return (a, r) => (o(), s("div", {
|
|
10
|
+
class: l(["KContainer", t.glassy && "KContainer--glassy"])
|
|
11
|
+
}, [
|
|
12
|
+
i(a.$slots, "default")
|
|
13
|
+
], 2));
|
|
14
|
+
}
|
|
15
|
+
}), V = {
|
|
4
16
|
class: "KIcon",
|
|
5
17
|
title: "icon",
|
|
6
18
|
role: "img"
|
|
7
|
-
},
|
|
19
|
+
}, j = ["href"], z = /* @__PURE__ */ f({
|
|
8
20
|
__name: "KIcon",
|
|
9
21
|
props: {
|
|
10
22
|
href: { default: "" }
|
|
11
23
|
},
|
|
12
24
|
setup(t) {
|
|
13
|
-
return (
|
|
14
|
-
|
|
25
|
+
return (a, r) => (o(), s("svg", V, [
|
|
26
|
+
n("use", {
|
|
15
27
|
href: `#${t.href.replace(/^#/, "")}`
|
|
16
|
-
}, null, 8,
|
|
28
|
+
}, null, 8, j)
|
|
17
29
|
]));
|
|
18
30
|
}
|
|
19
|
-
}),
|
|
20
|
-
class: /* @__PURE__ */
|
|
21
|
-
},
|
|
31
|
+
}), E = { class: "KNavbar-menu" }, O = ["href", "onClick"], w = { class: "KNavbar-icon" }, D = {
|
|
32
|
+
class: /* @__PURE__ */ l(["KNavbar-text"])
|
|
33
|
+
}, F = {
|
|
22
34
|
key: 0,
|
|
23
|
-
class: /* @__PURE__ */
|
|
35
|
+
class: /* @__PURE__ */ l(["KNavbar-caret", "KCollapse-toggle"]),
|
|
24
36
|
"data-collapse-toggle": ""
|
|
25
|
-
},
|
|
37
|
+
}, g = /* @__PURE__ */ f({
|
|
26
38
|
__name: "KNavbarMenu",
|
|
27
39
|
props: {
|
|
28
40
|
items: { default: () => [] }
|
|
29
41
|
},
|
|
30
42
|
setup(t) {
|
|
31
|
-
return (
|
|
32
|
-
const
|
|
33
|
-
return
|
|
34
|
-
(
|
|
35
|
-
key: `navbar-menu-item-${
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
s("a", {
|
|
49
|
-
class: c(["KNavbar-link"]),
|
|
50
|
-
href: N,
|
|
51
|
-
onClick: $
|
|
52
|
-
}, [
|
|
53
|
-
s("span", E, [
|
|
54
|
-
u(i, {
|
|
55
|
-
href: n.icon
|
|
56
|
-
}, null, 8, ["href"])
|
|
43
|
+
return (a, r) => {
|
|
44
|
+
const u = K("KIcon"), _ = K("KNavbarMenu", !0);
|
|
45
|
+
return o(), s("ul", E, [
|
|
46
|
+
(o(!0), s(C, null, $(t.items, (e, c) => i(a.$slots, "item", {
|
|
47
|
+
key: `navbar-menu-item-${c}`,
|
|
48
|
+
item: e
|
|
49
|
+
}, () => [
|
|
50
|
+
d(y(S), {
|
|
51
|
+
to: e.route ?? "/",
|
|
52
|
+
custom: ""
|
|
53
|
+
}, {
|
|
54
|
+
default: k(({ isActive: b, href: m, navigate: v }) => [
|
|
55
|
+
n("li", {
|
|
56
|
+
class: l([
|
|
57
|
+
"KNavbar-item",
|
|
58
|
+
"KCollapse is-collapsed",
|
|
59
|
+
b && "KNavbar-item-is-active"
|
|
57
60
|
]),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
"data-collapse": ""
|
|
62
|
+
}, [
|
|
63
|
+
n("a", {
|
|
64
|
+
class: l(["KNavbar-link"]),
|
|
65
|
+
href: e.route ? m : void 0,
|
|
66
|
+
onClick: (A) => e.route ? v() : e.onClick?.()
|
|
67
|
+
}, [
|
|
68
|
+
n("span", w, [
|
|
69
|
+
d(u, {
|
|
70
|
+
href: e.icon
|
|
71
|
+
}, null, 8, ["href"])
|
|
72
|
+
]),
|
|
73
|
+
n("span", D, x(e.text), 1),
|
|
74
|
+
e.children ? (o(), s("span", F, [
|
|
75
|
+
d(u, { href: "#caretUp" })
|
|
76
|
+
])) : p("", !0)
|
|
77
|
+
], 8, O),
|
|
78
|
+
e.children ? (o(), M(_, {
|
|
79
|
+
key: 0,
|
|
80
|
+
items: e.children,
|
|
81
|
+
class: "KCollapse-content",
|
|
82
|
+
"data-collapse-content": ""
|
|
83
|
+
}, null, 8, ["items"])) : p("", !0)
|
|
84
|
+
], 2)
|
|
85
|
+
]),
|
|
86
|
+
_: 2
|
|
87
|
+
}, 1032, ["to"])
|
|
88
|
+
])), 128))
|
|
73
89
|
]);
|
|
74
90
|
};
|
|
75
91
|
}
|
|
76
|
-
}),
|
|
92
|
+
}), P = { class: "KNavbar-inner" }, R = {
|
|
77
93
|
key: 0,
|
|
78
94
|
class: "KNavbar-brand"
|
|
79
|
-
},
|
|
95
|
+
}, T = { class: "KNavbar-body" }, U = {
|
|
80
96
|
key: 1,
|
|
81
97
|
class: "KNavbar-footer"
|
|
82
|
-
},
|
|
98
|
+
}, q = /* @__PURE__ */ f({
|
|
83
99
|
__name: "KNavbar",
|
|
84
|
-
props: {
|
|
85
|
-
items: {}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
props: /* @__PURE__ */ h({
|
|
101
|
+
items: {},
|
|
102
|
+
fixed: { type: Boolean, default: !1 }
|
|
103
|
+
}, {
|
|
104
|
+
expanded: { type: Boolean, default: !1 },
|
|
105
|
+
expandedModifiers: {}
|
|
106
|
+
}),
|
|
107
|
+
emits: /* @__PURE__ */ h(["toggle"], ["update:expanded"]),
|
|
108
|
+
setup(t, { emit: a }) {
|
|
109
|
+
const r = I(t, "expanded"), u = a, _ = B(), e = () => {
|
|
110
|
+
r.value = !r.value, u("toggle", r.value);
|
|
111
|
+
};
|
|
112
|
+
return (c, b) => {
|
|
113
|
+
const m = K("KIcon");
|
|
114
|
+
return o(), s("aside", {
|
|
115
|
+
class: l([
|
|
116
|
+
"KNavbar",
|
|
117
|
+
r.value && "KNavbar-is-expanded",
|
|
118
|
+
t.fixed && "KNavbar-is-fixed"
|
|
119
|
+
])
|
|
120
|
+
}, [
|
|
121
|
+
n("div", P, [
|
|
122
|
+
_.brand ? (o(), s("div", R, [
|
|
123
|
+
i(c.$slots, "brand")
|
|
124
|
+
])) : p("", !0),
|
|
125
|
+
n("nav", T, [
|
|
126
|
+
i(c.$slots, "default", {}, () => [
|
|
127
|
+
d(g, {
|
|
128
|
+
items: t.items.filter(({ hidden: v }) => !v)
|
|
129
|
+
}, null, 8, ["items"])
|
|
130
|
+
])
|
|
131
|
+
]),
|
|
132
|
+
_.footer ? (o(), s("div", U, [
|
|
133
|
+
i(c.$slots, "footer")
|
|
134
|
+
])) : p("", !0)
|
|
98
135
|
]),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
136
|
+
n("button", {
|
|
137
|
+
type: "button",
|
|
138
|
+
class: "KNavbar-toggle",
|
|
139
|
+
onClick: e
|
|
140
|
+
}, [
|
|
141
|
+
d(m, { href: "#caretLeft" })
|
|
142
|
+
])
|
|
143
|
+
], 2);
|
|
144
|
+
};
|
|
104
145
|
}
|
|
105
|
-
}),
|
|
146
|
+
}), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
106
147
|
__proto__: null,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
148
|
+
KContainer: L,
|
|
149
|
+
KIcon: z,
|
|
150
|
+
KNavbar: q,
|
|
151
|
+
KNavbarMenu: g
|
|
152
|
+
}, Symbol.toStringTag, { value: "Module" })), J = {
|
|
111
153
|
install(t) {
|
|
112
|
-
for (const
|
|
154
|
+
for (const a in N)
|
|
113
155
|
t.component(
|
|
114
|
-
|
|
115
|
-
|
|
156
|
+
a,
|
|
157
|
+
N[a]
|
|
116
158
|
);
|
|
117
159
|
}
|
|
118
160
|
};
|
|
119
161
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
162
|
+
L as KContainer,
|
|
163
|
+
z as KIcon,
|
|
164
|
+
q as KNavbar,
|
|
165
|
+
g as KNavbarMenu,
|
|
166
|
+
J as default
|
|
124
167
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["knitify-vue"]={},t.Vue,t.vueRouter))})(this,(function(t,e,
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["knitify-vue"]={},t.Vue,t.vueRouter))})(this,(function(t,e,b){"use strict";const p=e.defineComponent({__name:"KContainer",props:{glassy:{type:Boolean}},setup(n){return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["KContainer",n.glassy&&"KContainer--glassy"])},[e.renderSlot(a.$slots,"default")],2))}}),h={class:"KIcon",title:"icon",role:"img"},C=["href"],f=e.defineComponent({__name:"KIcon",props:{href:{default:""}},setup(n){return(a,s)=>(e.openBlock(),e.createElementBlock("svg",h,[e.createElementVNode("use",{href:`#${n.href.replace(/^#/,"")}`},null,8,C)]))}}),k={class:"KNavbar-menu"},g=["href","onClick"],u={class:"KNavbar-icon"},B={class:e.normalizeClass(["KNavbar-text"])},y={key:0,class:e.normalizeClass(["KNavbar-caret","KCollapse-toggle"]),"data-collapse-toggle":""},d=e.defineComponent({__name:"KNavbarMenu",props:{items:{default:()=>[]}},setup(n){return(a,s)=>{const r=e.resolveComponent("KIcon"),c=e.resolveComponent("KNavbarMenu",!0);return e.openBlock(),e.createElementBlock("ul",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(o,l)=>e.renderSlot(a.$slots,"item",{key:`navbar-menu-item-${l}`,item:o},()=>[e.createVNode(e.unref(b.RouterLink),{to:o.route??"/",custom:""},{default:e.withCtx(({isActive:K,href:i,navigate:m})=>[e.createElementVNode("li",{class:e.normalizeClass(["KNavbar-item","KCollapse is-collapsed",K&&"KNavbar-item-is-active"]),"data-collapse":""},[e.createElementVNode("a",{class:e.normalizeClass(["KNavbar-link"]),href:o.route?i:void 0,onClick:x=>o.route?m():o.onClick?.()},[e.createElementVNode("span",u,[e.createVNode(r,{href:o.icon},null,8,["href"])]),e.createElementVNode("span",B,e.toDisplayString(o.text),1),o.children?(e.openBlock(),e.createElementBlock("span",y,[e.createVNode(r,{href:"#caretUp"})])):e.createCommentVNode("",!0)],8,g),o.children?(e.openBlock(),e.createBlock(c,{key:0,items:o.children,class:"KCollapse-content","data-collapse-content":""},null,8,["items"])):e.createCommentVNode("",!0)],2)]),_:2},1032,["to"])])),128))])}}}),V={class:"KNavbar-inner"},$={key:0,class:"KNavbar-brand"},E={class:"KNavbar-body"},M={key:1,class:"KNavbar-footer"},_=e.defineComponent({__name:"KNavbar",props:e.mergeModels({items:{},fixed:{type:Boolean,default:!1}},{expanded:{type:Boolean,default:!1},expandedModifiers:{}}),emits:e.mergeModels(["toggle"],["update:expanded"]),setup(n,{emit:a}){const s=e.useModel(n,"expanded"),r=a,c=e.useSlots(),o=()=>{s.value=!s.value,r("toggle",s.value)};return(l,K)=>{const i=e.resolveComponent("KIcon");return e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["KNavbar",s.value&&"KNavbar-is-expanded",n.fixed&&"KNavbar-is-fixed"])},[e.createElementVNode("div",V,[c.brand?(e.openBlock(),e.createElementBlock("div",$,[e.renderSlot(l.$slots,"brand")])):e.createCommentVNode("",!0),e.createElementVNode("nav",E,[e.renderSlot(l.$slots,"default",{},()=>[e.createVNode(d,{items:n.items.filter(({hidden:m})=>!m)},null,8,["items"])])]),c.footer?(e.openBlock(),e.createElementBlock("div",M,[e.renderSlot(l.$slots,"footer")])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"button",class:"KNavbar-toggle",onClick:o},[e.createVNode(i,{href:"#caretLeft"})])],2)}}}),N=Object.freeze(Object.defineProperty({__proto__:null,KContainer:p,KIcon:f,KNavbar:_,KNavbarMenu:d},Symbol.toStringTag,{value:"Module"})),S={install(n){for(const a in N)n.component(a,N[a])}};t.KContainer=p,t.KIcon=f,t.KNavbar=_,t.KNavbarMenu=d,t.default=S,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { KContainerProps } from './types';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<KContainerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
import { KNavbarProps, KNavbarSlots } from './types';
|
|
1
|
+
import type { KNavbarProps, KNavbarSlots } from './types';
|
|
2
|
+
type __VLS_Props = KNavbarProps;
|
|
2
3
|
type __VLS_Slots = KNavbarSlots;
|
|
3
|
-
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
'expanded'?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:expanded": (value: boolean) => any;
|
|
10
|
+
} & {
|
|
11
|
+
toggle: (value: boolean) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
onToggle?: ((value: boolean) => any) | undefined;
|
|
14
|
+
"onUpdate:expanded"?: ((value: boolean) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
17
|
declare const _default: typeof __VLS_export;
|
|
6
18
|
export default _default;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { KNavbarMenuProps } from './types';
|
|
2
|
-
declare
|
|
2
|
+
declare var __VLS_1: {
|
|
3
|
+
item: import("./types").MenuItem;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
item?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<KNavbarMenuProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<KNavbarMenuProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
3
10
|
declare const _default: typeof __VLS_export;
|
|
4
11
|
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
2
|
export type MenuItem = {
|
|
3
3
|
text: string;
|
|
4
|
-
|
|
4
|
+
badge?: number | string;
|
|
5
5
|
children?: MenuItem[];
|
|
6
|
+
hidden?: boolean;
|
|
6
7
|
icon?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
route?: RouteLocationRaw;
|
|
7
10
|
};
|
|
8
11
|
export type KNavbarProps = {
|
|
9
12
|
items: MenuItem[];
|
|
13
|
+
fixed?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type KNavbarEmits = {
|
|
16
|
+
(event: 'toggle', value: boolean): void;
|
|
10
17
|
};
|
|
11
18
|
export type KNavbarSlots = {
|
|
12
19
|
brand?(): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knitify/vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"main": "dist/index.umd.js",
|
|
9
9
|
"module": "dist/index.es.js",
|
|
10
10
|
"types": "dist/types/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
11
14
|
"devDependencies": {
|
|
12
15
|
"@vitejs/plugin-vue": "^6.0.4",
|
|
13
16
|
"typescript": "^5.9.3",
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
"vue": "^3.5.12",
|
|
16
19
|
"vue-router": "^4.0.3",
|
|
17
20
|
"vue-tsc": "^3.2.5",
|
|
18
|
-
"@knitify/core": "1.0.
|
|
21
|
+
"@knitify/core": "1.0.3"
|
|
19
22
|
},
|
|
20
23
|
"peerDependencies": {
|
|
21
24
|
"@knitify/core": "^1.0.1",
|
package/playground/App.vue
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted, onUnmounted } from 'vue'
|
|
3
|
-
import '@knitify/core/main.css'
|
|
4
|
-
import Knitify from '@knitify/core'
|
|
5
|
-
|
|
6
|
-
onMounted(() => {
|
|
7
|
-
Knitify.init()
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
onUnmounted(() => {
|
|
11
|
-
Knitify.destroy()
|
|
12
|
-
})
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<div>
|
|
17
|
-
<RouterView />
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<style>
|
|
22
|
-
html {
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
}
|
|
25
|
-
*,
|
|
26
|
-
*::before,
|
|
27
|
-
*::after {
|
|
28
|
-
box-sizing: inherit;
|
|
29
|
-
}
|
|
30
|
-
</style>
|
package/playground/index.html
DELETED
package/playground/main.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
import knitifyVue from '../src'
|
|
4
|
-
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
5
|
-
|
|
6
|
-
const app = createApp(App)
|
|
7
|
-
|
|
8
|
-
app.use(knitifyVue)
|
|
9
|
-
|
|
10
|
-
const router = createRouter({
|
|
11
|
-
history: createWebHashHistory('/'),
|
|
12
|
-
routes: [
|
|
13
|
-
{
|
|
14
|
-
name: 'main',
|
|
15
|
-
path: '',
|
|
16
|
-
component: () => import('./views/MainView.vue'),
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
app.use(router)
|
|
22
|
-
|
|
23
|
-
app.mount('#app')
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<KNavbar
|
|
3
|
-
:items="[
|
|
4
|
-
{
|
|
5
|
-
text: 'HR Hub',
|
|
6
|
-
icon: '#moduleHrhubColored',
|
|
7
|
-
route: '/',
|
|
8
|
-
children: [{ text: 'Child', icon: '#moduleWeavesColored', route: '/' }],
|
|
9
|
-
},
|
|
10
|
-
{ text: 'Weaves', icon: '#moduleWeavesColored', route: '/' },
|
|
11
|
-
]"
|
|
12
|
-
/>
|
|
13
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { KIconProps } from './types'
|
|
3
|
-
|
|
4
|
-
const { href = '' } = defineProps<KIconProps>()
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<svg class="KIcon" title="icon" role="img">
|
|
9
|
-
<use :href="`#${href.replace(/^#/, '')}`"></use>
|
|
10
|
-
</svg>
|
|
11
|
-
</template>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { KNavbarProps, KNavbarSlots } from './types'
|
|
3
|
-
import KNavbarMenu from './KNavbarMenu.vue'
|
|
4
|
-
|
|
5
|
-
const { items } = defineProps<KNavbarProps>()
|
|
6
|
-
const slots = defineSlots<KNavbarSlots>()
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<aside class="KNavbar">
|
|
11
|
-
<div class="KNavbar-inner">
|
|
12
|
-
<div v-if="slots.brand" class="KNavbar-brand">
|
|
13
|
-
<slot name="brand"></slot>
|
|
14
|
-
</div>
|
|
15
|
-
<nav class="KNavbar-body">
|
|
16
|
-
<slot>
|
|
17
|
-
<KNavbarMenu :items="items" />
|
|
18
|
-
</slot>
|
|
19
|
-
</nav>
|
|
20
|
-
<div v-if="slots.footer" class="KNavbar-footer">
|
|
21
|
-
<slot name="footer"></slot>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</aside>
|
|
25
|
-
</template>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { KNavbarMenuProps } from './types'
|
|
3
|
-
import { RouterLink } from 'vue-router'
|
|
4
|
-
|
|
5
|
-
const { items = [] } = defineProps<KNavbarMenuProps>()
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<ul class="KNavbar-menu">
|
|
10
|
-
<RouterLink
|
|
11
|
-
v-for="(item, index) in items"
|
|
12
|
-
:key="`navbar-menu-item-${index}`"
|
|
13
|
-
:to="item.route"
|
|
14
|
-
custom
|
|
15
|
-
v-slot="{ isActive, href, navigate }"
|
|
16
|
-
>
|
|
17
|
-
<li
|
|
18
|
-
:class="[
|
|
19
|
-
'KNavbar-item',
|
|
20
|
-
'KCollapse is-collapsed',
|
|
21
|
-
isActive && 'KNavbar-item-is-active',
|
|
22
|
-
]"
|
|
23
|
-
data-collapse
|
|
24
|
-
>
|
|
25
|
-
<a :class="['KNavbar-link']" :href="href" @click="navigate">
|
|
26
|
-
<span class="KNavbar-icon">
|
|
27
|
-
<KIcon :href="item.icon" />
|
|
28
|
-
</span>
|
|
29
|
-
<span :class="['KNavbar-text']">{{ item.text }}</span>
|
|
30
|
-
<span
|
|
31
|
-
v-if="item.children"
|
|
32
|
-
:class="['KNavbar-caret', 'KCollapse-toggle']"
|
|
33
|
-
data-collapse-toggle
|
|
34
|
-
>
|
|
35
|
-
<KIcon href="#caretUp" />
|
|
36
|
-
</span>
|
|
37
|
-
</a>
|
|
38
|
-
<KNavbarMenu
|
|
39
|
-
v-if="item.children"
|
|
40
|
-
:items="item.children"
|
|
41
|
-
class="KCollapse-content"
|
|
42
|
-
data-collapse-content
|
|
43
|
-
/>
|
|
44
|
-
</li>
|
|
45
|
-
</RouterLink>
|
|
46
|
-
</ul>
|
|
47
|
-
</template>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { RouteLocationRaw } from 'vue-router'
|
|
2
|
-
|
|
3
|
-
export type MenuItem = {
|
|
4
|
-
text: string
|
|
5
|
-
route: RouteLocationRaw
|
|
6
|
-
children?: MenuItem[]
|
|
7
|
-
icon?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type KNavbarProps = {
|
|
11
|
-
items: MenuItem[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type KNavbarSlots = {
|
|
15
|
-
brand?(): any
|
|
16
|
-
default?(): any
|
|
17
|
-
footer?(): any
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type KNavbarMenuProps = {
|
|
21
|
-
items: MenuItem[]
|
|
22
|
-
}
|
package/src/components/index.ts
DELETED
package/src/components/types.ts
DELETED
package/src/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { App } from 'vue'
|
|
2
|
-
import * as Components from './components'
|
|
3
|
-
|
|
4
|
-
export * from './components/types'
|
|
5
|
-
export * from './components'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
install(app: App) {
|
|
9
|
-
for (const componentName in Components) {
|
|
10
|
-
app.component(
|
|
11
|
-
componentName,
|
|
12
|
-
Components[componentName as keyof typeof Components]
|
|
13
|
-
)
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationDir": "dist/types",
|
|
8
|
-
"outDir": "dist",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"jsx": "preserve",
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"skipLibCheck": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["src"],
|
|
15
|
-
"exclude": ["node_modules", "dist"]
|
|
16
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import vue from '@vitejs/plugin-vue'
|
|
3
|
-
import path from 'path'
|
|
4
|
-
|
|
5
|
-
export default defineConfig(({ mode }) => ({
|
|
6
|
-
plugins: [vue()],
|
|
7
|
-
|
|
8
|
-
build: {
|
|
9
|
-
lib: {
|
|
10
|
-
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
11
|
-
name: 'knitify-vue',
|
|
12
|
-
fileName: (format, name) => `${name}.${format}.js`,
|
|
13
|
-
},
|
|
14
|
-
rollupOptions: {
|
|
15
|
-
external: ['vue', 'vue-router'],
|
|
16
|
-
output: {
|
|
17
|
-
globals: {
|
|
18
|
-
vue: 'Vue',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
root: mode === 'development' ? 'playground' : '.',
|
|
25
|
-
}))
|