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