fan-standard-comp 4.1.50 → 4.1.52
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 +10 -1
- package/ai/component-index.json +269 -0
- package/ai/templates/AGENTS.md +83 -0
- package/dist/fan-standard-comp.min.js +1 -1
- package/docs/components/ButtonGroup.md +101 -0
- package/docs/components/ButtonGroupBeta.md +19 -0
- package/docs/components/CalendarCoordPicker.md +22 -0
- package/docs/components/DragContent.md +33 -0
- package/docs/components/EditButton.md +28 -0
- package/docs/components/FanProvider.md +95 -0
- package/docs/components/Field.md +112 -0
- package/docs/components/ImageGallery.md +65 -0
- package/docs/components/ItemGroup.md +164 -0
- package/docs/components/JsonInput.md +47 -0
- package/docs/components/NavLeafScroll.md +39 -0
- package/docs/components/Navigation.md +24 -0
- package/docs/components/RefactortTree.md +61 -0
- package/docs/components/SideCard.md +25 -0
- package/docs/components/SpecIcon.md +35 -0
- package/docs/components/SplitterLayout.md +37 -0
- package/docs/components/StandardDragModal.md +27 -0
- package/docs/components/StandardDrawer.md +144 -0
- package/docs/components/StandardFilter.md +199 -0
- package/docs/components/StandardForm.md +111 -0
- package/docs/components/StandardList.md +46 -0
- package/docs/components/StandardModal.md +175 -0
- package/docs/components/StandardPanel.md +64 -0
- package/docs/components/StandardTable.md +114 -0
- package/docs/components/StandardTablePro.md +98 -0
- package/docs/components/StandardTitle.md +24 -0
- package/docs/components/SubfieldContent.md +71 -0
- package/docs/components/Uploader.md +56 -0
- package/docs/components/VarTemplate.md +28 -0
- package/docs/components/WrapperContent.md +62 -0
- package/docs/global.less +6 -0
- package/docs/global.tsx +8 -0
- package/docs/guide/for-agents.md +15 -0
- package/docs/guide/theme.md +78 -0
- package/docs/guide/todoList.md +25 -0
- package/docs/guide/update.md +1068 -0
- package/docs/guide/usage.md +39 -0
- package/docs/index.md +24 -0
- package/docs/manage/authority.md +72 -0
- package/docs/manage/businessUtils.md +86 -0
- package/docs/manage/commit.md +72 -0
- package/docs/manage/componenting.md +217 -0
- package/docs/manage/errorBoundary.md +138 -0
- package/docs/manage/naming.md +88 -0
- package/docs/manage/sdkSystem.md +314 -0
- package/docs/manage/socketClient.md +318 -0
- package/docs/manage/upgrade.md +81 -0
- package/docs/manage/usage.md +112 -0
- package/docs/manage/watermark.md +213 -0
- package/docs/other/usage.md +29 -0
- package/docs/utils/convert.md +18 -0
- package/docs/utils/data.md +98 -0
- package/docs/utils/dataFuncBasic.tsx +40 -0
- package/docs/utils/dict.md +45 -0
- package/docs/utils/other.md +91 -0
- package/docs/utils/regExp.md +62 -0
- package/docs/utils/response.md +24 -0
- package/docs/utils/treeData.md +163 -0
- package/docs/utils/urlUtils.md +67 -0
- package/es/StandardFilter/index.js +27 -11
- package/lib/StandardFilter/index.js +27 -11
- package/llms-full.txt +103 -0
- package/llms.txt +35 -0
- package/package.json +9 -4
package/README.md
CHANGED
|
@@ -19,4 +19,13 @@ $ yarn add fan-standard-comp
|
|
|
19
19
|
### 打包文档站点
|
|
20
20
|
```
|
|
21
21
|
$ yarn docs:build:dumi
|
|
22
|
-
```
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
构建完成后,除 Dumi 文档站外,还会在产物中保留可直接访问的 Markdown 源文档和 AI 索引:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
doc-v4/docs/components/ButtonGroup.md
|
|
28
|
+
doc-v4/llms.txt
|
|
29
|
+
doc-v4/llms-full.txt
|
|
30
|
+
doc-v4/ai/component-index.json
|
|
31
|
+
```
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "fan-standard-comp",
|
|
5
|
+
"majorVersion": 4,
|
|
6
|
+
"framework": "React",
|
|
7
|
+
"baseLibrary": "antd@5",
|
|
8
|
+
"importPattern": "import { ComponentName } from 'fan-standard-comp'"
|
|
9
|
+
},
|
|
10
|
+
"components": [
|
|
11
|
+
{
|
|
12
|
+
"name": "FanProvider",
|
|
13
|
+
"category": "global-config",
|
|
14
|
+
"summary": "为组件库提供语言、表单、筛选、表格和弹窗的全局默认配置。",
|
|
15
|
+
"source": "src/ConfigContext/index.ts",
|
|
16
|
+
"docs": "docs/components/FanProvider.md",
|
|
17
|
+
"relatedExports": ["FanContext", "FanDefaultConfig"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Field",
|
|
21
|
+
"aliases": ["FieldComponent"],
|
|
22
|
+
"category": "form-control",
|
|
23
|
+
"summary": "通过 type 配置渲染输入、选择、日期、树选择、上传等基础控件。",
|
|
24
|
+
"source": "src/FormComp/FieldComponent/index.tsx",
|
|
25
|
+
"docs": "docs/components/Field.md",
|
|
26
|
+
"demos": ["src/FormComp/FieldComponent/demos/basic.tsx", "src/FormComp/FieldComponent/demos/fieldStatus.tsx", "src/FormComp/FieldComponent/demos/date.tsx", "src/FormComp/FieldComponent/demos/select.tsx", "src/FormComp/FieldComponent/demos/tree-select.tsx", "src/FormComp/FieldComponent/demos/custom.tsx", "src/FormComp/FieldComponent/demos/extend.tsx"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "ItemGroup",
|
|
30
|
+
"aliases": ["RenderItemGroup"],
|
|
31
|
+
"category": "form-layout",
|
|
32
|
+
"summary": "根据配置批量渲染表单项,并管理栅格、标签、尺寸和只读布局。",
|
|
33
|
+
"source": "src/FormComp/RenderItemGroup/index.tsx",
|
|
34
|
+
"docs": "docs/components/ItemGroup.md",
|
|
35
|
+
"demos": ["src/FormComp/RenderItemGroup/demos/basic.tsx", "src/FormComp/RenderItemGroup/demos/size.tsx", "src/FormComp/RenderItemGroup/demos/layout.tsx", "src/FormComp/RenderItemGroup/demos/formList.tsx"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "StandardForm",
|
|
39
|
+
"category": "form",
|
|
40
|
+
"summary": "通用配置化表单,提供表单项、操作按钮、校验和实例访问。",
|
|
41
|
+
"source": "src/StandardForm/index.tsx",
|
|
42
|
+
"docs": "docs/components/StandardForm.md",
|
|
43
|
+
"demos": ["src/StandardForm/demos/basic.tsx", "src/StandardForm/demos/fields.tsx"],
|
|
44
|
+
"relatedExports": ["StepForm", "TabForm"]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "StepForm",
|
|
48
|
+
"category": "form",
|
|
49
|
+
"summary": "StandardForm 体系的分步表单。",
|
|
50
|
+
"source": "src/StandardForm/StepForm.tsx",
|
|
51
|
+
"docs": "docs/components/StandardForm.md",
|
|
52
|
+
"demos": ["src/StandardForm/demos/stepFormBasic.tsx"]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "TabForm",
|
|
56
|
+
"category": "form",
|
|
57
|
+
"summary": "StandardForm 体系的分页签表单。",
|
|
58
|
+
"source": "src/StandardForm/TabForm.tsx",
|
|
59
|
+
"docs": "docs/components/StandardForm.md",
|
|
60
|
+
"demos": ["src/StandardForm/demos/tabFormBasic.tsx"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "StandardFilter",
|
|
64
|
+
"category": "filter",
|
|
65
|
+
"summary": "用于表格上方的配置化筛选栏,支持按钮组、展开折叠、布局和值转换。",
|
|
66
|
+
"source": "src/StandardFilter/index.tsx",
|
|
67
|
+
"docs": "docs/components/StandardFilter.md",
|
|
68
|
+
"demos": ["src/StandardFilter/demos/basic.tsx", "src/StandardFilter/demos/buttons.tsx", "src/StandardFilter/demos/layout.tsx", "src/StandardFilter/demos/collapseable.tsx", "src/StandardFilter/demos/transform.tsx"]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "StandardTable",
|
|
72
|
+
"category": "data-display",
|
|
73
|
+
"summary": "封装操作列、行选择、按钮组和分页策略的通用表格。",
|
|
74
|
+
"source": "src/StandardTable/index.tsx",
|
|
75
|
+
"docs": "docs/components/StandardTable.md",
|
|
76
|
+
"demos": ["src/StandardTable/demos/basic.tsx", "src/StandardTable/demos/action.tsx", "src/StandardTable/demos/checkbox.tsx", "src/StandardTable/demos/config.tsx"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "StandardTablePro",
|
|
80
|
+
"category": "data-display",
|
|
81
|
+
"summary": "带接口请求、查询表单和 ref 操作的高阶表格。",
|
|
82
|
+
"source": "src/StandardTablePro/index.tsx",
|
|
83
|
+
"docs": "docs/components/StandardTablePro.md",
|
|
84
|
+
"demos": ["src/StandardTablePro/demos/basic.tsx", "src/StandardTablePro/demos/fetchData.tsx"]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "StandardModal",
|
|
88
|
+
"category": "overlay",
|
|
89
|
+
"summary": "页面操作弹窗,可组合配置化表单、步骤表单、Tab 表单和自定义按钮。",
|
|
90
|
+
"source": "src/StandardModal/index.tsx",
|
|
91
|
+
"docs": "docs/components/StandardModal.md",
|
|
92
|
+
"demos": ["src/StandardModal/demos/basic.tsx", "src/StandardModal/demos/form.tsx", "src/StandardModal/demos/footer.tsx", "src/StandardModal/demos/stepForm.tsx", "src/StandardModal/demos/tabForm.tsx"]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "StandardDrawer",
|
|
96
|
+
"category": "overlay",
|
|
97
|
+
"summary": "支持配置化表单、栅格布局和底部按钮的通用抽屉。",
|
|
98
|
+
"source": "src/StandardDrawer/index.tsx",
|
|
99
|
+
"docs": "docs/components/StandardDrawer.md",
|
|
100
|
+
"demos": ["src/StandardDrawer/demos/basic.tsx", "src/StandardDrawer/demos/form.tsx"]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "StandardDragModal",
|
|
104
|
+
"category": "overlay",
|
|
105
|
+
"summary": "可拖拽弹窗;当前文档注明升级 Ant Design 后存在待修复问题。",
|
|
106
|
+
"status": "experimental",
|
|
107
|
+
"source": "src/StandardDragModal/Modal.tsx",
|
|
108
|
+
"docs": "docs/components/StandardDragModal.md",
|
|
109
|
+
"demos": ["src/StandardDragModal/demos/basic.tsx"]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "ButtonGroup",
|
|
113
|
+
"category": "action",
|
|
114
|
+
"summary": "支持普通按钮、文本操作和表格操作列的权限按钮组。",
|
|
115
|
+
"source": "src/ButtonGroup/index.tsx",
|
|
116
|
+
"docs": "docs/components/ButtonGroup.md",
|
|
117
|
+
"demos": ["src/ButtonGroup/demos/basic.tsx", "src/ButtonGroup/demos/text.tsx", "src/ButtonGroup/demos/action.tsx"]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "EditButton",
|
|
121
|
+
"category": "form-control",
|
|
122
|
+
"summary": "在按钮和输入保存状态间切换的编辑控件。",
|
|
123
|
+
"source": "src/FormComp/EditButton/index.tsx",
|
|
124
|
+
"docs": "docs/components/EditButton.md",
|
|
125
|
+
"demos": ["src/FormComp/EditButton/demos/basic.tsx"]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "JsonInput",
|
|
129
|
+
"category": "form-control",
|
|
130
|
+
"summary": "JSON 输入和编辑控件,支持实时校验、格式化、压缩和只读预览。",
|
|
131
|
+
"source": "src/FormComp/JsonInput/index.tsx",
|
|
132
|
+
"docs": "docs/components/JsonInput.md",
|
|
133
|
+
"demos": ["src/FormComp/JsonInput/demos/basic.tsx"]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "Uploader",
|
|
137
|
+
"category": "form-control",
|
|
138
|
+
"summary": "文件和图片上传控件,支持预览、数量限制、尺寸限制和裁剪。",
|
|
139
|
+
"source": "src/FormComp/Uploader/index.tsx",
|
|
140
|
+
"docs": "docs/components/Uploader.md",
|
|
141
|
+
"demos": ["src/FormComp/Uploader/demos/basic.tsx", "src/FormComp/Uploader/demos/image.tsx", "src/FormComp/Uploader/demos/limit.tsx", "src/FormComp/Uploader/demos/crop.tsx"]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "VarTemplate",
|
|
145
|
+
"category": "form-control",
|
|
146
|
+
"summary": "用于编辑包含变量的模板内容。",
|
|
147
|
+
"source": "src/FormComp/VarTemplate/index.tsx",
|
|
148
|
+
"docs": "docs/components/VarTemplate.md",
|
|
149
|
+
"demos": ["src/FormComp/VarTemplate/demos/basic.tsx"]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "StandardList",
|
|
153
|
+
"category": "data-display",
|
|
154
|
+
"summary": "通用列表,支持勾选和基于 dnd-kit 的拖拽排序。",
|
|
155
|
+
"source": "src/StandardList/index.tsx",
|
|
156
|
+
"docs": "docs/components/StandardList.md",
|
|
157
|
+
"demos": ["src/StandardList/demos/basic.tsx", "src/StandardList/demos/checkable.tsx", "src/StandardList/demos/dragSorting.tsx"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "RefactorTree",
|
|
161
|
+
"category": "navigation",
|
|
162
|
+
"summary": "常用于页面左侧的树形导航,支持搜索、根节点、禁用和选择限制。",
|
|
163
|
+
"source": "src/RefactorTree/index.tsx",
|
|
164
|
+
"docs": "docs/components/RefactortTree.md",
|
|
165
|
+
"demos": ["src/RefactorTree/demos/basic.tsx", "src/RefactorTree/demos/search.tsx", "src/RefactorTree/demos/disabled.tsx"]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "NavLeafScroll",
|
|
169
|
+
"category": "navigation",
|
|
170
|
+
"summary": "可横向或纵向翻页滚动的菜单或列表。",
|
|
171
|
+
"source": "src/NavLeafScroll/index.tsx",
|
|
172
|
+
"docs": "docs/components/NavLeafScroll.md",
|
|
173
|
+
"demos": ["src/NavLeafScroll/demos/basic.tsx"]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"name": "WrapperContent",
|
|
177
|
+
"category": "layout",
|
|
178
|
+
"summary": "包含可选页头和页脚的页面外层内容容器。",
|
|
179
|
+
"source": "src/StandardContent/WrapperContent.tsx",
|
|
180
|
+
"docs": "docs/components/WrapperContent.md",
|
|
181
|
+
"demos": ["src/StandardContent/demos/wrapper.tsx", "src/StandardContent/demos/wrapperPage.tsx", "src/StandardContent/demos/wrapperFooter.tsx"]
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "SubfieldContent",
|
|
185
|
+
"category": "layout",
|
|
186
|
+
"summary": "包含可选标题区和底部区的分区内容容器。",
|
|
187
|
+
"source": "src/StandardContent/SubfieldContent.tsx",
|
|
188
|
+
"docs": "docs/components/SubfieldContent.md",
|
|
189
|
+
"demos": ["src/StandardContent/demos/subfield.tsx", "src/StandardContent/demos/subfieldFooter.tsx", "src/StandardContent/demos/subfieldTable.tsx"]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "SideCard",
|
|
193
|
+
"category": "layout",
|
|
194
|
+
"summary": "用于 SubfieldContent 布局的侧边卡片。",
|
|
195
|
+
"source": "src/StandardContent/SideCard.tsx",
|
|
196
|
+
"docs": "docs/components/SideCard.md",
|
|
197
|
+
"demos": ["src/StandardContent/demos/sideCard.tsx"]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "SplitterLayout",
|
|
201
|
+
"category": "layout",
|
|
202
|
+
"summary": "用于创建可分割的多区域布局。",
|
|
203
|
+
"source": "src/StandardContent/SplitterLayout/index.jsx",
|
|
204
|
+
"docs": "docs/components/SplitterLayout.md",
|
|
205
|
+
"demos": ["src/StandardContent/demos/splitter.tsx"]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"name": "DragContent",
|
|
209
|
+
"category": "layout",
|
|
210
|
+
"summary": "可从指定方向拉伸的内容容器;功能仍在完善中。",
|
|
211
|
+
"status": "experimental",
|
|
212
|
+
"source": "src/DragContent/index.tsx",
|
|
213
|
+
"docs": "docs/components/DragContent.md",
|
|
214
|
+
"demos": ["src/DragContent/demos/basic.tsx"]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "StandardPanel",
|
|
218
|
+
"category": "layout",
|
|
219
|
+
"summary": "可组合标题、按钮、类别和标签的标准面板。",
|
|
220
|
+
"source": "src/StandardPanel/index.tsx",
|
|
221
|
+
"docs": "docs/components/StandardPanel.md",
|
|
222
|
+
"demos": ["src/StandardPanel/demos/basic.tsx", "src/StandardPanel/demos/buttons.tsx", "src/StandardPanel/demos/cates.tsx", "src/StandardPanel/demos/badges.tsx"]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "StandardTitle",
|
|
226
|
+
"category": "typography",
|
|
227
|
+
"summary": "统一页面与内容区域标题样式的组件。",
|
|
228
|
+
"source": "src/StandardTitle/index.tsx",
|
|
229
|
+
"docs": "docs/components/StandardTitle.md",
|
|
230
|
+
"demos": ["src/StandardTitle/demos/basic.tsx"]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"name": "SpecIcon",
|
|
234
|
+
"category": "media",
|
|
235
|
+
"summary": "渲染组件库内置或业务扩展图标,支持前缀、尺寸和状态色。",
|
|
236
|
+
"source": "src/SpecIcon/index.tsx",
|
|
237
|
+
"docs": "docs/components/SpecIcon.md",
|
|
238
|
+
"demos": ["src/SpecIcon/demos/basic.tsx", "src/SpecIcon/demos/prefix.tsx", "src/SpecIcon/demos/status.tsx"]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "ImageGallery",
|
|
242
|
+
"category": "media",
|
|
243
|
+
"summary": "基于 lightgallery 的图片画廊,可使用 children 或 items 提供图片。",
|
|
244
|
+
"source": "src/ImageGallery/index.tsx",
|
|
245
|
+
"docs": "docs/components/ImageGallery.md",
|
|
246
|
+
"relatedExports": ["ImagePreview"]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "ImagePreview",
|
|
250
|
+
"category": "media",
|
|
251
|
+
"summary": "支持 body 浮层或行内模式的图集预览。",
|
|
252
|
+
"source": "src/ImageGallery/ImagePreview.tsx",
|
|
253
|
+
"docs": "docs/components/ImageGallery.md",
|
|
254
|
+
"demos": ["src/ImageGallery/demos/images.tsx", "src/ImageGallery/demos/preview.tsx"]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "IconNode",
|
|
258
|
+
"category": "internal-primitive",
|
|
259
|
+
"summary": "将图标配置转换为可渲染节点的基础组件。",
|
|
260
|
+
"source": "src/components/IconNode/index.tsx",
|
|
261
|
+
"docs": null
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"notes": [
|
|
265
|
+
"components 仅收录 src/index.ts 通过包根路径公开导出的 React 组件与 Provider。",
|
|
266
|
+
"docs 为 null 表示当前没有独立使用文档。",
|
|
267
|
+
"公开组件的使用文档统一位于 docs/components,并随 npm 包发布。"
|
|
268
|
+
]
|
|
269
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## fan-standard-comp 使用规范
|
|
4
|
+
|
|
5
|
+
本项目使用 `fan-standard-comp@4.x` 作为主要业务组件库。该组件库基于 React 18 和 Ant Design 5。
|
|
6
|
+
|
|
7
|
+
开发或修改页面、表单、表格、筛选器、弹窗、抽屉以及页面布局时,应优先复用 `fan-standard-comp` 已提供的组件,不要重复实现相同能力。
|
|
8
|
+
|
|
9
|
+
### 组件资料读取顺序
|
|
10
|
+
|
|
11
|
+
优先读取当前安装版本中的资料:
|
|
12
|
+
|
|
13
|
+
1. `node_modules/fan-standard-comp/llms.txt`
|
|
14
|
+
2. `node_modules/fan-standard-comp/ai/component-index.json`
|
|
15
|
+
3. 索引中 `docs` 字段指向的组件文档
|
|
16
|
+
4. 必要时读取 `node_modules/fan-standard-comp/llms-full.txt`
|
|
17
|
+
|
|
18
|
+
如果当前环境无法访问 `node_modules`,再读取在线文档:
|
|
19
|
+
|
|
20
|
+
1. `http://47.113.227.251:1203/doc-v4/llms.txt`
|
|
21
|
+
2. `http://47.113.227.251:1203/doc-v4/ai/component-index.json`
|
|
22
|
+
3. `http://47.113.227.251:1203/doc-v4/llms-full.txt`
|
|
23
|
+
|
|
24
|
+
使用在线资料时,应确认其内容与项目安装的 `fan-standard-comp` 版本一致;若版本不一致,以本地 npm 包内文档和类型声明为准。
|
|
25
|
+
|
|
26
|
+
不要在任务开始时加载全部文档。先通过 `component-index.json` 按用途定位组件,再读取对应文档。
|
|
27
|
+
|
|
28
|
+
### 组件选择原则
|
|
29
|
+
|
|
30
|
+
- 基础表单控件优先使用 `Field`。
|
|
31
|
+
- 配置化表单项和栅格布局优先使用 `ItemGroup`。
|
|
32
|
+
- 普通表单优先使用 `StandardForm`。
|
|
33
|
+
- 分步表单使用 `StepForm`,分页签表单使用 `TabForm`。
|
|
34
|
+
- 查询条件区域优先使用 `StandardFilter`。
|
|
35
|
+
- 普通业务表格优先使用 `StandardTable`。
|
|
36
|
+
- 需要接口请求、查询条件或实例操作的表格优先使用 `StandardTablePro`。
|
|
37
|
+
- 操作弹窗优先使用 `StandardModal`,侧边操作面板使用 `StandardDrawer`。
|
|
38
|
+
- 页面内容结构优先复用 `WrapperContent`、`SubfieldContent`、`SideCard` 和 `SplitterLayout`。
|
|
39
|
+
- 权限按钮组和表格操作列优先使用 `ButtonGroup`。
|
|
40
|
+
- 文件或图片上传优先使用 `Uploader`。
|
|
41
|
+
- 不要仅因为熟悉 Ant Design,就绕过组件库重新组合一套相同业务能力。
|
|
42
|
+
|
|
43
|
+
### 导入规范
|
|
44
|
+
|
|
45
|
+
组件统一从包根路径导入:
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import {
|
|
49
|
+
Field,
|
|
50
|
+
ItemGroup,
|
|
51
|
+
StandardFilter,
|
|
52
|
+
StandardTable,
|
|
53
|
+
StandardModal,
|
|
54
|
+
} from 'fan-standard-comp';
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
除非包根路径没有公开导出,否则不要从 `fan-standard-comp/es/...` 或 `fan-standard-comp/lib/...` 深层导入。
|
|
58
|
+
|
|
59
|
+
注意以下导出别名:
|
|
60
|
+
|
|
61
|
+
- `FieldComponent` 与 `Field` 指向同一组件,新增代码优先使用 `Field`。
|
|
62
|
+
- `RenderItemGroup` 与 `ItemGroup` 指向同一组件,新增代码优先使用 `ItemGroup`。
|
|
63
|
+
|
|
64
|
+
### 实现要求
|
|
65
|
+
|
|
66
|
+
使用组件前应检查对应文档中的:
|
|
67
|
+
|
|
68
|
+
- API 参数和默认值
|
|
69
|
+
- 示例代码
|
|
70
|
+
- 与 Ant Design 原始属性的关系
|
|
71
|
+
- 全局 `FanProvider` 配置
|
|
72
|
+
- 已知问题和版本限制
|
|
73
|
+
|
|
74
|
+
配置化表单应尽量复用项目中现有的字段结构和转换逻辑,不要自行发明另一套字段协议。
|
|
75
|
+
|
|
76
|
+
当文档、类型声明和现有代码不一致时:
|
|
77
|
+
|
|
78
|
+
1. 优先参考当前安装版本的 TypeScript 声明。
|
|
79
|
+
2. 再检查项目中已经正常运行的同类用法。
|
|
80
|
+
3. 必要时检查组件实现源码。
|
|
81
|
+
4. 不确定的行为应明确说明,不要猜测不存在的属性。
|
|
82
|
+
|
|
83
|
+
修改完成后,应执行项目已有的类型检查、测试或构建命令。
|