@mc-markets/ui 1.0.87 → 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.
Files changed (65) hide show
  1. package/README.md +39 -54
  2. package/dist/404.html +22 -22
  3. package/dist/components/TabCard/TabCardItem.vue.d.ts.map +1 -1
  4. package/dist/components/Tag/Tag.vue.d.ts +2 -0
  5. package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.mjs +119 -110
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/style.css +1 -1
  11. package/package.json +1 -1
  12. package/packages/components/Alert/Alert.vue +139 -139
  13. package/packages/components/Banner/Banner.vue +299 -299
  14. package/packages/components/Breadcrumb/Breadcrumb.vue +113 -113
  15. package/packages/components/Breadcrumb/BreadcrumbSeparator.vue +31 -31
  16. package/packages/components/Button/Button.vue +17 -17
  17. package/packages/components/DatePicker/DatePicker.vue +85 -85
  18. package/packages/components/Dialog/Dialog.vue +61 -61
  19. package/packages/components/Empty/Empty.vue +73 -73
  20. package/packages/components/Form/Form.vue +30 -30
  21. package/packages/components/FormItem/FormItem.vue +19 -19
  22. package/packages/components/Icon/Icon.vue +210 -210
  23. package/packages/components/Input/Input.vue +15 -15
  24. package/packages/components/Message/Message.vue +503 -503
  25. package/packages/components/NotifiMessage/NotifiMessage.vue +293 -293
  26. package/packages/components/Notification/Notification.vue +19 -19
  27. package/packages/components/Option/Option.vue +13 -13
  28. package/packages/components/OptionGroup/OptionGroup.vue +13 -13
  29. package/packages/components/Pagination/Pagination.vue +61 -61
  30. package/packages/components/Radio/Radio.vue +67 -67
  31. package/packages/components/RadioButton/RadioButton.vue +110 -110
  32. package/packages/components/RadioGroup/RadioGroup.vue +155 -155
  33. package/packages/components/Select/Select.vue +22 -22
  34. package/packages/components/Switch/Switch.vue +47 -47
  35. package/packages/components/TabCard/TabCard.vue +107 -117
  36. package/packages/components/TabCard/TabCardItem.vue +105 -119
  37. package/packages/components/Table/Table.vue +17 -17
  38. package/packages/components/Table/TableColumn.vue +20 -20
  39. package/packages/components/Tabs/TabPane.vue +79 -79
  40. package/packages/components/Tabs/Tabs.vue +267 -267
  41. package/packages/components/Tag/Tag.vue +211 -164
  42. package/packages/components/Tooltip/Tooltip.vue +58 -58
  43. package/packages/hooks/useClassName.js +23 -23
  44. package/packages/styles/README.md +129 -129
  45. package/packages/styles/components/button.scss +121 -121
  46. package/packages/styles/components/checkbox.scss +18 -18
  47. package/packages/styles/components/dialog.scss +47 -47
  48. package/packages/styles/components/form.scss +18 -18
  49. package/packages/styles/components/input.scss +14 -14
  50. package/packages/styles/components/select.scss +62 -62
  51. package/packages/styles/components/table.scss +37 -37
  52. package/packages/styles/components/tabs.scss +76 -76
  53. package/packages/styles/components/tag.scss +142 -142
  54. package/packages/styles/font/iconfont.scss +363 -363
  55. package/packages/styles/index.scss +94 -94
  56. package/packages/styles/variables/border-mode.css +6 -6
  57. package/packages/styles/variables/color-modes-dark.css +143 -143
  58. package/packages/styles/variables/index.scss +5 -5
  59. package/packages/styles/variables/primitives-style.css +112 -112
  60. package/packages/styles/variables/radius-mode.css +14 -14
  61. package/packages/styles/variables/spacing-mode.css +20 -20
  62. package/packages/styles/variables/typography-desktop.css +40 -40
  63. package/packages/styles/variables/typography-mobile.css +40 -40
  64. package/packages/utils/classNames.js +23 -23
  65. package/packages/utils/styleUtils.js +105 -105
