@qin-ui/antd-vue-pro 2.1.14 → 2.2.0
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/AI-CONTEXT.md +208 -95
- package/LICENSE +9 -0
- package/api.json +40 -29
- package/bin/init-ai.mjs +212 -52
- package/es/antd-vue-pro.css +9 -9
- package/es/component-provider/{index-Dmz32tSB.js → index-PHCLwRXW.js} +5 -4
- package/es/component-provider/index-PHCLwRXW.js.map +1 -0
- package/es/component-provider/index.js +2 -1
- package/es/component-provider/index.js.map +1 -0
- package/es/components/component-provider/components/index.vue.d.ts +35 -0
- package/es/components/component-provider/components/index.vue.d.ts.map +1 -0
- package/es/components/component-provider/constants/index.d.ts +16 -0
- package/es/components/component-provider/constants/index.d.ts.map +1 -0
- package/es/components/component-provider/index.d.ts +4 -0
- package/es/components/component-provider/index.d.ts.map +1 -0
- package/es/components/component-provider/types/index.d.ts +63 -0
- package/es/components/component-provider/types/index.d.ts.map +1 -0
- package/es/components/form/components/BaseField/index.vue.d.ts +13 -0
- package/es/components/form/components/BaseField/index.vue.d.ts.map +1 -0
- package/es/components/form/components/BaseField/utils/index.d.ts +3 -0
- package/es/components/form/components/BaseField/utils/index.d.ts.map +1 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts +9 -0
- package/es/components/form/components/BaseFormItem/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts +23 -0
- package/es/components/form/components/ContainerFragment/index.vue.d.ts.map +1 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts +29 -0
- package/es/components/form/components/GroupedFieldAttrs/index.vue.d.ts.map +1 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts +24 -0
- package/es/components/form/components/PathProvider/index.vue.d.ts.map +1 -0
- package/es/components/form/components/ProForm/index.vue.d.ts +36 -0
- package/es/components/form/components/ProForm/index.vue.d.ts.map +1 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts +7 -0
- package/es/components/form/components/SlotComponent/index.vue.d.ts.map +1 -0
- package/es/components/form/components/index.d.ts +12 -0
- package/es/components/form/components/index.d.ts.map +1 -0
- package/es/components/form/constants/index.d.ts +78 -0
- package/es/components/form/constants/index.d.ts.map +1 -0
- package/es/components/form/hooks/index.d.ts +5 -0
- package/es/components/form/hooks/index.d.ts.map +1 -0
- package/es/components/form/hooks/useFields.d.ts +57 -0
- package/es/components/form/hooks/useFields.d.ts.map +1 -0
- package/es/components/form/hooks/useForm.d.ts +93 -0
- package/es/components/form/hooks/useForm.d.ts.map +1 -0
- package/es/components/form/hooks/useFormRef.d.ts +30 -0
- package/es/components/form/hooks/useFormRef.d.ts.map +1 -0
- package/es/components/form/index.d.ts +7 -0
- package/es/components/form/index.d.ts.map +1 -0
- package/es/components/form/types/index.d.ts +207 -0
- package/es/components/form/types/index.d.ts.map +1 -0
- package/es/components/table/components/ColumnControl.vue.d.ts +9 -0
- package/es/components/table/components/ColumnControl.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultSearchFormContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts +18 -0
- package/es/components/table/components/DefaultTableContainer.vue.d.ts.map +1 -0
- package/es/components/table/components/ProTable.vue.d.ts +100 -0
- package/es/components/table/components/ProTable.vue.d.ts.map +1 -0
- package/es/components/table/components/SearchForm.vue.d.ts +48 -0
- package/es/components/table/components/SearchForm.vue.d.ts.map +1 -0
- package/es/components/table/components/SizeControl.vue.d.ts +12 -0
- package/es/components/table/components/SizeControl.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/ColumnHeightOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/DownOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts +3 -0
- package/es/components/table/components/icons/FilterOutlined.vue.d.ts.map +1 -0
- package/es/components/table/components/index.d.ts +5 -0
- package/es/components/table/components/index.d.ts.map +1 -0
- package/es/components/table/hooks/index.d.ts +2 -0
- package/es/components/table/hooks/index.d.ts.map +1 -0
- package/es/components/table/hooks/useTable.d.ts +112 -0
- package/es/components/table/hooks/useTable.d.ts.map +1 -0
- package/es/components/table/index.d.ts +8 -0
- package/es/components/table/index.d.ts.map +1 -0
- package/es/components/table/types/index.d.ts +70 -0
- package/es/components/table/types/index.d.ts.map +1 -0
- package/es/form/index.js +14 -8
- package/es/form/index.js.map +1 -0
- package/es/index.d.ts +76 -1622
- package/es/index.d.ts.map +1 -0
- package/es/index.js +12 -22
- package/es/index.js.map +1 -0
- package/es/shared/core/index.d.ts +6 -0
- package/es/shared/core/index.d.ts.map +1 -0
- package/es/shared/ui/index.d.ts +15 -0
- package/es/shared/ui/index.d.ts.map +1 -0
- package/es/table/index.js +10 -8
- package/es/table/index.js.map +1 -0
- package/package.json +12 -13
- package/src/components/component-provider/components/index.vue +81 -0
- package/src/components/component-provider/constants/index.ts +165 -0
- package/src/components/component-provider/index.ts +6 -0
- package/src/components/component-provider/types/index.ts +90 -0
- package/src/components/form/components/BaseField/index.vue +188 -0
- package/src/components/form/components/BaseField/utils/index.ts +16 -0
- package/src/components/form/components/BaseFormItem/index.vue +163 -0
- package/src/components/form/components/ContainerFragment/index.vue +24 -0
- package/src/components/form/components/GroupedFieldAttrs/index.vue +118 -0
- package/src/components/form/components/PathProvider/index.vue +19 -0
- package/src/components/form/components/ProForm/index.vue +109 -0
- package/src/components/form/components/SlotComponent/index.vue +26 -0
- package/src/components/form/components/index.ts +15 -0
- package/src/components/form/constants/index.ts +135 -0
- package/src/components/form/hooks/index.ts +5 -0
- package/src/components/form/hooks/useFields.ts +67 -0
- package/src/components/form/hooks/useForm.ts +110 -0
- package/src/components/form/hooks/useFormRef.ts +35 -0
- package/src/components/form/index.ts +29 -0
- package/src/components/form/types/index.ts +271 -0
- package/src/components/table/components/ColumnControl.vue +132 -0
- package/src/components/table/components/DefaultSearchFormContainer.vue +20 -0
- package/src/components/table/components/DefaultTableContainer.vue +20 -0
- package/src/components/table/components/ProTable.vue +366 -0
- package/src/components/table/components/SearchForm.vue +295 -0
- package/src/components/table/components/SizeControl.vue +59 -0
- package/src/components/table/components/icons/ColumnHeightOutlined.vue +4 -0
- package/src/components/table/components/icons/DownOutlined.vue +4 -0
- package/src/components/table/components/icons/FilterOutlined.vue +4 -0
- package/src/components/table/components/index.ts +4 -0
- package/src/components/table/hooks/index.ts +1 -0
- package/src/components/table/hooks/useTable.ts +130 -0
- package/src/components/table/index.ts +14 -0
- package/src/components/table/types/index.ts +74 -0
- package/src/index.ts +80 -0
- package/src/shared/core/index.ts +37 -0
- package/src/shared/ui/index.ts +60 -0
- package/es/core/index-ghYuQ3Sy.js +0 -360
- package/es/vendor/utils/lodash-es-p6jau26B.js +0 -1120
package/bin/init-ai.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @qin-ui
|
|
4
|
+
* @qin-ui/antd-vue-pro AI 上下文初始化 CLI 工具
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* 在消费方项目中生成分层 AI 上下文文件,使 AI 工具能够:
|
|
7
|
+
* 1. 理解 @qin-ui/antd-vue-pro 的 Schema 驱动架构
|
|
8
|
+
* 2. 掌握属性透传规则(何时查阅 ant-design-vue 文档)
|
|
9
|
+
* 3. 快速获取完整 API 参考
|
|
8
10
|
*
|
|
9
11
|
* 用法:
|
|
10
12
|
* npx @qin-ui/antd-vue-pro init-ai
|
|
@@ -28,46 +30,171 @@ const PKG_SHORT = PKG_NAME.replace(/^@qin-ui\//, '');
|
|
|
28
30
|
|
|
29
31
|
// ==================== 终端颜色 ====================
|
|
30
32
|
|
|
31
|
-
const green =
|
|
32
|
-
const cyan =
|
|
33
|
-
const bold =
|
|
34
|
-
const
|
|
33
|
+
const green = s => `\x1b[32m${s}\x1b[0m`;
|
|
34
|
+
const cyan = s => `\x1b[36m${s}\x1b[0m`;
|
|
35
|
+
const bold = s => `\x1b[1m${s}\x1b[0m`;
|
|
36
|
+
const yellow = s => `\x1b[33m${s}\x1b[0m`;
|
|
37
|
+
const dim = s => `\x1b[2m${s}\x1b[0m`;
|
|
35
38
|
|
|
36
|
-
// ====================
|
|
39
|
+
// ==================== 内容读取 ====================
|
|
37
40
|
|
|
38
|
-
function
|
|
39
|
-
const filePath = path.join(PKG_ROOT,
|
|
41
|
+
function readPackageFile(filename) {
|
|
42
|
+
const filePath = path.join(PKG_ROOT, filename);
|
|
40
43
|
if (fs.existsSync(filePath)) {
|
|
41
44
|
return fs.readFileSync(filePath, 'utf-8').trim();
|
|
42
45
|
}
|
|
43
|
-
return
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getAiContextContent() {
|
|
50
|
+
return readPackageFile('AI-CONTEXT.md') || `# ${PKG_NAME}\n\n> 基于 Vue 3 的配置驱动组件库。`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function getReadmeContent() {
|
|
54
|
+
return readPackageFile('README.md') || '';
|
|
44
55
|
}
|
|
45
56
|
|
|
46
|
-
function
|
|
57
|
+
function getApiJsonContent() {
|
|
58
|
+
try {
|
|
59
|
+
const raw = readPackageFile('api.json');
|
|
60
|
+
if (!raw) return null;
|
|
61
|
+
return JSON.parse(raw);
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ==================== 内容生成 ====================
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 生成 rules 文件内容(Instructions 层)
|
|
71
|
+
* 包含:架构关系、透传规则、反模式、ant-design-vue 资源链接
|
|
72
|
+
*/
|
|
73
|
+
function getRulesContent() {
|
|
47
74
|
const aiContext = getAiContextContent();
|
|
48
|
-
const core = [
|
|
49
|
-
aiContext,
|
|
50
|
-
'',
|
|
51
|
-
'## 完整 API 参考',
|
|
52
|
-
'',
|
|
53
|
-
`使用 \`${PKG_NAME}\` 时,请阅读以下文件获取完整的 API 定义、类型签名和使用示例:`,
|
|
54
|
-
`- \`node_modules/${PKG_NAME}/README.md\` — 详细使用文档和代码示例`,
|
|
55
|
-
`- \`node_modules/${PKG_NAME}/api.json\` — 结构化 API 元数据(组件、Hook、类型的签名和 JSDoc 示例)`,
|
|
56
|
-
'',
|
|
57
|
-
].join('\n');
|
|
58
75
|
|
|
59
|
-
// 包含兼容性的 Frontmatter(如 Cursor 支持的 globs 等)
|
|
60
76
|
return [
|
|
61
77
|
'---',
|
|
62
|
-
`description: "${PKG_NAME} 组件库使用规范"`,
|
|
78
|
+
`description: "${PKG_NAME} 组件库使用规范 — Schema 驱动、属性透传规则"`,
|
|
63
79
|
'globs: ["**/*.vue", "**/*.ts", "**/*.tsx"]',
|
|
64
80
|
'alwaysApply: false',
|
|
65
81
|
'---',
|
|
66
82
|
'',
|
|
67
|
-
|
|
83
|
+
aiContext,
|
|
84
|
+
'',
|
|
85
|
+
'---',
|
|
86
|
+
'',
|
|
87
|
+
'## 本地参考文件',
|
|
88
|
+
'',
|
|
89
|
+
'本规则文件提供了核心架构和用法指南。需要完整 API 参考或底层组件文档时,请阅读以下资源:',
|
|
90
|
+
'',
|
|
91
|
+
`- **\`.agents/docs/${PKG_SHORT}-api.md\`** — 完整 API 文档(组件、Hooks、类型、Field 配置参考)`,
|
|
92
|
+
`- **\`node_modules/${PKG_NAME}/api.json\`** — 结构化 API 元数据(函数签名、类型定义)`,
|
|
93
|
+
'',
|
|
94
|
+
'## 底层组件文档',
|
|
95
|
+
'',
|
|
96
|
+
`${PKG_NAME} 基于 **ant-design-vue**(v4,\`a-\` 前缀)封装。编写 Field 中的输入控件属性前,请查阅 ant-design-vue 官方文档确认属性名和类型:`,
|
|
97
|
+
'',
|
|
98
|
+
'- **[ant-design-vue 官方文档](https://antdv.com)** — 组件 API 参考(中文)',
|
|
99
|
+
'',
|
|
68
100
|
].join('\n');
|
|
69
101
|
}
|
|
70
102
|
|
|
103
|
+
/**
|
|
104
|
+
* 生成 API 文档内容(Resources 层)
|
|
105
|
+
* 从 README.md + api.json 合并提取完整 API 参考
|
|
106
|
+
*/
|
|
107
|
+
function getApiDocContent() {
|
|
108
|
+
const readme = getReadmeContent();
|
|
109
|
+
const apiJson = getApiJsonContent();
|
|
110
|
+
|
|
111
|
+
const sections = [];
|
|
112
|
+
|
|
113
|
+
sections.push(`# ${PKG_NAME} — 完整 API 参考`, '');
|
|
114
|
+
sections.push(`> 自动生成自 README.md 和 api.json。版本: ${PKG_JSON.version}`, '');
|
|
115
|
+
|
|
116
|
+
// README 内容(已包含完整的使用文档)
|
|
117
|
+
if (readme) {
|
|
118
|
+
sections.push(readme);
|
|
119
|
+
sections.push('');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 结构化 API 元数据
|
|
123
|
+
if (apiJson && apiJson.api && apiJson.api.length > 0) {
|
|
124
|
+
sections.push('---');
|
|
125
|
+
sections.push('');
|
|
126
|
+
sections.push('## 结构化 API 元数据(自动提取自源码 JSDoc)');
|
|
127
|
+
sections.push('');
|
|
128
|
+
|
|
129
|
+
for (const item of apiJson.api) {
|
|
130
|
+
const typeLabel = {
|
|
131
|
+
component: '组件',
|
|
132
|
+
function: '函数/Hook',
|
|
133
|
+
type: '类型',
|
|
134
|
+
interface: '接口',
|
|
135
|
+
constant: '常量',
|
|
136
|
+
}[item.type] || '';
|
|
137
|
+
|
|
138
|
+
sections.push(`### ${typeLabel} \`${item.name}\``);
|
|
139
|
+
sections.push('');
|
|
140
|
+
sections.push(`**类型:** ${item.type}`);
|
|
141
|
+
if (item.signature) {
|
|
142
|
+
sections.push('');
|
|
143
|
+
sections.push('```typescript');
|
|
144
|
+
sections.push(item.signature);
|
|
145
|
+
sections.push('```');
|
|
146
|
+
}
|
|
147
|
+
if (item.description) {
|
|
148
|
+
sections.push('');
|
|
149
|
+
sections.push(item.description);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (item.typeParams && item.typeParams.length > 0) {
|
|
153
|
+
sections.push('');
|
|
154
|
+
sections.push('**泛型参数:**');
|
|
155
|
+
for (const tp of item.typeParams) {
|
|
156
|
+
const extras = [];
|
|
157
|
+
if (tp.extends) extras.push(`extends ${tp.extends}`);
|
|
158
|
+
if (tp.default) extras.push(`默认 ${tp.default}`);
|
|
159
|
+
const extra = extras.length ? ` (${extras.join(', ')})` : '';
|
|
160
|
+
sections.push(`- \`${tp.name}\`${extra}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (item.params && item.params.length > 0) {
|
|
165
|
+
sections.push('');
|
|
166
|
+
sections.push('**参数:**');
|
|
167
|
+
sections.push('');
|
|
168
|
+
sections.push('| 参数名 | 类型 | 可选 | 描述 |');
|
|
169
|
+
sections.push('| :--- | :--- | :--- | :--- |');
|
|
170
|
+
for (const p of item.params) {
|
|
171
|
+
sections.push(`| \`${p.name}\` | \`${p.type}\` | ${p.optional ? '是' : '否'} | ${p.description} |`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (item.returns) {
|
|
176
|
+
sections.push('');
|
|
177
|
+
sections.push(`**返回值:** ${item.returns}`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (item.examples && item.examples.length > 0) {
|
|
181
|
+
sections.push('');
|
|
182
|
+
sections.push('**示例:**');
|
|
183
|
+
for (const ex of item.examples) {
|
|
184
|
+
sections.push('');
|
|
185
|
+
sections.push(ex);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
sections.push('');
|
|
190
|
+
sections.push('---');
|
|
191
|
+
sections.push('');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return sections.join('\n');
|
|
196
|
+
}
|
|
197
|
+
|
|
71
198
|
// ==================== 文件写入 ====================
|
|
72
199
|
|
|
73
200
|
function ensureDir(dirPath) {
|
|
@@ -76,31 +203,43 @@ function ensureDir(dirPath) {
|
|
|
76
203
|
}
|
|
77
204
|
}
|
|
78
205
|
|
|
206
|
+
function writeFileWithLog(filePath, content, label) {
|
|
207
|
+
const dir = path.dirname(filePath);
|
|
208
|
+
ensureDir(dir);
|
|
209
|
+
const existed = fs.existsSync(filePath);
|
|
210
|
+
fs.writeFileSync(filePath, content, 'utf-8');
|
|
211
|
+
const status = existed ? yellow('[更新]') : green('[创建]');
|
|
212
|
+
console.log(` ${status} ${cyan(label)}`);
|
|
213
|
+
}
|
|
214
|
+
|
|
79
215
|
// ==================== CLI 入口 ====================
|
|
80
216
|
|
|
81
217
|
function printHelp() {
|
|
82
218
|
console.log(`
|
|
83
|
-
${bold(`${PKG_NAME} CLI
|
|
219
|
+
${bold(`${PKG_NAME} CLI — AI 上下文初始化`)}
|
|
84
220
|
|
|
85
221
|
${bold('用法:')}
|
|
86
222
|
npx ${PKG_NAME} init-ai
|
|
87
223
|
|
|
88
|
-
${bold('
|
|
89
|
-
|
|
224
|
+
${bold('说明:')}
|
|
225
|
+
在项目中生成分层 AI 上下文文件,使 AI 工具能够深度理解和规范使用 ${PKG_NAME}。
|
|
226
|
+
|
|
227
|
+
生成的文件结构:
|
|
228
|
+
.agents/
|
|
229
|
+
rules/
|
|
230
|
+
${PKG_SHORT}.md 规则文件(架构、透传规则、反模式)
|
|
231
|
+
docs/
|
|
232
|
+
${PKG_SHORT}-api.md API 参考(完整文档 + 结构化元数据)
|
|
90
233
|
|
|
91
234
|
${bold('选项:')}
|
|
92
235
|
--help 显示帮助信息
|
|
93
|
-
|
|
94
|
-
${bold('说明:')}
|
|
95
|
-
该命令将采用统一的 Agentic 标准,在项目的 .agents/rules/ 目录下
|
|
96
|
-
生成上下文文件。兼容支持读取 .agents 的主流 AI IDE 和 CLI 工具。
|
|
97
236
|
`);
|
|
98
237
|
}
|
|
99
238
|
|
|
100
239
|
function main() {
|
|
101
240
|
const args = process.argv.slice(2);
|
|
102
|
-
const subcommand = args.find(
|
|
103
|
-
const flags = args.filter(
|
|
241
|
+
const subcommand = args.find(a => !a.startsWith('-'));
|
|
242
|
+
const flags = args.filter(a => a.startsWith('-'));
|
|
104
243
|
|
|
105
244
|
if (!subcommand || flags.includes('--help') || flags.includes('-h')) {
|
|
106
245
|
printHelp();
|
|
@@ -108,35 +247,56 @@ function main() {
|
|
|
108
247
|
}
|
|
109
248
|
|
|
110
249
|
if (subcommand !== 'init-ai') {
|
|
111
|
-
console.error(
|
|
250
|
+
console.error(`\n ❌ 未知命令: ${subcommand}\n`);
|
|
112
251
|
printHelp();
|
|
113
252
|
process.exit(1);
|
|
114
253
|
}
|
|
115
254
|
|
|
116
255
|
console.log('');
|
|
117
|
-
console.log(bold(`📦 ${PKG_NAME} — AI 上下文初始化
|
|
256
|
+
console.log(bold(`📦 ${PKG_NAME} — AI 上下文初始化 v${PKG_JSON.version}`));
|
|
257
|
+
console.log(dim(` 基于 ant-design-vue 的 Schema 驱动组件库`));
|
|
118
258
|
console.log('');
|
|
119
|
-
|
|
120
|
-
const content = getUnifiedAgentContent();
|
|
121
|
-
const dirPath = '.agents/rules';
|
|
122
|
-
const fileName = `${PKG_SHORT}.md`;
|
|
123
|
-
|
|
124
|
-
const fullDir = path.join(process.cwd(), dirPath);
|
|
125
|
-
const fullPath = path.join(fullDir, fileName);
|
|
126
259
|
|
|
127
|
-
|
|
128
|
-
|
|
260
|
+
// 1. 生成 Rules 文件
|
|
261
|
+
console.log(bold('📋 规则层 (Rules)'));
|
|
262
|
+
const rulesContent = getRulesContent();
|
|
263
|
+
writeFileWithLog(
|
|
264
|
+
path.join(process.cwd(), '.agents/rules', `${PKG_SHORT}.md`),
|
|
265
|
+
rulesContent,
|
|
266
|
+
`.agents/rules/${PKG_SHORT}.md`
|
|
267
|
+
);
|
|
268
|
+
console.log(dim(' → 架构概览、属性透传决策树、渐进用法、反模式'));
|
|
269
|
+
console.log('');
|
|
129
270
|
|
|
130
|
-
|
|
131
|
-
console.log(
|
|
271
|
+
// 2. 生成 API 文档
|
|
272
|
+
console.log(bold('📖 参考层 (Docs)'));
|
|
273
|
+
const apiDocContent = getApiDocContent();
|
|
274
|
+
writeFileWithLog(
|
|
275
|
+
path.join(process.cwd(), '.agents/docs', `${PKG_SHORT}-api.md`),
|
|
276
|
+
apiDocContent,
|
|
277
|
+
`.agents/docs/${PKG_SHORT}-api.md`
|
|
278
|
+
);
|
|
279
|
+
console.log(dim(' → 完整 README 文档 + 结构化 API 元数据'));
|
|
280
|
+
console.log('');
|
|
132
281
|
|
|
282
|
+
// 3. 完成提示
|
|
283
|
+
console.log(green('✅ 完成!已生成分层 AI 上下文文件。'));
|
|
133
284
|
console.log('');
|
|
134
|
-
console.log(
|
|
285
|
+
console.log(`${bold('📂 生成的文件:')}`);
|
|
286
|
+
console.log(` ${cyan('.agents/')}`);
|
|
287
|
+
console.log(` ├── ${cyan('rules/')}`);
|
|
288
|
+
console.log(` │ └── ${cyan(PKG_SHORT + '.md')} ${dim('← 核心规则(AI 优先读取)')}`);
|
|
289
|
+
console.log(` └── ${cyan('docs/')}`);
|
|
290
|
+
console.log(` └── ${cyan(PKG_SHORT + '-api.md')} ${dim('← 完整 API 参考')}`);
|
|
291
|
+
console.log('');
|
|
292
|
+
|
|
293
|
+
console.log(`${bold('🔄 建议的下一步:')}`);
|
|
294
|
+
console.log(` 1. 提交 ${cyan('.agents/')} 目录到 Git 仓库,团队共享`);
|
|
295
|
+
console.log(` 2. 编写 Field 配置中的输入控件属性前,查阅 ant-design-vue 官方文档:`);
|
|
296
|
+
console.log(` ${cyan('https://antdv.com')}`);
|
|
297
|
+
console.log(` 3. ${dim('(可选)查看完整 API 参考:')}`);
|
|
298
|
+
console.log(` ${dim(`cat .agents/docs/${PKG_SHORT}-api.md`)}`);
|
|
135
299
|
console.log('');
|
|
136
|
-
console.log(`${bold('下一步:')}`);
|
|
137
|
-
console.log(
|
|
138
|
-
` 将 ${cyan(dirPath)} 目录提交到 Git,团队即可自动享受 AI 增强\n`
|
|
139
|
-
);
|
|
140
300
|
}
|
|
141
301
|
|
|
142
302
|
main();
|
package/es/antd-vue-pro.css
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.pro-table_search-form[data-v-
|
|
1
|
+
.pro-table_search-form[data-v-aee49e85] [class*='-form-item'] {
|
|
2
2
|
margin: 0;
|
|
3
3
|
}
|
|
4
|
-
.pro-table_search-form_expand-toggle-button[data-v-
|
|
4
|
+
.pro-table_search-form_expand-toggle-button[data-v-aee49e85] {
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
padding: 0;
|
|
8
8
|
padding-left: 4px;
|
|
9
9
|
}
|
|
10
|
-
.pro-table_search-form .transition[data-v-
|
|
10
|
+
.pro-table_search-form .transition[data-v-aee49e85] {
|
|
11
11
|
transition: all 0.25s;
|
|
12
12
|
}
|
|
13
13
|
.pro-table_search-form-container[data-v-c385cd54] {
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
.pro-table_column-control_button[data-v-d503f78a] svg {
|
|
37
37
|
transform: scale(1.2, 1.4);
|
|
38
38
|
}
|
|
39
|
-
.pro-table_header[data-v-
|
|
39
|
+
.pro-table_header[data-v-856c096b] {
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
justify-content: flex-end;
|
|
43
43
|
}
|
|
44
|
-
.pro-table_header[data-v-
|
|
44
|
+
.pro-table_header[data-v-856c096b]:empty {
|
|
45
45
|
display: none;
|
|
46
46
|
}
|
|
47
|
-
.pro-table_header + .pro-table_header_content[data-v-
|
|
47
|
+
.pro-table_header + .pro-table_header_content[data-v-856c096b] {
|
|
48
48
|
margin-top: 16px;
|
|
49
49
|
}
|
|
50
|
-
.pro-table_header_button-bar[data-v-
|
|
50
|
+
.pro-table_header_button-bar[data-v-856c096b] {
|
|
51
51
|
flex: 1;
|
|
52
52
|
}
|
|
53
|
-
.pro-table_header_toolbar[data-v-
|
|
53
|
+
.pro-table_header_toolbar[data-v-856c096b] {
|
|
54
54
|
margin-left: 12px;
|
|
55
55
|
}
|
|
56
|
-
.pro-table[data-v-
|
|
56
|
+
.pro-table[data-v-856c096b] [class*='-pagination'] [class*='-pagination-total-text'] {
|
|
57
57
|
flex: 1;
|
|
58
58
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { getObject } from "@qin-ui/pro-components-core";
|
|
1
2
|
import { defineComponent, provide, renderSlot } from "vue";
|
|
2
|
-
import { g as getObject } from "../core/index-ghYuQ3Sy.js";
|
|
3
3
|
const getPopupContainer = (triggerNode) => triggerNode.closest("form[class*='-form']");
|
|
4
4
|
const INJECT_COMPONENTS = Symbol("INJECT_COMPONENTS");
|
|
5
5
|
const INJECT_CONFIG = {
|
|
@@ -152,15 +152,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
152
152
|
},
|
|
153
153
|
setup(__props) {
|
|
154
154
|
const props = __props;
|
|
155
|
-
if (props.componentMap) {
|
|
156
|
-
provide(INJECT_COMPONENTS, props.componentMap);
|
|
157
|
-
}
|
|
158
155
|
if (props.componentVars) {
|
|
159
156
|
Object.entries(props.componentVars).forEach(([key, val]) => {
|
|
160
157
|
const config = ensureInjectConfig(key);
|
|
161
158
|
provide(config.injectionKey, { ...config.default, ...getObject(val) });
|
|
162
159
|
});
|
|
163
160
|
}
|
|
161
|
+
if (props.componentMap) {
|
|
162
|
+
provide(INJECT_COMPONENTS, props.componentMap);
|
|
163
|
+
}
|
|
164
164
|
return (_ctx, _cache) => {
|
|
165
165
|
return renderSlot(_ctx.$slots, "default");
|
|
166
166
|
};
|
|
@@ -172,3 +172,4 @@ export {
|
|
|
172
172
|
INJECT_COMPONENTS as a,
|
|
173
173
|
getInjectConfig as g
|
|
174
174
|
};
|
|
175
|
+
//# sourceMappingURL=index-PHCLwRXW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-PHCLwRXW.js","sources":["../../src/components/component-provider/constants/index.ts","../../src/components/component-provider/components/index.vue"],"sourcesContent":["import { RequiredComponentVars } from '../types';\nimport { InjectionKey, Component } from 'vue';\n\nconst getPopupContainer = (triggerNode: any) =>\n triggerNode.closest(\"form[class*='-form']\");\n\nexport const INJECT_COMPONENTS: InjectionKey<\n Partial<Record<string, Component>>\n> = Symbol('INJECT_COMPONENTS');\n\nexport type InjectConfigEntry<T = any> = {\n injectionKey: InjectionKey<T>;\n default: T;\n};\n\nexport const INJECT_CONFIG: {\n [key in keyof RequiredComponentVars]: {\n injectionKey: InjectionKey<RequiredComponentVars[key]>;\n default: RequiredComponentVars[key];\n };\n} = {\n 'pro-table': {\n injectionKey: Symbol(''),\n default: {\n pagination: {\n showTotal: total => `共 ${total} 条`,\n showSizeChanger: true,\n pageSizeOptions: ['10', '20', '30', '40', '50', '100'],\n showQuickJumper: true,\n },\n searchFormConfig: {\n layout: 'grid',\n expand: { minExpandRows: 2, expandStatus: false },\n },\n control: true,\n addIndexColumn: true,\n },\n },\n 'pro-form': {\n injectionKey: Symbol(''),\n default: { grid: { gutter: { xs: 8, sm: 16, md: 16, lg: 24 } } },\n },\n 'pro-form-item': {\n injectionKey: Symbol(''),\n default: { validateFirst: true, span: 8 },\n },\n // field\n input: {\n injectionKey: Symbol(''),\n default: { maxlength: 100, allowClear: true, placeholder: '请输入' },\n },\n textarea: {\n injectionKey: Symbol(''),\n default: {\n maxlength: 200,\n autoSize: { minRows: 3, maxRows: 6 },\n showCount: true,\n allowClear: true,\n placeholder: '请输入',\n },\n },\n 'input-password': {\n injectionKey: Symbol(''),\n default: { maxlength: 100, allowClear: true, placeholder: '请输入' },\n },\n 'input-search': {\n injectionKey: Symbol(''),\n default: {},\n },\n 'input-number': {\n injectionKey: Symbol(''),\n default: {\n max: 10 ** 15 - 1,\n min: -(10 ** 15 + 1),\n controls: false,\n placeholder: '请输入',\n style: { width: '100%' },\n },\n },\n select: {\n injectionKey: Symbol(''),\n default: { allowClear: true, placeholder: '请选择', getPopupContainer },\n },\n cascader: {\n injectionKey: Symbol(''),\n default: { allowClear: true, placeholder: '请选择', getPopupContainer },\n },\n 'date-picker': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'date-picker.date': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'date-picker.week': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'date-picker.month': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'date-picker.year': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'date-picker.quarter': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'range-picker': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'time-picker': {\n injectionKey: Symbol(''),\n default: { allowClear: true, getPopupContainer, style: { width: '100%' } },\n },\n 'checkbox-group': {\n injectionKey: Symbol(''),\n default: {},\n },\n 'radio-group': {\n injectionKey: Symbol(''),\n default: {},\n },\n switch: {\n injectionKey: Symbol(''),\n default: { modelProp: 'checked' },\n },\n slider: {\n injectionKey: Symbol(''),\n default: {},\n },\n 'tree-select': {\n injectionKey: Symbol(''),\n default: {},\n },\n transfer: {\n injectionKey: Symbol(''),\n default: {},\n },\n};\n\nconst DYNAMIC_INJECT_CONFIG: Record<string, InjectConfigEntry> =\n Object.create(null);\n\nexport const getInjectConfig = (key: string): InjectConfigEntry | undefined => {\n return (\n (INJECT_CONFIG as Record<string, InjectConfigEntry>)[key] ||\n DYNAMIC_INJECT_CONFIG[key]\n );\n};\n\nexport const ensureInjectConfig = (key: string): InjectConfigEntry => {\n const existing = getInjectConfig(key);\n if (existing) return existing;\n const created: InjectConfigEntry = {\n injectionKey: Symbol(`dynamic:${key}`),\n default: {},\n };\n DYNAMIC_INJECT_CONFIG[key] = created;\n return created;\n};\n","<script lang=\"ts\" setup>\n/**\n * @component ProComponentProvider\n * @description @qin-ui/antd-vue-pro 全局配置提供者组件\n * @public\n *\n * 用于在组件树的顶层配置所有子组件的全局默认属性。\n * 支持配置 ProForm、ProTable、ProFormItem 以及所有内置组件的默认属性。\n *\n * @param {ComponentVars} [componentVars] - 组件全局配置变量\n * @param {Record<ComponentName, any>} [componentMap] - 自定义组件映射,用于替换或扩展内置组件\n *\n * @slot default - 需要应用全局配置的子组件内容\n *\n * @example\n * ```vue\n * <template>\n * <ProComponentProvider\n * :componentVars=\"{\n * 'pro-form': { labelCol: { span: 4 } },\n * 'input': { placeholder: '请输入', maxlength: 200 },\n * 'select': { placeholder: '请选择' },\n * }\"\n * >\n * <ProForm :form=\"form\" :fields=\"fields\" />\n * </ProComponentProvider>\n * </template>\n * ```\n */\nimport { ComponentVars } from '../types';\nimport { INJECT_COMPONENTS, ensureInjectConfig } from '../constants';\nimport { provide } from 'vue';\nimport { getObject } from '../../../shared/core';\nimport { ComponentName } from '../../form/constants';\n\ntype ComponentMap = Partial<Record<ComponentName, any>>;\n\ndefineOptions({\n name: 'ProComponentProvider',\n inheritAttrs: false,\n});\n\ntype Props = {\n /**\n * @description 组件全局配置\n * 可配置所有内置组件和 Pro 组件的默认属性\n * @example { 'input': { placeholder: '请输入' }, 'pro-form': { grid: { gutter: 24 } } }\n */\n componentVars?: ComponentVars;\n /**\n * @description 自定义组件映射\n * 用于替换或扩展内置组件,传入的组件会覆盖默认的同名组件\n * @example { 'input': MyCustomInput, 'select': MyCustomSelect }\n */\n componentMap?: ComponentMap;\n};\n\nconst props = defineProps<Props>();\n\n/*\n * 遍历 componentVars 的每个 key,获取或创建对应的 inject 配置\n * 将用户提供的值合并到默认值上,通过 provide 注入到子组件树\n * 子组件通过 inject(config.injectionKey) 获取合并后的配置\n */\nif (props.componentVars) {\n Object.entries(props.componentVars).forEach(([key, val]) => {\n const config = ensureInjectConfig(key);\n // 用户配置覆盖默认值\n provide(config.injectionKey, { ...config.default, ...getObject(val) });\n });\n}\n\n// 注入自定义组件映射,BaseField 在解析组件时会优先使用此映射\nif (props.componentMap) {\n provide(INJECT_COMPONENTS, props.componentMap);\n}\n</script>\n\n<template>\n <slot />\n</template>\n"],"names":["_renderSlot"],"mappings":";;AAGA,MAAM,oBAAoB,CAAC,gBACzB,YAAY,QAAQ,sBAAsB;AAErC,MAAM,oBAET,OAAO,mBAAmB;AAOvB,MAAM,gBAKT;AAAA,EACF,aAAa;AAAA,IACX,cAAc,OAAO,EAAE;AAAA,IACvB,SAAS;AAAA,MACP,YAAY;AAAA,QACV,WAAW,CAAA,UAAS,KAAK,KAAK;AAAA,QAC9B,iBAAiB;AAAA,QACjB,iBAAiB,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK;AAAA,QACrD,iBAAiB;AAAA,MAAA;AAAA,MAEnB,kBAAkB;AAAA,QAChB,QAAQ;AAAA,QACR,QAAQ,EAAE,eAAe,GAAG,cAAc,MAAA;AAAA,MAAM;AAAA,MAElD,SAAS;AAAA,MACT,gBAAgB;AAAA,IAAA;AAAA,EAClB;AAAA,EAEF,YAAY;AAAA,IACV,cAAc,OAAO,EAAE;AAAA,IACvB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,IAAI,IAAI,IAAI,IAAI,GAAA,IAAK;AAAA,EAAE;AAAA,EAEjE,iBAAiB;AAAA,IACf,cAAc,OAAO,EAAE;AAAA,IACvB,SAAS,EAAE,eAAe,MAAM,MAAM,EAAA;AAAA,EAAE;AAAA;AAAA,EAG1C,OAAO;AAAA,IACL,cAAc,OAAO,EAAE;AAAA,IACvB,SAAS,EAAE,WAAW,KAAK,YAAY,MAAM,aAAa,MAAA;AAAA,EAAM;AAAA,EAElE,UAAU;AAAA,IACR,cAAc,OAAO,EAAE;AAAA,IACvB,SAAS;AAAA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kB,CAAC,QAA+C;AAC7E,SACG,cAAoD,GAAG,KACxD,sBAAsB,GAAG;AAE7B;AAEO,MAAM,qBAAqB,CAAC,QAAmC;AACpE,QAAM,WAAW,gBAAgB,GAAG;AACpC,MAAI,SAAU,QAAO;AACrB,QAAM,UAA6B;AAAA,IACjC,cAAc,OAAO,WAAW,GAAG,EAAE;AAAA,IACrC,SAAS,CAAA;AAAA,EAAC;AAEZ,wBAAsB,GAAG,IAAI;AAC7B,SAAO;AACT;;;;;;;;;;;;AC3GA,UAAM,QAAQ;AAOd,QAAI,MAAM,eAAe;AACvB,aAAO,QAAQ,MAAM,aAAa,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM;AAC1D,cAAM,SAAS,mBAAmB,GAAG;AAErC,gBAAQ,OAAO,cAAc,EAAE,GAAG,OAAO,SAAS,GAAG,UAAU,GAAG,GAAG;AAAA,MACvE,CAAC;AAAA,IACH;AAGA,QAAI,MAAM,cAAc;AACtB,cAAQ,mBAAmB,MAAM,YAAY;AAAA,IAC/C;;aAIEA,WAAQ,KAAA,QAAA,SAAA;AAAA;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentVars } from '../types';
|
|
2
|
+
import { ComponentName } from '../../form/constants';
|
|
3
|
+
type ComponentMap = Partial<Record<ComponentName, any>>;
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* @description 组件全局配置
|
|
7
|
+
* 可配置所有内置组件和 Pro 组件的默认属性
|
|
8
|
+
* @example { 'input': { placeholder: '请输入' }, 'pro-form': { grid: { gutter: 24 } } }
|
|
9
|
+
*/
|
|
10
|
+
componentVars?: ComponentVars;
|
|
11
|
+
/**
|
|
12
|
+
* @description 自定义组件映射
|
|
13
|
+
* 用于替换或扩展内置组件,传入的组件会覆盖默认的同名组件
|
|
14
|
+
* @example { 'input': MyCustomInput, 'select': MyCustomSelect }
|
|
15
|
+
*/
|
|
16
|
+
componentMap?: ComponentMap;
|
|
17
|
+
};
|
|
18
|
+
declare function __VLS_template(): {
|
|
19
|
+
attrs: Partial<{}>;
|
|
20
|
+
slots: {
|
|
21
|
+
default?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: any;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/components/index.vue"],"names":[],"mappings":"AAmFA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,KAAK,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC;AAOxD,KAAK,KAAK,GAAG;IACX;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAyBF,iBAAS,cAAc;WAoBT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,sRAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequiredComponentVars } from '../types';
|
|
2
|
+
import { InjectionKey, Component } from 'vue';
|
|
3
|
+
export declare const INJECT_COMPONENTS: InjectionKey<Partial<Record<string, Component>>>;
|
|
4
|
+
export type InjectConfigEntry<T = any> = {
|
|
5
|
+
injectionKey: InjectionKey<T>;
|
|
6
|
+
default: T;
|
|
7
|
+
};
|
|
8
|
+
export declare const INJECT_CONFIG: {
|
|
9
|
+
[key in keyof RequiredComponentVars]: {
|
|
10
|
+
injectionKey: InjectionKey<RequiredComponentVars[key]>;
|
|
11
|
+
default: RequiredComponentVars[key];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const getInjectConfig: (key: string) => InjectConfigEntry | undefined;
|
|
15
|
+
export declare const ensureInjectConfig: (key: string) => InjectConfigEntry;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAK9C,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAC1C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CACL,CAAC;AAEhC,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACvC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE;KACzB,GAAG,IAAI,MAAM,qBAAqB,GAAG;QACpC,YAAY,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;QACvD,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;KACrC;CA4HF,CAAC;AAKF,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,iBAAiB,GAAG,SAKjE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,iBAShD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/component-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { GridItemProps, FormItemProps, TableProps } from '../../../shared/ui';
|
|
2
|
+
import { Base, Grid } from '../../form/types';
|
|
3
|
+
import { ProFormProps } from '../../form';
|
|
4
|
+
import { ProTableProps } from '../../table';
|
|
5
|
+
import { AllowedComponentProps } from 'vue';
|
|
6
|
+
import { GetComponentType, ComponentName } from '../../form/constants';
|
|
7
|
+
import { ComponentProps } from 'vue-component-type-helpers';
|
|
8
|
+
type PP<T extends Record<string, any>> = Partial<T & AllowedComponentProps>;
|
|
9
|
+
type FP<T extends Record<string, any>> = Partial<T & Pick<Base, 'valueFormatter' | 'componentContainer' | 'modelProp'> & AllowedComponentProps>;
|
|
10
|
+
/**
|
|
11
|
+
* @qin-ui/antd-vue-pro 全局配置变量类型
|
|
12
|
+
*
|
|
13
|
+
* @description 定义可通过 ProComponentProvider 配置的所有组件默认属性。
|
|
14
|
+
* 支持配置表单、表格、表单项以及所有内置组件的默认属性。
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // 通过 ProComponentProvider 配置全局默认值
|
|
19
|
+
* const componentVars: ComponentVars = {
|
|
20
|
+
* 'pro-form': {
|
|
21
|
+
* grid: { gutter: 24 },
|
|
22
|
+
* labelCol: { span: 4 },
|
|
23
|
+
* },
|
|
24
|
+
* 'input': {
|
|
25
|
+
* placeholder: '请输入内容',
|
|
26
|
+
* maxlength: 200,
|
|
27
|
+
* },
|
|
28
|
+
* 'select': {
|
|
29
|
+
* placeholder: '请选择',
|
|
30
|
+
* },
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export type RequiredComponentVars = {
|
|
35
|
+
/** ProTable 全局默认属性 */
|
|
36
|
+
'pro-table': PP<TableProps & Pick<ProTableProps, 'control' | 'searchFormConfig' | 'immediateSearch' | 'addIndexColumn' | 'tableContainer'>>;
|
|
37
|
+
/** ProForm 全局默认属性,grid 必须为 GridProps 对象而非 boolean */
|
|
38
|
+
'pro-form': PP<Omit<ProFormProps, 'form' | 'grid'> & {
|
|
39
|
+
grid: Exclude<Grid, undefined | boolean>;
|
|
40
|
+
}>;
|
|
41
|
+
/** ProFormItem 全局默认属性 */
|
|
42
|
+
'pro-form-item': PP<FormItemProps & Pick<GridItemProps, 'span' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'> & Pick<Base, 'formItemContainer'>>;
|
|
43
|
+
/** DatePicker date 模式全局默认属性 */
|
|
44
|
+
'date-picker.date': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
45
|
+
/** DatePicker week 模式全局默认属性 */
|
|
46
|
+
'date-picker.week': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
47
|
+
/** DatePicker month 模式全局默认属性 */
|
|
48
|
+
'date-picker.month': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
49
|
+
/** DatePicker year 模式全局默认属性 */
|
|
50
|
+
'date-picker.year': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
51
|
+
/** DatePicker quarter 模式全局默认属性 */
|
|
52
|
+
'date-picker.quarter': FP<ComponentProps<GetComponentType<'date-picker'>>>;
|
|
53
|
+
} & {
|
|
54
|
+
[K in Exclude<ComponentName, 'custom'>]: FP<ComponentProps<GetComponentType<K>>>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* 组件全局配置
|
|
58
|
+
* @description RequiredComponentVars 的 Partial 版本,用于 ProComponentProvider 的 props
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export type ComponentVars = Partial<RequiredComponentVars>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/component-provider/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,KAAK,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,qBAA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aAAa,CAAC,CAAC,CAAC,CAAC;IACxE,kCAAkC;IAClC,qBAAqB,EAAE,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAC5E,GAAG;KAED,CAAC,IAAI,OAAO,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE,CACzC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CACpC;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
type Props = {
|
|
3
|
+
component?: string | Component;
|
|
4
|
+
path?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
7
|
+
getComponentRef: () => any;
|
|
8
|
+
getComponentComputedProps: () => any;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
10
|
+
componentRef: unknown;
|
|
11
|
+
}, any>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseField/index.vue"],"names":[],"mappings":"AA8LA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,KAAK,CAAC;AAeb,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;;;qCAgH6D,GAAG;;;;AAsGlE,wBAQG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/form/components/BaseField/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvC,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAW7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Fields, Grid } from '../../types';
|
|
2
|
+
type Props = {
|
|
3
|
+
grid?: Grid;
|
|
4
|
+
fields?: Fields;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/BaseFormItem/index.vue"],"names":[],"mappings":"AAyMA,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAQhD,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;AA0QF,wBAMG"}
|