@bobbykim/mcl-footer 0.3.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.4.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-footer@0.3.0...@bobbykim/mcl-footer@0.4.0) (2024-03-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * **mcl-header:** move deprecated items to deprecated folder in root dir, update configs, init mcl-header-b component ([19aa842](https://github.com/bobbykim89/manguito-component-library/commit/19aa842faa7f1594f7be030b97d5093014efe7cb))
12
+ * tsconfig update, slots and emits update ([c30ff80](https://github.com/bobbykim89/manguito-component-library/commit/c30ff804c961d205ac097e20cd51285a15ca8966))
13
+
14
+
15
+
16
+
17
+
6
18
  # [0.3.0](https://github.com/bobbykim89/manguito-component-library/compare/@bobbykim/mcl-footer@0.2.0...@bobbykim/mcl-footer@0.3.0) (2024-02-27)
7
19
 
8
20
 
@@ -7,7 +7,7 @@ import type {
7
7
  } from '@bobbykim/manguito-theme'
8
8
  import generateClass from '@bobbykim/manguito-theme'
9
9
  import SocialIcons from './SocialIcons.vue'
10
- import type { MenuItemEvent, MenuItemType, SocialUrl } from './index.types'
10
+ import type { MenuItemType, SocialUrl } from './index.types'
11
11
 
12
12
  const props = withDefaults(
13
13
  defineProps<{
@@ -54,8 +54,13 @@ const props = withDefaults(
54
54
  }
55
55
  )
56
56
 
57
- const emit = defineEmits(['menu-click', 'logo-click', 'secondary-menu-click'])
58
- type EmitType = 'menu' | 'logo' | 'secondary'
57
+ const slots = defineSlots<{
58
+ default: any
59
+ }>()
60
+ const emit = defineEmits<{
61
+ (e: 'logo-click', event: Event, link: string, target: CtaTarget): void
62
+ (e: 'menu-click', event: Event, item: MenuItemType): void
63
+ }>()
59
64
 
60
65
  const getFooterClass = (bg: ColorPalette, border: ColorPalette): string => {
61
66
  /**
@@ -100,39 +105,16 @@ const getMenuItemClass = (
100
105
  return classArray.join(' ')
101
106
  }
102
107
 
103
- const footerItemClick = (
104
- e: Event,
105
- title: string,
106
- link: string,
107
- target: CtaTarget = '_self',
108
- itemLink: boolean,
109
- emitType: EmitType
110
- ): void => {
111
- /**
112
- * @e - $event
113
- * @title - menuItems[#].title / title
114
- * @link - menuItems[#].url / logoLink
115
- * @target - menuItems[#].target / logoLinkTaget
116
- * @itemlink - menuItemAsLink / logoAsLink
117
- * @emitType - Non prop value type EmitType
118
- */
119
- !itemLink && e.preventDefault()
108
+ const handleTitleClick = (e: Event) => {
109
+ const { logoAsLink, logoLink, logoLinkTarget } = props
110
+ !logoAsLink && e.preventDefault()
111
+ emit('logo-click', e, logoLink, logoLinkTarget)
112
+ }
120
113
 
121
- const eventObj: MenuItemEvent = {
122
- event: e,
123
- title,
124
- link,
125
- target: target ? target : '_self',
126
- }
127
- if (emitType === 'menu') {
128
- emit('menu-click', eventObj)
129
- }
130
- if (emitType === 'logo') {
131
- emit('logo-click', eventObj)
132
- }
133
- if (emitType === 'secondary') {
134
- emit('secondary-menu-click', eventObj)
135
- }
114
+ const handleMenuItemClick = (e: Event, item: MenuItemType) => {
115
+ const { menuItemAsLink } = props
116
+ !menuItemAsLink && e.preventDefault()
117
+ emit('menu-click', e, item)
136
118
  }
137
119
  </script>
138
120
 
@@ -152,16 +134,7 @@ const footerItemClick = (
152
134
  :target="logoLinkTarget"
153
135
  class="h-full inline-block outline-none focus:ring-2 ring-offset-2 ring-offset-transparent rounded-md transition-all duration-300 ease-linear"
154
136
  :class="generateClass('RINGCOLOR', titleColor)"
155
- @click="
156
- footerItemClick(
157
- $event,
158
- title,
159
- logoLink,
160
- logoLinkTarget,
161
- logoAsLink,
162
- 'logo'
163
- )
164
- "
137
+ @click="handleTitleClick($event)"
165
138
  >
166
139
  <img class="inline-block h-full" :src="logo" :alt="logoAlt" />
167
140
  </a>
@@ -206,21 +179,12 @@ const footerItemClick = (
206
179
  >
207
180
  <a
208
181
  :href="item.url"
209
- :target="item.target"
182
+ :target="item.target ? item.target : '_self'"
210
183
  class="tracking-wide outline-none nav__text"
211
184
  :class="
212
185
  getMenuItemClass(menuTextSize, menuTextColor, menuTextBold)
213
186
  "
214
- @click="
215
- footerItemClick(
216
- $event,
217
- item.title,
218
- item.url,
219
- item.target,
220
- menuItemAsLink,
221
- 'menu'
222
- )
223
- "
187
+ @click="handleMenuItemClick($event, item)"
224
188
  v-html="item.title"
225
189
  >
226
190
  </a>
@@ -244,21 +208,12 @@ const footerItemClick = (
244
208
  >
245
209
  <a
246
210
  :href="item.url"
247
- :target="item.target"
211
+ :target="item.target ? item.target : '_self'"
248
212
  class="tracking-wide outline-none nav__text"
249
213
  :class="
250
214
  getMenuItemClass(menuTextSize, menuTextColor, menuTextBold)
251
215
  "
252
- @click="
253
- footerItemClick(
254
- $event,
255
- item.title,
256
- item.url,
257
- item.target,
258
- menuItemAsLink,
259
- 'secondary'
260
- )
261
- "
216
+ @click="handleMenuItemClick($event, item)"
262
217
  v-html="item.title"
263
218
  >
264
219
  </a>
@@ -41,9 +41,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
41
41
  borderTopColor: string;
42
42
  headlineColor: string;
43
43
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
- "menu-click": (...args: any[]) => void;
45
- "logo-click": (...args: any[]) => void;
46
- "secondary-menu-click": (...args: any[]) => void;
44
+ "logo-click": (event: Event, link: string, target: CtaTarget) => void;
45
+ "menu-click": (event: Event, item: MenuItemType) => void;
47
46
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
48
47
  title: string;
49
48
  titleSize?: HeadingSize | undefined;
@@ -85,10 +84,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
85
84
  borderTopColor: string;
86
85
  headlineColor: string;
87
86
  }>>> & {
88
- "onMenu-click"?: ((...args: any[]) => any) | undefined;
89
- "onLogo-click"?: ((...args: any[]) => any) | undefined;
90
- "onSecondary-menu-click"?: ((...args: any[]) => any) | undefined;
87
+ "onLogo-click"?: ((event: Event, link: string, target: CtaTarget) => any) | undefined;
88
+ "onMenu-click"?: ((event: Event, item: MenuItemType) => any) | undefined;
91
89
  }, {
90
+ bgColor: ColorPalette;
92
91
  titleColor: ColorPalette;
93
92
  titleSize: HeadingSize;
94
93
  logoAsLink: boolean;
@@ -101,12 +100,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
101
100
  menuTextBold: boolean;
102
101
  displayHighlight: boolean;
103
102
  highlightColor: ColorPalette;
104
- bgColor: ColorPalette;
105
103
  borderTopColor: ColorPalette;
106
104
  headlineColor: ColorPalette;
107
- }, {}>, {
108
- default?(_: {}): any;
109
- }>;
105
+ }, {}>, Readonly<{
106
+ default: any;
107
+ }>>;
110
108
  export default _default;
111
109
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
112
110
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -10,9 +10,3 @@ export interface SocialUrl {
10
10
  github?: string;
11
11
  twitter?: string;
12
12
  }
13
- export interface MenuItemEvent {
14
- event: Event;
15
- title: string;
16
- link: string;
17
- target?: CtaTarget;
18
- }
@@ -12,10 +12,3 @@ export interface SocialUrl {
12
12
  github?: string
13
13
  twitter?: string
14
14
  }
15
-
16
- export interface MenuItemEvent {
17
- event: Event
18
- title: string
19
- link: string
20
- target?: CtaTarget
21
- }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bobbykim/mcl-footer",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.ts",
7
7
  "scripts": {
8
- "build": "vue-tsc --project tsconfig.vue.json && tsc"
8
+ "build": "vue-tsc --project tsconfig.vue.json && tsc --project tsconfig.ts.json"
9
9
  },
10
10
  "author": {
11
11
  "name": "Bobby Kim",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@bobbykim/manguito-theme": "^0.15.0"
24
+ "@bobbykim/manguito-theme": "^0.16.0"
25
25
  },
26
- "gitHead": "69d6ee1c4f91a74b226cb46182845201141805fa"
26
+ "gitHead": "5b81953e5108fd166c0b89ebc6a24e6de9499635"
27
27
  }
package/tsconfig.json CHANGED
@@ -1,9 +1,5 @@
1
1
  {
2
- "extends": "../../../tsconfig.json",
3
- "include": ["./**/*.ts"],
4
- "exclude": ["node_modules", "./**/*.vue.d.ts", "./**/*.vue"],
5
- "compilerOptions": {
6
- "skipLibCheck": true,
7
- "declaration": true
8
- }
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["./**/*.ts", "./**/*.vue"],
4
+ "exclude": ["node_modules", "./**/*.vue.d.ts"]
9
5
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["./**/*.ts"],
4
+ "exclude": ["node_modules", "./**/*.vue.d.ts", "./**/*.vue"],
5
+ "compilerOptions": {
6
+ "skipLibCheck": true,
7
+ "declaration": true
8
+ }
9
+ }