@mc-markets/ui 1.0.34 → 1.0.37

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 (84) hide show
  1. package/README.md +0 -614
  2. package/dist/{packages/index.d.ts → index.d.ts} +2 -1
  3. package/dist/index.js +4 -3
  4. package/dist/node_modules/@babel/parser/typings/babel-parser.d.ts +235 -0
  5. package/dist/node_modules/@babel/types/lib/index.d.ts +3308 -0
  6. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +61 -0
  7. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +4 -0
  8. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +37 -0
  9. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +14 -0
  10. package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +207 -0
  11. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +46 -0
  12. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +11 -0
  13. package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +24 -0
  14. package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +46 -0
  15. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +5 -0
  16. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +514 -0
  17. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +327 -0
  18. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +103 -0
  19. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +47 -0
  20. package/dist/node_modules/@types/lodash/common/array.d.ts +2137 -0
  21. package/dist/node_modules/@types/lodash/common/collection.d.ts +1938 -0
  22. package/dist/node_modules/@types/lodash/common/common.d.ts +287 -0
  23. package/dist/node_modules/@types/lodash/common/date.d.ts +23 -0
  24. package/dist/node_modules/@types/lodash/common/function.d.ts +1455 -0
  25. package/dist/node_modules/@types/lodash/common/lang.d.ts +1700 -0
  26. package/dist/node_modules/@types/lodash/common/math.d.ts +405 -0
  27. package/dist/node_modules/@types/lodash/common/number.d.ts +131 -0
  28. package/dist/node_modules/@types/lodash/common/object.d.ts +2643 -0
  29. package/dist/node_modules/@types/lodash/common/seq.d.ts +210 -0
  30. package/dist/node_modules/@types/lodash/common/string.d.ts +788 -0
  31. package/dist/node_modules/@types/lodash/common/util.d.ts +1220 -0
  32. package/dist/node_modules/@types/lodash/index.d.ts +21 -0
  33. package/dist/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +1093 -0
  34. package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +45 -0
  35. package/dist/node_modules/@vue/reactivity/dist/reactivity.d.ts +756 -0
  36. package/dist/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +1839 -0
  37. package/dist/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1397 -0
  38. package/dist/node_modules/@vue/shared/dist/shared.d.ts +335 -0
  39. package/dist/node_modules/@vueuse/core/index.d.ts +4536 -0
  40. package/dist/node_modules/@vueuse/core/node_modules/vue-demi/lib/index.d.ts +22 -0
  41. package/dist/node_modules/@vueuse/shared/index.d.ts +1072 -0
  42. package/dist/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +22 -0
  43. package/dist/node_modules/async-validator/dist-types/index.d.ts +43 -0
  44. package/dist/node_modules/async-validator/dist-types/interface.d.ts +135 -0
  45. package/dist/node_modules/csstype/index.d.ts +21297 -0
  46. package/dist/node_modules/dayjs/index.d.ts +429 -0
  47. package/dist/node_modules/dayjs/locale/index.d.ts +11 -0
  48. package/dist/node_modules/dayjs/locale/types.d.ts +33 -0
  49. package/dist/node_modules/element-plus/es/index.d.ts +26960 -0
  50. package/dist/node_modules/element-plus/es/utils/vue3.3.polyfill.d.ts +34 -0
  51. package/dist/node_modules/memoize-one/dist/memoize-one.d.ts +7 -0
  52. package/dist/node_modules/vue/dist/vue.d.mts +7 -0
  53. package/dist/style.css +1 -1
  54. package/dist/{packages/styles → styles}/theme-config.d.ts +0 -2
  55. package/dist/types/auto-imports.d.ts +84 -0
  56. package/dist/types/components.d.ts +55 -0
  57. package/package.json +5 -2
  58. package/packages/styles/element/form.scss +27 -0
  59. package/packages/styles/index.scss +5 -4
  60. package/packages/styles/theme-config.ts +0 -24
  61. package/packages/styles/variables.scss +130 -137
  62. package/USAGE.md +0 -383
  63. package/dist/src/main.d.ts +0 -0
  64. package/dist/src/utils/theme.d.ts +0 -66
  65. package/dist/vite.config.d.ts +0 -2
  66. /package/dist/{packages/components → components}/Alert/Alert.vue.d.ts +0 -0
  67. /package/dist/{packages/components → components}/Alert/index.d.ts +0 -0
  68. /package/dist/{packages/components → components}/Banner/Banner.vue.d.ts +0 -0
  69. /package/dist/{packages/components → components}/Banner/index.d.ts +0 -0
  70. /package/dist/{packages/components → components}/DatePicker/DatePicker.vue.d.ts +0 -0
  71. /package/dist/{packages/components → components}/DatePicker/index.d.ts +0 -0
  72. /package/dist/{packages/components → components}/Dialog/index.vue.d.ts +0 -0
  73. /package/dist/{packages/components → components}/Empty/Empty.vue.d.ts +0 -0
  74. /package/dist/{packages/components → components}/Empty/index.d.ts +0 -0
  75. /package/dist/{packages/components → components}/Icon/index.d.ts +0 -0
  76. /package/dist/{packages/components → components}/Icon/types.d.ts +0 -0
  77. /package/dist/{packages/components → components}/Notification/Notification.vue.d.ts +0 -0
  78. /package/dist/{packages/components → components}/Notification/index.d.ts +0 -0
  79. /package/dist/{packages/components → components}/Pagination/Pagination.vue.d.ts +0 -0
  80. /package/dist/{packages/components → components}/Pagination/index.d.ts +0 -0
  81. /package/dist/{packages/components → components}/Tab/Tab.vue.d.ts +0 -0
  82. /package/dist/{packages/components → components}/Tab/TabPane.vue.d.ts +0 -0
  83. /package/dist/{packages/components → components}/Tooltips/Tooltips.vue.d.ts +0 -0
  84. /package/dist/{packages/components → components}/Tooltips/index.d.ts +0 -0