@@ -1,165 +1,212 @@
1
- <template>
2
- <el-tag v-bind="$attrs" class="m-tag" :class="{ 'is-loading': loading }">
3
- <template v-for="(_, name) in $slots" :key="name" #[name]>
4
- <!-- 自定义spinner loading效果 -->
5
- <div v-if="loading && !prefixIcon" class="custom-spinner">
6
- <div class="ldio-spinner">
7
- <div v-for="i in 8" :key="i"></div>
8
- </div>
9
- </div>
10
- <!-- 原有的prefixIcon -->
11
- <i
12
- class="prefixIcon"
13
- :class="['iconfont', computedPrefixIcon]"
14
- v-else-if="computedPrefixIcon"
15
- ></i>
16
- <div>
17
- <slot :name="name" />
18
- </div>
19
- <i
20
- class="suffixIcon"
21
- :class="['iconfont', suffixIcon]"
22
- v-if="suffixIcon"
23
- ></i>
24
- </template>
25
- </el-tag>
26
- </template>
27
-
28
- <script setup>
29
- import { computed } from 'vue'
30
-
31
- defineOptions({
32
- name: 'MTag'
33
- })
34
-
35
- const props = defineProps({
36
- prefixIcon: {
37
- type: String,
38
- default: ''
39
- },
40
- suffixIcon: {
41
- type: String,
42
- default: ''
43
- },
44
- loading: {
45
- type: Boolean,
46
- default: false
47
- }
48
- })
49
-
50
- // 计算属性:处理prefixIcon
51
- const computedPrefixIcon = computed(() => {
52
- return props.prefixIcon
53
- })
54
- </script>
55
-
56
- <style lang="scss">
57
- .m-tag {
58
- .prefixIcon,
59
- .suffixIcon {
60
- font-size: 16px;
61
- display: inline-block;
62
- line-height: 1;
63
-
64
- &.iconfont {
65
- font-family: "iconfont" !important;
66
- }
67
-
68
- &.colorfont {
69
- font-family: "colorfont" !important;
70
- }
71
- }
72
- .el-tag__content{
73
- display: flex;
74
- align-items: center;
75
- }
76
-
77
- .prefixIcon {
78
- margin-right: 4px;
79
- }
80
-
81
- .suffixIcon {
82
- margin-left: 4px;
83
- }
84
-
85
- // 自定义spinner样式
86
- .custom-spinner {
87
- display: inline-block;
88
- margin-right: 4px;
89
- width: 16px;
90
- height: 16px;
91
- overflow: hidden;
92
-
93
- .ldio-spinner {
94
- width: 100%;
95
- height: 100%;
96
- position: relative;
97
- transform: translateZ(0) scale(0.16);
98
- backface-visibility: hidden;
99
- transform-origin: 0 0;
100
-
101
- div {
102
- left: 46px;
103
- top: 7.5px;
104
- position: absolute;
105
- animation: ldio-spinner-fade linear 1s infinite;
106
- background: currentColor;
107
- width: 8px;
108
- height: 21px;
109
- border-radius: 3.15px / 3.15px;
110
- transform-origin: 4px 42.5px;
111
- box-sizing: content-box;
112
- }
113
-
114
- div:nth-child(1) {
115
- transform: rotate(0deg);
116
- animation-delay: -0.875s;
117
- }
118
-
119
- div:nth-child(2) {
120
- transform: rotate(45deg);
121
- animation-delay: -0.75s;
122
- }
123
-
124
- div:nth-child(3) {
125
- transform: rotate(90deg);
126
- animation-delay: -0.625s;
127
- }
128
-
129
- div:nth-child(4) {
130
- transform: rotate(135deg);
131
- animation-delay: -0.5s;
132
- }
133
-
134
- div:nth-child(5) {
135
- transform: rotate(180deg);
136
- animation-delay: -0.375s;
137
- }
138
-
139
- div:nth-child(6) {
140
- transform: rotate(225deg);
141
- animation-delay: -0.25s;
142
- }
143
-
144
- div:nth-child(7) {
145
- transform: rotate(270deg);
146
- animation-delay: -0.125s;
147
- }
148
-
149
- div:nth-child(8) {
150
- transform: rotate(315deg);
151
- animation-delay: 0s;
152
- }
153
- }
154
- }
155
- }
156
-
157
- @keyframes ldio-spinner-fade {
158
- 0% {
159
- opacity: 1;
160
- }
161
- 100% {
162
- opacity: 0;
163
- }
164
- }
1
+ <template>
2
+ <el-tag v-bind="$attrs" :type="computedType" class="m-tag" :class="{ 'is-loading': computedLoading }">
3
+ <template v-for="(_, name) in $slots" :key="name" #[name]>
4
+ <!-- 自定义spinner loading效果 -->
5
+ <div v-if="computedLoading && !computedPrefixIcon" class="custom-spinner">
6
+ <div class="ldio-spinner">
7
+ <div v-for="i in 8" :key="i"></div>
8
+ </div>
9
+ </div>
10
+ <!-- 原有的prefixIcon -->
11
+ <i
12
+ class="prefixIcon"
13
+ :class="['iconfont', computedPrefixIcon]"
14
+ v-else-if="computedPrefixIcon"
15
+ ></i>
16
+ <div>
17
+ <slot :name="name" />
18
+ </div>
19
+ <i
20
+ class="suffixIcon"
21
+ :class="['iconfont', computedSuffixIcon]"
22
+ v-if="computedSuffixIcon"
23
+ ></i>
24
+ </template>
25
+ </el-tag>
26
+ </template>
27
+
28
+ <script setup>
29
+ import { computed } from 'vue'
30
+
31
+ defineOptions({
32
+ name: 'MTag'
33
+ })
34
+
35
+ const props = defineProps({
36
+ prefixIcon: {
37
+ type: String,
38
+ default: ''
39
+ },
40
+ suffixIcon: {
41
+ type: String,
42
+ default: ''
43
+ },
44
+ loading: {
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ status: {
49
+ type: String,
50
+ default: '',
51
+ validator: (value) => {
52
+ return ['', 'success', 'warning', 'danger'].includes(value)
53
+ }
54
+ }
55
+ })
56
+
57
+ // 根据status自动设置type颜色
58
+ const computedType = computed(() => {
59
+ if (props.status) {
60
+ // 如果设置了status,自动映射到对应的type
61
+ return props.status
62
+ }
63
+ // 否则使用v-bind传入的type(通过$attrs)
64
+ return undefined
65
+ })
66
+
67
+ // 根据status自动设置图标和loading状态
68
+ const computedLoading = computed(() => {
69
+ if (props.status === 'warning') {
70
+ return true
71
+ }
72
+ return props.loading
73
+ })
74
+
75
+ const computedPrefixIcon = computed(() => {
76
+ // 如果有显式的prefixIcon,优先使用
77
+ if (props.prefixIcon) {
78
+ return props.prefixIcon
79
+ }
80
+
81
+ // 根据status自动设置prefixIcon
82
+ if (props.status === 'success') {
83
+ return 'icon-circle-check-filled'
84
+ }
85
+
86
+ if (props.status === 'danger') {
87
+ return 'icon-lucide_circle-x-filled'
88
+ }
89
+
90
+ return ''
91
+ })
92
+
93
+ const computedSuffixIcon = computed(() => {
94
+ // 如果有显式的suffixIcon,优先使用
95
+ if (props.suffixIcon) {
96
+ return props.suffixIcon
97
+ }
98
+
99
+ return ''
100
+ })
101
+ </script>
102
+
103
+ <style lang="scss">
104
+ .m-tag {
105
+ .prefixIcon,
106
+ .suffixIcon {
107
+ font-size: 16px;
108
+ display: inline-block;
109
+ line-height: 1;
110
+
111
+ &.iconfont {
112
+ font-family: "iconfont" !important;
113
+ }
114
+
115
+ &.colorfont {
116
+ font-family: "colorfont" !important;
117
+ }
118
+ }
119
+ .el-tag__content{
120
+ display: flex;
121
+ align-items: center;
122
+ }
123
+
124
+ .prefixIcon {
125
+ margin-right: 4px;
126
+ }
127
+
128
+ .suffixIcon {
129
+ margin-left: 4px;
130
+ }
131
+
132
+ // 自定义spinner样式
133
+ .custom-spinner {
134
+ display: inline-block;
135
+ margin-right: 4px;
136
+ width: 16px;
137
+ height: 16px;
138
+ overflow: hidden;
139
+
140
+ .ldio-spinner {
141
+ width: 100%;
142
+ height: 100%;
143
+ position: relative;
144
+ transform: translateZ(0) scale(0.16);
145
+ backface-visibility: hidden;
146
+ transform-origin: 0 0;
147
+
148
+ div {
149
+ left: 46px;
150
+ top: 7.5px;
151
+ position: absolute;
152
+ animation: ldio-spinner-fade linear 1s infinite;
153
+ background: currentColor;
154
+ width: 8px;
155
+ height: 21px;
156
+ border-radius: 3.15px / 3.15px;
157
+ transform-origin: 4px 42.5px;
158
+ box-sizing: content-box;
159
+ }
160
+
161
+ div:nth-child(1) {
162
+ transform: rotate(0deg);
163
+ animation-delay: -0.875s;
164
+ }
165
+
166
+ div:nth-child(2) {
167
+ transform: rotate(45deg);
168
+ animation-delay: -0.75s;
169
+ }
170
+
171
+ div:nth-child(3) {
172
+ transform: rotate(90deg);
173
+ animation-delay: -0.625s;
174
+ }
175
+
176
+ div:nth-child(4) {
177
+ transform: rotate(135deg);
178
+ animation-delay: -0.5s;
179
+ }
180
+
181
+ div:nth-child(5) {
182
+ transform: rotate(180deg);
183
+ animation-delay: -0.375s;
184
+ }
185
+
186
+ div:nth-child(6) {
187
+ transform: rotate(225deg);
188
+ animation-delay: -0.25s;
189
+ }
190
+
191
+ div:nth-child(7) {
192
+ transform: rotate(270deg);
193
+ animation-delay: -0.125s;
194
+ }
195
+
196
+ div:nth-child(8) {
197
+ transform: rotate(315deg);
198
+ animation-delay: 0s;
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ @keyframes ldio-spinner-fade {
205
+ 0% {
206
+ opacity: 1;
207
+ }
208
+ 100% {
209
+ opacity: 0;
210
+ }
211
+ }
165
212
  </style>
@@ -1,58 +1,58 @@
1
- <template>
2
- <el-tooltip v-bind="mergedAttrs" :popper-class="popperClass">
3
- <template v-for="(_, name) in $slots" :key="name" #[name]>
4
- <slot :name="name" />
5
- </template>
6
- </el-tooltip>
7
- </template>
8
-
9
- <script setup>
10
- import { useClassName } from "@packages/hooks/useClassName.js"
11
-
12
- defineOptions({
13
- name: 'MTooltip'
14
- })
15
-
16
- // 定义props
17
- const props = defineProps({
18
- popperClass: {
19
- type: String,
20
- default: ''
21
- }
22
- })
23
-
24
- // 使用类名 Hook
25
- const { mergedAttrs, className: popperClass } = useClassName('mc-tooltip-popper')
26
- </script>
27
-
28
- <style lang="scss">
29
- .mc-tooltip-popper {
30
- &.is-dark {
31
- color: #fff !important;
32
- background-color: var(--all-gray-6) !important;
33
- border-color: var(--all-gray-6) !important;
34
- .el-popper__arrow::before{
35
- background-color: var(--all-gray-6) !important;
36
- border-color: var(--all-gray-6) !important;
37
- }
38
- }
39
-
40
- &.is-light {
41
- color: #606266 !important;
42
- background-color: #fff !important;
43
- border: 1px solid #e4e7ed !important;
44
-
45
- .el-popper__arrow::before {
46
- background-color: #fff !important;
47
- border-color: #fff !important;
48
- }
49
- }
50
- }
51
-
52
- :deep(.el-popper) {
53
- &.is-light {
54
- background: var(--bg-tertiary-hover);
55
- border-color: var(--border-primary);
56
- }
57
- }
58
- </style>
1
+ <template>
2
+ <el-tooltip v-bind="mergedAttrs" :popper-class="popperClass">
3
+ <template v-for="(_, name) in $slots" :key="name" #[name]>
4
+ <slot :name="name" />
5
+ </template>
6
+ </el-tooltip>
7
+ </template>
8
+
9
+ <script setup>
10
+ import { useClassName } from "@packages/hooks/useClassName.js"
11
+
12
+ defineOptions({
13
+ name: 'MTooltip'
14
+ })
15
+
16
+ // 定义props
17
+ const props = defineProps({
18
+ popperClass: {
19
+ type: String,
20
+ default: ''
21
+ }
22
+ })
23
+
24
+ // 使用类名 Hook
25
+ const { mergedAttrs, className: popperClass } = useClassName('mc-tooltip-popper')
26
+ </script>
27
+
28
+ <style lang="scss">
29
+ .mc-tooltip-popper {
30
+ &.is-dark {
31
+ color: #fff !important;
32
+ background-color: var(--all-gray-6) !important;
33
+ border-color: var(--all-gray-6) !important;
34
+ .el-popper__arrow::before{
35
+ background-color: var(--all-gray-6) !important;
36
+ border-color: var(--all-gray-6) !important;
37
+ }
38
+ }
39
+
40
+ &.is-light {
41
+ color: #606266 !important;
42
+ background-color: #fff !important;
43
+ border: 1px solid #e4e7ed !important;
44
+
45
+ .el-popper__arrow::before {
46
+ background-color: #fff !important;
47
+ border-color: #fff !important;
48
+ }
49
+ }
50
+ }
51
+
52
+ :deep(.el-popper) {
53
+ &.is-light {
54
+ background: var(--bg-tertiary-hover);
55
+ border-color: var(--border-primary);
56
+ }
57
+ }
58
+ </style>
@@ -1,23 +1,23 @@
1
- import { computed, useAttrs } from 'vue'
2
- import { classNames, excludeAttrs } from '@packages/utils/classNames.js'
3
-
4
- /**
5
- * 类名 Hook
6
- * @param {string} defaultClass - 默认的类名
7
- * @param {string} excludeKey - 要排除的属性名,默认为 'popperClass'
8
- * @returns {Object} 包含 mergedAttrs 和 className 的对象
9
- */
10
- export function useClassName(defaultClass, excludeKey = 'popperClass') {
11
- const attrs = useAttrs()
12
-
13
- // 排除指定属性
14
- const mergedAttrs = computed(() => excludeAttrs(attrs, excludeKey))
15
-
16
- // 计算类名
17
- const className = computed(() => classNames(defaultClass, attrs[excludeKey]))
18
-
19
- return {
20
- mergedAttrs,
21
- className
22
- }
23
- }
1
+ import { computed, useAttrs } from 'vue'
2
+ import { classNames, excludeAttrs } from '@packages/utils/classNames.js'
3
+
4
+ /**
5
+ * 类名 Hook
6
+ * @param {string} defaultClass - 默认的类名
7
+ * @param {string} excludeKey - 要排除的属性名,默认为 'popperClass'
8
+ * @returns {Object} 包含 mergedAttrs 和 className 的对象
9
+ */
10
+ export function useClassName(defaultClass, excludeKey = 'popperClass') {
11
+ const attrs = useAttrs()
12
+
13
+ // 排除指定属性
14
+ const mergedAttrs = computed(() => excludeAttrs(attrs, excludeKey))
15
+
16
+ // 计算类名
17
+ const className = computed(() => classNames(defaultClass, attrs[excludeKey]))
18
+
19
+ return {
20
+ mergedAttrs,
21
+ className
22
+ }
23
+ }