@bobbykim/manguito-theme 0.6.0 → 0.8.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 +12 -0
- package/index.d.ts +13 -0
- package/index.js +30 -0
- package/lib/collapse/Collapse.vue +46 -15
- package/lib/collapse/Collapse.vue.d.ts +46 -0
- package/lib/collapse/index.types.d.ts +3 -0
- package/lib/collapse/index.types.js +1 -0
- package/lib/collapse/index.types.ts +1 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/index.js +1 -0
- package/lib/composables/index.ts +1 -0
- package/lib/composables/observeVisible.d.ts +1 -0
- package/lib/composables/observeVisible.js +24 -0
- package/lib/composables/observeVisible.ts +24 -0
- package/lib/directives/index.d.ts +6 -0
- package/lib/directives/index.js +215 -0
- package/lib/directives/index.ts +57 -5
- package/lib/directives/index.types.d.ts +14 -0
- package/lib/directives/index.types.js +1 -0
- package/lib/dropdown/DropdownContainer.vue.d.ts +19 -0
- package/lib/dropdown/DropdownContent.vue.d.ts +23 -0
- package/lib/dropdown/index.types.d.ts +4 -0
- package/lib/dropdown/index.types.js +1 -0
- package/lib/modal/Modal.vue +47 -10
- package/lib/modal/Modal.vue.d.ts +112 -0
- package/lib/nav/HamburgerMenu.vue +1 -1
- package/lib/nav/HamburgerMenu.vue.d.ts +44 -0
- package/lib/sidebar/Sidebar.vue +45 -8
- package/lib/sidebar/Sidebar.vue.d.ts +121 -0
- package/lib/tooltip/index.d.ts +62 -0
- package/lib/tooltip/index.js +71 -0
- package/package.json +5 -2
- package/theme/index.d.ts +94 -0
- package/theme/index.js +631 -0
- package/theme/theme.d.ts +88 -0
- package/theme/theme.js +831 -0
- package/theme/theme.types.d.ts +21 -0
- package/theme/theme.types.js +1 -0
- package/tsconfig.json +12 -0
- package/tsconfig.vue.json +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/modal/Modal.vue
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ref,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
Transition,
|
|
7
|
+
onMounted,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
} from 'vue'
|
|
3
10
|
import generateClass, {
|
|
4
11
|
ColorPalette,
|
|
5
12
|
vClickOutside,
|
|
6
13
|
VerticalAlignment,
|
|
7
14
|
} from '../../'
|
|
15
|
+
import { observeVisibleAttr } from '../composables'
|
|
8
16
|
|
|
9
17
|
const props = withDefaults(
|
|
10
18
|
defineProps<{
|
|
11
|
-
modalId: string
|
|
12
19
|
title?: string
|
|
13
20
|
titleColor?: ColorPalette
|
|
14
21
|
className?: string
|
|
@@ -31,23 +38,31 @@ const props = withDefaults(
|
|
|
31
38
|
}
|
|
32
39
|
)
|
|
33
40
|
|
|
34
|
-
const emit = defineEmits(['
|
|
41
|
+
const emit = defineEmits(['open', 'close'])
|
|
42
|
+
const modalRef = ref<HTMLElement | undefined>()
|
|
35
43
|
const toggle = ref<boolean>(props.visible)
|
|
36
44
|
const toggleComplete = ref<boolean>(false)
|
|
37
45
|
|
|
38
|
-
const handleToggleEvent = (
|
|
46
|
+
// const handleToggleEvent = (): void => {
|
|
47
|
+
// toggle.value = !toggle.value
|
|
48
|
+
// }
|
|
49
|
+
const toggleModal = (): void => {
|
|
39
50
|
toggle.value = !toggle.value
|
|
40
|
-
emit('toggle', e)
|
|
41
51
|
}
|
|
42
52
|
const openModal = (): void => {
|
|
43
53
|
toggle.value = true
|
|
44
54
|
}
|
|
45
|
-
const closeModal = (
|
|
55
|
+
const closeModal = (): void => {
|
|
46
56
|
if (toggleComplete.value === true) {
|
|
47
57
|
toggle.value = false
|
|
48
|
-
emit('close', e)
|
|
49
58
|
}
|
|
50
59
|
}
|
|
60
|
+
const emitOpenEvent = () => {
|
|
61
|
+
emit('open', { visible: true })
|
|
62
|
+
}
|
|
63
|
+
const emitCloseEvent = () => {
|
|
64
|
+
emit('close', { visible: false })
|
|
65
|
+
}
|
|
51
66
|
const handlePlacementVar = computed(() => {
|
|
52
67
|
let placementVariable: number
|
|
53
68
|
if (props.placement === 'top') {
|
|
@@ -70,22 +85,44 @@ const onAfterEnter = () => {
|
|
|
70
85
|
const onAfterLeave = () => {
|
|
71
86
|
toggleComplete.value = false
|
|
72
87
|
}
|
|
88
|
+
|
|
89
|
+
// set nutation observer watching `visible` attribute in element
|
|
90
|
+
const handleVisibility = (visible: boolean = false) => {
|
|
91
|
+
toggle.value = visible
|
|
92
|
+
}
|
|
93
|
+
const observer = observeVisibleAttr(handleVisibility)
|
|
94
|
+
|
|
73
95
|
watch(
|
|
74
96
|
() => props.visible,
|
|
75
97
|
(newValue) => {
|
|
76
98
|
toggle.value = newValue
|
|
77
99
|
}
|
|
78
100
|
)
|
|
101
|
+
watch(toggle, (newValue) => {
|
|
102
|
+
if (newValue === true) {
|
|
103
|
+
emitOpenEvent()
|
|
104
|
+
} else if (newValue === false && toggleComplete.value === true) {
|
|
105
|
+
emitCloseEvent()
|
|
106
|
+
}
|
|
107
|
+
})
|
|
79
108
|
defineExpose({
|
|
80
|
-
toggle:
|
|
109
|
+
toggle: toggleModal,
|
|
81
110
|
close: closeModal,
|
|
82
111
|
open: openModal,
|
|
83
112
|
})
|
|
113
|
+
onMounted(() => {
|
|
114
|
+
if (modalRef.value) {
|
|
115
|
+
observer.observe(modalRef.value, { attributes: true })
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
onBeforeUnmount(() => {
|
|
119
|
+
observer.disconnect()
|
|
120
|
+
})
|
|
84
121
|
</script>
|
|
85
122
|
|
|
86
123
|
<template>
|
|
87
|
-
<div :style="handlePlacementVar">
|
|
88
|
-
<button :id="modalId" @click="handleToggleEvent" class="hidden"></button>
|
|
124
|
+
<div :style="handlePlacementVar" :visible="toggle" ref="modalRef">
|
|
125
|
+
<!-- <button :id="modalId" @click="handleToggleEvent" class="hidden"></button> -->
|
|
89
126
|
<Transition name="fade" appear tag="div" v-if="!noBackdrop">
|
|
90
127
|
<section
|
|
91
128
|
v-if="toggle"
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ColorPalette, VerticalAlignment } from '../../';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
visible: {
|
|
4
|
+
type: import("vue").PropType<boolean>;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
className: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
title: {
|
|
12
|
+
type: import("vue").PropType<string>;
|
|
13
|
+
};
|
|
14
|
+
titleColor: {
|
|
15
|
+
type: import("vue").PropType<ColorPalette>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
noBackdrop: {
|
|
19
|
+
type: import("vue").PropType<boolean>;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
noHeader: {
|
|
23
|
+
type: import("vue").PropType<boolean>;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: import("vue").PropType<ColorPalette>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
backdropColor: {
|
|
31
|
+
type: import("vue").PropType<ColorPalette>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
placement: {
|
|
35
|
+
type: import("vue").PropType<VerticalAlignment>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
toggle: () => void;
|
|
40
|
+
close: () => void;
|
|
41
|
+
open: () => void;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
open: (...args: any[]) => void;
|
|
44
|
+
close: (...args: any[]) => void;
|
|
45
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
46
|
+
visible: {
|
|
47
|
+
type: import("vue").PropType<boolean>;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
className: {
|
|
51
|
+
type: import("vue").PropType<string>;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
title: {
|
|
55
|
+
type: import("vue").PropType<string>;
|
|
56
|
+
};
|
|
57
|
+
titleColor: {
|
|
58
|
+
type: import("vue").PropType<ColorPalette>;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
noBackdrop: {
|
|
62
|
+
type: import("vue").PropType<boolean>;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
noHeader: {
|
|
66
|
+
type: import("vue").PropType<boolean>;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
color: {
|
|
70
|
+
type: import("vue").PropType<ColorPalette>;
|
|
71
|
+
default: string;
|
|
72
|
+
};
|
|
73
|
+
backdropColor: {
|
|
74
|
+
type: import("vue").PropType<ColorPalette>;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
placement: {
|
|
78
|
+
type: import("vue").PropType<VerticalAlignment>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
}>> & {
|
|
82
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
visible: boolean;
|
|
86
|
+
className: string;
|
|
87
|
+
titleColor: ColorPalette;
|
|
88
|
+
noBackdrop: boolean;
|
|
89
|
+
noHeader: boolean;
|
|
90
|
+
color: ColorPalette;
|
|
91
|
+
backdropColor: ColorPalette;
|
|
92
|
+
placement: VerticalAlignment;
|
|
93
|
+
}, {}>, {
|
|
94
|
+
header?(_: {
|
|
95
|
+
close: () => void;
|
|
96
|
+
status: true;
|
|
97
|
+
}): any;
|
|
98
|
+
body?(_: {
|
|
99
|
+
close: () => void;
|
|
100
|
+
status: true;
|
|
101
|
+
}): any;
|
|
102
|
+
footer?(_: {
|
|
103
|
+
close: () => void;
|
|
104
|
+
status: true;
|
|
105
|
+
}): any;
|
|
106
|
+
}>;
|
|
107
|
+
export default _default;
|
|
108
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ColorPalette } from '../../';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
toggle: {
|
|
4
|
+
type: import("vue").PropType<boolean>;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
color: {
|
|
8
|
+
type: import("vue").PropType<ColorPalette>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
displayBorder: {
|
|
12
|
+
type: import("vue").PropType<boolean>;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
navColor: {
|
|
16
|
+
type: import("vue").PropType<ColorPalette>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"hbg-click": (...args: any[]) => void;
|
|
21
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
toggle: {
|
|
23
|
+
type: import("vue").PropType<boolean>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: import("vue").PropType<ColorPalette>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
displayBorder: {
|
|
31
|
+
type: import("vue").PropType<boolean>;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
navColor: {
|
|
35
|
+
type: import("vue").PropType<ColorPalette>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
}>> & {
|
|
39
|
+
"onHbg-click"?: ((...args: any[]) => any) | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
color: ColorPalette;
|
|
42
|
+
displayBorder: boolean;
|
|
43
|
+
}, {}>;
|
|
44
|
+
export default _default;
|
package/lib/sidebar/Sidebar.vue
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ref,
|
|
4
|
+
computed,
|
|
5
|
+
watch,
|
|
6
|
+
Transition,
|
|
7
|
+
onMounted,
|
|
8
|
+
onBeforeUnmount,
|
|
9
|
+
} from 'vue'
|
|
3
10
|
import generateClass, { ColorPalette, vClickOutside, DirectionX } from '../../'
|
|
11
|
+
import { observeVisibleAttr } from '../composables'
|
|
4
12
|
|
|
5
13
|
const props = withDefaults(
|
|
6
14
|
defineProps<{
|
|
7
|
-
sidebarId: string
|
|
8
15
|
title?: string
|
|
9
16
|
titleColor?: ColorPalette
|
|
10
17
|
className?: string
|
|
@@ -29,15 +36,18 @@ const props = withDefaults(
|
|
|
29
36
|
}
|
|
30
37
|
)
|
|
31
38
|
|
|
32
|
-
const emit = defineEmits(['
|
|
39
|
+
const emit = defineEmits(['open', 'close'])
|
|
33
40
|
const toggle = ref<boolean>(props.visible)
|
|
34
41
|
const toggleComplete = ref<boolean>(false)
|
|
42
|
+
const sidebarRef = ref<HTMLElement | undefined>()
|
|
35
43
|
const headerRef = ref<HTMLElement>()
|
|
36
44
|
const footerRef = ref<HTMLElement>()
|
|
37
45
|
|
|
38
46
|
const handleToggleEvent = (e: Event): void => {
|
|
39
47
|
toggle.value = !toggle.value
|
|
40
|
-
|
|
48
|
+
}
|
|
49
|
+
const toggleSidebar = (): void => {
|
|
50
|
+
toggle.value = !toggle.value
|
|
41
51
|
}
|
|
42
52
|
const openSidebar = (): void => {
|
|
43
53
|
toggle.value = true
|
|
@@ -45,9 +55,14 @@ const openSidebar = (): void => {
|
|
|
45
55
|
const closeSidebar = (e: Event): void => {
|
|
46
56
|
if (toggleComplete.value === true) {
|
|
47
57
|
toggle.value = false
|
|
48
|
-
emit('close', e)
|
|
49
58
|
}
|
|
50
59
|
}
|
|
60
|
+
const emitOpenEvent = () => {
|
|
61
|
+
emit('open', { visible: true })
|
|
62
|
+
}
|
|
63
|
+
const emitCloseEvent = () => {
|
|
64
|
+
emit('close', { visible: false })
|
|
65
|
+
}
|
|
51
66
|
const handleStyleVariables = computed(() => {
|
|
52
67
|
return {
|
|
53
68
|
'--sidebar-width': `${props.width}px`,
|
|
@@ -75,22 +90,44 @@ const onAfterEnter = () => {
|
|
|
75
90
|
const onAfterLeave = () => {
|
|
76
91
|
toggleComplete.value = false
|
|
77
92
|
}
|
|
93
|
+
|
|
94
|
+
// set nutation observer watching `visible` attribute in element
|
|
95
|
+
const handleVisibility = (visible: boolean = false) => {
|
|
96
|
+
toggle.value = visible
|
|
97
|
+
}
|
|
98
|
+
const observer = observeVisibleAttr(handleVisibility)
|
|
99
|
+
|
|
78
100
|
watch(
|
|
79
101
|
() => props.visible,
|
|
80
102
|
(newValue) => {
|
|
81
103
|
toggle.value = newValue
|
|
82
104
|
}
|
|
83
105
|
)
|
|
106
|
+
watch(toggle, (newValue) => {
|
|
107
|
+
if (newValue === true) {
|
|
108
|
+
emitOpenEvent()
|
|
109
|
+
} else if (newValue === false && toggleComplete.value === true) {
|
|
110
|
+
emitCloseEvent()
|
|
111
|
+
}
|
|
112
|
+
})
|
|
84
113
|
defineExpose({
|
|
85
|
-
toggle:
|
|
114
|
+
toggle: toggleSidebar,
|
|
86
115
|
open: openSidebar,
|
|
87
116
|
close: closeSidebar,
|
|
88
117
|
})
|
|
118
|
+
onMounted(() => {
|
|
119
|
+
if (sidebarRef.value) {
|
|
120
|
+
observer.observe(sidebarRef.value, { attributes: true })
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
onBeforeUnmount(() => {
|
|
124
|
+
observer.disconnect()
|
|
125
|
+
})
|
|
89
126
|
</script>
|
|
90
127
|
|
|
91
128
|
<template>
|
|
92
|
-
<div :style="handleStyleVariables">
|
|
93
|
-
<button :id="sidebarId" @click="handleToggleEvent" class="hidden"></button>
|
|
129
|
+
<div :style="handleStyleVariables" :visible="toggle" ref="sidebarRef">
|
|
130
|
+
<!-- <button :id="sidebarId" @click="handleToggleEvent" class="hidden"></button> -->
|
|
94
131
|
<Transition name="fade" appear tag="div" v-if="!noBackdrop">
|
|
95
132
|
<section
|
|
96
133
|
v-if="toggle"
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ColorPalette, DirectionX } from '../../';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
|
+
visible: {
|
|
4
|
+
type: import("vue").PropType<boolean>;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
className: {
|
|
8
|
+
type: import("vue").PropType<string>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
title: {
|
|
12
|
+
type: import("vue").PropType<string>;
|
|
13
|
+
};
|
|
14
|
+
titleColor: {
|
|
15
|
+
type: import("vue").PropType<ColorPalette>;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
noBackdrop: {
|
|
19
|
+
type: import("vue").PropType<boolean>;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
noHeader: {
|
|
23
|
+
type: import("vue").PropType<boolean>;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: import("vue").PropType<ColorPalette>;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
backdropColor: {
|
|
31
|
+
type: import("vue").PropType<ColorPalette>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
placement: {
|
|
35
|
+
type: import("vue").PropType<DirectionX>;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
width: {
|
|
39
|
+
type: import("vue").PropType<string | number>;
|
|
40
|
+
default: number;
|
|
41
|
+
};
|
|
42
|
+
}, {
|
|
43
|
+
toggle: () => void;
|
|
44
|
+
open: () => void;
|
|
45
|
+
close: (e: Event) => void;
|
|
46
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
47
|
+
open: (...args: any[]) => void;
|
|
48
|
+
close: (...args: any[]) => void;
|
|
49
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
+
visible: {
|
|
51
|
+
type: import("vue").PropType<boolean>;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
className: {
|
|
55
|
+
type: import("vue").PropType<string>;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
title: {
|
|
59
|
+
type: import("vue").PropType<string>;
|
|
60
|
+
};
|
|
61
|
+
titleColor: {
|
|
62
|
+
type: import("vue").PropType<ColorPalette>;
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
noBackdrop: {
|
|
66
|
+
type: import("vue").PropType<boolean>;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
noHeader: {
|
|
70
|
+
type: import("vue").PropType<boolean>;
|
|
71
|
+
default: boolean;
|
|
72
|
+
};
|
|
73
|
+
color: {
|
|
74
|
+
type: import("vue").PropType<ColorPalette>;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
77
|
+
backdropColor: {
|
|
78
|
+
type: import("vue").PropType<ColorPalette>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
placement: {
|
|
82
|
+
type: import("vue").PropType<DirectionX>;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
width: {
|
|
86
|
+
type: import("vue").PropType<string | number>;
|
|
87
|
+
default: number;
|
|
88
|
+
};
|
|
89
|
+
}>> & {
|
|
90
|
+
onOpen?: ((...args: any[]) => any) | undefined;
|
|
91
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
visible: boolean;
|
|
94
|
+
className: string;
|
|
95
|
+
titleColor: ColorPalette;
|
|
96
|
+
noBackdrop: boolean;
|
|
97
|
+
noHeader: boolean;
|
|
98
|
+
color: ColorPalette;
|
|
99
|
+
backdropColor: ColorPalette;
|
|
100
|
+
placement: DirectionX;
|
|
101
|
+
width: string | number;
|
|
102
|
+
}, {}>, {
|
|
103
|
+
header?(_: {
|
|
104
|
+
close: (e: Event) => void;
|
|
105
|
+
status: true;
|
|
106
|
+
}): any;
|
|
107
|
+
body?(_: {
|
|
108
|
+
close: (e: Event) => void;
|
|
109
|
+
status: true;
|
|
110
|
+
}): any;
|
|
111
|
+
footer?(_: {
|
|
112
|
+
close: (e: Event) => void;
|
|
113
|
+
status: true;
|
|
114
|
+
}): any;
|
|
115
|
+
}>;
|
|
116
|
+
export default _default;
|
|
117
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
118
|
+
new (): {
|
|
119
|
+
$slots: S;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import type { Direction, ColorPalette } from '../../';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
direction: {
|
|
5
|
+
type: PropType<Direction>;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
color: {
|
|
9
|
+
type: PropType<ColorPalette>;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
textColor: {
|
|
13
|
+
type: PropType<ColorPalette>;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
width: {
|
|
17
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
customClass: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
title: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
direction: {
|
|
32
|
+
type: PropType<Direction>;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
color: {
|
|
36
|
+
type: PropType<ColorPalette>;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
textColor: {
|
|
40
|
+
type: PropType<ColorPalette>;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
width: {
|
|
44
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
customClass: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
title: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
}>>, {
|
|
56
|
+
direction: Direction;
|
|
57
|
+
color: ColorPalette;
|
|
58
|
+
textColor: ColorPalette;
|
|
59
|
+
width: string | number;
|
|
60
|
+
customClass: string;
|
|
61
|
+
}, {}>;
|
|
62
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent, h, computed } from 'vue';
|
|
2
|
+
import generateClass from '../../';
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
direction: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'right',
|
|
8
|
+
},
|
|
9
|
+
color: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: 'dark-3',
|
|
12
|
+
},
|
|
13
|
+
textColor: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'white',
|
|
16
|
+
},
|
|
17
|
+
width: {
|
|
18
|
+
type: [Number, String],
|
|
19
|
+
default: 80,
|
|
20
|
+
},
|
|
21
|
+
customClass: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
},
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
setup(props) {
|
|
31
|
+
const defaultClassList = 'invisible opacity-0 group-hover:visible group-hover:opacity-100 z-[100] tooltip';
|
|
32
|
+
const colorClass = computed(() => {
|
|
33
|
+
/**
|
|
34
|
+
* @param {ColorPalette} color - props
|
|
35
|
+
* @param {ColorPalette} textolor - props
|
|
36
|
+
*/
|
|
37
|
+
const { color, textColor } = props;
|
|
38
|
+
const classArray = [
|
|
39
|
+
generateClass('BGCOLOR', color),
|
|
40
|
+
generateClass('TEXTCOLOR', textColor),
|
|
41
|
+
];
|
|
42
|
+
return classArray.join(' ');
|
|
43
|
+
});
|
|
44
|
+
const tooltipWidth = computed(() => {
|
|
45
|
+
return { width: `${props.width}px` };
|
|
46
|
+
});
|
|
47
|
+
const tooltipDirection = computed(() => {
|
|
48
|
+
switch (props.direction) {
|
|
49
|
+
case 'left':
|
|
50
|
+
return 'tooltip-left';
|
|
51
|
+
case 'top':
|
|
52
|
+
return 'tooltip-top';
|
|
53
|
+
case 'bottom':
|
|
54
|
+
return 'tooltip-bottom';
|
|
55
|
+
default:
|
|
56
|
+
return 'tooltip-right';
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return () => h('div', {
|
|
60
|
+
class: [
|
|
61
|
+
defaultClassList,
|
|
62
|
+
props.customClass,
|
|
63
|
+
tooltipDirection.value,
|
|
64
|
+
colorClass.value,
|
|
65
|
+
],
|
|
66
|
+
role: 'tooltip',
|
|
67
|
+
innerHTML: props.title,
|
|
68
|
+
style: [tooltipWidth.value],
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "main theme file for manguito components library. Other MCL components will need to import this file to run.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "vue-tsc --project tsconfig.vue.json && tsc"
|
|
12
|
+
},
|
|
10
13
|
"author": {
|
|
11
14
|
"name": "Bobby Kim",
|
|
12
15
|
"url": "https://www.devbobbykim.com/"
|
|
@@ -17,5 +20,5 @@
|
|
|
17
20
|
"url": "https://github.com/bobbykim89/manguito-component-library.git"
|
|
18
21
|
},
|
|
19
22
|
"license": "MIT",
|
|
20
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "97c70699ec57726f77f021927b61f83715847f33"
|
|
21
24
|
}
|