package/USAGE.md DELETED
@@ -1,383 +0,0 @@
1
- # @mc-markets/ui 使用指南
2
-
3
- 这是一个完整的 Element Plus 导出包,提供了 Element Plus 的所有功能,包括组件、指令、服务、样式、主题和国际化支持。
4
-
5
- ## 安装
6
-
7
- ```bash
8
- npm install @mc-markets/ui
9
- # 或
10
- yarn add @mc-markets/ui
11
- # 或
12
- pnpm add @mc-markets/ui
13
- ```
14
-
15
- ## 基础使用
16
-
17
- ### 1. 完整导入(推荐)
18
-
19
- ```typescript
20
- import { createApp } from 'vue'
21
- import McMarketsUI from '@mc-markets/ui'
22
- import '@mc-markets/ui/style' // 导入样式
23
-
24
- const app = createApp(App)
25
-
26
- // 使用默认配置
27
- app.use(McMarketsUI)
28
-
29
- // 或使用自定义配置
30
- app.use(McMarketsUI, {
31
- locale: 'zh-cn', // 默认语言
32
- theme: {
33
- name: 'custom',
34
- dark: false,
35
- cssVars: {
36
- '--el-color-primary': '#409eff',
37
- '--el-color-success': '#67c23a'
38
- }
39
- },
40
- importStyle: true // 是否自动导入样式
41
- })
42
-
43
- app.mount('#app')
44
- ```
45
-
46
- ### 2. 按需导入
47
-
48
- ```typescript
49
- import { createApp } from 'vue'
50
- import { ElButton, ElInput, ElForm, ElFormItem } from '@mc-markets/ui'
51
- import '@mc-markets/ui/style'
52
-
53
- const app = createApp(App)
54
-
55
- // 手动注册组件
56
- app.component('ElButton', ElButton)
57
- app.component('ElInput', ElInput)
58
- app.component('ElForm', ElForm)
59
- app.component('ElFormItem', ElFormItem)
60
-
61
- app.mount('#app')
62
- ```
63
-
64
- ## 国际化支持
65
-
66
- ### 1. 使用内置语言包
67
-
68
- ```typescript
69
- import { createApp } from 'vue'
70
- import McMarketsUI, { locales, getLocale } from '@mc-markets/ui'
71
-
72
- const app = createApp(App)
73
-
74
- // 使用中文
75
- app.use(McMarketsUI, {
76
- locale: 'zh-cn'
77
- })
78
-
79
- // 使用英文
80
- app.use(McMarketsUI, {
81
- locale: 'en'
82
- })
83
-
84
- // 动态切换语言
85
- const switchToEnglish = () => {
86
- const locale = getLocale('en')
87
- // 重新配置 Element Plus
88
- }
89
- ```
90
-
91
- ### 2. 支持的语言列表
92
-
93
- ```typescript
94
- import { supportedLocales } from '@mc-markets/ui'
95
-
96
- console.log(supportedLocales)
97
- // ['zh-cn', 'en', 'zh-tw', 'ja', 'ko', 'es', 'fr', 'de', ...]
98
- ```
99
-
100
- ## 主题定制
101
-
102
- ### 1. 使用主题管理器
103
-
104
- ```typescript
105
- import { themeManager } from '@mc-markets/ui'
106
-
107
- // 设置主题
108
- themeManager.setTheme({
109
- name: 'custom',
110
- dark: false,
111
- cssVars: {
112
- '--el-color-primary': '#409eff',
113
- '--el-color-success': '#67c23a',
114
- '--el-color-warning': '#e6a23c',
115
- '--el-color-danger': '#f56c6c',
116
- '--el-color-info': '#909399'
117
- },
118
- customClass: 'my-custom-theme'
119
- })
120
-
121
- // 切换暗色主题
122
- themeManager.toggleDark()
123
-
124
- // 获取当前主题
125
- const currentTheme = themeManager.getTheme()
126
- ```
127
-
128
- ### 2. 在组件中使用
129
-
130
- ```vue
131
- <template>
132
- <div>
133
- <el-button @click="toggleTheme">切换主题</el-button>
134
- <el-button @click="setCustomTheme">设置自定义主题</el-button>
135
- </div>
136
- </template>
137
-
138
- <script setup>
139
- import { themeManager } from '@mc-markets/ui'
140
-
141
- const toggleTheme = () => {
142
- themeManager.toggleDark()
143
- }
144
-
145
- const setCustomTheme = () => {
146
- themeManager.setTheme({
147
- name: 'blue',
148
- cssVars: {
149
- '--el-color-primary': '#1890ff'
150
- }
151
- })
152
- }
153
- </script>
154
- ```
155
-
156
- ## 样式覆盖和主题配置
157
-
158
- ### 1. 使用 CSS 变量(推荐)
159
-
160
- ```typescript
161
- import { createApp } from 'vue'
162
- import McMarketsUI from '@mc-markets/ui'
163
- import '@mc-markets/ui/scss-variables' // 导入SCSS变量
164
-
165
- const app = createApp(App)
166
- app.use(McMarketsUI)
167
- ```
168
-
169
- ```css
170
- /* 在你的 CSS 文件中 */
171
- :root {
172
- --el-color-primary: #409eff;
173
- --el-color-success: #67c23a;
174
- --el-color-warning: #e6a23c;
175
- --el-color-danger: #f56c6c;
176
- --el-color-info: #909399;
177
- }
178
-
179
- /* 暗色主题 */
180
- .dark {
181
- --el-color-primary: #409eff;
182
- --el-color-success: #67c23a;
183
- --el-color-warning: #e6a23c;
184
- --el-color-danger: #f56c6c;
185
- --el-color-info: #909399;
186
- }
187
- ```
188
-
189
- ### 2. 使用 SCSS 变量
190
-
191
- ```scss
192
- // 在你的 SCSS 文件中
193
- @use '@mc-markets/ui/scss-variables' as *;
194
-
195
- // 或者自定义变量
196
- @forward 'element-plus/theme-chalk/src/common/var.scss' with (
197
- $colors: (
198
- 'primary': (
199
- 'base': #409eff,
200
- ),
201
- 'success': (
202
- 'base': #67c23a,
203
- ),
204
- )
205
- );
206
- ```
207
-
208
- ### 3. JavaScript 动态配置
209
-
210
- ```typescript
211
- import {
212
- setTheme,
213
- setPrimaryColor,
214
- toggleDark,
215
- themeConfigManager
216
- } from '@mc-markets/ui'
217
-
218
- // 设置主题
219
- setTheme({
220
- name: 'custom',
221
- dark: false,
222
- primaryColor: '#1890ff',
223
- successColor: '#52c41a',
224
- warningColor: '#faad14',
225
- dangerColor: '#ff4d4f',
226
- infoColor: '#1890ff',
227
- cssVars: {
228
- '--el-border-radius-base': '6px',
229
- '--el-font-size-base': '14px'
230
- }
231
- })
232
-
233
- // 单独设置颜色
234
- setPrimaryColor('#1890ff')
235
- setSuccessColor('#52c41a')
236
- setWarningColor('#faad14')
237
- setDangerColor('#ff4d4f')
238
- setInfoColor('#1890ff')
239
-
240
- // 切换暗色主题
241
- toggleDark()
242
- ```
243
-
244
- ## 高级用法
245
-
246
- ### 1. 自定义配置
247
-
248
- ```typescript
249
- import { createApp } from 'vue'
250
- import McMarketsUI, {
251
- themeManager,
252
- getLocale,
253
- supportedLocales
254
- } from '@mc-markets/ui'
255
-
256
- const app = createApp(App)
257
-
258
- // 自定义配置
259
- app.use(McMarketsUI, {
260
- locale: 'zh-cn',
261
- theme: {
262
- name: 'enterprise',
263
- dark: false,
264
- cssVars: {
265
- '--el-color-primary': '#1890ff',
266
- '--el-border-radius-base': '6px',
267
- '--el-font-size-base': '14px'
268
- }
269
- },
270
- importStyle: true
271
- })
272
-
273
- // 全局访问
274
- app.config.globalProperties.$theme = themeManager
275
- app.config.globalProperties.$locales = supportedLocales
276
- ```
277
-
278
- ### 2. 在组合式 API 中使用
279
-
280
- ```vue
281
- <template>
282
- <div>
283
- <el-button @click="changeLanguage">切换语言</el-button>
284
- <el-button @click="changeTheme">切换主题</el-button>
285
- </div>
286
- </template>
287
-
288
- <script setup>
289
- import { ref } from 'vue'
290
- import { themeManager, getLocale, supportedLocales } from '@mc-markets/ui'
291
-
292
- const currentLocale = ref('zh-cn')
293
-
294
- const changeLanguage = () => {
295
- const currentIndex = supportedLocales.indexOf(currentLocale.value)
296
- const nextIndex = (currentIndex + 1) % supportedLocales.length
297
- currentLocale.value = supportedLocales[nextIndex]
298
-
299
- // 重新配置语言
300
- const locale = getLocale(currentLocale.value)
301
- // 这里需要重新配置 Element Plus
302
- }
303
-
304
- const changeTheme = () => {
305
- themeManager.toggleDark()
306
- }
307
- </script>
308
- ```
309
-
310
- ## 类型支持
311
-
312
- ```typescript
313
- import type {
314
- ThemeConfig,
315
- McMarketsUI
316
- } from '@mc-markets/ui'
317
-
318
- // 使用类型
319
- const theme: ThemeConfig = {
320
- name: 'custom',
321
- dark: false,
322
- cssVars: {
323
- '--el-color-primary': '#409eff'
324
- }
325
- }
326
- ```
327
-
328
- ## 注意事项
329
-
330
- 1. **样式导入**:确保导入了 Element Plus 的样式文件
331
- 2. **语言包**:所有语言包都已内置,无需额外安装
332
- 3. **主题切换**:主题切换是全局的,会影响整个应用
333
- 4. **性能优化**:建议使用按需导入来减少包体积
334
- 5. **兼容性**:需要 Vue 3.3+ 和 Element Plus 2.8+
335
-
336
- ## 完整示例
337
-
338
- ```vue
339
- <template>
340
- <div class="app">
341
- <el-header>
342
- <el-menu mode="horizontal">
343
- <el-menu-item index="1">首页</el-menu-item>
344
- <el-menu-item index="2">关于</el-menu-item>
345
- </el-menu>
346
- </el-header>
347
-
348
- <el-main>
349
- <el-form :model="form" label-width="100px">
350
- <el-form-item label="用户名">
351
- <el-input v-model="form.username" />
352
- </el-form-item>
353
- <el-form-item label="密码">
354
- <el-input v-model="form.password" type="password" />
355
- </el-form-item>
356
- <el-form-item>
357
- <el-button type="primary" @click="submit">提交</el-button>
358
- </el-form-item>
359
- </el-form>
360
- </el-main>
361
- </div>
362
- </template>
363
-
364
- <script setup>
365
- import { ref } from 'vue'
366
- import { ElMessage } from '@mc-markets/ui'
367
-
368
- const form = ref({
369
- username: '',
370
- password: ''
371
- })
372
-
373
- const submit = () => {
374
- ElMessage.success('提交成功!')
375
- }
376
- </script>
377
-
378
- <style>
379
- @import '@mc-markets/ui/style';
380
- </style>
381
- ```
382
-
383
- 这个包提供了 Element Plus 的完整功能,包括所有组件、指令、服务、样式、主题和国际化支持,让您可以轻松地在项目中使用 Element Plus 的所有功能。
File without changes
@@ -1,66 +0,0 @@
1
- /**
2
- * 简化的主题配置工具
3
- * 基于 Element Plus 官方主题定制指南
4
- */
5
- export interface ThemeConfig {
6
- name?: string;
7
- dark?: boolean;
8
- primaryColor?: string;
9
- successColor?: string;
10
- warningColor?: string;
11
- dangerColor?: string;
12
- infoColor?: string;
13
- cssVars?: Record<string, string>;
14
- }
15
- declare class ThemeManager {
16
- private currentTheme;
17
- /** 设置主题 */
18
- setTheme(theme: ThemeConfig): void;
19
- /** 获取当前主题 */
20
- getTheme(): ThemeConfig;
21
- /** 切换暗色主题 */
22
- toggleDark(): void;
23
- /** 设置主色调 */
24
- setPrimaryColor(color: string): void;
25
- /** 设置成功色 */
26
- setSuccessColor(color: string): void;
27
- /** 设置警告色 */
28
- setWarningColor(color: string): void;
29
- /** 设置危险色 */
30
- setDangerColor(color: string): void;
31
- /** 设置信息色 */
32
- setInfoColor(color: string): void;
33
- /** 设置CSS变量 */
34
- setCssVar(name: string, value: string): void;
35
- /** 获取CSS变量 */
36
- getCssVar(name: string): string;
37
- /** 生成颜色调色板 */
38
- private generateColorPalette;
39
- /** 应用主题 */
40
- private applyTheme;
41
- /** 十六进制颜色转RGB */
42
- private hexToRgb;
43
- /** RGB转十六进制 */
44
- private rgbToHex;
45
- /** 生成浅色变体 */
46
- private generateLightColors;
47
- /** 生成深色变体 */
48
- private generateDarkColors;
49
- }
50
- export declare const themeManager: ThemeManager;
51
- export declare const setTheme: (theme: ThemeConfig) => void;
52
- export declare const getTheme: () => ThemeConfig;
53
- export declare const toggleDark: () => void;
54
- export declare const setPrimaryColor: (color: string) => void;
55
- export declare const setSuccessColor: (color: string) => void;
56
- export declare const setWarningColor: (color: string) => void;
57
- export declare const setDangerColor: (color: string) => void;
58
- export declare const setInfoColor: (color: string) => void;
59
- export declare const setCssVar: (name: string, value: string) => void;
60
- export declare const getCssVar: (name: string) => string;
61
- export declare const supportedLocales: string[];
62
- export declare const getLocaleLabel: (locale: string) => any;
63
- export declare const getLocale: (locale: string) => {
64
- locale: string;
65
- };
66
- export {};
@@ -1,2 +0,0 @@
1
- declare const _default: () => import('vite').UserConfig;
2
- export default _default;