@bobbykim/mcl-collapse 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-collapse@0.3.0...@bobbykim/mcl-collapse@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-collapse@0.2.0...@bobbykim/mcl-collapse@0.3.0) (2024-02-27)
7
19
 
8
20
 
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { ref, watch } from 'vue'
3
- import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
4
- import type { CollapseEvent } from '@bobbykim/manguito-theme'
5
2
  import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
3
+ import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
4
+ import { ref, watch } from 'vue'
6
5
 
7
6
  const props = withDefaults(
8
7
  defineProps<{
@@ -35,14 +34,22 @@ const props = withDefaults(
35
34
  )
36
35
 
37
36
  const toggle = ref(props.visible)
38
- const emit = defineEmits(['collapse-open', 'collapse-close'])
37
+ const slots = defineSlots<{
38
+ content: any
39
+ tab: any
40
+ }>()
41
+ const emit = defineEmits<{
42
+ (e: 'collapse-open', visible: boolean, title: string): void
43
+ (e: 'collapse-close', visible: boolean, title: string): void
44
+ }>()
39
45
 
40
- const toggleAction = (e: CollapseEvent): void => {
41
- toggle.value = e.visible
42
- if (e.visible === true) {
43
- emit('collapse-open', { ...e, title: props.title })
46
+ const toggleAction = (visible: boolean): void => {
47
+ const { title } = props
48
+ toggle.value = visible
49
+ if (visible === true) {
50
+ emit('collapse-open', visible, title)
44
51
  } else {
45
- emit('collapse-close', { ...e, title: props.title })
52
+ emit('collapse-close', visible, title)
46
53
  }
47
54
  }
48
55
 
@@ -111,7 +118,7 @@ watch(
111
118
  <h3 :class="getTitleClass(titleSize, titleColor)">
112
119
  {{ title }}
113
120
  </h3>
114
- <div @click.stop class="cursor-default">
121
+ <div @click.stop class="cursor-default" v-if="slots['tab']">
115
122
  <slot name="tab"></slot>
116
123
  </div>
117
124
  </div>
@@ -154,5 +161,3 @@ watch(
154
161
  </div>
155
162
  </div>
156
163
  </template>
157
-
158
- <style lang="scss" scoped></style>
@@ -25,8 +25,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
25
25
  bgColor: string;
26
26
  slotBgColor: string;
27
27
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
- "collapse-open": (...args: any[]) => void;
29
- "collapse-close": (...args: any[]) => void;
28
+ "collapse-open": (visible: boolean, title: string) => void;
29
+ "collapse-close": (visible: boolean, title: string) => void;
30
30
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
31
31
  collapseId: string;
32
32
  borderColor?: ColorPalette | undefined;
@@ -53,10 +53,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
53
53
  bgColor: string;
54
54
  slotBgColor: string;
55
55
  }>>> & {
56
- "onCollapse-open"?: ((...args: any[]) => any) | undefined;
57
- "onCollapse-close"?: ((...args: any[]) => any) | undefined;
56
+ "onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
57
+ "onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
58
58
  }, {
59
59
  visible: boolean;
60
+ bgColor: ColorPalette;
60
61
  titleColor: ColorPalette;
61
62
  borderColor: ColorPalette;
62
63
  rounded: boolean;
@@ -64,12 +65,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
64
65
  highlightColor: ColorPalette;
65
66
  titleSize: HeadingSize;
66
67
  iconColor: ColorPalette;
67
- bgColor: ColorPalette;
68
68
  slotBgColor: ColorPalette;
69
- }, {}>, {
70
- tab?(_: {}): any;
71
- content?(_: {}): any;
72
- }>;
69
+ }, {}>, Readonly<{
70
+ content: any;
71
+ tab: any;
72
+ }>>;
73
73
  export default _default;
74
74
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
75
75
  type __VLS_TypePropsToRuntimeProps<T> = {
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { ref, watch } from 'vue'
3
- import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
4
- import type { CollapseEvent } from '@bobbykim/manguito-theme'
5
2
  import type { ColorPalette, HeadingSize } from '@bobbykim/manguito-theme'
3
+ import generateClass, { Collapse, vCollapse } from '@bobbykim/manguito-theme'
4
+ import { ref, watch } from 'vue'
6
5
 
7
6
  const props = withDefaults(
8
7
  defineProps<{
@@ -32,15 +31,22 @@ const props = withDefaults(
32
31
  }
33
32
  )
34
33
 
34
+ const slots = defineSlots<{
35
+ default: any
36
+ }>()
35
37
  const toggle = ref(props.visible)
36
- const emit = defineEmits(['collapse-open', 'collapse-close'])
38
+ const emit = defineEmits<{
39
+ (e: 'collapse-open', visible: boolean, title: string): void
40
+ (e: 'collapse-close', visible: boolean, title: string): void
41
+ }>()
37
42
 
38
- const toggleAction = (e: CollapseEvent): void => {
39
- toggle.value = e.visible
40
- if (e.visible === true) {
41
- emit('collapse-open', { ...e, title: props.title })
43
+ const toggleAction = (visible: boolean): void => {
44
+ const { title } = props
45
+ toggle.value = visible
46
+ if (visible === true) {
47
+ emit('collapse-open', visible, title)
42
48
  } else {
43
- emit('collapse-close', { ...e, title: props.title })
49
+ emit('collapse-close', visible, title)
44
50
  }
45
51
  }
46
52
 
@@ -141,5 +147,3 @@ watch(
141
147
  </div>
142
148
  </div>
143
149
  </template>
144
-
145
- <style lang="scss" scoped></style>
@@ -23,8 +23,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
23
23
  displayShadow: boolean;
24
24
  visible: boolean;
25
25
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
- "collapse-open": (...args: any[]) => void;
27
- "collapse-close": (...args: any[]) => void;
26
+ "collapse-open": (visible: boolean, title: string) => void;
27
+ "collapse-close": (visible: boolean, title: string) => void;
28
28
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
29
29
  collapseId: string;
30
30
  title: string;
@@ -49,21 +49,21 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
49
49
  displayShadow: boolean;
50
50
  visible: boolean;
51
51
  }>>> & {
52
- "onCollapse-open"?: ((...args: any[]) => any) | undefined;
53
- "onCollapse-close"?: ((...args: any[]) => any) | undefined;
52
+ "onCollapse-open"?: ((visible: boolean, title: string) => any) | undefined;
53
+ "onCollapse-close"?: ((visible: boolean, title: string) => any) | undefined;
54
54
  }, {
55
55
  visible: boolean;
56
+ bgColor: ColorPalette;
56
57
  titleColor: ColorPalette;
57
58
  borderColor: ColorPalette;
58
59
  rounded: boolean;
59
60
  titleSize: HeadingSize;
60
61
  iconColor: ColorPalette;
61
- bgColor: ColorPalette;
62
62
  btnColor: ColorPalette;
63
63
  displayShadow: boolean;
64
- }, {}>, {
65
- default?(_: {}): any;
66
- }>;
64
+ }, {}>, Readonly<{
65
+ default: any;
66
+ }>>;
67
67
  export default _default;
68
68
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
69
69
  type __VLS_TypePropsToRuntimeProps<T> = {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bobbykim/mcl-collapse",
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
+ }