@bobbykim/mcl-header 0.5.1 → 0.6.0
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.d.ts +314 -0
- package/dist/mcl-header.js +793 -0
- package/dist/mcl-header.umd.cjs +2 -0
- package/package.json +28 -6
- package/CHANGELOG.md +0 -75
- package/index.d.ts +0 -4
- package/index.js +0 -4
- package/index.ts +0 -5
- package/lib/common/index.types.d.ts +0 -10
- package/lib/common/index.types.js +0 -1
- package/lib/common/index.types.ts +0 -12
- package/lib/mcl-header-a/MclHeaderA.vue +0 -251
- package/lib/mcl-header-a/MclHeaderA.vue.d.ts +0 -148
- package/lib/mcl-header-a/NavCollapse.vue +0 -165
- package/lib/mcl-header-a/NavCollapse.vue.d.ts +0 -78
- package/lib/mcl-header-a/NavDropdown.vue +0 -165
- package/lib/mcl-header-a/NavDropdown.vue.d.ts +0 -69
- package/lib/mcl-header-a/NavLink.vue +0 -91
- package/lib/mcl-header-a/NavLink.vue.d.ts +0 -62
- package/lib/mcl-header-b/MclHeaderB.vue +0 -270
- package/lib/mcl-header-b/MclHeaderB.vue.d.ts +0 -138
- package/lib/mcl-header-b/NavCollapseVertical.vue +0 -211
- package/lib/mcl-header-b/NavCollapseVertical.vue.d.ts +0 -73
- package/lib/mcl-header-b/NavLinkVertical.vue +0 -78
- package/lib/mcl-header-b/NavLinkVertical.vue.d.ts +0 -62
- package/tsconfig.json +0 -5
- package/tsconfig.ts.json +0 -9
- package/tsconfig.vue.json +0 -9
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { BodyText, ColorPalette } from '@bobbykim/manguito-theme'
|
|
3
|
-
import generateClass from '@bobbykim/manguito-theme'
|
|
4
|
-
import { computed } from 'vue'
|
|
5
|
-
import type { MenuItemType } from '../common/index.types'
|
|
6
|
-
const props = withDefaults(
|
|
7
|
-
defineProps<{
|
|
8
|
-
menuItem: MenuItemType
|
|
9
|
-
textColor?: ColorPalette
|
|
10
|
-
textSize?: BodyText
|
|
11
|
-
fontBold?: boolean
|
|
12
|
-
dHl?: boolean
|
|
13
|
-
hlColor?: ColorPalette
|
|
14
|
-
asLink?: boolean
|
|
15
|
-
}>(),
|
|
16
|
-
{
|
|
17
|
-
textColor: 'dark-3',
|
|
18
|
-
textSize: 'md',
|
|
19
|
-
fontBold: false,
|
|
20
|
-
dHl: true,
|
|
21
|
-
hlColor: 'primary',
|
|
22
|
-
asLink: true,
|
|
23
|
-
}
|
|
24
|
-
)
|
|
25
|
-
const emit = defineEmits<{
|
|
26
|
-
(e: 'menu-click', event: Event, item: MenuItemType): void
|
|
27
|
-
}>()
|
|
28
|
-
const handleLinkClick = (e: Event, item: MenuItemType) => {
|
|
29
|
-
const { asLink } = props
|
|
30
|
-
if (!asLink) {
|
|
31
|
-
e.preventDefault()
|
|
32
|
-
}
|
|
33
|
-
emit('menu-click', e, item)
|
|
34
|
-
}
|
|
35
|
-
const colorClass = computed<string>(() => {
|
|
36
|
-
const { textColor, textSize, dHl, hlColor, fontBold } = props
|
|
37
|
-
const classArray: string[] = [
|
|
38
|
-
// generateClass('TEXTCOLOR', textColor),
|
|
39
|
-
generateClass('BODYTEXT', textSize),
|
|
40
|
-
]
|
|
41
|
-
if (!dHl) {
|
|
42
|
-
const nonHlTextClass: string[] = [
|
|
43
|
-
generateClass('TEXTCOLOR', textColor),
|
|
44
|
-
generateClass('HVTEXTCOLOR', hlColor),
|
|
45
|
-
generateClass('FCTEXTCOLOR', hlColor),
|
|
46
|
-
]
|
|
47
|
-
classArray.push(nonHlTextClass.join(' '))
|
|
48
|
-
}
|
|
49
|
-
if (dHl) {
|
|
50
|
-
const highlightColor: string = generateClass('BEFOREBG', hlColor)
|
|
51
|
-
const hlClass: string =
|
|
52
|
-
'before:inset-y-0 before:left-0 before:transition-[width] before:duration-300 before:ease-linear before:w-0 hover:before:w-full focus:before:w-full '
|
|
53
|
-
classArray.push(hlClass + highlightColor)
|
|
54
|
-
const hlTextClass: string[] = [
|
|
55
|
-
generateClass('TEXTCOLOR', hlColor),
|
|
56
|
-
generateClass('HVTEXTCOLOR', textColor),
|
|
57
|
-
generateClass('FCTEXTCOLOR', textColor),
|
|
58
|
-
]
|
|
59
|
-
classArray.push(hlTextClass.join(' '))
|
|
60
|
-
}
|
|
61
|
-
if (fontBold) {
|
|
62
|
-
classArray.push('font-bold')
|
|
63
|
-
}
|
|
64
|
-
return classArray.join(' ')
|
|
65
|
-
})
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<template>
|
|
69
|
-
<a
|
|
70
|
-
:class="[colorClass]"
|
|
71
|
-
class="px-xs py-2xs relative text-center block w-full before:absolute transition-colors duration-300 ease-linear"
|
|
72
|
-
:href="menuItem.url"
|
|
73
|
-
:target="menuItem.target ? menuItem.target : '_self'"
|
|
74
|
-
@click="handleLinkClick($event, menuItem)"
|
|
75
|
-
>
|
|
76
|
-
<span class="relative">{{ menuItem.title }}</span>
|
|
77
|
-
</a>
|
|
78
|
-
</template>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { BodyText, ColorPalette } from '@bobbykim/manguito-theme';
|
|
2
|
-
import type { MenuItemType } from '../common/index.types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
-
menuItem: MenuItemType;
|
|
5
|
-
textColor?: ColorPalette | undefined;
|
|
6
|
-
textSize?: BodyText | undefined;
|
|
7
|
-
fontBold?: boolean | undefined;
|
|
8
|
-
dHl?: boolean | undefined;
|
|
9
|
-
hlColor?: ColorPalette | undefined;
|
|
10
|
-
asLink?: boolean | undefined;
|
|
11
|
-
}>, {
|
|
12
|
-
textColor: string;
|
|
13
|
-
textSize: string;
|
|
14
|
-
fontBold: boolean;
|
|
15
|
-
dHl: boolean;
|
|
16
|
-
hlColor: string;
|
|
17
|
-
asLink: boolean;
|
|
18
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
-
"menu-click": (event: Event, item: MenuItemType) => void;
|
|
20
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
21
|
-
menuItem: MenuItemType;
|
|
22
|
-
textColor?: ColorPalette | undefined;
|
|
23
|
-
textSize?: BodyText | undefined;
|
|
24
|
-
fontBold?: boolean | undefined;
|
|
25
|
-
dHl?: boolean | undefined;
|
|
26
|
-
hlColor?: ColorPalette | undefined;
|
|
27
|
-
asLink?: boolean | undefined;
|
|
28
|
-
}>, {
|
|
29
|
-
textColor: string;
|
|
30
|
-
textSize: string;
|
|
31
|
-
fontBold: boolean;
|
|
32
|
-
dHl: boolean;
|
|
33
|
-
hlColor: string;
|
|
34
|
-
asLink: boolean;
|
|
35
|
-
}>>> & {
|
|
36
|
-
"onMenu-click"?: ((event: Event, item: MenuItemType) => any) | undefined;
|
|
37
|
-
}, {
|
|
38
|
-
textColor: ColorPalette;
|
|
39
|
-
asLink: boolean;
|
|
40
|
-
textSize: BodyText;
|
|
41
|
-
fontBold: boolean;
|
|
42
|
-
dHl: boolean;
|
|
43
|
-
hlColor: ColorPalette;
|
|
44
|
-
}, {}>;
|
|
45
|
-
export default _default;
|
|
46
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
47
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
48
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
49
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
50
|
-
} : {
|
|
51
|
-
type: import('vue').PropType<T[K]>;
|
|
52
|
-
required: true;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
type __VLS_WithDefaults<P, D> = {
|
|
56
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
57
|
-
default: D[K];
|
|
58
|
-
}> : P[K];
|
|
59
|
-
};
|
|
60
|
-
type __VLS_Prettify<T> = {
|
|
61
|
-
[K in keyof T]: T[K];
|
|
62
|
-
} & {};
|
package/tsconfig.json
DELETED
package/tsconfig.ts.json
DELETED