@mc-markets/ui 1.0.86 → 1.0.90
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/README.md +40 -141
- package/dist/404.html +22 -22
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +5 -13
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts.map +1 -1
- package/dist/components/Breadcrumb/BreadcrumbSeparator.vue.d.ts +3 -0
- package/dist/components/Breadcrumb/BreadcrumbSeparator.vue.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.vue.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/TabCard/TabCard.vue.d.ts.map +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +2 -0
- package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +605 -661
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/packages/components/Alert/Alert.vue +139 -139
- package/packages/components/Banner/Banner.vue +299 -299
- package/packages/components/Breadcrumb/Breadcrumb.vue +113 -77
- package/packages/components/Breadcrumb/BreadcrumbSeparator.vue +31 -0
- package/packages/components/Button/Button.vue +17 -17
- package/packages/components/DatePicker/DatePicker.vue +85 -86
- package/packages/components/Dialog/Dialog.vue +61 -61
- package/packages/components/Empty/Empty.vue +74 -74
- package/packages/components/Form/Form.vue +30 -30
- package/packages/components/FormItem/FormItem.vue +19 -19
- package/packages/components/Icon/Icon.vue +210 -210
- package/packages/components/Input/Input.vue +15 -15
- package/packages/components/Message/Message.vue +503 -503
- package/packages/components/NotifiMessage/NotifiMessage.vue +293 -293
- package/packages/components/Notification/Notification.vue +19 -19
- package/packages/components/Option/Option.vue +13 -13
- package/packages/components/OptionGroup/OptionGroup.vue +13 -13
- package/packages/components/Pagination/Pagination.vue +61 -61
- package/packages/components/Radio/Radio.vue +67 -67
- package/packages/components/RadioButton/RadioButton.vue +110 -110
- package/packages/components/RadioGroup/RadioGroup.vue +155 -155
- package/packages/components/Select/Select.vue +22 -22
- package/packages/components/Switch/Switch.vue +47 -47
- package/packages/components/TabCard/TabCard.vue +107 -177
- package/packages/components/TabCard/TabCardItem.vue +105 -102
- package/packages/components/Table/Table.vue +17 -17
- package/packages/components/Table/TableColumn.vue +20 -20
- package/packages/components/Tabs/TabPane.vue +79 -79
- package/packages/components/Tabs/Tabs.vue +267 -267
- package/packages/components/Tag/Tag.vue +211 -164
- package/packages/components/Tooltip/Tooltip.vue +58 -58
- package/packages/hooks/useClassName.js +23 -23
- package/packages/styles/README.md +129 -129
- package/packages/styles/components/button.scss +121 -121
- package/packages/styles/components/checkbox.scss +18 -18
- package/packages/styles/components/dialog.scss +47 -47
- package/packages/styles/components/form.scss +18 -18
- package/packages/styles/components/input.scss +14 -14
- package/packages/styles/components/select.scss +62 -60
- package/packages/styles/components/table.scss +37 -37
- package/packages/styles/components/tabs.scss +76 -76
- package/packages/styles/components/tag.scss +142 -142
- package/packages/styles/font/iconfont.scss +363 -363
- package/packages/styles/index.scss +94 -94
- package/packages/styles/variables/border-mode.css +6 -6
- package/packages/styles/variables/color-modes-dark.css +143 -143
- package/packages/styles/variables/index.scss +5 -5
- package/packages/styles/variables/primitives-style.css +112 -112
- package/packages/styles/variables/radius-mode.css +14 -14
- package/packages/styles/variables/spacing-mode.css +20 -20
- package/packages/styles/variables/typography-desktop.css +40 -40
- package/packages/styles/variables/typography-mobile.css +40 -40
- package/packages/utils/classNames.js +23 -23
- package/packages/utils/styleUtils.js +105 -105
- package/dist/components/Breadcrumb/BreadcrumbItem.vue.d.ts +0 -17
- package/dist/components/Breadcrumb/BreadcrumbItem.vue.d.ts.map +0 -1
- package/packages/components/Breadcrumb/BreadcrumbItem.vue +0 -142
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 样式工具函数
|
|
3
|
-
* 用于确保组件样式完全覆盖 Element Plus
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 为元素添加高优先级样式类
|
|
8
|
-
* @param {HTMLElement} element - 目标元素
|
|
9
|
-
*/
|
|
10
|
-
export function addOverrideClass(element) {
|
|
11
|
-
if (element && element.classList) {
|
|
12
|
-
element.classList.add('mc-ui-override');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 为 Vue 组件实例添加覆盖样式
|
|
18
|
-
* @param {Object} componentInstance - Vue 组件实例
|
|
19
|
-
*/
|
|
20
|
-
export function addComponentOverride(componentInstance) {
|
|
21
|
-
if (componentInstance && componentInstance.$el) {
|
|
22
|
-
addOverrideClass(componentInstance.$el);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 全局应用样式覆盖
|
|
28
|
-
* 在应用启动时调用,确保所有 Element Plus 组件都被覆盖
|
|
29
|
-
*/
|
|
30
|
-
export function applyGlobalOverride() {
|
|
31
|
-
// 为 body 添加覆盖类
|
|
32
|
-
if (typeof document !== 'undefined') {
|
|
33
|
-
document.body.classList.add('mc-ui-override');
|
|
34
|
-
|
|
35
|
-
// 监听动态添加的 Element Plus 组件
|
|
36
|
-
const observer = new MutationObserver((mutations) => {
|
|
37
|
-
mutations.forEach((mutation) => {
|
|
38
|
-
mutation.addedNodes.forEach((node) => {
|
|
39
|
-
if (node.nodeType === 1 && node.classList) {
|
|
40
|
-
// 为新添加的 Element Plus 组件添加覆盖类
|
|
41
|
-
if (node.className && typeof node.className === 'string' && node.className.includes('el-')) {
|
|
42
|
-
const parent = node.closest('.mc-ui-override') || node.parentElement;
|
|
43
|
-
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
44
|
-
parent.classList.add('mc-ui-override');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// 检查子元素
|
|
49
|
-
const elComponents = node.querySelectorAll('[class*="el-"]');
|
|
50
|
-
elComponents.forEach(el => {
|
|
51
|
-
const parent = el.closest('.mc-ui-override') || el.parentElement;
|
|
52
|
-
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
53
|
-
parent.classList.add('mc-ui-override');
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
observer.observe(document.body, {
|
|
62
|
-
childList: true,
|
|
63
|
-
subtree: true
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 强制刷新组件样式
|
|
70
|
-
* @param {string} selector - CSS 选择器
|
|
71
|
-
*/
|
|
72
|
-
export function forceRefreshStyles(selector = '[class*="el-"]') {
|
|
73
|
-
if (typeof document !== 'undefined') {
|
|
74
|
-
const elements = document.querySelectorAll(selector);
|
|
75
|
-
elements.forEach(el => {
|
|
76
|
-
const parent = el.closest('.mc-ui-override') || el.parentElement;
|
|
77
|
-
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
78
|
-
parent.classList.add('mc-ui-override');
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 创建带有样式覆盖的 Element Plus 组件配置
|
|
86
|
-
* @param {Object} componentConfig - 组件配置
|
|
87
|
-
* @returns {Object} 增强后的组件配置
|
|
88
|
-
*/
|
|
89
|
-
export function createOverrideComponent(componentConfig) {
|
|
90
|
-
return {
|
|
91
|
-
...componentConfig,
|
|
92
|
-
mounted() {
|
|
93
|
-
addOverrideClass(this.$el);
|
|
94
|
-
if (componentConfig.mounted) {
|
|
95
|
-
componentConfig.mounted.call(this);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
updated() {
|
|
99
|
-
addOverrideClass(this.$el);
|
|
100
|
-
if (componentConfig.updated) {
|
|
101
|
-
componentConfig.updated.call(this);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 样式工具函数
|
|
3
|
+
* 用于确保组件样式完全覆盖 Element Plus
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 为元素添加高优先级样式类
|
|
8
|
+
* @param {HTMLElement} element - 目标元素
|
|
9
|
+
*/
|
|
10
|
+
export function addOverrideClass(element) {
|
|
11
|
+
if (element && element.classList) {
|
|
12
|
+
element.classList.add('mc-ui-override');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 为 Vue 组件实例添加覆盖样式
|
|
18
|
+
* @param {Object} componentInstance - Vue 组件实例
|
|
19
|
+
*/
|
|
20
|
+
export function addComponentOverride(componentInstance) {
|
|
21
|
+
if (componentInstance && componentInstance.$el) {
|
|
22
|
+
addOverrideClass(componentInstance.$el);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 全局应用样式覆盖
|
|
28
|
+
* 在应用启动时调用,确保所有 Element Plus 组件都被覆盖
|
|
29
|
+
*/
|
|
30
|
+
export function applyGlobalOverride() {
|
|
31
|
+
// 为 body 添加覆盖类
|
|
32
|
+
if (typeof document !== 'undefined') {
|
|
33
|
+
document.body.classList.add('mc-ui-override');
|
|
34
|
+
|
|
35
|
+
// 监听动态添加的 Element Plus 组件
|
|
36
|
+
const observer = new MutationObserver((mutations) => {
|
|
37
|
+
mutations.forEach((mutation) => {
|
|
38
|
+
mutation.addedNodes.forEach((node) => {
|
|
39
|
+
if (node.nodeType === 1 && node.classList) {
|
|
40
|
+
// 为新添加的 Element Plus 组件添加覆盖类
|
|
41
|
+
if (node.className && typeof node.className === 'string' && node.className.includes('el-')) {
|
|
42
|
+
const parent = node.closest('.mc-ui-override') || node.parentElement;
|
|
43
|
+
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
44
|
+
parent.classList.add('mc-ui-override');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 检查子元素
|
|
49
|
+
const elComponents = node.querySelectorAll('[class*="el-"]');
|
|
50
|
+
elComponents.forEach(el => {
|
|
51
|
+
const parent = el.closest('.mc-ui-override') || el.parentElement;
|
|
52
|
+
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
53
|
+
parent.classList.add('mc-ui-override');
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
observer.observe(document.body, {
|
|
62
|
+
childList: true,
|
|
63
|
+
subtree: true
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 强制刷新组件样式
|
|
70
|
+
* @param {string} selector - CSS 选择器
|
|
71
|
+
*/
|
|
72
|
+
export function forceRefreshStyles(selector = '[class*="el-"]') {
|
|
73
|
+
if (typeof document !== 'undefined') {
|
|
74
|
+
const elements = document.querySelectorAll(selector);
|
|
75
|
+
elements.forEach(el => {
|
|
76
|
+
const parent = el.closest('.mc-ui-override') || el.parentElement;
|
|
77
|
+
if (parent && !parent.classList.contains('mc-ui-override')) {
|
|
78
|
+
parent.classList.add('mc-ui-override');
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 创建带有样式覆盖的 Element Plus 组件配置
|
|
86
|
+
* @param {Object} componentConfig - 组件配置
|
|
87
|
+
* @returns {Object} 增强后的组件配置
|
|
88
|
+
*/
|
|
89
|
+
export function createOverrideComponent(componentConfig) {
|
|
90
|
+
return {
|
|
91
|
+
...componentConfig,
|
|
92
|
+
mounted() {
|
|
93
|
+
addOverrideClass(this.$el);
|
|
94
|
+
if (componentConfig.mounted) {
|
|
95
|
+
componentConfig.mounted.call(this);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
updated() {
|
|
99
|
+
addOverrideClass(this.$el);
|
|
100
|
+
if (componentConfig.updated) {
|
|
101
|
+
componentConfig.updated.call(this);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
2
|
-
export default _default;
|
|
3
|
-
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
4
|
-
$slots: S;
|
|
5
|
-
});
|
|
6
|
-
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
7
|
-
replace: boolean;
|
|
8
|
-
to: string | Record<string, any>;
|
|
9
|
-
$props: {
|
|
10
|
-
readonly replace?: boolean;
|
|
11
|
-
readonly to?: string | Record<string, any>;
|
|
12
|
-
};
|
|
13
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
-
declare function __VLS_template(): {
|
|
15
|
-
default?(_: {}): any;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=BreadcrumbItem.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.vue.d.ts","sourceRoot":"","sources":["../../../packages/components/Breadcrumb/BreadcrumbItem.vue.js"],"names":[],"mappings":"AA2BA;wBAwNqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;;6BAC1E,CAAC,EAAE,CAAC;;;AATjC;;;;;;;2OAOG;AA9IH;qBAuH8B,GAAG;EAGhC"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span class="m-breadcrumb__item">
|
|
3
|
-
<span
|
|
4
|
-
v-if="to"
|
|
5
|
-
class="m-breadcrumb__inner"
|
|
6
|
-
:class="{ 'is-link': to }"
|
|
7
|
-
@click="handleClick"
|
|
8
|
-
>
|
|
9
|
-
<slot></slot>
|
|
10
|
-
</span>
|
|
11
|
-
<span v-else class="m-breadcrumb__inner">
|
|
12
|
-
<slot></slot>
|
|
13
|
-
</span>
|
|
14
|
-
<i
|
|
15
|
-
v-if="separatorIcon && !isLast"
|
|
16
|
-
class="m-breadcrumb__separator"
|
|
17
|
-
>
|
|
18
|
-
<component :is="separatorIcon" />
|
|
19
|
-
</i>
|
|
20
|
-
<span
|
|
21
|
-
v-else-if="!isLast"
|
|
22
|
-
class="m-breadcrumb__separator"
|
|
23
|
-
>
|
|
24
|
-
{{ separator }}
|
|
25
|
-
</span>
|
|
26
|
-
</span>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script setup>
|
|
30
|
-
import { inject, computed, onMounted, onUnmounted, ref } from 'vue'
|
|
31
|
-
import { useRouter } from 'vue-router'
|
|
32
|
-
|
|
33
|
-
defineOptions({
|
|
34
|
-
name: "MBreadcrumbItem",
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
// 定义 props
|
|
38
|
-
const props = defineProps({
|
|
39
|
-
to: {
|
|
40
|
-
type: [String, Object],
|
|
41
|
-
default: ''
|
|
42
|
-
},
|
|
43
|
-
replace: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: false
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
// 注入父组件上下文
|
|
50
|
-
const breadcrumbContext = inject('breadcrumbContext', {
|
|
51
|
-
separator: '/',
|
|
52
|
-
separatorIcon: undefined,
|
|
53
|
-
registerItem: () => null,
|
|
54
|
-
unregisterItem: () => {},
|
|
55
|
-
isLastItem: () => false
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
// 获取分隔符配置
|
|
59
|
-
const separator = computed(() => breadcrumbContext.separator)
|
|
60
|
-
const separatorIcon = computed(() => breadcrumbContext.separatorIcon)
|
|
61
|
-
|
|
62
|
-
// 组件 ID
|
|
63
|
-
const itemId = ref(null)
|
|
64
|
-
|
|
65
|
-
// 判断是否为最后一项
|
|
66
|
-
const isLast = computed(() => {
|
|
67
|
-
return itemId.value ? breadcrumbContext.isLastItem(itemId.value) : false
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
// 路由跳转
|
|
71
|
-
const router = useRouter()
|
|
72
|
-
|
|
73
|
-
const handleClick = () => {
|
|
74
|
-
if (!props.to) return
|
|
75
|
-
|
|
76
|
-
if (props.replace) {
|
|
77
|
-
router.replace(props.to)
|
|
78
|
-
} else {
|
|
79
|
-
router.push(props.to)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// 注册和注销组件
|
|
84
|
-
onMounted(() => {
|
|
85
|
-
if (breadcrumbContext.registerItem) {
|
|
86
|
-
itemId.value = breadcrumbContext.registerItem()
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
onUnmounted(() => {
|
|
91
|
-
if (breadcrumbContext.unregisterItem && itemId.value) {
|
|
92
|
-
breadcrumbContext.unregisterItem(itemId.value)
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
</script>
|
|
96
|
-
|
|
97
|
-
<style lang="scss" scoped>
|
|
98
|
-
.m-breadcrumb__item {
|
|
99
|
-
float: left;
|
|
100
|
-
|
|
101
|
-
.m-breadcrumb__inner {
|
|
102
|
-
color: var(--text-secondary, #606266);
|
|
103
|
-
text-decoration: none;
|
|
104
|
-
transition: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
105
|
-
|
|
106
|
-
&:hover,
|
|
107
|
-
&.is-link {
|
|
108
|
-
color: var(--text-primary);
|
|
109
|
-
// color: var(--bg-brand, #409eff);
|
|
110
|
-
cursor: pointer;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.m-breadcrumb__separator {
|
|
115
|
-
margin: 0 9px;
|
|
116
|
-
font-weight: 500;
|
|
117
|
-
color: var(--text-tertiary, #c0c4cc);
|
|
118
|
-
display: inline-flex;
|
|
119
|
-
align-items: center;
|
|
120
|
-
transform: translateY(10%);
|
|
121
|
-
:deep(svg) {
|
|
122
|
-
width: 14px;
|
|
123
|
-
height: 14px;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
[class*="icon"] {
|
|
127
|
-
margin-right: 6px;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&:last-child {
|
|
132
|
-
.m-breadcrumb__inner {
|
|
133
|
-
color: var(--text-tertiary, #909399);
|
|
134
|
-
cursor: text;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.m-breadcrumb__separator {
|
|
138
|
-
display: none;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
</style>
|