@tak-ps/vue-tabler 4.28.0 → 4.29.1
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 +8 -0
- package/components/Badge.vue +27 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/components/Badge.vue
CHANGED
|
@@ -13,13 +13,25 @@ import { computed } from 'vue';
|
|
|
13
13
|
export interface BadgeProps {
|
|
14
14
|
backgroundColor?: string;
|
|
15
15
|
borderColor?: string;
|
|
16
|
+
borderStyle?: string;
|
|
17
|
+
borderWidth?: string;
|
|
16
18
|
textColor?: string;
|
|
19
|
+
hoverBackgroundColor?: string;
|
|
20
|
+
hoverBorderColor?: string;
|
|
21
|
+
hoverBorderStyle?: string;
|
|
22
|
+
hoverTextColor?: string;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
const props = withDefaults(defineProps<BadgeProps>(), {
|
|
20
26
|
backgroundColor: 'rgba(34, 197, 94, 0.2)',
|
|
21
27
|
borderColor: undefined,
|
|
28
|
+
borderStyle: 'solid',
|
|
29
|
+
borderWidth: '1px',
|
|
22
30
|
textColor: '#ffffff',
|
|
31
|
+
hoverBackgroundColor: undefined,
|
|
32
|
+
hoverBorderColor: undefined,
|
|
33
|
+
hoverBorderStyle: undefined,
|
|
34
|
+
hoverTextColor: undefined,
|
|
23
35
|
});
|
|
24
36
|
|
|
25
37
|
type ParsedColor = {
|
|
@@ -123,14 +135,26 @@ const badgeStyle = computed(() => {
|
|
|
123
135
|
return {
|
|
124
136
|
backgroundColor: props.backgroundColor,
|
|
125
137
|
borderColor: resolvedBorderColor.value,
|
|
138
|
+
borderStyle: props.borderStyle,
|
|
139
|
+
borderWidth: props.borderWidth,
|
|
126
140
|
color: props.textColor,
|
|
141
|
+
'--badge-hover-bg': props.hoverBackgroundColor ?? props.backgroundColor,
|
|
142
|
+
'--badge-hover-border': props.hoverBorderColor ?? resolvedBorderColor.value,
|
|
143
|
+
'--badge-hover-border-style': props.hoverBorderStyle ?? props.borderStyle,
|
|
144
|
+
'--badge-hover-text': props.hoverTextColor ?? props.textColor,
|
|
127
145
|
};
|
|
128
146
|
});
|
|
129
147
|
</script>
|
|
130
148
|
|
|
131
149
|
<style scoped>
|
|
132
150
|
.tabler-badge {
|
|
133
|
-
border-
|
|
134
|
-
border-width: 1px;
|
|
151
|
+
transition: background-color 0.15s, border-color 0.15s, color 0.15s;
|
|
135
152
|
}
|
|
136
|
-
|
|
153
|
+
|
|
154
|
+
.tabler-badge:hover {
|
|
155
|
+
background-color: var(--badge-hover-bg) !important;
|
|
156
|
+
border-color: var(--badge-hover-border) !important;
|
|
157
|
+
border-style: var(--badge-hover-border-style) !important;
|
|
158
|
+
color: var(--badge-hover-text) !important;
|
|
159
|
+
}
|
|
160
|
+
</style>
|