@para-ui/core 5.0.0-beta.9 → 5.0.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.
Files changed (730) hide show
  1. package/AGENTS.md +315 -0
  2. package/AlignBox/component.json +89 -0
  3. package/Anchor/component.json +130 -0
  4. package/Argv/component.json +216 -0
  5. package/AutoBox/component.json +133 -0
  6. package/AutoButton/component.json +109 -0
  7. package/AutoTips/component.json +121 -0
  8. package/Badge/component.json +92 -0
  9. package/Breadcrumbs/component.json +142 -0
  10. package/Button/component.json +168 -0
  11. package/ButtonGroup/component.json +132 -0
  12. package/Card/component.json +162 -0
  13. package/Carousel/component.json +142 -0
  14. package/Cascader/component.json +196 -0
  15. package/Checkbox/component.json +138 -0
  16. package/CheckboxGroup/component.json +152 -0
  17. package/CodeEditor/component.json +189 -0
  18. package/Collapse/component.json +166 -0
  19. package/CollapseBox/component.json +84 -0
  20. package/CollapseLayout/component.json +155 -0
  21. package/ColorPicker/component.json +142 -0
  22. package/ComboSelect/component.json +181 -0
  23. package/Container/component.json +111 -0
  24. package/ContentBox/component.json +81 -0
  25. package/CopyText/component.json +118 -0
  26. package/CycleSelector/component.json +98 -0
  27. package/DatePicker/component.json +192 -0
  28. package/Descriptions/component.json +142 -0
  29. package/Desktop/component.json +171 -0
  30. package/DragVerify/component.json +114 -0
  31. package/Drawer/component.json +200 -0
  32. package/Dropdown/component.json +147 -0
  33. package/DynamicMultiBox/component.json +278 -0
  34. package/Empty/component.json +123 -0
  35. package/ExpressionInput/component.json +79 -0
  36. package/FieldForm/component.json +196 -0
  37. package/Form/component.json +161 -0
  38. package/FormItem/component.json +171 -0
  39. package/FunctionModal/component.json +197 -0
  40. package/Help/component.json +118 -0
  41. package/HelperText/component.json +126 -0
  42. package/Image/component.json +165 -0
  43. package/InputCode/component.json +191 -0
  44. package/InputLang/component.json +205 -0
  45. package/InputNumber/component.json +162 -0
  46. package/Label/component.json +126 -0
  47. package/Loading/component.json +91 -0
  48. package/Menu/component.json +180 -0
  49. package/Message/component.json +246 -0
  50. package/Modal/component.json +277 -0
  51. package/MultiBox/component.json +216 -0
  52. package/Notification/component.json +184 -0
  53. package/OperateBtn/component.json +134 -0
  54. package/PageHeader/component.json +112 -0
  55. package/Pagination/component.json +181 -0
  56. package/PasswordRules/component.json +105 -0
  57. package/PopConfirm/component.json +227 -0
  58. package/PopMenu/component.json +131 -0
  59. package/Popover/component.json +165 -0
  60. package/Progress/component.json +161 -0
  61. package/Prompt/component.json +144 -0
  62. package/Querying/component.json +96 -0
  63. package/QuickReply/component.json +129 -0
  64. package/Radio/component.json +136 -0
  65. package/RadioGroup/component.json +149 -0
  66. package/RangeInput/component.json +198 -0
  67. package/Result/component.json +104 -0
  68. package/ScrollBar/component.json +115 -0
  69. package/Search/component.json +177 -0
  70. package/Select/component.json +244 -0
  71. package/SelectInput/component.json +184 -0
  72. package/Selector/component.json +203 -0
  73. package/SelectorPicker/component.json +179 -0
  74. package/SingleBox/component.json +151 -0
  75. package/Slider/component.json +181 -0
  76. package/SortBox/component.json +108 -0
  77. package/Status/component.json +104 -0
  78. package/Stepper/component.json +129 -0
  79. package/Switch/component.json +207 -0
  80. package/Table/component.json +547 -0
  81. package/Tabs/component.json +227 -0
  82. package/Tag/component.json +221 -0
  83. package/TextEditor/component.json +186 -0
  84. package/TextField/component.json +290 -0
  85. package/TimePicker/component.json +176 -0
  86. package/Timeline/component.json +110 -0
  87. package/Title/component.json +156 -0
  88. package/ToggleButton/component.json +153 -0
  89. package/Tooltip/component.json +176 -0
  90. package/Transfer/component.json +157 -0
  91. package/Tree/component.json +512 -0
  92. package/Upload/component.json +450 -0
  93. package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
  94. package/ai-workflows/02-rbac-operation-buttons.md +290 -0
  95. package/ai-workflows/03-complex-form-async-cascade.md +350 -0
  96. package/ai-workflows/04-array-field-form.md +281 -0
  97. package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
  98. package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
  99. package/ai-workflows/07-search-filter-table-trio.md +387 -0
  100. package/ai-workflows/08-table-advanced-features.md +365 -0
  101. package/ai-workflows/09-batch-operation-export-progress.md +367 -0
  102. package/ai-workflows/10-cross-component-state-coordination.md +412 -0
  103. package/es/AlignBox/component.json +89 -0
  104. package/es/AlignBox/index.css +1 -1
  105. package/es/AlignBox/index.d.ts +6 -2
  106. package/es/AlignBox/index.js +1 -1
  107. package/es/AlignBox/style/index.css +1 -1
  108. package/es/Anchor/anchorMenu/index.d.ts +2 -1
  109. package/es/Anchor/anchorMenu/index.js +36 -33
  110. package/es/Anchor/component.json +130 -0
  111. package/es/Anchor/index.js +52 -49
  112. package/es/Anchor/type.d.ts +8 -4
  113. package/es/Argv/batchEdit/index.js +1 -1
  114. package/es/Argv/component.json +216 -0
  115. package/es/Argv/dataGenerator/index.js +1 -1
  116. package/es/Argv/index.d.ts +5 -6
  117. package/es/Argv/index.js +1 -1
  118. package/es/AutoBox/component.json +133 -0
  119. package/es/AutoBox/index.d.ts +3 -3
  120. package/es/AutoBox/index.js +1 -1
  121. package/es/AutoBox/protal.d.ts +2 -2
  122. package/es/AutoBox/protal.js +33 -30
  123. package/es/AutoButton/component.json +109 -0
  124. package/es/AutoButton/index.js +1 -1
  125. package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  126. package/es/AutoTips/autoTipsMultiline/index.js +1 -1
  127. package/es/AutoTips/component.json +121 -0
  128. package/es/AutoTips/index.js +1 -1
  129. package/es/Badge/component.json +92 -0
  130. package/es/Breadcrumbs/component.json +142 -0
  131. package/es/Breadcrumbs/index.js +1 -1
  132. package/es/Button/SplitButton.d.ts +2 -2
  133. package/es/Button/component.json +168 -0
  134. package/es/Button/index.js +44 -44
  135. package/es/ButtonGroup/component.json +132 -0
  136. package/es/ButtonGroup/index.d.ts +1 -1
  137. package/es/Card/component.json +162 -0
  138. package/es/Card/index.d.ts +2 -2
  139. package/es/Card/index.js +2 -2
  140. package/es/Carousel/component.json +142 -0
  141. package/es/Carousel/index.d.ts +1 -1
  142. package/es/Cascader/Cascader.js +1 -1
  143. package/es/Cascader/OptionList/Column.js +1 -1
  144. package/es/Cascader/OptionList/index.js +1 -1
  145. package/es/Cascader/component.json +196 -0
  146. package/es/Cascader/hooks/useEntities.js +7 -7
  147. package/es/Cascader/interface.d.ts +1 -0
  148. package/es/Cascader/utils/commonUtil.d.ts +1 -1
  149. package/es/Cascader/utils/commonUtil.js +16 -16
  150. package/es/Cascader/utils/treeUtil.d.ts +14 -5
  151. package/es/Cascader/utils/treeUtil.js +1 -1
  152. package/es/Checkbox/component.json +138 -0
  153. package/es/CheckboxGroup/component.json +152 -0
  154. package/es/CheckboxGroup/index.js +1 -1
  155. package/es/CodeEditor/component.json +189 -0
  156. package/es/CodeEditor/index.d.ts +11 -10
  157. package/es/CodeEditor/index.js +25 -25
  158. package/es/Collapse/component.json +166 -0
  159. package/es/Collapse/index.d.ts +1 -1
  160. package/es/Collapse/index.js +23 -22
  161. package/es/CollapseBox/component.json +84 -0
  162. package/es/CollapseLayout/component.json +155 -0
  163. package/es/ColorPicker/component.json +142 -0
  164. package/es/ComboSelect/component.json +181 -0
  165. package/es/ComboSelect/index.js +115 -109
  166. package/es/ComboSelect/interface.d.ts +2 -2
  167. package/es/ComboSelect/utils.d.ts +3 -3
  168. package/es/ComboSelect/utils.js +1 -1
  169. package/es/Container/component.json +111 -0
  170. package/es/ContentBox/component.json +81 -0
  171. package/es/CopyText/component.json +118 -0
  172. package/es/CycleSelector/component.json +98 -0
  173. package/es/CycleSelector/index.js +14 -13
  174. package/es/DatePicker/component.json +192 -0
  175. package/es/DatePicker/generatePicker/generateRangePicker.js +11 -11
  176. package/es/DatePicker/generatePicker/generateSinglePicker.js +2 -2
  177. package/es/Descriptions/component.json +142 -0
  178. package/es/Descriptions/index.d.ts +1 -1
  179. package/es/Desktop/component.json +171 -0
  180. package/es/Desktop/index.js +1 -1
  181. package/es/DragVerify/component.json +114 -0
  182. package/es/DragVerify/index.js +19 -19
  183. package/es/Drawer/component.json +200 -0
  184. package/es/Drawer/index.js +86 -86
  185. package/es/Drawer/interface.d.ts +1 -1
  186. package/es/Drawer/util.d.ts +1 -6
  187. package/es/Drawer/util.js +9 -6
  188. package/es/Dropdown/component.json +147 -0
  189. package/es/Dropdown/index.js +1 -1
  190. package/es/DynamicMultiBox/component.json +278 -0
  191. package/es/DynamicMultiBox/formItem.d.ts +1 -1
  192. package/es/DynamicMultiBox/index.js +1 -1
  193. package/es/DynamicMultiBox/rowForm.d.ts +2 -2
  194. package/es/Empty/component.json +123 -0
  195. package/es/Empty/index.css +1 -1
  196. package/es/Empty/index.d.ts +2 -2
  197. package/es/Empty/index.js +27 -26
  198. package/es/Empty/style/index.css +1 -1
  199. package/es/ExpressionInput/HighlightOverlay.d.ts +8 -0
  200. package/es/ExpressionInput/HighlightOverlay.js +27 -0
  201. package/es/ExpressionInput/Popup.d.ts +19 -0
  202. package/es/ExpressionInput/Popup.js +93 -0
  203. package/es/ExpressionInput/component.json +79 -0
  204. package/es/ExpressionInput/detectChainAtCursor.d.ts +17 -0
  205. package/es/ExpressionInput/detectChainAtCursor.js +31 -0
  206. package/es/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
  207. package/es/ExpressionInput/filterCandidatesByPartial.js +15 -0
  208. package/es/ExpressionInput/highlightSegments.d.ts +9 -0
  209. package/es/ExpressionInput/highlightSegments.js +14 -0
  210. package/es/ExpressionInput/index.css +1 -0
  211. package/es/ExpressionInput/index.d.ts +5 -0
  212. package/es/ExpressionInput/index.js +178 -0
  213. package/es/ExpressionInput/interface.d.ts +52 -0
  214. package/es/ExpressionInput/isExpressionValue.d.ts +5 -0
  215. package/es/ExpressionInput/isExpressionValue.js +18 -0
  216. package/es/ExpressionInput/lang/en_US.d.ts +4 -0
  217. package/es/ExpressionInput/lang/en_US.js +7 -0
  218. package/es/ExpressionInput/lang/index.d.ts +9 -0
  219. package/es/ExpressionInput/lang/index.js +10 -0
  220. package/es/ExpressionInput/lang/zh_CN.d.ts +4 -0
  221. package/es/ExpressionInput/lang/zh_CN.js +7 -0
  222. package/es/ExpressionInput/style/css.js +1 -0
  223. package/es/ExpressionInput/style/index.css +1 -0
  224. package/es/ExpressionInput/style/index.js +1 -0
  225. package/es/ExpressionInput/useExpressionInput.d.ts +26 -0
  226. package/es/ExpressionInput/useExpressionInput.js +59 -0
  227. package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  228. package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  229. package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  230. package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
  231. package/es/FieldForm/Form.d.ts +2 -2
  232. package/es/FieldForm/Form.js +1 -1
  233. package/es/FieldForm/FormItemInput.js +1 -1
  234. package/es/FieldForm/FormItemLabel.js +1 -1
  235. package/es/FieldForm/FormList.d.ts +2 -2
  236. package/es/FieldForm/component.json +196 -0
  237. package/es/FieldForm/context.d.ts +5 -1
  238. package/es/FieldForm/context.js +2 -2
  239. package/es/FieldForm/hooks/useForm.d.ts +4 -3
  240. package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
  241. package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  242. package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
  243. package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
  244. package/es/FieldForm/hooks/useItemRef.js +6 -6
  245. package/es/Form/component.json +161 -0
  246. package/es/Form/index.d.ts +52 -49
  247. package/es/Form/index.js +1 -1
  248. package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  249. package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
  250. package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  251. package/es/FormItem/compoments/formFile/index.js +8 -8
  252. package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  253. package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
  254. package/es/FormItem/component.json +171 -0
  255. package/es/FormItem/index.d.ts +5 -5
  256. package/es/FormItem/index.js +23 -23
  257. package/es/FormItem/itemType.js +1 -1
  258. package/es/FunctionModal/component.json +197 -0
  259. package/es/FunctionModal/dialog.d.ts +1 -1
  260. package/es/FunctionModal/modalContext.d.ts +4 -1
  261. package/es/GlobalContext/confirmLocale.js +1 -1
  262. package/es/GlobalContext/index.js +1 -1
  263. package/es/Help/component.json +118 -0
  264. package/es/HelperText/component.json +126 -0
  265. package/es/Image/PreviewGroup.js +1 -1
  266. package/es/Image/component.json +165 -0
  267. package/es/Image/index.js +1 -1
  268. package/es/InputCode/component.json +191 -0
  269. package/es/InputCode/index.d.ts +2 -2
  270. package/es/InputCode/index.js +1 -1
  271. package/es/InputLang/component.json +205 -0
  272. package/es/InputLang/index.js +2 -2
  273. package/es/InputNumber/component.json +162 -0
  274. package/es/InputNumber/index.d.ts +13 -7
  275. package/es/InputNumber/index.js +152 -144
  276. package/es/Label/component.json +126 -0
  277. package/es/Label/index.d.ts +2 -2
  278. package/es/Loading/component.json +91 -0
  279. package/es/Menu/component.json +180 -0
  280. package/es/Menu/verticalMenuList.js +1 -1
  281. package/es/Message/component.json +246 -0
  282. package/es/Message/index.d.ts +2 -2
  283. package/es/Message/index.js +19 -19
  284. package/es/Modal/Confirm/index.d.ts +1 -1
  285. package/es/Modal/Confirm/index.js +1 -1
  286. package/es/Modal/component.json +277 -0
  287. package/es/Modal/index.d.ts +85 -5
  288. package/es/Modal/index.js +159 -122
  289. package/es/Modal/interface.d.ts +1 -0
  290. package/es/MultiBox/component.json +216 -0
  291. package/es/MultiBox/index.js +19 -14
  292. package/es/Notification/component.json +184 -0
  293. package/es/OperateBtn/component.json +134 -0
  294. package/es/OperateBtn/index.d.ts +3 -3
  295. package/es/PageHeader/component.json +112 -0
  296. package/es/PageHeader/horizontalMeun.js +1 -1
  297. package/es/PageHeader/horizontalMeunRight.js +1 -1
  298. package/es/Pagination/component.json +181 -0
  299. package/es/Pagination/index.js +15 -15
  300. package/es/ParauiProvider/index.js +1 -1
  301. package/es/PasswordRules/component.json +105 -0
  302. package/es/PasswordRules/index.d.ts +4 -4
  303. package/es/PopConfirm/component.json +227 -0
  304. package/es/PopConfirm/index.d.ts +1 -1
  305. package/es/PopConfirm/index.js +1 -1
  306. package/es/PopMenu/component.json +131 -0
  307. package/es/PopMenu/hooks.d.ts +1 -1
  308. package/es/PopMenu/index.js +8 -8
  309. package/es/Popover/component.json +165 -0
  310. package/es/Popover/index.js +1 -1
  311. package/es/Progress/component.json +161 -0
  312. package/es/Prompt/component.json +144 -0
  313. package/es/Querying/component.json +96 -0
  314. package/es/Querying/index.css +1 -1
  315. package/es/Querying/index.d.ts +2 -2
  316. package/es/Querying/index.js +20 -19
  317. package/es/Querying/style/index.css +1 -1
  318. package/es/QuickReply/QuickReplyCode/index.js +1 -1
  319. package/es/QuickReply/component.json +129 -0
  320. package/es/QuickReply/index.d.ts +1 -1
  321. package/es/Radio/component.json +136 -0
  322. package/es/RadioGroup/component.json +149 -0
  323. package/es/RangeInput/component.json +198 -0
  324. package/es/RangeInput/index.d.ts +15 -7
  325. package/es/RangeInput/index.js +120 -103
  326. package/es/Result/component.json +104 -0
  327. package/es/ScrollBar/component.json +115 -0
  328. package/es/Search/component.json +177 -0
  329. package/es/Search/index.d.ts +1 -1
  330. package/es/Select/component.json +244 -0
  331. package/es/Select/index.d.ts +11 -8
  332. package/es/Select/index.js +441 -438
  333. package/es/SelectInput/component.json +184 -0
  334. package/es/SelectInput/index.d.ts +4 -4
  335. package/es/SelectInput/index.js +8 -8
  336. package/es/Selector/component.json +203 -0
  337. package/es/Selector/index.js +56 -50
  338. package/es/Selector/interface.d.ts +2 -2
  339. package/es/Selector/selectorData/index.js +1 -1
  340. package/es/Selector/selectorMain/index.js +3 -3
  341. package/es/Selector/selectorNode/index.js +1 -1
  342. package/es/Selector/util.d.ts +3 -3
  343. package/es/Selector/util.js +6 -12
  344. package/es/SelectorPicker/component.json +179 -0
  345. package/es/SelectorPicker/index.d.ts +5 -5
  346. package/es/SelectorPicker/index.js +15 -15
  347. package/es/SingleBox/component.json +151 -0
  348. package/es/SingleBox/index.d.ts +2 -2
  349. package/es/Slider/component.json +181 -0
  350. package/es/SortBox/component.json +108 -0
  351. package/es/Status/component.json +104 -0
  352. package/es/Stepper/component.json +129 -0
  353. package/es/Stepper/index.d.ts +2 -2
  354. package/es/Switch/component.json +207 -0
  355. package/es/Switch/index.css +1 -1
  356. package/es/Switch/index.d.ts +3 -2
  357. package/es/Switch/index.js +60 -59
  358. package/es/Switch/style/index.css +1 -1
  359. package/es/Table/component.json +547 -0
  360. package/es/Table/index.d.ts +2 -2
  361. package/es/Table/index.js +385 -382
  362. package/es/Table/interface.d.ts +30 -0
  363. package/es/Table/tableHead.js +1 -1
  364. package/es/Table/util.d.ts +1 -1
  365. package/es/Table/util.js +3 -12
  366. package/es/Tabs/component.json +227 -0
  367. package/es/Tag/component.json +221 -0
  368. package/es/Tag/index.css +1 -1
  369. package/es/Tag/index.d.ts +1 -1
  370. package/es/Tag/index.js +20 -20
  371. package/es/Tag/style/index.css +1 -1
  372. package/es/TextEditor/component.json +186 -0
  373. package/es/TextEditor/index.d.ts +5 -5
  374. package/es/TextEditor/index.js +1 -1
  375. package/es/TextField/component.json +290 -0
  376. package/es/TextField/index.d.ts +2 -2
  377. package/es/TextField/index.js +1 -1
  378. package/es/TimePicker/component.json +176 -0
  379. package/es/Timeline/component.json +110 -0
  380. package/es/Title/component.json +156 -0
  381. package/es/ToggleButton/component.json +153 -0
  382. package/es/ToggleButton/index.js +1 -1
  383. package/es/Tooltip/component.json +176 -0
  384. package/es/Tooltip/index.js +58 -53
  385. package/es/Tooltip/interface.d.ts +14 -1
  386. package/es/Tooltip/utils.js +6 -6
  387. package/es/Transfer/component.json +157 -0
  388. package/es/Tree/OperateBar/index.js +1 -1
  389. package/es/Tree/Tree.js +3 -3
  390. package/es/Tree/component.json +512 -0
  391. package/es/Tree/interface.d.ts +1 -1
  392. package/es/Upload/component.json +450 -0
  393. package/es/Upload/util.js +1 -1
  394. package/es/Utils/snack-kit-shims.d.ts +18 -0
  395. package/es/Utils/snack-kit-shims.js +19 -0
  396. package/es/Utils/type.d.ts +0 -6
  397. package/es/_virtual/index.js +5 -3
  398. package/es/_virtual/index2.js +2 -5
  399. package/es/index.d.ts +4 -0
  400. package/es/index.js +152 -150
  401. package/es/locale/en-US.d.ts +3 -0
  402. package/es/locale/en-US.js +3 -0
  403. package/es/locale/en_US.d.ts +361 -0
  404. package/es/locale/en_US.js +364 -0
  405. package/es/locale/index.d.ts +1 -723
  406. package/es/locale/index2.js +10 -0
  407. package/es/locale/zh-CN.d.ts +3 -0
  408. package/es/locale/zh-CN.js +3 -0
  409. package/es/locale/zh_CN.d.ts +361 -0
  410. package/es/locale/zh_CN.js +364 -0
  411. package/es/node_modules/classnames/index.js +1 -1
  412. package/lib/AlignBox/component.json +89 -0
  413. package/lib/AlignBox/index.css +1 -1
  414. package/lib/AlignBox/index.d.ts +6 -2
  415. package/lib/AlignBox/index.js +1 -1
  416. package/lib/AlignBox/style/index.css +1 -1
  417. package/lib/Anchor/anchorMenu/index.d.ts +2 -1
  418. package/lib/Anchor/anchorMenu/index.js +1 -1
  419. package/lib/Anchor/component.json +130 -0
  420. package/lib/Anchor/index.js +1 -1
  421. package/lib/Anchor/type.d.ts +8 -4
  422. package/lib/Argv/component.json +216 -0
  423. package/lib/Argv/dataGenerator/index.js +1 -1
  424. package/lib/Argv/index.d.ts +5 -6
  425. package/lib/Argv/index.js +1 -1
  426. package/lib/AutoBox/component.json +133 -0
  427. package/lib/AutoBox/index.d.ts +3 -3
  428. package/lib/AutoBox/index.js +1 -1
  429. package/lib/AutoBox/protal.d.ts +2 -2
  430. package/lib/AutoBox/protal.js +1 -1
  431. package/lib/AutoButton/component.json +109 -0
  432. package/lib/AutoButton/index.js +1 -1
  433. package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  434. package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
  435. package/lib/AutoTips/component.json +121 -0
  436. package/lib/AutoTips/index.js +1 -1
  437. package/lib/Badge/component.json +92 -0
  438. package/lib/Breadcrumbs/component.json +142 -0
  439. package/lib/Breadcrumbs/index.js +1 -1
  440. package/lib/Button/SplitButton.d.ts +2 -2
  441. package/lib/Button/component.json +168 -0
  442. package/lib/Button/index.js +1 -1
  443. package/lib/ButtonGroup/component.json +132 -0
  444. package/lib/ButtonGroup/index.d.ts +1 -1
  445. package/lib/Card/component.json +162 -0
  446. package/lib/Card/index.d.ts +2 -2
  447. package/lib/Card/index.js +1 -1
  448. package/lib/Carousel/component.json +142 -0
  449. package/lib/Carousel/index.d.ts +1 -1
  450. package/lib/Cascader/Cascader.js +1 -1
  451. package/lib/Cascader/OptionList/Column.js +1 -1
  452. package/lib/Cascader/OptionList/index.js +1 -1
  453. package/lib/Cascader/component.json +196 -0
  454. package/lib/Cascader/hooks/useEntities.js +1 -1
  455. package/lib/Cascader/interface.d.ts +1 -0
  456. package/lib/Cascader/utils/commonUtil.d.ts +1 -1
  457. package/lib/Cascader/utils/commonUtil.js +1 -1
  458. package/lib/Cascader/utils/treeUtil.d.ts +14 -5
  459. package/lib/Cascader/utils/treeUtil.js +1 -1
  460. package/lib/Checkbox/component.json +138 -0
  461. package/lib/CheckboxGroup/component.json +152 -0
  462. package/lib/CheckboxGroup/index.js +1 -1
  463. package/lib/CodeEditor/component.json +189 -0
  464. package/lib/CodeEditor/index.d.ts +11 -10
  465. package/lib/CodeEditor/index.js +1 -1
  466. package/lib/Collapse/component.json +166 -0
  467. package/lib/Collapse/index.d.ts +1 -1
  468. package/lib/Collapse/index.js +1 -1
  469. package/lib/CollapseBox/component.json +84 -0
  470. package/lib/CollapseLayout/component.json +155 -0
  471. package/lib/ColorPicker/component.json +142 -0
  472. package/lib/ComboSelect/component.json +181 -0
  473. package/lib/ComboSelect/index.js +1 -1
  474. package/lib/ComboSelect/interface.d.ts +2 -2
  475. package/lib/ComboSelect/utils.d.ts +3 -3
  476. package/lib/ComboSelect/utils.js +1 -1
  477. package/lib/Container/component.json +111 -0
  478. package/lib/ContentBox/component.json +81 -0
  479. package/lib/CopyText/component.json +118 -0
  480. package/lib/CycleSelector/component.json +98 -0
  481. package/lib/CycleSelector/index.js +1 -1
  482. package/lib/DatePicker/component.json +192 -0
  483. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  484. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  485. package/lib/Descriptions/component.json +142 -0
  486. package/lib/Descriptions/index.d.ts +1 -1
  487. package/lib/Desktop/component.json +171 -0
  488. package/lib/Desktop/index.js +1 -1
  489. package/lib/DragVerify/component.json +114 -0
  490. package/lib/DragVerify/index.js +1 -1
  491. package/lib/Drawer/component.json +200 -0
  492. package/lib/Drawer/index.js +1 -1
  493. package/lib/Drawer/interface.d.ts +1 -1
  494. package/lib/Drawer/util.d.ts +1 -6
  495. package/lib/Drawer/util.js +1 -1
  496. package/lib/Dropdown/component.json +147 -0
  497. package/lib/Dropdown/index.js +1 -1
  498. package/lib/DynamicMultiBox/component.json +278 -0
  499. package/lib/DynamicMultiBox/formItem.d.ts +1 -1
  500. package/lib/DynamicMultiBox/index.js +1 -1
  501. package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
  502. package/lib/Empty/component.json +123 -0
  503. package/lib/Empty/index.css +1 -1
  504. package/lib/Empty/index.d.ts +2 -2
  505. package/lib/Empty/index.js +1 -1
  506. package/lib/Empty/style/index.css +1 -1
  507. package/lib/ExpressionInput/HighlightOverlay.d.ts +8 -0
  508. package/lib/ExpressionInput/HighlightOverlay.js +2 -0
  509. package/lib/ExpressionInput/Popup.d.ts +19 -0
  510. package/lib/ExpressionInput/Popup.js +2 -0
  511. package/lib/ExpressionInput/component.json +79 -0
  512. package/lib/ExpressionInput/detectChainAtCursor.d.ts +17 -0
  513. package/lib/ExpressionInput/detectChainAtCursor.js +2 -0
  514. package/lib/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
  515. package/lib/ExpressionInput/filterCandidatesByPartial.js +2 -0
  516. package/lib/ExpressionInput/highlightSegments.d.ts +9 -0
  517. package/lib/ExpressionInput/highlightSegments.js +2 -0
  518. package/lib/ExpressionInput/index.css +1 -0
  519. package/lib/ExpressionInput/index.d.ts +5 -0
  520. package/lib/ExpressionInput/index.js +2 -0
  521. package/lib/ExpressionInput/interface.d.ts +52 -0
  522. package/lib/ExpressionInput/isExpressionValue.d.ts +5 -0
  523. package/lib/ExpressionInput/isExpressionValue.js +2 -0
  524. package/lib/ExpressionInput/lang/en_US.d.ts +4 -0
  525. package/lib/ExpressionInput/lang/en_US.js +2 -0
  526. package/lib/ExpressionInput/lang/index.d.ts +9 -0
  527. package/lib/ExpressionInput/lang/index.js +2 -0
  528. package/lib/ExpressionInput/lang/zh_CN.d.ts +4 -0
  529. package/lib/ExpressionInput/lang/zh_CN.js +2 -0
  530. package/lib/ExpressionInput/style/css.js +1 -0
  531. package/lib/ExpressionInput/style/index.css +1 -0
  532. package/lib/ExpressionInput/style/index.js +1 -0
  533. package/lib/ExpressionInput/useExpressionInput.d.ts +26 -0
  534. package/lib/ExpressionInput/useExpressionInput.js +2 -0
  535. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  536. package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  537. package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  538. package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
  539. package/lib/FieldForm/Form.d.ts +2 -2
  540. package/lib/FieldForm/Form.js +1 -1
  541. package/lib/FieldForm/FormItemInput.js +1 -1
  542. package/lib/FieldForm/FormItemLabel.js +1 -1
  543. package/lib/FieldForm/FormList.d.ts +2 -2
  544. package/lib/FieldForm/component.json +196 -0
  545. package/lib/FieldForm/context.d.ts +5 -1
  546. package/lib/FieldForm/context.js +1 -1
  547. package/lib/FieldForm/hooks/useForm.d.ts +4 -3
  548. package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
  549. package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  550. package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
  551. package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
  552. package/lib/FieldForm/hooks/useItemRef.js +1 -1
  553. package/lib/Form/component.json +161 -0
  554. package/lib/Form/index.d.ts +52 -49
  555. package/lib/Form/index.js +1 -1
  556. package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  557. package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
  558. package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  559. package/lib/FormItem/compoments/formFile/index.js +1 -1
  560. package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  561. package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
  562. package/lib/FormItem/component.json +171 -0
  563. package/lib/FormItem/index.d.ts +5 -5
  564. package/lib/FormItem/index.js +1 -1
  565. package/lib/FormItem/itemType.js +1 -1
  566. package/lib/FunctionModal/component.json +197 -0
  567. package/lib/FunctionModal/dialog.d.ts +1 -1
  568. package/lib/FunctionModal/modalContext.d.ts +4 -1
  569. package/lib/GlobalContext/confirmLocale.js +1 -1
  570. package/lib/GlobalContext/index.js +1 -1
  571. package/lib/Help/component.json +118 -0
  572. package/lib/HelperText/component.json +126 -0
  573. package/lib/Image/PreviewGroup.js +1 -1
  574. package/lib/Image/component.json +165 -0
  575. package/lib/Image/index.js +1 -1
  576. package/lib/InputCode/component.json +191 -0
  577. package/lib/InputCode/index.d.ts +2 -2
  578. package/lib/InputLang/component.json +205 -0
  579. package/lib/InputLang/index.js +1 -1
  580. package/lib/InputNumber/component.json +162 -0
  581. package/lib/InputNumber/index.d.ts +13 -7
  582. package/lib/InputNumber/index.js +1 -1
  583. package/lib/Label/component.json +126 -0
  584. package/lib/Label/index.d.ts +2 -2
  585. package/lib/Loading/component.json +91 -0
  586. package/lib/Menu/component.json +180 -0
  587. package/lib/Menu/verticalMenuList.js +1 -1
  588. package/lib/Message/component.json +246 -0
  589. package/lib/Message/index.d.ts +2 -2
  590. package/lib/Message/index.js +1 -1
  591. package/lib/Modal/Confirm/index.d.ts +1 -1
  592. package/lib/Modal/Confirm/index.js +1 -1
  593. package/lib/Modal/component.json +277 -0
  594. package/lib/Modal/index.d.ts +85 -5
  595. package/lib/Modal/index.js +1 -1
  596. package/lib/Modal/interface.d.ts +1 -0
  597. package/lib/MultiBox/component.json +216 -0
  598. package/lib/MultiBox/index.js +1 -1
  599. package/lib/Notification/component.json +184 -0
  600. package/lib/OperateBtn/component.json +134 -0
  601. package/lib/OperateBtn/index.d.ts +3 -3
  602. package/lib/PageHeader/component.json +112 -0
  603. package/lib/PageHeader/horizontalMeun.js +1 -1
  604. package/lib/PageHeader/horizontalMeunRight.js +1 -1
  605. package/lib/Pagination/component.json +181 -0
  606. package/lib/Pagination/index.js +1 -1
  607. package/lib/ParauiProvider/index.js +1 -1
  608. package/lib/PasswordRules/component.json +105 -0
  609. package/lib/PasswordRules/index.d.ts +4 -4
  610. package/lib/PopConfirm/component.json +227 -0
  611. package/lib/PopConfirm/index.d.ts +1 -1
  612. package/lib/PopConfirm/index.js +1 -1
  613. package/lib/PopMenu/component.json +131 -0
  614. package/lib/PopMenu/hooks.d.ts +1 -1
  615. package/lib/PopMenu/index.js +1 -1
  616. package/lib/Popover/component.json +165 -0
  617. package/lib/Popover/index.js +1 -1
  618. package/lib/Progress/component.json +161 -0
  619. package/lib/Prompt/component.json +144 -0
  620. package/lib/Querying/component.json +96 -0
  621. package/lib/Querying/index.css +1 -1
  622. package/lib/Querying/index.d.ts +2 -2
  623. package/lib/Querying/index.js +1 -1
  624. package/lib/Querying/style/index.css +1 -1
  625. package/lib/QuickReply/QuickReplyCode/index.js +1 -1
  626. package/lib/QuickReply/component.json +129 -0
  627. package/lib/QuickReply/index.d.ts +1 -1
  628. package/lib/Radio/component.json +136 -0
  629. package/lib/RadioGroup/component.json +149 -0
  630. package/lib/RangeInput/component.json +198 -0
  631. package/lib/RangeInput/index.d.ts +15 -7
  632. package/lib/RangeInput/index.js +1 -1
  633. package/lib/Result/component.json +104 -0
  634. package/lib/ScrollBar/component.json +115 -0
  635. package/lib/Search/component.json +177 -0
  636. package/lib/Search/index.d.ts +1 -1
  637. package/lib/Select/component.json +244 -0
  638. package/lib/Select/index.d.ts +11 -8
  639. package/lib/Select/index.js +1 -1
  640. package/lib/SelectInput/component.json +184 -0
  641. package/lib/SelectInput/index.d.ts +4 -4
  642. package/lib/SelectInput/index.js +1 -1
  643. package/lib/Selector/component.json +203 -0
  644. package/lib/Selector/index.js +1 -1
  645. package/lib/Selector/interface.d.ts +2 -2
  646. package/lib/Selector/selectorData/index.js +1 -1
  647. package/lib/Selector/selectorMain/index.js +1 -1
  648. package/lib/Selector/selectorNode/index.js +1 -1
  649. package/lib/Selector/util.d.ts +3 -3
  650. package/lib/Selector/util.js +1 -1
  651. package/lib/SelectorPicker/component.json +179 -0
  652. package/lib/SelectorPicker/index.d.ts +5 -5
  653. package/lib/SelectorPicker/index.js +1 -1
  654. package/lib/SingleBox/component.json +151 -0
  655. package/lib/SingleBox/index.d.ts +2 -2
  656. package/lib/Slider/component.json +181 -0
  657. package/lib/SortBox/component.json +108 -0
  658. package/lib/Status/component.json +104 -0
  659. package/lib/Stepper/component.json +129 -0
  660. package/lib/Stepper/index.d.ts +2 -2
  661. package/lib/Switch/component.json +207 -0
  662. package/lib/Switch/index.css +1 -1
  663. package/lib/Switch/index.d.ts +3 -2
  664. package/lib/Switch/index.js +1 -1
  665. package/lib/Switch/style/index.css +1 -1
  666. package/lib/Table/component.json +547 -0
  667. package/lib/Table/index.d.ts +2 -2
  668. package/lib/Table/index.js +1 -1
  669. package/lib/Table/interface.d.ts +30 -0
  670. package/lib/Table/tableHead.js +1 -1
  671. package/lib/Table/util.d.ts +1 -1
  672. package/lib/Table/util.js +1 -1
  673. package/lib/Tabs/component.json +227 -0
  674. package/lib/Tag/component.json +221 -0
  675. package/lib/Tag/index.css +1 -1
  676. package/lib/Tag/index.d.ts +1 -1
  677. package/lib/Tag/index.js +1 -1
  678. package/lib/Tag/style/index.css +1 -1
  679. package/lib/TextEditor/component.json +186 -0
  680. package/lib/TextEditor/index.d.ts +5 -5
  681. package/lib/TextEditor/index.js +1 -1
  682. package/lib/TextField/component.json +290 -0
  683. package/lib/TextField/index.d.ts +2 -2
  684. package/lib/TextField/index.js +1 -1
  685. package/lib/TimePicker/component.json +176 -0
  686. package/lib/Timeline/component.json +110 -0
  687. package/lib/Title/component.json +156 -0
  688. package/lib/ToggleButton/component.json +153 -0
  689. package/lib/ToggleButton/index.js +1 -1
  690. package/lib/Tooltip/component.json +176 -0
  691. package/lib/Tooltip/index.js +1 -1
  692. package/lib/Tooltip/interface.d.ts +14 -1
  693. package/lib/Tooltip/utils.js +1 -1
  694. package/lib/Transfer/component.json +157 -0
  695. package/lib/Tree/OperateBar/index.js +2 -2
  696. package/lib/Tree/Tree.js +1 -1
  697. package/lib/Tree/component.json +512 -0
  698. package/lib/Tree/interface.d.ts +1 -1
  699. package/lib/Upload/component.json +450 -0
  700. package/lib/Upload/util.js +1 -1
  701. package/lib/Utils/snack-kit-shims.d.ts +18 -0
  702. package/lib/Utils/snack-kit-shims.js +2 -0
  703. package/lib/Utils/type.d.ts +0 -6
  704. package/lib/_virtual/index.js +1 -1
  705. package/lib/_virtual/index2.js +1 -1
  706. package/lib/index.d.ts +4 -0
  707. package/lib/index.js +1 -1
  708. package/lib/locale/en-US.d.ts +3 -0
  709. package/lib/locale/en-US.js +1 -1
  710. package/lib/locale/en_US.d.ts +361 -0
  711. package/lib/locale/en_US.js +2 -0
  712. package/lib/locale/index.d.ts +1 -723
  713. package/lib/locale/index2.js +2 -0
  714. package/lib/locale/zh-CN.d.ts +3 -0
  715. package/lib/locale/zh-CN.js +1 -1
  716. package/lib/locale/zh_CN.d.ts +361 -0
  717. package/lib/locale/zh_CN.js +2 -0
  718. package/lib/node_modules/classnames/index.js +1 -1
  719. package/package.json +24 -4
  720. package/es/_virtual/index3.js +0 -5
  721. package/es/_virtual/index4.js +0 -5
  722. package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
  723. package/lib/_virtual/index3.js +0 -2
  724. package/lib/_virtual/index4.js +0 -2
  725. package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
  726. /package/es/{InputCode → CodeEditor}/index.css +0 -0
  727. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  728. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
  729. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  730. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
