@mc-markets/ui 1.0.90 → 1.0.91
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 +30 -40
- package/dist/404.html +22 -22
- package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -11
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -4
- package/packages/components/Alert/Alert.vue +139 -139
- package/packages/components/Banner/Banner.vue +299 -299
- package/packages/components/Breadcrumb/Breadcrumb.vue +113 -113
- package/packages/components/Breadcrumb/BreadcrumbSeparator.vue +31 -31
- package/packages/components/Button/Button.vue +17 -17
- package/packages/components/DatePicker/DatePicker.vue +85 -85
- package/packages/components/Dialog/Dialog.vue +61 -61
- package/packages/components/Empty/Empty.vue +73 -73
- 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 -107
- package/packages/components/TabCard/TabCardItem.vue +105 -105
- 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 +208 -211
- 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/colorfont/iconfont.css +1 -0
- 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 -62
- 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
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="[
|
|
4
|
-
'm-tab-card-item',
|
|
5
|
-
{
|
|
6
|
-
'is-active': isActive,
|
|
7
|
-
'is-disabled': disabled
|
|
8
|
-
}
|
|
9
|
-
]"
|
|
10
|
-
@click="handleClick"
|
|
11
|
-
>
|
|
12
|
-
<span class="m-tab-card-item__text">
|
|
13
|
-
<slot>{{ label }}</slot>
|
|
14
|
-
</span>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup>
|
|
19
|
-
import { inject, computed } from 'vue'
|
|
20
|
-
|
|
21
|
-
defineOptions({
|
|
22
|
-
name: "MTabCardItem",
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
// 定义 props
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
label: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: ''
|
|
30
|
-
},
|
|
31
|
-
name: {
|
|
32
|
-
type: [String, Number],
|
|
33
|
-
required: true
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
// 定义 emits
|
|
42
|
-
const emit = defineEmits(['click'])
|
|
43
|
-
|
|
44
|
-
// 注入父组件上下文
|
|
45
|
-
const tabCardContext = inject('tabCardContext')
|
|
46
|
-
|
|
47
|
-
// 计算是否激活
|
|
48
|
-
const isActive = computed(() => {
|
|
49
|
-
return tabCardContext.activeTab.value === props.name
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
// 处理点击
|
|
53
|
-
const handleClick = () => {
|
|
54
|
-
if (props.disabled) {
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
tabCardContext.handleTabClick(props.name, props.disabled)
|
|
59
|
-
emit('click', props.name)
|
|
60
|
-
}
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style lang="scss" scoped>
|
|
64
|
-
.m-tab-card-item {
|
|
65
|
-
position: relative;
|
|
66
|
-
display: flex;
|
|
67
|
-
align-items: center;
|
|
68
|
-
justify-content: center;
|
|
69
|
-
height: 40px;
|
|
70
|
-
border-radius: var(--md);
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
// transition: all 0.3s ease;
|
|
73
|
-
user-select: none;
|
|
74
|
-
background-color: transparent;
|
|
75
|
-
padding: 0 36px;
|
|
76
|
-
text-align: center;
|
|
77
|
-
z-index: 1;
|
|
78
|
-
|
|
79
|
-
// &:hover:not(.is-disabled):not(.is-active) {
|
|
80
|
-
// background-color: rgba(255, 255, 255, 0.05);
|
|
81
|
-
// }
|
|
82
|
-
|
|
83
|
-
&.is-active {
|
|
84
|
-
background-color: var(--bg-brand, #ffd700);
|
|
85
|
-
color: var(--text-quaternary);
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&.is-disabled {
|
|
91
|
-
cursor: not-allowed;
|
|
92
|
-
opacity: 0.5;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&:not(.is-active) {
|
|
96
|
-
color: var(--text-secondary, #ffffff);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&__text {
|
|
100
|
-
font-size: 14px;
|
|
101
|
-
line-height: 1.4;
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'm-tab-card-item',
|
|
5
|
+
{
|
|
6
|
+
'is-active': isActive,
|
|
7
|
+
'is-disabled': disabled
|
|
8
|
+
}
|
|
9
|
+
]"
|
|
10
|
+
@click="handleClick"
|
|
11
|
+
>
|
|
12
|
+
<span class="m-tab-card-item__text">
|
|
13
|
+
<slot>{{ label }}</slot>
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { inject, computed } from 'vue'
|
|
20
|
+
|
|
21
|
+
defineOptions({
|
|
22
|
+
name: "MTabCardItem",
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
// 定义 props
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
label: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ''
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
type: [String, Number],
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
// 定义 emits
|
|
42
|
+
const emit = defineEmits(['click'])
|
|
43
|
+
|
|
44
|
+
// 注入父组件上下文
|
|
45
|
+
const tabCardContext = inject('tabCardContext')
|
|
46
|
+
|
|
47
|
+
// 计算是否激活
|
|
48
|
+
const isActive = computed(() => {
|
|
49
|
+
return tabCardContext.activeTab.value === props.name
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// 处理点击
|
|
53
|
+
const handleClick = () => {
|
|
54
|
+
if (props.disabled) {
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
tabCardContext.handleTabClick(props.name, props.disabled)
|
|
59
|
+
emit('click', props.name)
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped>
|
|
64
|
+
.m-tab-card-item {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
height: 40px;
|
|
70
|
+
border-radius: var(--md);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
// transition: all 0.3s ease;
|
|
73
|
+
user-select: none;
|
|
74
|
+
background-color: transparent;
|
|
75
|
+
padding: 0 36px;
|
|
76
|
+
text-align: center;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
|
|
79
|
+
// &:hover:not(.is-disabled):not(.is-active) {
|
|
80
|
+
// background-color: rgba(255, 255, 255, 0.05);
|
|
81
|
+
// }
|
|
82
|
+
|
|
83
|
+
&.is-active {
|
|
84
|
+
background-color: var(--bg-brand, #ffd700);
|
|
85
|
+
color: var(--text-quaternary);
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.is-disabled {
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
opacity: 0.5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:not(.is-active) {
|
|
96
|
+
color: var(--text-secondary, #ffffff);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&__text {
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
line-height: 1.4;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-table v-bind="$attrs">
|
|
3
|
-
<template v-for="(_, name) in $slots" :key="name" #[name]>
|
|
4
|
-
<slot :name="name" />
|
|
5
|
-
</template>
|
|
6
|
-
</el-table>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script setup>
|
|
10
|
-
defineOptions({
|
|
11
|
-
name: "MTable",
|
|
12
|
-
});
|
|
13
|
-
</script>
|
|
14
|
-
<style lang="scss">
|
|
15
|
-
// Table 组件样式 - 无边框设计
|
|
16
|
-
|
|
17
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-table v-bind="$attrs">
|
|
3
|
+
<template v-for="(_, name) in $slots" :key="name" #[name]>
|
|
4
|
+
<slot :name="name" />
|
|
5
|
+
</template>
|
|
6
|
+
</el-table>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: "MTable",
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
<style lang="scss">
|
|
15
|
+
// Table 组件样式 - 无边框设计
|
|
16
|
+
|
|
17
|
+
</style>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-table-column v-bind="$attrs" class="m-table-column">
|
|
3
|
-
<template v-for="(_, name) in $slots" :key="name" #[name]>
|
|
4
|
-
<slot :name="name" />
|
|
5
|
-
</template>
|
|
6
|
-
</el-table-column>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script setup>
|
|
10
|
-
defineOptions({
|
|
11
|
-
name: "MTableColumn",
|
|
12
|
-
});
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<style lang="scss">
|
|
16
|
-
// TableColumn 组件样式
|
|
17
|
-
.m-table-column.el-table-column {
|
|
18
|
-
// 继承父级 Table 组件的样式
|
|
19
|
-
}
|
|
20
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-table-column v-bind="$attrs" class="m-table-column">
|
|
3
|
+
<template v-for="(_, name) in $slots" :key="name" #[name]>
|
|
4
|
+
<slot :name="name" />
|
|
5
|
+
</template>
|
|
6
|
+
</el-table-column>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: "MTableColumn",
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<style lang="scss">
|
|
16
|
+
// TableColumn 组件样式
|
|
17
|
+
.m-table-column.el-table-column {
|
|
18
|
+
// 继承父级 Table 组件的样式
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-show="isActive"
|
|
4
|
-
class="m-tab-pane"
|
|
5
|
-
:class="{ 'is-active': isActive }"
|
|
6
|
-
>
|
|
7
|
-
<slot></slot>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import { inject, computed, onMounted, onUnmounted } from 'vue'
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
name: 'MTabPane',
|
|
16
|
-
props: {
|
|
17
|
-
label: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true
|
|
20
|
-
},
|
|
21
|
-
name: {
|
|
22
|
-
type: [String, Number],
|
|
23
|
-
default: ''
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: false
|
|
28
|
-
},
|
|
29
|
-
closable: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
setup(props) {
|
|
35
|
-
const tabsContext = inject('tabsContext')
|
|
36
|
-
|
|
37
|
-
// 计算tab名称,如果没有提供name则使用label
|
|
38
|
-
const tabName = computed(() => {
|
|
39
|
-
return props.name || props.label
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
// 计算是否激活
|
|
43
|
-
const isActive = computed(() => {
|
|
44
|
-
return tabsContext.activeTab.value === tabName.value
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
// 组件挂载时注册tab
|
|
48
|
-
onMounted(() => {
|
|
49
|
-
const tabInfo = {
|
|
50
|
-
label: props.label,
|
|
51
|
-
name: tabName.value,
|
|
52
|
-
disabled: props.disabled,
|
|
53
|
-
closable: props.closable
|
|
54
|
-
}
|
|
55
|
-
tabsContext.registerTab(tabInfo)
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
// 组件卸载时注销tab
|
|
59
|
-
onUnmounted(() => {
|
|
60
|
-
tabsContext.unregisterTab(tabName.value)
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
isActive,
|
|
65
|
-
tabName
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<style lang="scss" scoped>
|
|
72
|
-
.m-tab-pane {
|
|
73
|
-
display: none;
|
|
74
|
-
|
|
75
|
-
&.is-active {
|
|
76
|
-
display: block;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-show="isActive"
|
|
4
|
+
class="m-tab-pane"
|
|
5
|
+
:class="{ 'is-active': isActive }"
|
|
6
|
+
>
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { inject, computed, onMounted, onUnmounted } from 'vue'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'MTabPane',
|
|
16
|
+
props: {
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
name: {
|
|
22
|
+
type: [String, Number],
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
closable: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setup(props) {
|
|
35
|
+
const tabsContext = inject('tabsContext')
|
|
36
|
+
|
|
37
|
+
// 计算tab名称,如果没有提供name则使用label
|
|
38
|
+
const tabName = computed(() => {
|
|
39
|
+
return props.name || props.label
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// 计算是否激活
|
|
43
|
+
const isActive = computed(() => {
|
|
44
|
+
return tabsContext.activeTab.value === tabName.value
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// 组件挂载时注册tab
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
const tabInfo = {
|
|
50
|
+
label: props.label,
|
|
51
|
+
name: tabName.value,
|
|
52
|
+
disabled: props.disabled,
|
|
53
|
+
closable: props.closable
|
|
54
|
+
}
|
|
55
|
+
tabsContext.registerTab(tabInfo)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
// 组件卸载时注销tab
|
|
59
|
+
onUnmounted(() => {
|
|
60
|
+
tabsContext.unregisterTab(tabName.value)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
isActive,
|
|
65
|
+
tabName
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
.m-tab-pane {
|
|
73
|
+
display: none;
|
|
74
|
+
|
|
75
|
+
&.is-active {
|
|
76
|
+
display: block;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</style>
|