@mc-markets/ui 1.0.93 → 1.0.94
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 +16 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/package.json +1 -1
- package/packages/resolver.d.ts +6 -3
- package/packages/resolver.js +12 -3
package/dist/resolver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../packages/resolver.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,8CAPG;IAAwB,MAAM,EAAtB,MAAM;IACwB,WAAW,EAAzC,OAAO,GAAC,KAAK,GAAC,MAAM;CAI5B,
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../packages/resolver.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,8CAPG;IAAwB,MAAM,EAAtB,MAAM;IACwB,WAAW,EAAzC,OAAO,GAAC,KAAK,GAAC,MAAM;CAI5B,OA0FF;AAED;;;GAGG;AACH;;EA+EC"}
|
package/package.json
CHANGED
package/packages/resolver.d.ts
CHANGED
|
@@ -14,10 +14,13 @@ export interface McMarketsUIResolverOptions {
|
|
|
14
14
|
prefix?: string
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* 样式导入方式
|
|
18
|
+
* - false: 不导入样式(需要手动在 main.js 中导入)
|
|
19
|
+
* - true 或 'css': 导入编译后的 CSS 文件(推荐)
|
|
20
|
+
* - 'scss': 导入 SCSS 源文件(可自定义变量)
|
|
21
|
+
* @default 'css'
|
|
19
22
|
*/
|
|
20
|
-
importStyle?: boolean
|
|
23
|
+
importStyle?: boolean | 'css' | 'scss'
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
package/packages/resolver.js
CHANGED
|
@@ -73,14 +73,23 @@ export function McMarketsUIResolver(options = {}) {
|
|
|
73
73
|
const componentName = componentMap[name]
|
|
74
74
|
|
|
75
75
|
if (componentName || name.startsWith('M')) {
|
|
76
|
-
//
|
|
76
|
+
// 确定样式文件路径(支持导入多个样式文件)
|
|
77
77
|
let sideEffects
|
|
78
78
|
|
|
79
79
|
if (importStyle && !styleImported) {
|
|
80
80
|
if (importStyle === 'scss') {
|
|
81
|
-
|
|
81
|
+
// 导入 SCSS 源文件 + 字体图标
|
|
82
|
+
sideEffects = [
|
|
83
|
+
'@mc-markets/ui/packages/styles/index.scss',
|
|
84
|
+
'@mc-markets/ui/styles/font'
|
|
85
|
+
]
|
|
82
86
|
} else if (importStyle === true || importStyle === 'css') {
|
|
83
|
-
|
|
87
|
+
// 导入编译后的 CSS + 字体图标
|
|
88
|
+
sideEffects = [
|
|
89
|
+
'@mc-markets/ui/dist/style.css',
|
|
90
|
+
'@mc-markets/ui/styles/font',
|
|
91
|
+
'@mc-markets/ui/styles/colorfont'
|
|
92
|
+
]
|
|
84
93
|
}
|
|
85
94
|
styleImported = true
|
|
86
95
|
}
|