@@ -0,0 +1,278 @@
1
+ {
2
+ "name": "DynamicMultiBox",
3
+ "category": "Data Entry",
4
+ "description": "动态多行表单,支持动态增删行 + 拖拽排序 + 字段级错误反馈。**封装协议:外部以业务对象数组传入,内部维护 valueList + errors 双 state(必须双 state,见 commonPatterns.wrapperPattern)**",
5
+ "semantic": {
6
+ "intent": [
7
+ "动态表单",
8
+ "多行录入",
9
+ "支持拖拽 + 行级错误反馈"
10
+ ],
11
+ "useCases": [
12
+ "批量参数 / 联系人录入",
13
+ "规则配置(条件 → 动作)",
14
+ "可排序步骤配置(工作流)",
15
+ "动态字段表单(字段配置由父组件传入)"
16
+ ],
17
+ "riskLevel": "normal"
18
+ },
19
+ "r23FailingScenarios": {
20
+ "scenario_003_TS2538_undefined_index": {
21
+ "failedRequirement": "DynamicMultiBox-003 可拖拽排序的步骤配置",
22
+ "wrongCode": "const errRow: IErrors = { id: s.id };\nfieldConfig.forEach((cfg: IConfig) => {\n errRow[cfg.name] = ''; // ❌ TS2538 'Type undefined cannot be used as an index type'\n});",
23
+ "rootCause": "**IConfig.name 在 v5.x 类型严格化后是 `string | undefined`**(非必填字段)。直接用 cfg.name 做对象索引时 TS 拒绝(undefined 不能作为索引)",
24
+ "fixedCode": "const errRow: IErrors = { id: s.id };\nfieldConfig.forEach((cfg: IConfig) => {\n if (cfg.name) errRow[cfg.name] = ''; // ✅ narrow 后再索引\n});",
25
+ "alternativeFix": "// 或用 ! 非空断言(已知 config 项必有 name):\nfieldConfig.forEach((cfg: IConfig) => {\n errRow[cfg.name!] = '';\n});"
26
+ },
27
+ "scenario_006_TS2352_rest_spread_unknown": {
28
+ "failedRequirement": "DynamicMultiBox-006 标准联系人录入",
29
+ "wrongCode": "interface Contact { name: string; phone: string; email: string; }\nconst valueListToContacts = (valueList: IValueList[]): Contact[] =>\n valueList.map(({ id, ...rest }) => rest as Contact); // ❌ TS2352",
30
+ "rootCause": "对 IValueList 做 `{id, ...rest}` 解构后,TS 把 rest 推断为 `{[x: string]: unknown}`(索引签名)。**unknown 索引签名 → 具体业务类型** 直接 `as Contact` 被 TS 5.x 拒绝(类型不充分重叠)",
31
+ "fixedCode": "const valueListToContacts = (valueList: IValueList[]): Contact[] =>\n valueList.map(({ id, ...rest }) => rest as unknown as Contact); // ✅ unknown 中转",
32
+ "alternativeFix": "// 或显式字段映射(更类型安全):\nconst valueListToContacts = (valueList: IValueList[]): Contact[] =>\n valueList.map(({ name, phone, email }) => ({ name, phone, email } as Contact));"
33
+ }
34
+ },
35
+ "titleModeBehavior": {
36
+ "all": "**默认值**。每列在表格顶部独立显示 IConfig.label —— '第一数据行上方有列标题'就是 all。典型表格效果",
37
+ "none": "完全隐藏所有标题。所有列单元格直接从表顶开始,无任何 label",
38
+ "single": "**整张表只有 1 个合并标题行**(跨所有列居中显示 singleTitle.label),不是'只在第一行显示列标题'。配合 singleTitle prop = `{ label: ReactNode, required: boolean }` 配置文案。**误解警告**:需求描述'只在第一行显示标题'通常想要的是 all(每列独立标题),不是 single(整表 1 个合并标题)",
39
+ "domStructure": "// all:\n// <thead>列1 label | 列2 label | 列3 label</thead>\n// <tbody>行 1 数据 | 行 2 数据 | ...</tbody>\n//\n// single:\n// <thead>singleTitle.label (跨列居中)</thead>\n// <tbody>行 1 数据 | 行 2 数据 | ...</tbody>\n//\n// none:\n// <tbody>行 1 数据 | 行 2 数据 | ...</tbody>(无 thead)"
40
+ },
41
+ "variants": {
42
+ "default": {
43
+ "meaning": "默认样式"
44
+ }
45
+ },
46
+ "states": [
47
+ "default",
48
+ "error"
49
+ ],
50
+ "idealProps": {
51
+ "config": {
52
+ "type": "IConfig[]",
53
+ "description": "每列配置数组:[{ name, label, inputType, isFixed, required, list?, customRender? }];**name 必须等于 valueList[*][name] —— 否则该列读不到值**。注意 IConfig.name 类型签名是 `string | undefined`(R23 003 fail 根因 —— 见 r23FailingScenarios)。**inputType 是 IInputType 严格 union(必须 PascalCase · 不是 HTML lowercase)**:`'TextField' | 'Select' | 'Switch' | 'InputNumber' | 'InputLang' | 'ComboSelect' | 'DatePicker' | 'custom'`。⚠️ **不要写 inputType: 'text' / 'date' / 'select'(HTML 风格 · TS 编译报错 · runtime 不渲染)**。完整 schema 签名见 `dist/es/DynamicMultiBox/interface.d.ts`(发布产物)",
54
+ "required": true
55
+ },
56
+ "valueList": {
57
+ "type": "IValueList[]",
58
+ "description": "受控值集合 [{ id: string, [name]: any }];初始 id 由调用方维护;点击新增时组件 UUID 自动生成新行 id 并通过 onAdd 回填",
59
+ "required": true
60
+ },
61
+ "errors": {
62
+ "type": "IErrors[]",
63
+ "description": "每行错误集合,结构同 valueList,**按 id 一一对应**;无错误字段留空字符串占位。**调用方必须维护 errors state**,在 onAdd/onDelete 回调里用第二参数同步(见 wrapperPattern)"
64
+ },
65
+ "onChange": {
66
+ "type": "(valueList, currentItem) => void",
67
+ "description": "单元格值变化回调(不在新增/删除/拖拽时触发);currentItem 含 id/name/value/rowIndex 用于行内校验"
68
+ },
69
+ "onAdd": {
70
+ "type": "(valueList, errors) => void",
71
+ "description": "点击新增按钮触发;valueList 已含新行(id 由组件生成);**回调第二参数已是同步后的新 errors(含新行空占位),不要忽略**"
72
+ },
73
+ "onDelete": {
74
+ "type": "(valueList, errors) => void",
75
+ "description": "点击删除按钮触发;valueList 已剔除该行;errors 同步剔除对应行"
76
+ },
77
+ "titleMode": {
78
+ "type": "enum",
79
+ "values": [
80
+ "none",
81
+ "single",
82
+ "all"
83
+ ],
84
+ "default": "all",
85
+ "description": "见 titleModeBehavior:all=每列独立 label(常见表格效果);none=隐藏所有标题;**single=整表 1 个合并标题**(不是'只在第一行显示列标题',此处常被误解)"
86
+ },
87
+ "singleTitle": {
88
+ "type": "{ label: ReactNode, required: boolean }",
89
+ "description": "titleMode='single' 时的合并标题配置(必须传)"
90
+ },
91
+ "isSort": {
92
+ "type": "boolean",
93
+ "default": false,
94
+ "description": "true 启用拖拽排序;需配合 onSort 接收新顺序;拖拽时不触发 onChange"
95
+ },
96
+ "onSort": {
97
+ "type": "(newValueList, swapIds) => void",
98
+ "description": "排序回调;swapIds 是位置变动行的下标集合,非 [from,to] 对"
99
+ },
100
+ "initValue": {
101
+ "type": "Record<string, any>",
102
+ "description": "新增行字段默认值(不含 id)"
103
+ },
104
+ "isFilter": {
105
+ "type": "boolean",
106
+ "default": false,
107
+ "description": "true 启用列筛选下拉(用户可在 UI 中切换显示哪些列)"
108
+ },
109
+ "checkedValue": {
110
+ "type": "string[]",
111
+ "description": "配合 isFilter=true 使用 —— 当前筛选下拉中'已勾选展示'的列 key 数组。`isFilter=false`(默认)时无需传"
112
+ },
113
+ "filterConfig": {
114
+ "type": "IConfig[]",
115
+ "description": "筛选下拉中可勾选的可选列(结构同 IConfig),配合 isFilter=true + checkedValue 使用"
116
+ }
117
+ },
118
+ "commonMisconceptions": {
119
+ "M1": {
120
+ "wrong": "对 IConfig.name 直接做对象索引: `errRow[cfg.name] = ''`",
121
+ "result": "**TS2538 'Type undefined cannot be used as an index type'** —— IConfig.name 类型 `string | undefined`(R23 DynamicMultiBox-003 fail 根因)",
122
+ "fix": "narrow 后再索引: `if (cfg.name) errRow[cfg.name] = ''` 或 `errRow[cfg.name!] = ''`(非空断言)"
123
+ },
124
+ "M2": {
125
+ "wrong": "用 `{id, ...rest} = item; rest as Contact` 把 IValueList 转业务类型",
126
+ "result": "**TS2352 'Conversion may be a mistake because neither type sufficiently overlaps'** —— rest 是 unknown 索引签名,直接 as 业务类型被 TS 5.x 拒绝(R23 DynamicMultiBox-006 fail 根因)",
127
+ "fix": "用 `as unknown as Contact` 中转,或显式字段映射 `({ name, phone, email })`"
128
+ },
129
+ "M3": {
130
+ "wrong": "onAdd / onDelete 只接受单参数 valueList: `onAdd={(valueList) => setValueList(valueList)}`",
131
+ "result": "**errors state 与 valueList 不同步** —— 新行没有对应 errors 占位,该行渲染时查 errors 失败显示异常",
132
+ "fix": "双参数 + 双 setState: `onAdd={(valueList, errors) => { setValueList(valueList); setErrors(errors); }}`"
133
+ },
134
+ "M4": {
135
+ "wrong": "把 titleMode='single' 当成'只在第一行显示列标题',期望第 1 行上方有列标题、其余行无",
136
+ "result": "**single 实际是'整表 1 个合并标题'**(跨所有列居中),不是按行/列粒度的控制",
137
+ "fix": "需要'每列独立标题'(常见表格):用默认的 titleMode='all'(或不传)。需要'整表 1 合并标题':用 single + singleTitle prop"
138
+ },
139
+ "M5": {
140
+ "wrong": "在 fieldConfig 变化时不重置 errors state,继续用旧 errors",
141
+ "result": "字段集合变化后,errors 旧 key 残留,新 key 缺占位 → 渲染异常",
142
+ "fix": "用 useMemo 或 useEffect 监听 fieldConfig 变化,重新调用 buildEmptyErrors(valueList, fieldConfig) 重建 errors"
143
+ }
144
+ },
145
+ "do": [
146
+ "封装包装组件时,valueList + errors 都必须维护 state(双 state 联动 — 见 commonPatterns.wrapperPattern)",
147
+ "**onAdd / onDelete 必须接受双参数**(valueList, errors)并同时 setValueList + setErrors(M3)",
148
+ "**初始化 errors** 时用 narrow 写法: `if (cfg.name) errRow[cfg.name] = ''`(M1,R23 003 fail 修复)",
149
+ "**业务类型转换** rest 解构后用 `as unknown as Contact` 中转(M2,R23 006 fail 修复)",
150
+ "fieldConfig 动态变化时:重新计算 errors,避免 key 不对齐(M5)",
151
+ "需要每列独立标题用 titleMode='all',需要整表合并 1 个标题用 'single' + singleTitle(M4)"
152
+ ],
153
+ "dont": [
154
+ "行数过多时不分页",
155
+ "每行字段过多导致布局拥挤",
156
+ "**onAdd / onDelete 只接受 valueList 一个参数**(M3,errors 不同步)",
157
+ "**直接 `errRow[cfg.name] = ''` 不做 narrow**(M1,TS2538)",
158
+ "**`valueList.map(({ id, ...rest }) => rest as Contact)`** 缺 unknown 中转(M2,TS2352)",
159
+ "**把 titleMode='single' 当作'只第一行有标题'**(M4)"
160
+ ],
161
+ "commonPatterns": {
162
+ "wrapperPattern": {
163
+ "scenario": "封装 DynamicMultiBox 为业务组件(如 SortableStepsForm / ContactsEntryForm),外部以业务对象数组传入,内部维护 valueList + errors 双 state",
164
+ "code": "import React, { FC, useState, useMemo } from 'react';\nimport DynamicMultiBox from '@para-ui/core/DynamicMultiBox';\nimport type { IConfig, IErrors, IValueList } from '@para-ui/core/DynamicMultiBox/interface';\n\ninterface SortableStepsFormProps {\n fieldConfig: IConfig[];\n steps: Array<Record<string, any>>;\n onStepsChange: (next: Array<Record<string, any>>) => void;\n}\n\n// 工具:把 fieldConfig 转为 errors 空占位行(M1 narrow 修法)\nconst buildEmptyErrors = (valueList: IValueList[], fieldConfig: IConfig[]): IErrors[] =>\n valueList.map(row => {\n const errRow: IErrors = { id: row.id };\n fieldConfig.forEach(cfg => {\n if (cfg.name) errRow[cfg.name] = ''; // ⚠️ narrow:cfg.name 是 string | undefined\n });\n return errRow;\n });\n\nconst SortableStepsForm: FC<SortableStepsFormProps> = ({ fieldConfig, steps, onStepsChange }) => {\n const [valueList, setValueList] = useState<IValueList[]>(steps as IValueList[]);\n const [errors, setErrors] = useState<IErrors[]>(\n () => buildEmptyErrors(steps as IValueList[], fieldConfig)\n );\n\n return (\n <DynamicMultiBox\n config={fieldConfig}\n valueList={valueList}\n errors={errors}\n isSort\n onChange={(next) => { setValueList(next); onStepsChange(next); }}\n onAdd={(next, nextErrors) => { // ✅ 必须接受双参数\n setValueList(next);\n setErrors(nextErrors); // ✅ errors 同步\n onStepsChange(next);\n }}\n onDelete={(next, nextErrors) => { // ✅ 必须接受双参数\n setValueList(next);\n setErrors(nextErrors);\n onStepsChange(next);\n }}\n onSort={(newList) => { setValueList(newList); onStepsChange(newList); }}\n />\n );\n};\n"
165
+ },
166
+ "businessTypeMappingPattern": {
167
+ "scenario": "外部以业务 Contact[] 类型受控,IValueList[] 与 Contact[] 双向映射(R23 DynamicMultiBox-006 fail 修复版本)",
168
+ "code": "interface Contact { name: string; phone: string; email: string; }\n\n// IN: Contact[] → IValueList[](补 id)\nconst contactsToValueList = (contacts: Contact[]): IValueList[] =>\n contacts.map((c, i) => ({ id: String(i + 1), ...c }));\n\n// OUT: IValueList[] → Contact[](剔除 id,业务类型转换)\n// ⚠️ 关键:rest 解构后 TS 推断为 { [x: string]: unknown },要 as unknown 中转\nconst valueListToContacts = (valueList: IValueList[]): Contact[] =>\n valueList.map(({ id, ...rest }) => rest as unknown as Contact);\n\n// 替代:显式字段映射(更类型安全,IDE 跳转友好)\nconst valueListToContactsExplicit = (valueList: IValueList[]): Contact[] =>\n valueList.map(({ name, phone, email }) => ({ name, phone, email } as Contact));\n"
169
+ }
170
+ },
171
+ "events": {
172
+ "onChange": {
173
+ "signature": "(valueList: IValueList<T>[], currentItem?: ICurrentItem<T>) => void",
174
+ "asyncSupported": false,
175
+ "examples": [
176
+ "同步整表值:onChange={(list) => setValueList(list)}",
177
+ "利用 currentItem 做行内校验:onChange={(list, cur) => { setValueList(list); validateRow(cur.rowIndex, cur.name, cur.value); }}",
178
+ "currentItem 包含 { name, value, rowIndex, id }——可精确定位是哪行哪字段发生了变化"
179
+ ],
180
+ "commonMistakes": [
181
+ "在 onChange 里同时 setErrors——onChange 只在单元格值变化时触发,不涉及 errors;errors 同步在 onAdd/onDelete 完成",
182
+ "假设 onChange 在新增/删除/拖拽时也触发——这三种操作分别走 onAdd/onDelete/onSort 回调",
183
+ "onChange 第二参数 currentItem 的 name 是 keyof T & string——与 IConfig.name 类型一致,可直接做对象索引"
184
+ ]
185
+ },
186
+ "onAdd": {
187
+ "signature": "(valueList: IValueList<T>[], errors: IErrors<T>[]) => void",
188
+ "asyncSupported": false,
189
+ "examples": [
190
+ "双 state 同步(必须):onAdd={(list, errs) => { setValueList(list); setErrors(errs); }}",
191
+ "同时通知父组件:onAdd={(list, errs) => { setValueList(list); setErrors(errs); onStepsChange(list); }}"
192
+ ],
193
+ "commonMistakes": [
194
+ "只接受一个参数 valueList,忽略 errors——errors 不同步导致新行渲染异常(TS 签名有第二参数)",
195
+ "在 onAdd 里手动构造 errors 新行——组件已帮你构造好新行空占位 errors,直接 setErrors(errs) 即可",
196
+ "期望 onAdd 触发后 valueList 还是旧数据加上新行——onAdd 第一参数已是含新行的新数组"
197
+ ]
198
+ },
199
+ "onDelete": {
200
+ "signature": "(valueList: IValueList<T>[], errors: IErrors<T>[]) => void",
201
+ "asyncSupported": false,
202
+ "examples": [
203
+ "双 state 同步:onDelete={(list, errs) => { setValueList(list); setErrors(errs); }}",
204
+ "配合业务通知:onDelete={(list, errs) => { setValueList(list); setErrors(errs); onStepsChange(list); }}"
205
+ ],
206
+ "commonMistakes": [
207
+ "只接受 valueList 忽略 errors 第二参数——errors 不同步,行对应关系错位(id 对不上)",
208
+ "期望 keepLastItem=true 时最后一行也能删——keepLastItem=true(默认)时只剩 1 行时删除图标隐藏,onDelete 不触发"
209
+ ]
210
+ },
211
+ "onSort": {
212
+ "signature": "(newValueList: IValueList<T>[], swapIds?: number[]) => void",
213
+ "asyncSupported": false,
214
+ "examples": [
215
+ "同步排序后的顺序:onSort={(newList) => setValueList(newList)}",
216
+ "swapIds 是位置变动行的下标集合,不是 [from, to] 对:onSort={(newList, swapIds) => console.log(swapIds)}"
217
+ ],
218
+ "commonMistakes": [
219
+ "把 swapIds 当作 [fromIndex, toIndex] 对使用——实际是所有位置变动行的下标集合",
220
+ "onSort 里同时重建 errors——拖拽排序不改变行数,errors 的行数不变;只需按 newList 顺序重排 errors(用 rowKey 映射)",
221
+ "期望 isSort=true 自动维护排序——isSort 只开启 UI 拖拽,newList 必须通过 onSort 回调同步到父组件 state"
222
+ ]
223
+ },
224
+ "onFilter": {
225
+ "signature": "(data: IFilterParams<T>) => void",
226
+ "asyncSupported": false,
227
+ "examples": [
228
+ "监听筛选变化:onFilter={(data) => console.log(data.checkedVal, data.valueList)}",
229
+ "data 包含 { name, checkedVal, valueList, errors }——列筛选变化时的完整快照"
230
+ ],
231
+ "commonMistakes": [
232
+ "期望 isFilter=false 时 onFilter 也触发——isFilter 必须为 true 才显示筛选 UI",
233
+ "假设 onFilter 替代 onChange——onFilter 只在列筛选器操作时触发,单元格值变化走 onChange"
234
+ ]
235
+ }
236
+ },
237
+ "typescriptPitfalls": [
238
+ {
239
+ "issue": "IConfig.name 类型是 keyof T & string(可能含 undefined),直接用作对象索引报 TS2538",
240
+ "wrong": "const errRow: IErrors = { id: s.id };\nfieldConfig.forEach((cfg: IConfig) => {\n errRow[cfg.name] = ''; // TS2538: 'undefined' cannot be used as an index type\n});",
241
+ "right": "fieldConfig.forEach((cfg: IConfig) => {\n if (cfg.name) errRow[cfg.name] = ''; // narrow 后再索引\n // 或:errRow[cfg.name!] = ''; // 非空断言(已知 name 必有值时)\n});"
242
+ },
243
+ {
244
+ "issue": "IValueList 解构后 rest 是 unknown 索引签名,直接 as 具体类型被 TS 5.x 拒绝",
245
+ "wrong": "const toContact = (item: IValueList): Contact =>\n (({ id, ...rest }) => rest as Contact)(item); // TS2352: not sufficiently overlapping",
246
+ "right": "const toContact = (item: IValueList): Contact =>\n (({ id, ...rest }) => rest as unknown as Contact)(item); // 先转 unknown 再转目标类型"
247
+ },
248
+ {
249
+ "issue": "IConfig.inputType 只接受 PascalCase 严格枚举,不接受 HTML 小写风格",
250
+ "wrong": "{ inputType: 'text' } // 或 'date'、'select'——TS 报错,runtime 不渲染",
251
+ "right": "{ inputType: 'TextField' } // 或 'Select'、'DatePicker'、'Switch'、'InputNumber'——PascalCase"
252
+ },
253
+ {
254
+ "issue": "onAdd/onDelete 是双参数签名,只声明单参数会导致 errors 不同步(TS 不会报错但逻辑错误)",
255
+ "wrong": "onAdd={(valueList) => setValueList(valueList)} // errors 参数丢失,新行无占位",
256
+ "right": "onAdd={(valueList, errors) => { setValueList(valueList); setErrors(errors); }} // 两个 state 同时同步"
257
+ },
258
+ {
259
+ "issue": "IMultiValueProps 是泛型 <T extends Record<string, unknown>>,使用具体业务类型时需传泛型参数",
260
+ "wrong": "// 不传泛型,render/onChange 里 row/currentItem 的字段是 unknown\n<DynamicMultiBox config={config} valueList={valueList} />",
261
+ "right": "// 传泛型,类型推断正确\nconst config: IConfig<Contact>[] = [...];\nconst valueList: IValueList<Contact>[] = [...];\n<DynamicMultiBox<Contact> config={config} valueList={valueList} />"
262
+ },
263
+ {
264
+ "issue": "泛型 T 必须满足 Record<string, unknown> 约束,普通 interface 没有 index signature 会报 TS2344",
265
+ "wrong": "interface Param { foo: string } // 没有 index signature\n<DynamicMultiBox<Param> ... /> // TS2344: Type 'Param' does not satisfy the constraint 'Record<string, unknown>'. Index signature for type 'string' is missing in type 'Param'.",
266
+ "right": "interface Param { foo: string; [key: string]: unknown } // 加 index signature\n// 或用 type 别名: type Param = { foo: string } & Record<string, unknown>\n<DynamicMultiBox<Param> ... /> // 编译通过"
267
+ },
268
+ {
269
+ "issue": "IConfig / IValueList 等类型必须从 @para-ui/core/DynamicMultiBox 导入,不是子路径 /interface",
270
+ "wrong": "import type { IConfig } from '@para-ui/core/DynamicMultiBox/interface'; // TS2307: Cannot find module",
271
+ "right": "import type { IConfig, IValueList } from '@para-ui/core/DynamicMultiBox';"
272
+ }
273
+ ],
274
+ "mapping": {
275
+ "realComponent": "DynamicMultiBox",
276
+ "adapter": null
277
+ }
278
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "name": "Empty",
3
+ "category": "Data Display",
4
+ "description": "空状态时的展示占位符,用于无数据、无搜索结果、无权限等场景,支持自定义图片、描述文案、刷新按钮及整体替换",
5
+ "semantic": {
6
+ "intent": [
7
+ "展示空状态",
8
+ "引导操作",
9
+ "占位"
10
+ ],
11
+ "useCases": [
12
+ "无数据",
13
+ "无搜索结果",
14
+ "无权限"
15
+ ],
16
+ "riskLevel": "low"
17
+ },
18
+ "variants": {
19
+ "default": {
20
+ "meaning": "默认样式"
21
+ }
22
+ },
23
+ "states": [
24
+ "visible"
25
+ ],
26
+ "idealProps": {
27
+ "size": {
28
+ "type": "enum",
29
+ "values": [
30
+ "small",
31
+ "medium",
32
+ "large"
33
+ ],
34
+ "default": "large",
35
+ "description": "尺寸。三档统一为 small / medium / large(2026-05-08 跨组件命名 epic §3.1 选项 B 实施,medium 为新增视觉档,默认 large 不变,既有 small/large 调用零回归)"
36
+ },
37
+ "image": {
38
+ "type": "ReactNode | string",
39
+ "description": "自定义图片节点。传字符串时渲染为 <img src={image}>,传 ReactNode 时直接渲染。**不传时按 size 自动选内置图:small=SmallNull, medium/large=LargeNull**"
40
+ },
41
+ "description": {
42
+ "type": "ReactNode | string",
43
+ "description": "自定义描述内容;不传时显示国际化默认文案(zh_CN='暂无内容')"
44
+ },
45
+ "imageStyle": {
46
+ "type": "object",
47
+ "objectShape": {
48
+ "height": { "type": "string | number", "description": "图片高度" },
49
+ "width": { "type": "string | number", "description": "图片宽度" }
50
+ },
51
+ "completeExample": "{ height: 60 }",
52
+ "description": "图片区域内联样式(React.CSSProperties 子集)"
53
+ },
54
+ "showRefresh": {
55
+ "type": "boolean",
56
+ "default": false,
57
+ "description": "是否显示刷新按钮;配合 onRefresh 使用"
58
+ },
59
+ "onRefresh": {
60
+ "type": "(event: React.MouseEvent) => void",
61
+ "description": "点击刷新按钮回调;仅 showRefresh=true 时展示触发"
62
+ },
63
+ "customEmpty": {
64
+ "type": "ReactNode",
65
+ "description": "**完整替换**整个空状态内容(包括图片 + 描述),传入后 image / description / showRefresh 全部不渲染(src/Empty/index.tsx 90 行 if(customEmpty) 分支实证)"
66
+ },
67
+ "className": {
68
+ "type": "string",
69
+ "description": "外层容器自定义类名"
70
+ },
71
+ "style": {
72
+ "type": "React.CSSProperties",
73
+ "description": "外层容器 style"
74
+ }
75
+ },
76
+ "do": [
77
+ "在无数据时提供 Empty 状态",
78
+ "提供引导操作:配合 showRefresh + onRefresh 增加刷新入口",
79
+ "需要完整自定义布局时使用 customEmpty 整体替换",
80
+ "size 默认 large,需要紧凑展示(如表格内嵌)时用 small"
81
+ ],
82
+ "dont": [
83
+ "在 Loading 时显示 Empty——应先消除 Loading 遮罩再渲染 Empty",
84
+ "同时传 customEmpty 和 description/image——customEmpty 会覆盖后者,造成困惑"
85
+ ],
86
+ "events": {
87
+ "onRefresh": {
88
+ "signature": "(event: React.MouseEvent) => void",
89
+ "asyncSupported": false,
90
+ "examples": [
91
+ "showRefresh={true} onRefresh={() => fetchData()} — 点击刷新文字触发重新请求",
92
+ "onRefresh={(e) => { e.stopPropagation(); reload(); }} — 阻止冒泡后重载",
93
+ "配合 loading state:onRefresh={() => { setLoading(true); fetch().finally(() => setLoading(false)); }}"
94
+ ],
95
+ "commonMistakes": [
96
+ "不传 showRefresh={true} 只传 onRefresh — 刷新按钮不会渲染,回调永不触发",
97
+ "期望点击图片触发 onRefresh — 只有文字区域的刷新链接触发,图片无点击事件",
98
+ "异步刷新后没有给用户反馈(Loading 状态)— 应结合父组件 loading 状态"
99
+ ]
100
+ }
101
+ },
102
+ "typescriptPitfalls": [
103
+ {
104
+ "issue": "image prop 类型是 ReactNode | string,传 null 会触发 TS2322",
105
+ "wrong": "const img: React.ReactNode | null = getImg(); <Empty image={img} /> // 可能 null,TS 报错",
106
+ "right": "const img = getImg(); <Empty image={img ?? undefined} /> // 用 undefined 替代 null"
107
+ },
108
+ {
109
+ "issue": "description 类型是 ReactNode,不支持 false/null 显式传递",
110
+ "wrong": "<Empty description={null} /> // 期望显示默认文案,但 null 在 ReactNode 中合法,结果不渲染描述区域",
111
+ "right": "<Empty /> // 不传 description 时自动用国际化默认文案('暂无内容')"
112
+ },
113
+ {
114
+ "issue": "customEmpty 传入后 image/description/showRefresh 均不生效——源码 if(customEmpty) 分支直接 return customEmpty",
115
+ "wrong": "<Empty customEmpty={<CustomUI />} description='还有数据哦' /> // description 被 customEmpty 覆盖",
116
+ "right": "// 要自定义描述同时用 customEmpty:把描述塞进 customEmpty 里\n<Empty customEmpty={<><CustomUI /><p>还有数据哦</p></>} />"
117
+ }
118
+ ],
119
+ "mapping": {
120
+ "realComponent": "Empty",
121
+ "adapter": null
122
+ }
123
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "ExpressionInput",
3
+ "category": "数据录入",
4
+ "description": "单行表达式变量自动补全输入框,默认要求 {{ }} 包裹触发,候选数据完全由业务方通过 resolveCandidates 注入。",
5
+ "semantic": {
6
+ "intent": ["在文本中输入引用变量的表达式", "按命名空间层级下钻选择变量"],
7
+ "useCases": ["脚本/配置里引用运行时变量", "低代码画布属性面板里的表达式绑定"],
8
+ "riskLevel": "low"
9
+ },
10
+ "variants": {
11
+ "braces": { "meaning": "默认触发模式,要求光标位于 {{ }} 区间内才弹出候选" },
12
+ "bare": { "meaning": "不要求大括号包裹,任意位置匹配 triggerPrefix 即弹出候选" }
13
+ },
14
+ "states": ["default", "focus", "disabled", "readOnly", "popup-open"],
15
+ "idealProps": {
16
+ "value": { "type": "string", "description": "受控值", "required": false },
17
+ "onChange": { "type": "function", "description": "值变化回调", "signature": "(value: string) => void" },
18
+ "resolveCandidates": {
19
+ "type": "function",
20
+ "description": "按命名空间路径返回该层级的完整候选列表,组件内部按 parts 缓存",
21
+ "signature": "(parts: string[]) => ExprCandidate[]",
22
+ "required": true
23
+ },
24
+ "triggerMode": {
25
+ "type": "string",
26
+ "description": "触发匹配机制",
27
+ "values": ["braces", "bare"],
28
+ "default": "braces"
29
+ },
30
+ "triggerPrefix": { "type": "string", "description": "触发前缀符号", "default": "$" },
31
+ "virtualizeThreshold": { "type": "number", "description": "候选数超过该阈值启用虚拟滚动", "default": "50" },
32
+ "renderPopupHeader": {
33
+ "type": "function",
34
+ "description": "自定义浮层 header 文案",
35
+ "signature": "(ctx: ExprChainCtx, count: number) => React.ReactNode",
36
+ "required": false
37
+ },
38
+ "expressionTooltip": {
39
+ "type": "ReactNode",
40
+ "description": "表达式说明 tooltip 文案,不传则不展示;仅当 value 命中表达式格式(braces/bare)时 hover/focus 才弹出",
41
+ "required": false
42
+ }
43
+ },
44
+ "commonMisconceptions": [
45
+ "以为 resolveCandidates 每次按键都会被调用——实际只有下钻/回退到新的命名空间层级时才调用,同层级内逐字过滤是客户端完成的",
46
+ "以为默认触发不需要 {{ }} 包裹——默认 triggerMode 是 'braces',裸写 $.xxx 不会触发,需要显式传 triggerMode='bare' 才对齐 Ditto 原始行为",
47
+ "以为传入的 candidate.value 可以是任意字符串——实际必须是合法标识符字符([A-Za-z0-9_$]),否则插入后再次解析会被截断",
48
+ "以为 expressionTooltip 会随打字实时弹出/消失——实际是否命中只在 hover/focus 触发那一刻判定,光标停留期间继续输入使 value 从未命中变为命中不会自动弹出,需要重新 hover/focus",
49
+ "以为花括号着色和 expressionTooltip 用同一套判定标准——实际着色只看 {{ }} 是否配对闭合,不校验内容合法性,门槛比 expressionTooltip 低,{{$.}} 这类值会着色但不会弹出 tooltip,两者可能不一致,这是预期行为"
50
+ ],
51
+ "do": [
52
+ "为需要继续下钻子级的候选项设置 chain: true,让选中后自动追加 . 方便连续输入",
53
+ "为敏感字段设置 sensitive: true,组件会自动展示锁图标",
54
+ "在 Modal/Drawer 中使用时无需额外处理,组件内部已对接 usePopupContainer 自动寻找最近可滚动祖先容器"
55
+ ],
56
+ "dont": [
57
+ "不要在 resolveCandidates 内部做未做缓存的重量级计算并假设组件会防抖——组件只在 parts 变化时调用一次,但单次调用本身仍需业务方保证足够快",
58
+ "不要给多个实例传相同的 DOM id 或手动操作 document.body 上的浮层 — 组件已经用 UUID 做了实例隔离"
59
+ ],
60
+ "events": {
61
+ "onChange": {
62
+ "signature": "(value: string) => void",
63
+ "asyncSupported": false,
64
+ "examples": ["受控更新 value 状态"],
65
+ "commonMistakes": ["忘记把新 value 传回 props.value,导致组件表现为不可编辑"]
66
+ }
67
+ },
68
+ "typescriptPitfalls": [
69
+ {
70
+ "issue": "resolveCandidates 类型签名从 ChainCtx 变成了 parts: string[]",
71
+ "wrong": "resolveCandidates={(ctx) => ctx.partial ? [] : rootCandidates}",
72
+ "right": "resolveCandidates={(parts) => parts.length === 0 ? rootCandidates : []}"
73
+ }
74
+ ],
75
+ "mapping": {
76
+ "realComponent": "ExpressionInput",
77
+ "adapter": "无,直接使用"
78
+ }
79
+ }