yc-vep-ui 0.0.31 → 0.0.32

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/dist/resolver.cjs CHANGED
@@ -27,7 +27,7 @@
27
27
  * @param {YcVepUiResolverOptions} [options={}]
28
28
  * @returns {import('unplugin-vue-components/types').ComponentResolver}
29
29
  */
30
- export function YcVepUiResolver(options = {}) {
30
+ function YcVepUiResolver(options = {}) {
31
31
  const { prefix = 'Ui' } = options
32
32
 
33
33
  return {
@@ -62,72 +62,4 @@ export function YcVepUiResolver(options = {}) {
62
62
  }
63
63
  }
64
64
 
65
- export default YcVepUiResolver
66
- /**
67
- * unplugin-vue-components 解析器
68
- * 用于自动导入 yc-vep-ui 组件
69
- *
70
- * 使用方式:
71
- * ```ts
72
- * import Components from 'unplugin-vue-components/vite'
73
- * import { YcVepUiResolver } from 'yc-vep-ui/resolver'
74
- *
75
- * export default defineConfig({
76
- * plugins: [
77
- * Components({
78
- * resolvers: [YcVepUiResolver()],
79
- * }),
80
- * ],
81
- * })
82
- * ```
83
- */
84
-
85
- import type { ComponentResolver } from 'unplugin-vue-components/types'
86
-
87
- export interface YcVepUiResolverOptions {
88
- /**
89
- * 组件前缀(默认 'Ui')
90
- * @default 'Ui'
91
- */
92
- prefix?: string
93
- }
94
-
95
- /**
96
- * yc-vep-ui 组件库的自动导入解析器
97
- */
98
- export function YcVepUiResolver(options: YcVepUiResolverOptions = {}): ComponentResolver {
99
- const { prefix = 'Ui' } = options
100
-
101
- return {
102
- type: 'component',
103
- resolve: (name: string) => {
104
- // 匹配以 Ui 开头的组件名
105
- if (name.startsWith(prefix)) {
106
- const componentName = name.slice(prefix.length)
107
-
108
- // 组件名称映射(将驼峰命名转换为实际的文件名)
109
- const componentMap: Record<string, string> = {
110
- Card: 'Card',
111
- Table: 'Table',
112
- Filter: 'Filter',
113
- Form: 'Form',
114
- Editor: 'Editor',
115
- Tree: 'Tree',
116
- InfiniteScroll: 'InfiniteScroll',
117
- Descriptions: 'Descriptions',
118
- Dialog: 'Dialog',
119
- }
120
-
121
- const mappedName = componentMap[componentName]
122
- if (mappedName) {
123
- return {
124
- name: `Ui${mappedName}`,
125
- from: 'yc-vep-ui',
126
- }
127
- }
128
- }
129
- },
130
- }
131
- }
132
-
133
- export default YcVepUiResolver
65
+ module.exports = YcVepUiResolver
package/dist/resolver.mjs CHANGED
@@ -63,71 +63,3 @@ export function YcVepUiResolver(options = {}) {
63
63
  }
64
64
 
65
65
  export default YcVepUiResolver
66
- /**
67
- * unplugin-vue-components 解析器
68
- * 用于自动导入 yc-vep-ui 组件
69
- *
70
- * 使用方式:
71
- * ```ts
72
- * import Components from 'unplugin-vue-components/vite'
73
- * import { YcVepUiResolver } from 'yc-vep-ui/resolver'
74
- *
75
- * export default defineConfig({
76
- * plugins: [
77
- * Components({
78
- * resolvers: [YcVepUiResolver()],
79
- * }),
80
- * ],
81
- * })
82
- * ```
83
- */
84
-
85
- import type { ComponentResolver } from 'unplugin-vue-components/types'
86
-
87
- export interface YcVepUiResolverOptions {
88
- /**
89
- * 组件前缀(默认 'Ui')
90
- * @default 'Ui'
91
- */
92
- prefix?: string
93
- }
94
-
95
- /**
96
- * yc-vep-ui 组件库的自动导入解析器
97
- */
98
- export function YcVepUiResolver(options: YcVepUiResolverOptions = {}): ComponentResolver {
99
- const { prefix = 'Ui' } = options
100
-
101
- return {
102
- type: 'component',
103
- resolve: (name: string) => {
104
- // 匹配以 Ui 开头的组件名
105
- if (name.startsWith(prefix)) {
106
- const componentName = name.slice(prefix.length)
107
-
108
- // 组件名称映射(将驼峰命名转换为实际的文件名)
109
- const componentMap: Record<string, string> = {
110
- Card: 'Card',
111
- Table: 'Table',
112
- Filter: 'Filter',
113
- Form: 'Form',
114
- Editor: 'Editor',
115
- Tree: 'Tree',
116
- InfiniteScroll: 'InfiniteScroll',
117
- Descriptions: 'Descriptions',
118
- Dialog: 'Dialog',
119
- }
120
-
121
- const mappedName = componentMap[componentName]
122
- if (mappedName) {
123
- return {
124
- name: `Ui${mappedName}`,
125
- from: 'yc-vep-ui',
126
- }
127
- }
128
- }
129
- },
130
- }
131
- }
132
-
133
- export default YcVepUiResolver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-vep-ui",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "type": "module",
5
5
  "description": "基于 Vue 3 + Element Plus 的企业级 UI 组件库",
6
6
  "keywords": [