@para-ui/core 5.0.0-beta.12 → 5.0.0-beta.14

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 (565) 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/FieldForm/component.json +196 -0
  36. package/Form/component.json +161 -0
  37. package/FormItem/component.json +171 -0
  38. package/FunctionModal/component.json +197 -0
  39. package/Help/component.json +118 -0
  40. package/HelperText/component.json +126 -0
  41. package/Image/component.json +165 -0
  42. package/InputCode/component.json +191 -0
  43. package/InputLang/component.json +205 -0
  44. package/InputNumber/component.json +162 -0
  45. package/Label/component.json +126 -0
  46. package/Loading/component.json +91 -0
  47. package/Menu/component.json +180 -0
  48. package/Message/component.json +246 -0
  49. package/Modal/component.json +277 -0
  50. package/MultiBox/component.json +216 -0
  51. package/Notification/component.json +184 -0
  52. package/OperateBtn/component.json +134 -0
  53. package/PageHeader/component.json +112 -0
  54. package/Pagination/component.json +181 -0
  55. package/PasswordRules/component.json +105 -0
  56. package/PopConfirm/component.json +227 -0
  57. package/PopMenu/component.json +131 -0
  58. package/Popover/component.json +165 -0
  59. package/Progress/component.json +161 -0
  60. package/Prompt/component.json +144 -0
  61. package/Querying/component.json +96 -0
  62. package/QuickReply/component.json +129 -0
  63. package/Radio/component.json +136 -0
  64. package/RadioGroup/component.json +149 -0
  65. package/RangeInput/component.json +198 -0
  66. package/Result/component.json +104 -0
  67. package/ScrollBar/component.json +115 -0
  68. package/Search/component.json +177 -0
  69. package/Select/component.json +244 -0
  70. package/SelectInput/component.json +184 -0
  71. package/Selector/component.json +203 -0
  72. package/SelectorPicker/component.json +179 -0
  73. package/SingleBox/component.json +151 -0
  74. package/Slider/component.json +181 -0
  75. package/SortBox/component.json +108 -0
  76. package/Status/component.json +104 -0
  77. package/Stepper/component.json +129 -0
  78. package/Switch/component.json +207 -0
  79. package/Table/component.json +547 -0
  80. package/Tabs/component.json +227 -0
  81. package/Tag/component.json +221 -0
  82. package/TextEditor/component.json +186 -0
  83. package/TextField/component.json +290 -0
  84. package/TimePicker/component.json +176 -0
  85. package/Timeline/component.json +110 -0
  86. package/Title/component.json +156 -0
  87. package/ToggleButton/component.json +153 -0
  88. package/Tooltip/component.json +176 -0
  89. package/Transfer/component.json +157 -0
  90. package/Tree/component.json +512 -0
  91. package/Upload/component.json +450 -0
  92. package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
  93. package/ai-workflows/02-rbac-operation-buttons.md +290 -0
  94. package/ai-workflows/03-complex-form-async-cascade.md +350 -0
  95. package/ai-workflows/04-array-field-form.md +281 -0
  96. package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
  97. package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
  98. package/ai-workflows/07-search-filter-table-trio.md +387 -0
  99. package/ai-workflows/08-table-advanced-features.md +365 -0
  100. package/ai-workflows/09-batch-operation-export-progress.md +367 -0
  101. package/ai-workflows/10-cross-component-state-coordination.md +412 -0
  102. package/codemods/modal-onCancel-to-onDismiss.js +69 -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 +50 -47
  112. package/es/Anchor/type.d.ts +8 -4
  113. package/es/Argv/component.json +216 -0
  114. package/es/Argv/index.d.ts +5 -6
  115. package/es/AutoBox/component.json +133 -0
  116. package/es/AutoBox/index.d.ts +3 -3
  117. package/es/AutoBox/index.js +1 -1
  118. package/es/AutoBox/protal.d.ts +2 -2
  119. package/es/AutoBox/protal.js +32 -29
  120. package/es/AutoButton/component.json +109 -0
  121. package/es/AutoButton/index.js +1 -1
  122. package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  123. package/es/AutoTips/autoTipsMultiline/index.js +1 -1
  124. package/es/AutoTips/component.json +121 -0
  125. package/es/Badge/component.json +92 -0
  126. package/es/Breadcrumbs/component.json +142 -0
  127. package/es/Breadcrumbs/index.js +1 -1
  128. package/es/Button/SplitButton.d.ts +2 -2
  129. package/es/Button/component.json +168 -0
  130. package/es/Button/index.js +44 -44
  131. package/es/ButtonGroup/component.json +132 -0
  132. package/es/ButtonGroup/index.d.ts +1 -1
  133. package/es/Card/component.json +162 -0
  134. package/es/Card/index.d.ts +2 -2
  135. package/es/Card/index.js +2 -2
  136. package/es/Carousel/component.json +142 -0
  137. package/es/Carousel/index.d.ts +1 -1
  138. package/es/Cascader/Cascader.js +188 -180
  139. package/es/Cascader/component.json +196 -0
  140. package/es/Cascader/hooks/useEntities.js +7 -7
  141. package/es/Cascader/interface.d.ts +1 -0
  142. package/es/Cascader/utils/commonUtil.d.ts +1 -1
  143. package/es/Cascader/utils/commonUtil.js +16 -16
  144. package/es/Cascader/utils/treeUtil.d.ts +14 -5
  145. package/es/Cascader/utils/treeUtil.js +1 -1
  146. package/es/Checkbox/component.json +138 -0
  147. package/es/CheckboxGroup/component.json +152 -0
  148. package/es/CodeEditor/component.json +189 -0
  149. package/es/CodeEditor/index.d.ts +10 -9
  150. package/es/Collapse/component.json +166 -0
  151. package/es/Collapse/index.d.ts +1 -1
  152. package/es/Collapse/index.js +41 -33
  153. package/es/CollapseBox/component.json +84 -0
  154. package/es/CollapseLayout/component.json +155 -0
  155. package/es/ColorPicker/component.json +142 -0
  156. package/es/ComboSelect/component.json +181 -0
  157. package/es/ComboSelect/index.js +299 -287
  158. package/es/ComboSelect/interface.d.ts +6 -3
  159. package/es/ComboSelect/utils.d.ts +3 -3
  160. package/es/ComboSelect/utils.js +1 -1
  161. package/es/Container/component.json +111 -0
  162. package/es/ContentBox/component.json +81 -0
  163. package/es/CopyText/component.json +118 -0
  164. package/es/CycleSelector/component.json +98 -0
  165. package/es/CycleSelector/index.js +14 -13
  166. package/es/DatePicker/component.json +192 -0
  167. package/es/DatePicker/generatePicker/generateRangePicker.d.ts +0 -8
  168. package/es/DatePicker/generatePicker/generateRangePicker.js +73 -65
  169. package/es/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  170. package/es/DatePicker/generatePicker/index.d.ts +11 -4
  171. package/es/Descriptions/component.json +142 -0
  172. package/es/Descriptions/index.d.ts +1 -1
  173. package/es/Desktop/component.json +171 -0
  174. package/es/DragVerify/component.json +114 -0
  175. package/es/DragVerify/index.js +19 -19
  176. package/es/Drawer/component.json +200 -0
  177. package/es/Drawer/index.js +86 -86
  178. package/es/Drawer/interface.d.ts +1 -1
  179. package/es/Drawer/util.d.ts +1 -6
  180. package/es/Drawer/util.js +9 -6
  181. package/es/Dropdown/component.json +147 -0
  182. package/es/DynamicMultiBox/component.json +278 -0
  183. package/es/DynamicMultiBox/formItem.d.ts +1 -1
  184. package/es/DynamicMultiBox/rowForm.d.ts +2 -2
  185. package/es/Empty/component.json +123 -0
  186. package/es/Empty/index.css +1 -1
  187. package/es/Empty/index.d.ts +2 -2
  188. package/es/Empty/index.js +27 -26
  189. package/es/Empty/style/index.css +1 -1
  190. package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  191. package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
  192. package/es/FieldForm/Form.d.ts +2 -2
  193. package/es/FieldForm/FormList.d.ts +2 -2
  194. package/es/FieldForm/component.json +196 -0
  195. package/es/FieldForm/context.d.ts +5 -1
  196. package/es/FieldForm/context.js +2 -2
  197. package/es/FieldForm/hooks/useForm.d.ts +4 -3
  198. package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
  199. package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  200. package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
  201. package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
  202. package/es/FieldForm/hooks/useItemRef.js +6 -6
  203. package/es/Form/component.json +161 -0
  204. package/es/Form/index.d.ts +52 -49
  205. package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  206. package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
  207. package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  208. package/es/FormItem/compoments/formFile/index.js +8 -8
  209. package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  210. package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
  211. package/es/FormItem/component.json +171 -0
  212. package/es/FormItem/index.d.ts +5 -5
  213. package/es/FormItem/index.js +23 -23
  214. package/es/FormItem/itemType.js +1 -1
  215. package/es/FunctionModal/component.json +197 -0
  216. package/es/FunctionModal/dialog.d.ts +1 -1
  217. package/es/FunctionModal/modalContext.d.ts +4 -1
  218. package/es/Help/component.json +118 -0
  219. package/es/HelperText/component.json +126 -0
  220. package/es/Image/component.json +165 -0
  221. package/es/InputCode/component.json +191 -0
  222. package/es/InputCode/index.d.ts +2 -2
  223. package/es/InputLang/component.json +205 -0
  224. package/es/InputLang/index.js +1 -1
  225. package/es/InputNumber/component.json +162 -0
  226. package/es/Label/component.json +126 -0
  227. package/es/Label/index.d.ts +2 -2
  228. package/es/Loading/component.json +91 -0
  229. package/es/Menu/component.json +180 -0
  230. package/es/Message/component.json +246 -0
  231. package/es/Message/index.d.ts +2 -2
  232. package/es/Message/index.js +2 -2
  233. package/es/Modal/Confirm/index.d.ts +1 -1
  234. package/es/Modal/Confirm/index.js +81 -75
  235. package/es/Modal/component.json +277 -0
  236. package/es/Modal/index.d.ts +97 -6
  237. package/es/Modal/index.js +174 -122
  238. package/es/Modal/interface.d.ts +1 -0
  239. package/es/MultiBox/component.json +216 -0
  240. package/es/MultiBox/index.js +19 -14
  241. package/es/Notification/component.json +184 -0
  242. package/es/OperateBtn/component.json +134 -0
  243. package/es/OperateBtn/index.d.ts +3 -3
  244. package/es/PageHeader/component.json +112 -0
  245. package/es/Pagination/component.json +181 -0
  246. package/es/Pagination/index.js +15 -15
  247. package/es/PasswordRules/component.json +105 -0
  248. package/es/PasswordRules/index.d.ts +4 -4
  249. package/es/PopConfirm/component.json +227 -0
  250. package/es/PopConfirm/index.d.ts +1 -1
  251. package/es/PopConfirm/index.js +1 -1
  252. package/es/PopMenu/component.json +131 -0
  253. package/es/PopMenu/hooks.d.ts +1 -1
  254. package/es/PopMenu/index.js +8 -8
  255. package/es/Popover/component.json +165 -0
  256. package/es/Popover/index.js +1 -1
  257. package/es/Progress/component.json +161 -0
  258. package/es/Prompt/component.json +144 -0
  259. package/es/Querying/component.json +96 -0
  260. package/es/Querying/index.css +1 -1
  261. package/es/Querying/index.d.ts +2 -2
  262. package/es/Querying/index.js +20 -19
  263. package/es/Querying/style/index.css +1 -1
  264. package/es/QuickReply/component.json +129 -0
  265. package/es/QuickReply/index.d.ts +1 -1
  266. package/es/Radio/component.json +136 -0
  267. package/es/RadioGroup/component.json +149 -0
  268. package/es/RangeInput/component.json +198 -0
  269. package/es/RangeInput/index.js +1 -1
  270. package/es/Result/component.json +104 -0
  271. package/es/ScrollBar/component.json +115 -0
  272. package/es/Search/component.json +177 -0
  273. package/es/Search/index.d.ts +1 -1
  274. package/es/Select/component.json +244 -0
  275. package/es/Select/index.js +113 -113
  276. package/es/SelectInput/component.json +184 -0
  277. package/es/Selector/component.json +203 -0
  278. package/es/Selector/index.js +28 -27
  279. package/es/Selector/interface.d.ts +1 -1
  280. package/es/Selector/selectorMain/index.js +2 -2
  281. package/es/Selector/selectorNode/index.js +1 -1
  282. package/es/Selector/util.d.ts +2 -2
  283. package/es/SelectorPicker/component.json +179 -0
  284. package/es/SelectorPicker/index.d.ts +5 -5
  285. package/es/SelectorPicker/index.js +15 -15
  286. package/es/SingleBox/component.json +151 -0
  287. package/es/SingleBox/index.d.ts +2 -2
  288. package/es/Slider/component.json +181 -0
  289. package/es/SortBox/component.json +108 -0
  290. package/es/Status/component.json +104 -0
  291. package/es/Stepper/component.json +129 -0
  292. package/es/Stepper/index.d.ts +2 -2
  293. package/es/Switch/component.json +207 -0
  294. package/es/Switch/index.css +1 -1
  295. package/es/Switch/index.d.ts +3 -2
  296. package/es/Switch/index.js +60 -59
  297. package/es/Switch/style/index.css +1 -1
  298. package/es/Table/component.json +547 -0
  299. package/es/Table/index.d.ts +2 -2
  300. package/es/Table/index.js +414 -414
  301. package/es/Table/interface.d.ts +6 -0
  302. package/es/Tabs/component.json +227 -0
  303. package/es/Tag/component.json +221 -0
  304. package/es/Tag/index.css +1 -1
  305. package/es/Tag/index.d.ts +1 -1
  306. package/es/Tag/index.js +20 -20
  307. package/es/Tag/style/index.css +1 -1
  308. package/es/TextEditor/component.json +186 -0
  309. package/es/TextEditor/index.d.ts +5 -5
  310. package/es/TextField/component.json +290 -0
  311. package/es/TextField/index.d.ts +2 -2
  312. package/es/TimePicker/component.json +176 -0
  313. package/es/Timeline/component.json +110 -0
  314. package/es/Title/component.json +156 -0
  315. package/es/ToggleButton/component.json +153 -0
  316. package/es/Tooltip/component.json +176 -0
  317. package/es/Tooltip/index.js +74 -63
  318. package/es/Tooltip/interface.d.ts +14 -1
  319. package/es/Tooltip/utils.js +6 -6
  320. package/es/Transfer/component.json +157 -0
  321. package/es/Tree/component.json +512 -0
  322. package/es/Upload/component.json +450 -0
  323. package/es/Utils/type.d.ts +0 -2
  324. package/es/index.d.ts +2 -0
  325. package/es/index.js +1 -1
  326. package/es/locale/en_US.d.ts +361 -0
  327. package/es/locale/en_US.js +364 -0
  328. package/es/locale/index.d.ts +1 -723
  329. package/es/locale/index2.js +10 -0
  330. package/es/locale/zh_CN.d.ts +361 -0
  331. package/es/locale/zh_CN.js +364 -0
  332. package/lib/AlignBox/component.json +89 -0
  333. package/lib/AlignBox/index.css +1 -1
  334. package/lib/AlignBox/index.d.ts +6 -2
  335. package/lib/AlignBox/index.js +1 -1
  336. package/lib/AlignBox/style/index.css +1 -1
  337. package/lib/Anchor/anchorMenu/index.d.ts +2 -1
  338. package/lib/Anchor/anchorMenu/index.js +1 -1
  339. package/lib/Anchor/component.json +130 -0
  340. package/lib/Anchor/index.js +1 -1
  341. package/lib/Anchor/type.d.ts +8 -4
  342. package/lib/Argv/component.json +216 -0
  343. package/lib/Argv/index.d.ts +5 -6
  344. package/lib/AutoBox/component.json +133 -0
  345. package/lib/AutoBox/index.d.ts +3 -3
  346. package/lib/AutoBox/index.js +1 -1
  347. package/lib/AutoBox/protal.d.ts +2 -2
  348. package/lib/AutoBox/protal.js +1 -1
  349. package/lib/AutoButton/component.json +109 -0
  350. package/lib/AutoButton/index.js +1 -1
  351. package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  352. package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
  353. package/lib/AutoTips/component.json +121 -0
  354. package/lib/Badge/component.json +92 -0
  355. package/lib/Breadcrumbs/component.json +142 -0
  356. package/lib/Breadcrumbs/index.js +1 -1
  357. package/lib/Button/SplitButton.d.ts +2 -2
  358. package/lib/Button/component.json +168 -0
  359. package/lib/Button/index.js +1 -1
  360. package/lib/ButtonGroup/component.json +132 -0
  361. package/lib/ButtonGroup/index.d.ts +1 -1
  362. package/lib/Card/component.json +162 -0
  363. package/lib/Card/index.d.ts +2 -2
  364. package/lib/Card/index.js +1 -1
  365. package/lib/Carousel/component.json +142 -0
  366. package/lib/Carousel/index.d.ts +1 -1
  367. package/lib/Cascader/Cascader.js +1 -1
  368. package/lib/Cascader/component.json +196 -0
  369. package/lib/Cascader/hooks/useEntities.js +1 -1
  370. package/lib/Cascader/interface.d.ts +1 -0
  371. package/lib/Cascader/utils/commonUtil.d.ts +1 -1
  372. package/lib/Cascader/utils/commonUtil.js +1 -1
  373. package/lib/Cascader/utils/treeUtil.d.ts +14 -5
  374. package/lib/Cascader/utils/treeUtil.js +1 -1
  375. package/lib/Checkbox/component.json +138 -0
  376. package/lib/CheckboxGroup/component.json +152 -0
  377. package/lib/CodeEditor/component.json +189 -0
  378. package/lib/CodeEditor/index.d.ts +10 -9
  379. package/lib/Collapse/component.json +166 -0
  380. package/lib/Collapse/index.d.ts +1 -1
  381. package/lib/Collapse/index.js +1 -1
  382. package/lib/CollapseBox/component.json +84 -0
  383. package/lib/CollapseLayout/component.json +155 -0
  384. package/lib/ColorPicker/component.json +142 -0
  385. package/lib/ComboSelect/component.json +181 -0
  386. package/lib/ComboSelect/index.js +1 -1
  387. package/lib/ComboSelect/interface.d.ts +6 -3
  388. package/lib/ComboSelect/utils.d.ts +3 -3
  389. package/lib/ComboSelect/utils.js +1 -1
  390. package/lib/Container/component.json +111 -0
  391. package/lib/ContentBox/component.json +81 -0
  392. package/lib/CopyText/component.json +118 -0
  393. package/lib/CycleSelector/component.json +98 -0
  394. package/lib/CycleSelector/index.js +1 -1
  395. package/lib/DatePicker/component.json +192 -0
  396. package/lib/DatePicker/generatePicker/generateRangePicker.d.ts +0 -8
  397. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  398. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  399. package/lib/DatePicker/generatePicker/index.d.ts +11 -4
  400. package/lib/Descriptions/component.json +142 -0
  401. package/lib/Descriptions/index.d.ts +1 -1
  402. package/lib/Desktop/component.json +171 -0
  403. package/lib/DragVerify/component.json +114 -0
  404. package/lib/DragVerify/index.js +1 -1
  405. package/lib/Drawer/component.json +200 -0
  406. package/lib/Drawer/index.js +1 -1
  407. package/lib/Drawer/interface.d.ts +1 -1
  408. package/lib/Drawer/util.d.ts +1 -6
  409. package/lib/Drawer/util.js +1 -1
  410. package/lib/Dropdown/component.json +147 -0
  411. package/lib/DynamicMultiBox/component.json +278 -0
  412. package/lib/DynamicMultiBox/formItem.d.ts +1 -1
  413. package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
  414. package/lib/Empty/component.json +123 -0
  415. package/lib/Empty/index.css +1 -1
  416. package/lib/Empty/index.d.ts +2 -2
  417. package/lib/Empty/index.js +1 -1
  418. package/lib/Empty/style/index.css +1 -1
  419. package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  420. package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
  421. package/lib/FieldForm/Form.d.ts +2 -2
  422. package/lib/FieldForm/FormList.d.ts +2 -2
  423. package/lib/FieldForm/component.json +196 -0
  424. package/lib/FieldForm/context.d.ts +5 -1
  425. package/lib/FieldForm/context.js +1 -1
  426. package/lib/FieldForm/hooks/useForm.d.ts +4 -3
  427. package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
  428. package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  429. package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
  430. package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
  431. package/lib/FieldForm/hooks/useItemRef.js +1 -1
  432. package/lib/Form/component.json +161 -0
  433. package/lib/Form/index.d.ts +52 -49
  434. package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  435. package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
  436. package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  437. package/lib/FormItem/compoments/formFile/index.js +1 -1
  438. package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  439. package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
  440. package/lib/FormItem/component.json +171 -0
  441. package/lib/FormItem/index.d.ts +5 -5
  442. package/lib/FormItem/index.js +1 -1
  443. package/lib/FormItem/itemType.js +1 -1
  444. package/lib/FunctionModal/component.json +197 -0
  445. package/lib/FunctionModal/dialog.d.ts +1 -1
  446. package/lib/FunctionModal/modalContext.d.ts +4 -1
  447. package/lib/Help/component.json +118 -0
  448. package/lib/HelperText/component.json +126 -0
  449. package/lib/Image/component.json +165 -0
  450. package/lib/InputCode/component.json +191 -0
  451. package/lib/InputCode/index.d.ts +2 -2
  452. package/lib/InputLang/component.json +205 -0
  453. package/lib/InputLang/index.js +1 -1
  454. package/lib/InputNumber/component.json +162 -0
  455. package/lib/Label/component.json +126 -0
  456. package/lib/Label/index.d.ts +2 -2
  457. package/lib/Loading/component.json +91 -0
  458. package/lib/Menu/component.json +180 -0
  459. package/lib/Message/component.json +246 -0
  460. package/lib/Message/index.d.ts +2 -2
  461. package/lib/Message/index.js +1 -1
  462. package/lib/Modal/Confirm/index.d.ts +1 -1
  463. package/lib/Modal/Confirm/index.js +1 -1
  464. package/lib/Modal/component.json +277 -0
  465. package/lib/Modal/index.d.ts +97 -6
  466. package/lib/Modal/index.js +1 -1
  467. package/lib/Modal/interface.d.ts +1 -0
  468. package/lib/MultiBox/component.json +216 -0
  469. package/lib/MultiBox/index.js +1 -1
  470. package/lib/Notification/component.json +184 -0
  471. package/lib/OperateBtn/component.json +134 -0
  472. package/lib/OperateBtn/index.d.ts +3 -3
  473. package/lib/PageHeader/component.json +112 -0
  474. package/lib/Pagination/component.json +181 -0
  475. package/lib/Pagination/index.js +1 -1
  476. package/lib/PasswordRules/component.json +105 -0
  477. package/lib/PasswordRules/index.d.ts +4 -4
  478. package/lib/PopConfirm/component.json +227 -0
  479. package/lib/PopConfirm/index.d.ts +1 -1
  480. package/lib/PopConfirm/index.js +1 -1
  481. package/lib/PopMenu/component.json +131 -0
  482. package/lib/PopMenu/hooks.d.ts +1 -1
  483. package/lib/PopMenu/index.js +1 -1
  484. package/lib/Popover/component.json +165 -0
  485. package/lib/Popover/index.js +1 -1
  486. package/lib/Progress/component.json +161 -0
  487. package/lib/Prompt/component.json +144 -0
  488. package/lib/Querying/component.json +96 -0
  489. package/lib/Querying/index.css +1 -1
  490. package/lib/Querying/index.d.ts +2 -2
  491. package/lib/Querying/index.js +1 -1
  492. package/lib/Querying/style/index.css +1 -1
  493. package/lib/QuickReply/component.json +129 -0
  494. package/lib/QuickReply/index.d.ts +1 -1
  495. package/lib/Radio/component.json +136 -0
  496. package/lib/RadioGroup/component.json +149 -0
  497. package/lib/RangeInput/component.json +198 -0
  498. package/lib/RangeInput/index.js +1 -1
  499. package/lib/Result/component.json +104 -0
  500. package/lib/ScrollBar/component.json +115 -0
  501. package/lib/Search/component.json +177 -0
  502. package/lib/Search/index.d.ts +1 -1
  503. package/lib/Select/component.json +244 -0
  504. package/lib/Select/index.js +1 -1
  505. package/lib/SelectInput/component.json +184 -0
  506. package/lib/Selector/component.json +203 -0
  507. package/lib/Selector/index.js +1 -1
  508. package/lib/Selector/interface.d.ts +1 -1
  509. package/lib/Selector/selectorMain/index.js +1 -1
  510. package/lib/Selector/selectorNode/index.js +1 -1
  511. package/lib/Selector/util.d.ts +2 -2
  512. package/lib/SelectorPicker/component.json +179 -0
  513. package/lib/SelectorPicker/index.d.ts +5 -5
  514. package/lib/SelectorPicker/index.js +1 -1
  515. package/lib/SingleBox/component.json +151 -0
  516. package/lib/SingleBox/index.d.ts +2 -2
  517. package/lib/Slider/component.json +181 -0
  518. package/lib/SortBox/component.json +108 -0
  519. package/lib/Status/component.json +104 -0
  520. package/lib/Stepper/component.json +129 -0
  521. package/lib/Stepper/index.d.ts +2 -2
  522. package/lib/Switch/component.json +207 -0
  523. package/lib/Switch/index.css +1 -1
  524. package/lib/Switch/index.d.ts +3 -2
  525. package/lib/Switch/index.js +1 -1
  526. package/lib/Switch/style/index.css +1 -1
  527. package/lib/Table/component.json +547 -0
  528. package/lib/Table/index.d.ts +2 -2
  529. package/lib/Table/index.js +1 -1
  530. package/lib/Table/interface.d.ts +6 -0
  531. package/lib/Tabs/component.json +227 -0
  532. package/lib/Tag/component.json +221 -0
  533. package/lib/Tag/index.css +1 -1
  534. package/lib/Tag/index.d.ts +1 -1
  535. package/lib/Tag/index.js +1 -1
  536. package/lib/Tag/style/index.css +1 -1
  537. package/lib/TextEditor/component.json +186 -0
  538. package/lib/TextEditor/index.d.ts +5 -5
  539. package/lib/TextField/component.json +290 -0
  540. package/lib/TextField/index.d.ts +2 -2
  541. package/lib/TimePicker/component.json +176 -0
  542. package/lib/Timeline/component.json +110 -0
  543. package/lib/Title/component.json +156 -0
  544. package/lib/ToggleButton/component.json +153 -0
  545. package/lib/Tooltip/component.json +176 -0
  546. package/lib/Tooltip/index.js +1 -1
  547. package/lib/Tooltip/interface.d.ts +14 -1
  548. package/lib/Tooltip/utils.js +1 -1
  549. package/lib/Transfer/component.json +157 -0
  550. package/lib/Tree/component.json +512 -0
  551. package/lib/Upload/component.json +450 -0
  552. package/lib/Utils/type.d.ts +0 -2
  553. package/lib/index.d.ts +2 -0
  554. package/lib/index.js +1 -1
  555. package/lib/locale/en_US.d.ts +361 -0
  556. package/lib/locale/en_US.js +2 -0
  557. package/lib/locale/index.d.ts +1 -723
  558. package/lib/locale/index2.js +2 -0
  559. package/lib/locale/zh_CN.d.ts +361 -0
  560. package/lib/locale/zh_CN.js +2 -0
  561. package/package.json +10 -3
  562. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  563. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
  564. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  565. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
@@ -1,12 +1,33 @@
1
1
  import { default as React, ReactNode } from 'react';
2
2
  import { ButtonProps } from '../Button';
3
3
  import { Confirm, ConfirmObject } from './Confirm';
4
+ import { ModalDismissReason } from './interface';
4
5
  type ModalSize = 'sm' | 'md' | 'lg' | 'auto' | 'fullScreen';
6
+ /**
7
+ * Modal onClose 关闭路径标识(R6 §B3 阶段 1 引入,见 BREAKING-CHANGES §B3 + discussions/Modal-unified-onClose.md)
8
+ * - 'cancel' = 取消按钮
9
+ * - 'ok' = 确定按钮
10
+ * - 'esc' = 键盘 Escape 关闭(若 keyboard 启用)
11
+ * - 'mask' = 蒙层点击关闭(若 maskClosable 启用)
12
+ * - 'x' = 右上角 X 按钮
13
+ */
14
+ export type ModalCloseReason = 'cancel' | 'ok' | 'esc' | 'mask' | 'x';
5
15
  export interface ModalProps {
6
- /** 对话框是否可见 */
16
+ /**
17
+ * @deprecated v5.x.next 改用 `open`(命名对齐业界 antd5/Chakra/Radix/MUI);v6.0 移除 visible prop + fallback。详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #3-A
18
+ * `open` 的旧别名;与 open 二选一即可,新代码推荐用 open
19
+ */
7
20
  visible?: boolean;
8
21
  /** 打开 */
9
22
  open?: boolean;
23
+ /**
24
+ * **(v5.x.next 议题 #2 引入)** 非受控模式初始 open 值。
25
+ * 未传 `open`(且未传 `visible`)时启用非受控 — Modal 内部维护 open state,
26
+ * 关闭路径自动 setOpen(false),业务方不需要手动管理 open state。
27
+ * 与 React `<input defaultValue>` 惯例一致。
28
+ * 同时传 open + defaultOpen → open 优先(受控模式),dev warn 提示。
29
+ */
30
+ defaultOpen?: boolean;
10
31
  /** 确定按钮 loading */
11
32
  confirmLoading?: boolean;
12
33
  /** 标题 */
@@ -27,10 +48,59 @@ export interface ModalProps {
27
48
  showCancel?: boolean;
28
49
  /** 是否显示右上角的关闭按钮 */
29
50
  closable?: boolean;
30
- /** 点击确定回调 */
51
+ /**
52
+ * @deprecated v5.x.next 改用 `onSubmit`(语义更清晰:submit 比 ok 更准确表达"确认提交"行为,对齐表单语义);v6.0 移除 onOk。详见 BREAKING-CHANGES §B-Modal-props-rework
53
+ * 点击确定回调(旧名)
54
+ */
31
55
  onOk?: (e?: React.MouseEvent<HTMLElement>) => void;
32
- /** 点击模态框右上角叉、取消按钮,return false 不关闭 */
56
+ /**
57
+ * **(v5.x.next 议题 #M1 引入)** 点击确定回调(推荐新 API,语义清晰)。
58
+ * 与 `onOk` 同义但 submit 比 ok 更准确表达"确认提交"行为。同时传 `onOk + onSubmit` → `onSubmit` 优先调用,`onOk` 跳过(避免业务函数重复触发);
59
+ * 仅传 `onOk` → 旧行为不变(onOk 仍触发)。dev 环境若检测到只传 `onOk` 会 console.warn 1 次提示迁移。
60
+ */
61
+ onSubmit?: (e?: React.MouseEvent<HTMLElement>) => void | Promise<void>;
62
+ /**
63
+ * 取消按钮回调(v5.x.next 起为主职责)。
64
+ *
65
+ * **v5.0.0-beta.14(v5.x.next-fix)起兼容性约定**:
66
+ * - 显式传 `onDismiss` → 仅取消按钮触发 onCancel,X / ESC / mask 走 onDismiss(γ 单触发)
67
+ * - 显式传 `onClose` → R6 双触发:onCancel + onClose(legacy)
68
+ * - **未传 onDismiss / onClose**(v4 写法) → onCancel 仍 fallback 兜底 X / ESC / mask 三路;
69
+ * **dev 环境抛 Error 强制业务方迁移到 onDismiss(prod 仍 fallback 不影响线上)**。
70
+ *
71
+ * v6.0(2026 Q3)起 fallback 兜底移除 — 只用 onCancel 接 X / ESC / mask 的写法运行时静默失效。
72
+ * 详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #5。
73
+ */
33
74
  onCancel?: (e?: React.MouseEvent<HTMLElement>) => boolean | void;
75
+ /**
76
+ * @deprecated v5.x.next 改用 onDismiss(X/ESC/mask)+ onOk(确定)+ onCancel(取消)三回调职责互斥;v6.0 移除 onClose。详见 BREAKING-CHANGES §B-Modal-props-rework
77
+ *
78
+ * **(R6 §B3 阶段 1 引入)** 任意路径关闭都触发的统一回调,reason 区分关闭来源(`'cancel' | 'ok' | 'esc' | 'mask' | 'x'`)。
79
+ *
80
+ * 与 onCancel/onOk 共存(阶段 3 v6 移除单独 onCancel/onOk → BREAKING):
81
+ * - 取消按钮关闭 → 同时调 onCancel + onClose('cancel')
82
+ * - 确定按钮关闭 → 同时调 onOk + onClose('ok')
83
+ * - ESC 关闭 → 同时调 onCancel + onClose('esc')
84
+ * - 蒙层关闭 → 同时调 onCancel + onClose('mask')
85
+ * - X 按钮关闭 → 同时调 onCancel + onClose('x')
86
+ *
87
+ * 推荐写法 — 业务方在 onClose 里统一 setOpen(false) + reason 分支(埋点 / 重置 state 等),不再写双绑 `onCancel={fn} onOk={fn}` 兜底。
88
+ * 详见 BREAKING-CHANGES §B3 + discussions/Modal-unified-onClose.md
89
+ */
90
+ onClose?: (reason: ModalCloseReason) => void;
91
+ /**
92
+ * **(v5.x.next γ 方案 议题 #1 引入)** 非按钮关闭路径(X / ESC / 蒙层)的专用回调。
93
+ * 职责显式互斥:
94
+ * - onOk = 仅确定按钮
95
+ * - onCancel = 仅取消按钮
96
+ * - onDismiss = 仅 X / ESC / mask 三种"非按钮关闭"
97
+ *
98
+ * 仅传 onDismiss(不传 onClose)→ 新单触发行为:3 个非按钮路径仅调 onDismiss,不双触发。
99
+ * 同时传 onClose(无论是否也传 onDismiss)→ 旧兼容行为:维持 R6 双触发(onCancel + onClose)。
100
+ * 迁移时推荐:删 onClose,改用 onDismiss(理由见 discussions/Modal-props-rework.md §3.1)。
101
+ * 详见 BREAKING-CHANGES §B-Modal-props-rework。
102
+ */
103
+ onDismiss?: (reason: ModalDismissReason) => void;
34
104
  afterClose?: () => void;
35
105
  /** 大小 */
36
106
  size?: ModalSize;
@@ -40,13 +110,20 @@ export interface ModalProps {
40
110
  width?: string | number;
41
111
  /** 确认按钮文字 */
42
112
  okText?: ReactNode;
43
- /** 确认按钮类型 */
44
- okType?: string;
45
113
  /** 取消按钮文字 */
46
114
  cancelText?: ReactNode;
47
115
  /** 点击蒙层是否允许关闭 */
48
116
  maskClosable?: boolean;
117
+ /**
118
+ * @deprecated v5.x.next 改用 `closeOnBackdrop`(正向命名,业界对齐 antd `maskClosable` / chakra `closeOnOverlayClick`);v6 移除。
119
+ * 默认 `true`(即默认禁用蒙层关闭),与多数 Modal 库默认开放的直觉相反。详见 BREAKING-CHANGES §B6。
120
+ */
49
121
  disableBackdropClick?: boolean;
122
+ /**
123
+ * **(R6 §B6 阶段 1 引入)** 是否允许蒙层点击关闭(正向命名,业界对齐)。显式传值优先 — 未传时 fallback 旧 `disableBackdropClick`(默认 true 即禁用)。
124
+ * 阶段 3 v6 移除 `disableBackdropClick` 后默认 `true`(允许蒙层关闭)。详见 BREAKING-CHANGES §B6
125
+ */
126
+ closeOnBackdrop?: boolean;
50
127
  /** 强制渲染 Modal */
51
128
  forceRender?: boolean;
52
129
  /** 确定按钮属性 */
@@ -73,7 +150,21 @@ export interface ModalProps {
73
150
  mask?: boolean;
74
151
  /** 是否支持键盘esc关闭 */
75
152
  keyboard?: boolean;
153
+ /**
154
+ * @deprecated v5.x.next 改用 `closeOnEsc`(正向命名,业界对齐 antd `keyboard` / chakra `closeOnEsc`);v6 移除。
155
+ * 默认 `true`(即默认禁用 ESC 关闭),与多数 Modal 库默认开放的直觉相反。详见 BREAKING-CHANGES §B6。
156
+ */
76
157
  disableEscapeKeyDown?: boolean;
158
+ /**
159
+ * **(R6 §B6 阶段 1 引入)** 是否允许 Escape 键关闭(正向命名,业界对齐)。显式传值优先 — 未传时 fallback 旧 `disableEscapeKeyDown`(默认 true 即禁用)。
160
+ * 阶段 3 v6 移除 `disableEscapeKeyDown` 后默认 `true`(允许 ESC 关闭)。详见 BREAKING-CHANGES §B6
161
+ */
162
+ closeOnEsc?: boolean;
163
+ /**
164
+ * **(R6 §B6 阶段 1 引入)** 关闭后是否将焦点恢复到原触发元素(正向命名,业界对齐 mui `restoreFocus`)。等价 `focusTriggerAfterClose` 的正向 alias — 显式传值优先,未传时 fallback `focusTriggerAfterClose`(默认 true)。
165
+ * 注:`disableEnforceFocus` 仅 component.json/api.ts 文档层警示词,src 实际控制由 `focusTriggerAfterClose` 反向承担;v6 路径只保留 `restoreFocusOnClose`。详见 BREAKING-CHANGES §B6
166
+ */
167
+ restoreFocusOnClose?: boolean;
77
168
  /** 右上角关闭图标 */
78
169
  closeIcon?: ReactNode;
79
170
  /** 自定义渲染对话框 */
@@ -90,7 +181,7 @@ export interface ModalProps {
90
181
  contentHeight?: number | string;
91
182
  /** 内容样式 */
92
183
  contentStyle?: React.CSSProperties;
93
- [name: string]: any;
184
+ [name: string]: unknown;
94
185
  }
95
186
  export declare const Modal: React.FC<ModalProps>;
96
187
  export { Confirm };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const t=require("../_virtual/jsx-runtime.js"),p=require("react"),le=require("rc-dialog"),u=require("../Button/index.js"),ae=require("../node_modules/@para-ui/icons/Close/index.js"),ce=require("../GlobalContext/useFormatMessage.js"),ue=require("./lang/index.js"),me=require("./Confirm/index.js"),C=require("clsx"),k=require("../GlobalContext/constant.js"),de=require("../AutoTips/index.js");;/* empty css */let m;const xe=s=>{m={x:s.pageX,y:s.pageY},setTimeout(()=>{m=null},100)};window.document.documentElement&&document.documentElement.addEventListener("click",xe,!0);const $=s=>{const{open:y,visible:E=!1,closeIcon:b,centered:S=!0,focusTriggerAfterClose:R=!0,title:w,footer:q,showActions:z=!0,actions:N,header:d,hideHeader:B=!1,showCancel:M=!0,maskClosable:v=!1,disableBackdropClick:F=!0,keyboard:H=!1,disableEscapeKeyDown:T=!0,fullScreen:A,customizeSize:P,style:_,bodyStyle:I,contentWidth:O,contentHeight:x,contentStyle:f,size:o="md",children:D,closable:L=!0,mask:h=!0,...W}=s,K=A||o==="fullScreen",g=ce.default("Modal",ue.default),e=`${k.$prefixCls}-modal`,l=n=>{s.onCancel?.(n)},X=n=>{s.onOk?.(n)},Y=()=>{const n={sm:`${e}-sm`,md:`${e}-md`,lg:`${e}-lg`,auto:`${e}-auto`,fullScreen:`${e}-fullscreen`};if(!f)return K?n.fullScreen:n[o]},G=()=>!o||o==="fullScreen"||o==="auto"?void 0:{sm:{width:430,maxHeight:118},md:{width:486,maxHeight:478},lg:{width:948,maxHeight:478}}[o],J=()=>h?`${e}-with-mask`:`${e}-without-mask`,Q=()=>({...P,..._}),U=()=>{const{maxHeight:n,width:a}=G()||{};return{maxHeight:x||n||"calc(100vh - 142px)",width:O||a,height:x,...I,...f}},V=()=>{if(B)return null;if(d)return d;const n=L&&t.jsxRuntimeExports.jsx(u.Button.IconButton,{onClick:l,className:`${e}-close`,variant:"outlined",size:"small",children:b||t.jsxRuntimeExports.jsx(ae.Close,{className:`${e}-close-icon`})});return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(de.default,{className:`${e}-title-text`,children:w}),n]})},Z=()=>{if(!z)return null;const{okText:n,cancelText:a,okButtonProps:ne,cancelButtonProps:se,confirmLoading:oe=!1}=s,re=t.jsxRuntimeExports.jsx(u.Button,{variant:"contained",size:"large",loading:oe,onClick:X,...ne,children:n??g({id:"ok"})}),j=[M&&t.jsxRuntimeExports.jsx(u.Button,{variant:"outlined",size:"large",onClick:l,...se,children:a??g({id:"cancel"})}),re],i=N??q;if(typeof i=="function"){const r=i(j);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Array.isArray(r)?r.map((c,ie)=>t.jsxRuntimeExports.jsx(p.Fragment,{children:c},ie)):r})}else if(i)return i;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:j.map((r,c)=>t.jsxRuntimeExports.jsx(p.Fragment,{children:r},c))})},ee=C(s.wrapClassName,{[`${e}-centered`]:S}),te=C(s.className,`${k.$prefixCls}-scrollbar-small`,Y(),J());return t.jsxRuntimeExports.jsx(le,{...W,mask:h,visible:y??E,title:V(),footer:Z(),style:Q(),bodyStyle:U(),prefixCls:e,className:te,wrapClassName:ee,mousePosition:m,onClose:l,closable:!1,closeIcon:null,maskClosable:!F||v,keyboard:!T||H,focusTriggerAfterClose:R,transitionName:`${e}-zoom`,maskTransitionName:`${e}-fade`,children:D})};exports.Confirm=me.Confirm;exports.Modal=$;exports.default=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const t=require("../_virtual/jsx-runtime.js"),n=require("react"),qe=require("rc-dialog"),C=require("../Button/index.js"),ze=require("../node_modules/@para-ui/icons/Close/index.js"),Fe=require("../GlobalContext/useFormatMessage.js"),Te=require("./lang/index.js"),Ie=require("./Confirm/index.js"),P=require("clsx"),V=require("../GlobalContext/constant.js"),Ke=require("../AutoTips/index.js");;/* empty css */let E;const Pe=e=>{E={x:e.pageX,y:e.pageY},setTimeout(()=>{E=null},100)};window.document.documentElement&&document.documentElement.addEventListener("click",Pe,!0);const W=e=>{const{open:f,visible:m,defaultOpen:k,closeIcon:X,centered:L=!0,focusTriggerAfterClose:Q=!0,title:U,footer:Y,showActions:J=!0,actions:Z,header:h,hideHeader:ee=!1,showCancel:se=!0,maskClosable:ne=!1,disableBackdropClick:oe=!0,closeOnBackdrop:v,keyboard:te=!1,disableEscapeKeyDown:re=!0,closeOnEsc:p,restoreFocusOnClose:g,fullScreen:le,customizeSize:ie,style:ce,bodyStyle:ae,contentWidth:ue,contentHeight:b,contentStyle:N,size:l="md",children:de,closable:fe=!0,mask:O=!0,...me}=e,R=Fe.default("Modal",Te.default),a=e.onClose!==void 0,w=n.useRef(!1);n.useEffect(()=>{process.env.NODE_ENV!=="production"&&a&&!w.current&&(w.current=!0,console.warn("[Modal] onClose 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请迁移到 onDismiss(处理 X/ESC/mask 关闭)+ onOk(确定按钮)+ onCancel(取消按钮)三回调模式。详见 BREAKING-CHANGES §B-Modal-props-rework。"))},[a]);const S=m!==void 0,B=n.useRef(!1);n.useEffect(()=>{process.env.NODE_ENV!=="production"&&S&&!B.current&&(B.current=!0,console.warn("[Modal] visible 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请改用 open prop。详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #3-A"))},[S]);const j=e.onOk!==void 0,D=e.onSubmit!==void 0,M=n.useRef(!1);n.useEffect(()=>{process.env.NODE_ENV!=="production"&&j&&!D&&!M.current&&(M.current=!0,console.warn("[Modal] onOk 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请改用 onSubmit prop(语义更清晰)。详见 BREAKING-CHANGES §B-Modal-props-rework"))},[j,D]);const A=e.onCancel!==void 0,y=e.onDismiss!==void 0,$=n.useRef(!1);n.useEffect(()=>{if(process.env.NODE_ENV!=="production"&&A&&!y&&!a&&!$.current)throw $.current=!0,new Error("[Modal] v5.0.0-beta.14 起 X / ESC / 蒙层关闭路径主职责已交给 onDismiss(γ 互斥语义)。当前仅传 onCancel 而未传 onDismiss/onClose,prod 走 fallback 兼容,dev 抛 Error 强制迁移。一键迁移:`npx jscodeshift -t node_modules/@para-ui/core/codemods/modal-onCancel-to-onDismiss.js --parser=tsx src/`。v6.0(2026 Q3)起 fallback 删除,届时 X/ESC/mask 静默失效。详见 docs/UPGRADE_v4_to_v5.md §3.D.0 + BREAKING-CHANGES §B-Modal-props-rework 子条 #5。")},[A,y,a]);const _=e.maskClosable!==void 0,H=e.disableBackdropClick!==void 0,G=e.disableEscapeKeyDown!==void 0,q=e.focusTriggerAfterClose!==void 0,z=n.useRef(!1);n.useEffect(()=>{if(process.env.NODE_ENV==="production"||z.current)return;const s=[];_&&s.push("maskClosable → closeOnBackdrop"),H&&s.push("disableBackdropClick → closeOnBackdrop"),G&&s.push("disableEscapeKeyDown → closeOnEsc"),q&&s.push("focusTriggerAfterClose → restoreFocusOnClose"),s.length!==0&&(z.current=!0,console.warn(`[Modal] 检测到 v5.x.next 已 @deprecated 的反向命名 prop:${s.join("、")}。v5.x 仍 fallback 兼容,v6.0 移除。请按箭头右侧迁移到正向命名(对齐业界 antd/chakra/mui)。详见 BREAKING-CHANGES §B-Modal-props-rework + §B6。`))},[_,H,G,q]);const r=f!==void 0||m!==void 0,[xe,u]=n.useState(k??!1),Ce=r?f??m??!1:xe,F=k!==void 0,T=f!==void 0;n.useEffect(()=>{process.env.NODE_ENV!=="production"&&T&&F&&console.warn("[Modal] 同时传 open + defaultOpen,defaultOpen 被忽略(open 优先,受控模式)。详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #2")},[T,F]);const I=n.useRef(r);n.useEffect(()=>{I.current!==r&&(process.env.NODE_ENV!=="production"&&console.warn("[Modal] open 受控/非受控状态运行时切换,React 不支持此模式,请保持一致。"),I.current=r)},[r]);const Ee=le||l==="fullScreen",o=`${V.$prefixCls}-modal`,ke=p!==void 0?p:!re,he=v!==void 0?v:!oe,ve=g!==void 0?g:Q,pe=s=>{e.onCancel?.(s),e.onClose?.("cancel"),r||u(!1)},ge=s=>{e.onClose!==void 0?(e.onCancel?.(s),e.onClose("x")):e.onDismiss!==void 0?e.onDismiss("x"):e.onCancel?.(s),r||u(!1)},be=s=>{const i=s&&s.type==="keydown"?"esc":"mask";e.onClose!==void 0?(e.onCancel?.(s),e.onClose(i)):e.onDismiss!==void 0?e.onDismiss(i):e.onCancel?.(s),r||u(!1)},Ne=s=>{e.onSubmit?e.onSubmit(s):e.onOk?.(s),e.onClose?.("ok"),r||u(!1)},Oe=()=>{const s={sm:`${o}-sm`,md:`${o}-md`,lg:`${o}-lg`,auto:`${o}-auto`,fullScreen:`${o}-fullscreen`};if(!N)return Ee?s.fullScreen:s[l]},Re=()=>!l||l==="fullScreen"||l==="auto"?void 0:{sm:{width:430,maxHeight:118},md:{width:486,maxHeight:478},lg:{width:948,maxHeight:478}}[l],we=()=>O?`${o}-with-mask`:`${o}-without-mask`,Se=()=>({...ie,...ce}),Be=()=>{const{maxHeight:s,width:i}=Re()||{};return{maxHeight:b||s||"calc(100vh - 142px)",width:ue||i,height:b,...ae,...N}},je=()=>{if(ee)return null;if(h)return h;const s=fe&&t.jsxRuntimeExports.jsx(C.Button.IconButton,{onClick:ge,className:`${o}-close`,variant:"outlined",size:"small",children:X||t.jsxRuntimeExports.jsx(ze.Close,{className:`${o}-close-icon`})});return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Ke.default,{className:`${o}-title-text`,children:U}),s]})},De=()=>{if(!J)return null;const{okText:s,cancelText:i,okButtonProps:ye,cancelButtonProps:$e,confirmLoading:_e=!1}=e,He=t.jsxRuntimeExports.jsx(C.Button,{variant:"contained",size:"large",loading:_e,onClick:Ne,...ye,children:s??R({id:"ok"})}),K=[se&&t.jsxRuntimeExports.jsx(C.Button,{variant:"outlined",size:"large",onClick:pe,...$e,children:i??R({id:"cancel"})}),He],d=Z??Y;if(typeof d=="function"){const c=d(K);return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Array.isArray(c)?c.map((x,Ge)=>t.jsxRuntimeExports.jsx(n.Fragment,{children:x},Ge)):c})}else if(d)return d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:K.map((c,x)=>t.jsxRuntimeExports.jsx(n.Fragment,{children:c},x))})},Me=P(e.wrapClassName,{[`${o}-centered`]:L}),Ae=P(e.className,`${V.$prefixCls}-scrollbar-small`,Oe(),we());return t.jsxRuntimeExports.jsx(qe,{...me,mask:O,visible:Ce,title:je(),footer:De(),style:Se(),bodyStyle:Be(),prefixCls:o,className:Ae,wrapClassName:Me,mousePosition:E,onClose:be,closable:!1,closeIcon:null,maskClosable:he||ne,keyboard:ke||te,focusTriggerAfterClose:ve,transitionName:`${o}-zoom`,maskTransitionName:`${o}-fade`,children:de})};exports.Confirm=Ie.Confirm;exports.Modal=W;exports.default=W;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export type ModalDismissReason = 'esc' | 'mask' | 'x';
@@ -0,0 +1,216 @@
1
+ {
2
+ "name": "MultiBox",
3
+ "category": "Data Entry",
4
+ "description": "键值对列表输入组件(支持增删行、补全、行级禁用)。内部用 Record<string,string>[] 作为受控值类型,默认字段名为 label/value,可通过 replaceFields 改成业务字段名",
5
+ "semantic": {
6
+ "intent": [
7
+ "键值录入",
8
+ "参数配置",
9
+ "可增删行的键值对编辑"
10
+ ],
11
+ "useCases": [
12
+ "HTTP Headers 编辑器",
13
+ "环境变量 / 配置项",
14
+ "URL Query 参数",
15
+ "Dictionary / Map 类型业务数据录入"
16
+ ],
17
+ "riskLevel": "normal"
18
+ },
19
+ "protocolSummary": "**核心:value 类型是 Record<string, string>[],默认字段名 label / value**。业务类型(如 `{key, value}[]` 或 `{name, val}[]`)通过 replaceFields 映射进来。**replaceFields 是 partial override**(L115 实证),只写 `{key: 'k'}` 会保留默认的 `value: 'value'` 映射。onChange 回调返回的字段名跟随 replaceFields(双向联动)",
20
+ "typeCastingGuide": {
21
+ "issue": "R23 通过率 2/5 fail 根因:业务类型如 `{key: string; value: string}[]` 想透传给 MultiBox.value(类型为 `Record<string,string>[]`),sub-agent 写 `value as Record<string,string>[]` —— **TS 5.x nominal 类型严格,即使结构兼容也拒绝直接 as cast** (TS2352 'may be a mistake because neither type sufficiently overlaps')",
22
+ "wrongPattern": "// ❌ 错误:TS 5.x 拒绝\nconst value = headers as Record<string, string>[];\nconst handleChange = (val: Record<string, string>[]) => setHeaders(val as HeaderPair[]);",
23
+ "correctPatternA": "**推荐:不要 cast,直接用 Record<string, string>[] 业务类型**\n```ts\ninterface HttpEditor {\n headers: Record<string, string>[]; // 业务类型直接用 MultiBox 期望类型\n onHeadersChange: (next: Record<string, string>[]) => void;\n}\n<MultiBox value={headers} onChange={onHeadersChange} replaceFields={{ key: 'key', value: 'value' }} />\n```\n业务接口字段名是 `key`/`value` 时,Record<string,string>[] 本来就能容纳,无需自定义业务类型",
24
+ "correctPatternB": "**如必须保留自定义业务类型 + 双向 cast:用 unknown 中转**\n```ts\ninterface HeaderPair { key: string; value: string; }\nconst handleChange = (val: Record<string, string>[]) => {\n onHeadersChange(val as unknown as HeaderPair[]);\n};\n<MultiBox\n value={headers as unknown as Record<string, string>[]}\n onChange={handleChange}\n replaceFields={{ key: 'key', value: 'value' }}\n/>\n```\n**注意 unknown 中转是逃避 TS 严格 cast 校验,业务有责任保证字段名真的兼容**",
25
+ "correctPatternC": "**改 replaceFields 适配业务字段名**(最干净):\n```ts\n// 业务数据是 {name, val}[],不是 {key, value}[]\nconst data: {name: string; val: string}[] = [...];\n<MultiBox\n value={data as unknown as Record<string, string>[]}\n onChange={(v) => setData(v as unknown as {name:string;val:string}[])}\n replaceFields={{ key: 'name', value: 'val' }} // ← 让 src 按 'name'/'val' 解析\n/>\n```"
26
+ },
27
+ "replaceFieldsBehavior": {
28
+ "default": "{ key: 'label', value: 'value' }",
29
+ "mergeSemantics": "**partial override(浅合并)**:src 内部 `{ ...defaultReplaceFields, ...userReplaceFields }`。只写一个字段会保留另一个默认。例如 `replaceFields={{ key: 'name' }}` 等价于 `{ key: 'name', value: 'value' }`",
30
+ "outputBinding": "onChange 回调返回的 val 数组中每项字段名**跟随 replaceFields 设置**(双向联动)。即:`replaceFields={{ key: 'name' }}` 时 onChange 收到的 val 是 `{ name: string; value: string }[]` 形态",
31
+ "warning": "改 replaceFields 后必须同步改 value/defaultValue 元素的字段名,单改一侧(只改 replaceFields 没改 value 数据)会导致 src 找不到字段,显示空内容"
32
+ },
33
+ "variants": {
34
+ "default": {
35
+ "meaning": "默认样式"
36
+ }
37
+ },
38
+ "states": [
39
+ "default",
40
+ "disabled",
41
+ "error"
42
+ ],
43
+ "idealProps": {
44
+ "size": {
45
+ "type": "enum",
46
+ "values": [
47
+ "small",
48
+ "medium",
49
+ "large"
50
+ ],
51
+ "default": "large",
52
+ "description": "控件大小(影响 TextField 行高 + padding,具体像素由 SCSS 变量决定)"
53
+ },
54
+ "label": {
55
+ "type": "ReactNode",
56
+ "description": "标题"
57
+ },
58
+ "labelTooltip": {
59
+ "type": "LabelTooltipProps",
60
+ "description": "标题旁帮助提示"
61
+ },
62
+ "labelSign": {
63
+ "type": "ReactNode",
64
+ "description": "标题旁次级提示(短文本/标签)"
65
+ },
66
+ "placeholderKey": {
67
+ "type": "ReactNode",
68
+ "description": "键侧提示语"
69
+ },
70
+ "placeholderValue": {
71
+ "type": "ReactNode",
72
+ "description": "值侧提示语"
73
+ },
74
+ "separator": {
75
+ "type": "ReactNode",
76
+ "default": "':'",
77
+ "description": "键/值之间的分隔符 UI"
78
+ },
79
+ "value": {
80
+ "type": "Record<string, string>[]",
81
+ "description": "**受控值**。每项是一行键/值对象,默认按 'label'/'value' 字段名解析,可通过 replaceFields 改字段名。**业务类型如 `{key, value}[]` 与 Record<string,string>[] 的 TS cast 处理见 typeCastingGuide**"
82
+ },
83
+ "defaultValue": {
84
+ "type": "Record<string, string>[]",
85
+ "description": "**非受控初始值**;形态同 value。仅 mount + 引用变化时灌入"
86
+ },
87
+ "onChange": {
88
+ "type": "(val: Record<string, string>[]) => void",
89
+ "description": "值变化回调;val 是**完整对象数组**(不是 string[]),字段名跟随 replaceFields 设置"
90
+ },
91
+ "replaceFields": {
92
+ "type": "{ key?: string; value?: string }",
93
+ "default": "{ key: 'label', value: 'value' }",
94
+ "description": "**partial override**(浅合并默认值,见 replaceFieldsBehavior.mergeSemantics)。改后:1) value/defaultValue 元素字段名必须同步改 2) onChange 回调返回的字段名也跟随改(双向联动)。**单改一侧 src 找不到字段,显示空内容**"
95
+ },
96
+ "required": {
97
+ "type": "boolean",
98
+ "default": "false",
99
+ "description": "是否必填(影响 label 后是否显示红星 * 等视觉)"
100
+ },
101
+ "disabled": {
102
+ "type": "boolean | { [name: string]: boolean }[]",
103
+ "default": "false",
104
+ "description": "**两种形态**:1) `true` 整体禁用所有行所有字段;2) `{ [name: string]: boolean }[]` **行级 + 字段级禁用**——数组每项对应一行,对象 key 对应 replaceFields 的字段名(默认 'label'/'value'),value 为 true 时禁用该行该字段。例如 `[{label: true, value: false}, {label: false, value: true}]` 禁用第 1 行的 key 列 + 第 2 行的 value 列"
105
+ },
106
+ "disabledTooltip": {
107
+ "type": "TooltipProps",
108
+ "description": "禁用态 hover 提示"
109
+ },
110
+ "helperText": {
111
+ "type": "ReactNode | Record<string, ReactNode>[]",
112
+ "description": "**两种形态**:① ReactNode/string = 整体错误提示文字(typeof === 'string' 时激活 error 视觉,所有行都标红);② Record<string, ReactNode>[] = **row-level + 字段级错误**,数组每项对应一行,对象 key 对应 replaceFields 字段名,value 为错误文本"
113
+ },
114
+ "hideErrorDom": {
115
+ "type": "boolean | null",
116
+ "description": "见 HelperText 同名 prop:true=无错误不渲染,false=都渲染(布局稳定),null=永不渲染"
117
+ },
118
+ "fetchSuggestionsKey": {
119
+ "type": "(val: string, cb: (data: Record<string, unknown>[]) => void) => void",
120
+ "description": "**键侧补全数据源**(用户输入 key 时调用)。**cb 接受 Record<string, unknown>[]** 不是 string[]。每项至少要有 label 字段(显示在下拉),value 字段(选中后填回)。例:`cb([{label: 'Content-Type', value: 'Content-Type'}, ...])`。**通常与 fetchSuggestionsValue 成对使用**"
121
+ },
122
+ "fetchSuggestionsValue": {
123
+ "type": "(val: string, cb: (data: Record<string, unknown>[]) => void) => void",
124
+ "description": "**值侧补全数据源**;cb 形态同 fetchSuggestionsKey"
125
+ },
126
+ "keyOtherProps": {
127
+ "type": "(index: number, val: string) => TextFieldProps",
128
+ "description": "键侧 TextField 的额外 props(按 index 区分行,可实现某行只读 / 加 prefix 等)"
129
+ },
130
+ "valueOtherProps": {
131
+ "type": "(index: number, val: string) => TextFieldProps",
132
+ "description": "值侧 TextField 的额外 props"
133
+ }
134
+ },
135
+ "commonMisconceptions": {
136
+ "M1": {
137
+ "wrong": "用 `as Record<string, string>[]` 把业务类型 `HeaderPair[]` / `EnvVar[]` 强制转给 MultiBox.value",
138
+ "result": "**TS 5.x 报错 TS2352** 'Conversion may be a mistake because neither type sufficiently overlaps' —— TS nominal 类型严格,即使结构兼容也拒绝。R23 MultiBox-001/002/003 fail 都是这个",
139
+ "fix": "**3 种方案**(详见 typeCastingGuide):A) 业务直接用 Record<string,string>[] 类型(最干净);B) 用 `as unknown as` 中转(逃避 TS 严格 cast);C) 改 replaceFields 适配业务字段名 + unknown 中转"
140
+ },
141
+ "M2": {
142
+ "wrong": "改 replaceFields 字段名但忘记同步改 value 数据: `replaceFields={{ key: 'name' }} value={[{label: 'x', value: 'y'}]}`(value 仍按默认 label/value 字段名)",
143
+ "result": "src 按 replaceFieldsCom.key='name' 在 value 元素里找 `.name` 字段,**找不到 → 显示空内容**",
144
+ "fix": "改 replaceFields 时必须同步改 value 元素字段名:`replaceFields={{ key: 'name' }} value={[{name: 'x', value: 'y'}]}`(注意 value 字段也要保留或同时改 replaceFields.value)"
145
+ },
146
+ "M3": {
147
+ "wrong": "假设 replaceFields 是完全替换语义: `replaceFields={{ key: 'k' }}` 期望 value 字段名也是 'k'",
148
+ "result": "**replaceFields 是 partial override**(浅合并),只写 key 会保留默认 value:'value'。所以 `value={[{k: 'x', val: 'y'}]}` 不工作,需写成 `[{k: 'x', value: 'y'}]`",
149
+ "fix": "1) 单字段改:确保 value 用对应字段名 + 默认 value:'value';2) 双字段都改:`replaceFields={{ key: 'k', value: 'v' }}` 双向同步"
150
+ },
151
+ "M4": {
152
+ "wrong": "假设 disabled 只是 boolean: `disabled={ rowIndex === 0 }`",
153
+ "result": "整体禁用整个 MultiBox,而非'第 1 行禁用'。**disabled 支持 `{ [name]: boolean }[]` 形态做行级 + 字段级禁用**",
154
+ "fix": "用对象数组形态:`disabled={[{label: true, value: false}, {label: false, value: false}]}`(第 1 行 key 列禁用,其他全开)"
155
+ },
156
+ "M5": {
157
+ "wrong": "用 helperText: string 期望某行某列单独红框",
158
+ "result": "**string 形态的 helperText 激活整体错误视觉**(所有行标红),不是 row-level",
159
+ "fix": "row-level + 字段级错误:用 `Record<string, ReactNode>[]` 形态: `helperText={[{label: 'key 重复'}, {}, {value: '格式错误'}]}`(第 1 行 key 列报错 + 第 3 行 value 列报错)"
160
+ }
161
+ },
162
+ "do": [
163
+ "**优先用 Record<string, string>[] 作为业务类型**,避免 TS cast(M1 patternA)",
164
+ "**必须自定义业务类型**:用 `as unknown as` 中转(M1 patternB)",
165
+ "**业务字段名不叫 label/value**:同时改 replaceFields **和** value/defaultValue 数据字段名(M2/M3)",
166
+ "行级禁用:用 `disabled={[{label/value: boolean}]}` 对象数组形态(M4)",
167
+ "行级错误:用 `helperText={[{label/value: errorMsg}]}` 对象数组形态(M5)",
168
+ "自动补全:fetchSuggestionsKey 和 fetchSuggestionsValue 通常成对使用,cb 接受 `{label, value}` 对象数组(不是 string[])"
169
+ ],
170
+ "dont": [
171
+ "**不要**直接 `as Record<string, string>[]` 强制 cast 业务类型——TS5 严格拒绝(M1)",
172
+ "**不要**单改 replaceFields 而不改 value 字段名——src 找不到字段(M2)",
173
+ "**不要**假设 replaceFields 完全替换——是 partial override(M3)",
174
+ "**不要**假设 disabled 只能 boolean——对象数组形态做行级禁用(M4)",
175
+ "**不要**用 string helperText 期望 row-level 错误——整体激活(M5)",
176
+ "键或值过长时不做截断/省略——TextField 自身样式",
177
+ "复杂嵌套对象录入——MultiBox 仅 2 层(key + value),换 FieldForm + dynamicFields"
178
+ ],
179
+ "events": {
180
+ "onChange": {
181
+ "signature": "(val: Record<string, string>[]) => void",
182
+ "asyncSupported": false,
183
+ "examples": [
184
+ "onChange={(val) => setHeaders(val)} — val 是完整对象数组,字段名跟随 replaceFields 设置(默认 label/value)",
185
+ "增/删行也触发 onChange,val 是操作后完整的新数组(不是 diff)",
186
+ "行内 TextField 值变化实时触发 onChange(不是 onBlur)"
187
+ ],
188
+ "commonMistakes": [
189
+ "期望 onChange 返回 string[]——实际返回 Record<string, string>[](对象数组),需取对应字段:val.map(v => v.value)",
190
+ "用 as Record<string, string>[] 把业务类型传给 onChange setter——TS 5.x 拒绝结构兼容 cast,需用 as unknown as 中转",
191
+ "只处理 onChange 不处理新增/删除——增删操作也走同一 onChange,val 是全量数组,不是操作了哪一行"
192
+ ]
193
+ }
194
+ },
195
+ "typescriptPitfalls": [
196
+ {
197
+ "issue": "业务类型 `{key: string; value: string}[]` 与 `Record<string, string>[]` 在 TS 5.x 不能直接 as cast",
198
+ "wrong": "const headers: {key: string; value: string}[] = []; <MultiBox value={headers as Record<string, string>[]} /> // TS2352 拒绝",
199
+ "right": "<MultiBox value={headers as unknown as Record<string, string>[]} replaceFields={{ key: 'key', value: 'value' }} /> // unknown 中转"
200
+ },
201
+ {
202
+ "issue": "改 replaceFields.key 但不改 value 数据字段名,src 找不到字段显示空",
203
+ "wrong": "replaceFields={{ key: 'name' }} value={[{label: 'x', value: 'y'}]} // src 按 'name' 读,label 字段被忽略",
204
+ "right": "replaceFields={{ key: 'name' }} value={[{name: 'x', value: 'y'}]} // replaceFields 和数据字段名必须同步"
205
+ },
206
+ {
207
+ "issue": "disabled 只传 boolean 期望行级禁用——boolean true 是整体禁用,行级需用对象数组",
208
+ "wrong": "disabled={rowIndex === 0} // 期望第一行禁用,实际 disabled=true 时整体禁用所有行",
209
+ "right": "disabled={[{label: true, value: false}, {label: false, value: false}]} // 对象数组:第一行 key 列禁用"
210
+ }
211
+ ],
212
+ "mapping": {
213
+ "realComponent": "MultiBox",
214
+ "adapter": null
215
+ }
216
+ }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),x=require("react"),B=require("../TextField/index.js"),se=require("../Label/index.js"),re=require("../HelperText/index.js"),le=require("../node_modules/@para-ui/icons/Delete/index.js"),oe=require("../node_modules/@para-ui/icons/PlusCircleF/index.js"),f=require("../GlobalContext/constant.js"),ie=require("../GlobalContext/useFormatMessage.js"),ae=require("./lang/index.js"),ne=require("../Tooltip/index.js");;/* empty css */const O=n=>{const{className:y,style:K,size:m="large",placeholderKey:P="",placeholderValue:L="",label:C="",labelTooltip:p,labelSign:R,disabled:o=!1,disabledTooltip:b,required:D=!1,error:I=!1,hideErrorDom:z,separator:h=":",helperText:d="",value:j,replaceFields:v,onChange:a,fetchSuggestionsKey:E,fetchSuggestionsValue:g,keyOtherProps:N,valueOtherProps:$}=n,T=!!(d&&typeof d=="string"),H=d instanceof Array,w=ie.default("MultiBox",ae.default),[l,c]=x.useState([]),[i,G]=x.useState({key:"label",value:"value"});x.useEffect(()=>{n.defaultValue!==void 0&&c([...n.defaultValue])},[]),x.useEffect(()=>{j!==void 0&&c([...j])},[j]),x.useEffect(()=>{if(v){const t={...i,...v};G(t)}},[v]);const q=(t,e)=>{let s={error:!1,helperText:""};if(H){const u=d[t];u&&u[e]&&(s={error:!0,helperText:u[e]})}return s},J=()=>{o!==!0&&(l.push({}),n.value===void 0&&c([...l]),a&&a(l))},Q=t=>()=>{o!==!0&&(l.splice(t,1),n.value===void 0&&c([...l]),a&&a(l))},S=(t,e)=>s=>{l[e][t]=s.target.value,n.value===void 0&&c([...l]),a&&a(l)},U=()=>{if(!C&&!R)return null;const t=()=>{let e="multi-box-label";return p&&p.className&&(e+=` ${p.className}`),e};return r.jsxRuntimeExports.jsx(se.default,{label:C,required:D,labelSign:R,...p,className:t()})},W=(t,e)=>{const s=t[i.key||""]||"",u=t[i.value||""]||"",ee=o instanceof Array?o[e]?.[s]:o,te=o instanceof Array?o[e]?.[u]:o,A=q(e,i.key||""),M=q(e,i.value||"");let _="multi-box-content-item-input";return(A.error||M.error)&&(_+=" multi-box-content-item-input-error"),r.jsxRuntimeExports.jsxs("div",{className:_,children:[r.jsxRuntimeExports.jsx(B.TextField,{className:"multi-box-text-field",size:m,disabled:ee,placeholder:P,value:s,...A,onChange:S(i.key||"",e),fetchSuggestions:E?V("key"):void 0,onSelect:k(i.key||"",e),...N&&N(e,s)}),h&&r.jsxRuntimeExports.jsx("span",{className:"multi-box-separator",children:h}),r.jsxRuntimeExports.jsx(B.TextField,{className:"multi-box-text-field",size:m,disabled:te,placeholder:L,value:u,...M,onChange:S(i.value||"",e),fetchSuggestions:g?V("value"):void 0,onSelect:k(i.value||"",e),...$&&$(e,u)})]})},X=()=>r.jsxRuntimeExports.jsx("div",{className:"multi-box-content",children:l.map((t,e)=>r.jsxRuntimeExports.jsxs("div",{className:"multi-box-content-item",children:[W(t,e),o!==!0&&r.jsxRuntimeExports.jsx("div",{className:"opera-box",children:r.jsxRuntimeExports.jsx("span",{className:"del-box",onClick:Q(e),children:r.jsxRuntimeExports.jsx(le.Delete,{})})})]},e))}),V=t=>(e,s)=>{t==="key"?E&&E(e,s):g&&g(e,s)},k=(t,e)=>s=>{typeof s=="object"&&s!==null?l[e][t]=s.value:l[e][t]=s,n.value===void 0&&c([...l]),a&&a(l)},Y=()=>{let t=`${f.$prefixCls}-multi-box multi-box`;return y&&(t+=` ${y}`),m&&(t+=` ${f.$prefixCls}-multi-box-${m}`),I&&(t+=` ${f.$prefixCls}-multi-box-error`),o===!0&&(t+=` ${f.$prefixCls}-multi-box-disabled`),h&&(t+=` ${f.$prefixCls}-multi-box-separator`),t},F=()=>r.jsxRuntimeExports.jsxs("div",{className:"multi-box-add",onClick:J,children:[r.jsxRuntimeExports.jsx(oe.PlusCircleF,{}),r.jsxRuntimeExports.jsx("span",{children:w({id:"add"})})]}),Z=()=>b?r.jsxRuntimeExports.jsx(ne.Tooltip,{disabled:!0,placement:b.placement||"top",...b,children:F()}):F();return r.jsxRuntimeExports.jsxs("div",{className:Y(),style:K,children:[U(),X(),Z(),r.jsxRuntimeExports.jsx(re.default,{className:"multi-box-error-text",error:T,helperText:T?d:void 0,hideErrorDom:z})]})};exports.MultiBox=O;exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),x=require("react"),B=require("../TextField/index.js"),se=require("../Label/index.js"),re=require("../HelperText/index.js"),le=require("../node_modules/@para-ui/icons/Delete/index.js"),oe=require("../node_modules/@para-ui/icons/PlusCircleF/index.js"),m=require("../GlobalContext/constant.js"),ie=require("../GlobalContext/useFormatMessage.js"),ae=require("./lang/index.js"),ne=require("../Tooltip/index.js");;/* empty css */const O=u=>{const{className:y,style:K,size:f="large",placeholderKey:P="",placeholderValue:L="",label:C="",labelTooltip:p,labelSign:R,disabled:o=!1,disabledTooltip:b,required:D=!1,error:I=!1,hideErrorDom:z,separator:h=":",helperText:d="",value:j,replaceFields:v,onChange:n,fetchSuggestionsKey:E,fetchSuggestionsValue:g,keyOtherProps:N,valueOtherProps:$}=u,T=!!(d&&typeof d=="string"),H=d instanceof Array,w=ie.default("MultiBox",ae.default),[l,c]=x.useState([]),[i,G]=x.useState({key:"label",value:"value"});x.useEffect(()=>{u.defaultValue!==void 0&&c([...u.defaultValue])},[]),x.useEffect(()=>{j!==void 0&&c([...j])},[j]),x.useEffect(()=>{if(v){const t={...i,...v};G(t)}},[v]);const q=(t,e)=>{let s={error:!1,helperText:""};if(H){const a=d[t];a&&a[e]&&(s={error:!0,helperText:a[e]})}return s},J=()=>{o!==!0&&(l.push({}),u.value===void 0&&c([...l]),n&&n(l))},Q=t=>()=>{o!==!0&&(l.splice(t,1),u.value===void 0&&c([...l]),n&&n(l))},S=(t,e)=>s=>{l[e][t]=s.target.value,u.value===void 0&&c([...l]),n&&n(l)},U=()=>{if(!C&&!R)return null;const t=()=>{let e="multi-box-label";return p&&p.className&&(e+=` ${p.className}`),e};return r.jsxRuntimeExports.jsx(se.default,{label:C,required:D,labelSign:R,...p,className:t()})},W=(t,e)=>{const s=t[i.key||""]||"",a=t[i.value||""]||"",ee=o instanceof Array?o[e]?.[s]:o,te=o instanceof Array?o[e]?.[a]:o,A=q(e,i.key||""),M=q(e,i.value||"");let _="multi-box-content-item-input";return(A.error||M.error)&&(_+=" multi-box-content-item-input-error"),r.jsxRuntimeExports.jsxs("div",{className:_,children:[r.jsxRuntimeExports.jsx(B.TextField,{className:"multi-box-text-field",size:f,disabled:ee,placeholder:P,value:s,...A,onChange:S(i.key||"",e),fetchSuggestions:E?V("key"):void 0,onSelect:k(i.key||"",e),...N&&N(e,s)}),h&&r.jsxRuntimeExports.jsx("span",{className:"multi-box-separator",children:h}),r.jsxRuntimeExports.jsx(B.TextField,{className:"multi-box-text-field",size:f,disabled:te,placeholder:L,value:a,...M,onChange:S(i.value||"",e),fetchSuggestions:g?V("value"):void 0,onSelect:k(i.value||"",e),...$&&$(e,a)})]})},X=()=>r.jsxRuntimeExports.jsx("div",{className:"multi-box-content",children:l.map((t,e)=>r.jsxRuntimeExports.jsxs("div",{className:"multi-box-content-item",children:[W(t,e),o!==!0&&r.jsxRuntimeExports.jsx("div",{className:"opera-box",children:r.jsxRuntimeExports.jsx("span",{className:"del-box",onClick:Q(e),children:r.jsxRuntimeExports.jsx(le.Delete,{})})})]},e))}),V=t=>(e,s)=>{t==="key"?E&&E(e,s):g&&g(e,s)},k=(t,e)=>s=>{if(typeof s=="object"&&s!==null){const a=s.value;l[e][t]=a}else l[e][t]=s;u.value===void 0&&c([...l]),n&&n(l)},Y=()=>{let t=`${m.$prefixCls}-multi-box multi-box`;return y&&(t+=` ${y}`),f&&(t+=` ${m.$prefixCls}-multi-box-${f}`),I&&(t+=` ${m.$prefixCls}-multi-box-error`),o===!0&&(t+=` ${m.$prefixCls}-multi-box-disabled`),h&&(t+=` ${m.$prefixCls}-multi-box-separator`),t},F=()=>r.jsxRuntimeExports.jsxs("div",{className:"multi-box-add",onClick:J,children:[r.jsxRuntimeExports.jsx(oe.PlusCircleF,{}),r.jsxRuntimeExports.jsx("span",{children:w({id:"add"})})]}),Z=()=>b?r.jsxRuntimeExports.jsx(ne.Tooltip,{disabled:!0,placement:b.placement||"top",...b,children:F()}):F();return r.jsxRuntimeExports.jsxs("div",{className:Y(),style:K,children:[U(),X(),Z(),r.jsxRuntimeExports.jsx(re.default,{className:"multi-box-error-text",error:T,helperText:T?d:void 0,hideErrorDom:z})]})};exports.MultiBox=O;exports.default=O;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,184 @@
1
+ {
2
+ "name": "Notification",
3
+ "category": "Feedback",
4
+ "description": "全局通知提醒框,通过命令式 API(Notification.open / .success / .info / .warning / .error)触发,支持角落定位、标题 + 内容 + 操作按钮、可关闭回调、key 管理",
5
+ "semantic": {
6
+ "intent": [
7
+ "系统通知",
8
+ "重要提醒",
9
+ "复杂反馈"
10
+ ],
11
+ "useCases": [
12
+ "系统升级通知",
13
+ "后台任务完成提醒",
14
+ "带操作按钮的系统消息"
15
+ ],
16
+ "riskLevel": "normal"
17
+ },
18
+ "protocolSummary": "**命令式 API,不是 React 组件**。调用方式:\n```\nNotification.success({ message: '标题', description: '内容', duration: 3 })\nNotification.info({ message: '提示', description: '详情' })\nNotification.warning({ message: '警告', description: '说明' })\nNotification.error({ message: '错误', description: '信息' })\nNotification.open({ message: '标题', description: '内容', type: 'success' }) // open 是 success/info/warning/error 的底层\nNotification.close('my-key') // 关闭指定 key 的通知\nNotification.destroy() // 关闭所有通知\nNotification.config({ placement, top, maxCount, duration }) // 全局配置\n```\n**duration 单位是秒**(与 Message.duration 毫秒不同!)。默认 5 秒自动关闭;传 null 不自动关闭。",
19
+ "variants": {
20
+ "success": { "meaning": "成功(绿色 ✓ 图标)" },
21
+ "info": { "meaning": "普通信息(蓝色 i 图标)" },
22
+ "warning": { "meaning": "警告(黄色 ! 图标)" },
23
+ "error": { "meaning": "错误(红色 × 图标)" }
24
+ },
25
+ "states": [
26
+ "opening",
27
+ "closing"
28
+ ],
29
+ "idealProps": {
30
+ "message": {
31
+ "type": "ReactNode",
32
+ "description": "通知标题(必填),通知卡片上方的粗体文字"
33
+ },
34
+ "description": {
35
+ "type": "ReactNode",
36
+ "description": "通知正文内容;与 message 同时出现时,message 作为标题,description 作为正文"
37
+ },
38
+ "duration": {
39
+ "type": "number | null",
40
+ "default": 5,
41
+ "description": "**自动关闭延时,单位秒**(注意:与 Message 组件的毫秒单位不同!);传 null 不自动关闭(需用户点击关闭按钮或调用 Notification.close(key))"
42
+ },
43
+ "placement": {
44
+ "type": "enum",
45
+ "values": ["topLeft", "topRight", "bottomLeft", "bottomRight"],
46
+ "default": "topRight",
47
+ "description": "弹出位置,4 个角落,topRight 最常用"
48
+ },
49
+ "key": {
50
+ "type": "string",
51
+ "description": "通知唯一标志;传了 key 才能用 Notification.close(key) 程序性关闭;同一 key 再次 open 会更新已有通知"
52
+ },
53
+ "onClose": {
54
+ "type": "() => void",
55
+ "description": "关闭时触发(自动关闭 + 用户手动关闭都触发)"
56
+ },
57
+ "onClick": {
58
+ "type": "() => void",
59
+ "description": "点击通知内容区域(非关闭按钮)时触发"
60
+ },
61
+ "btn": {
62
+ "type": "ReactNode",
63
+ "description": "通知卡片底部自定义操作区域(如 '立即更新' 按钮)"
64
+ },
65
+ "icon": {
66
+ "type": "ReactNode",
67
+ "description": "自定义图标,覆盖 type 默认图标"
68
+ },
69
+ "top": {
70
+ "type": "number",
71
+ "default": 20,
72
+ "description": "topLeft/topRight 时距顶部距离(px)"
73
+ },
74
+ "bottom": {
75
+ "type": "number",
76
+ "default": 20,
77
+ "description": "bottomLeft/bottomRight 时距底部距离(px)"
78
+ },
79
+ "getContainer": {
80
+ "type": "() => HTMLElement",
81
+ "description": "渲染容器,默认 document.body"
82
+ }
83
+ },
84
+ "commonPatterns": {
85
+ "basic": "Notification.success({ message: '操作成功', description: '数据已保存', duration: 3 })",
86
+ "persistent": "Notification.warning({ message: '需要确认', description: '请及时处理', duration: null, key: 'warn-1' });\n// 处理完成后:\nNotification.close('warn-1');",
87
+ "withButton": "Notification.info({\n message: '发现新版本',\n description: 'v2.0.0 已发布',\n duration: null,\n key: 'update',\n btn: <Button onClick={() => { window.open(releaseUrl); Notification.close('update'); }}>立即更新</Button>\n});",
88
+ "globalConfig": "Notification.config({ placement: 'topRight', top: 60, maxCount: 5, duration: 3 });"
89
+ },
90
+ "commandApi": {
91
+ "Notification.open": {
92
+ "signature": "(args: ArgsProps) => void",
93
+ "description": "打开通知,所有 ideaProps 字段均为 ArgsProps 的字段"
94
+ },
95
+ "Notification.success": {
96
+ "signature": "(args: ArgsProps) => void",
97
+ "description": "等价于 Notification.open({...args, type: 'success'})"
98
+ },
99
+ "Notification.info": {
100
+ "signature": "(args: ArgsProps) => void"
101
+ },
102
+ "Notification.warning": {
103
+ "signature": "(args: ArgsProps) => void",
104
+ "description": "Notification.warn 是 Notification.warning 的别名"
105
+ },
106
+ "Notification.error": {
107
+ "signature": "(args: ArgsProps) => void"
108
+ },
109
+ "Notification.close": {
110
+ "signature": "(key: string) => void",
111
+ "description": "关闭指定 key 的通知,遍历所有 placement 实例"
112
+ },
113
+ "Notification.destroy": {
114
+ "signature": "() => void",
115
+ "description": "销毁所有通知实例(包括已显示的和正在动画的)"
116
+ },
117
+ "Notification.config": {
118
+ "signature": "(options: ConfigProps) => void",
119
+ "description": "全局配置,应用入口调用一次"
120
+ }
121
+ },
122
+ "do": [
123
+ "用于比 Message 更重要的、需要用户关注的全局通知(如系统升级、任务完成)",
124
+ "**duration 单位是秒**(默认 5),不是毫秒——与 Message 组件不同",
125
+ "需要程序性关闭时传 key 字段并用 Notification.close(key)",
126
+ "App 入口调用 Notification.config 设置全局 placement / maxCount / duration"
127
+ ],
128
+ "dont": [
129
+ "频繁使用 Notification 打断用户操作——轻提示用 Message,重要操作确认用 FunctionModal",
130
+ "堆叠过多——配合 maxCount 限制同时显示数量",
131
+ "把 duration 写成毫秒——duration 是秒,写 3000 会导致通知 3000 秒后才关闭"
132
+ ],
133
+ "events": {
134
+ "onClose": {
135
+ "signature": "() => void",
136
+ "asyncSupported": false,
137
+ "examples": [
138
+ "Notification.info({ message: '提示', onClose: () => console.log('已关闭') }) — 自动关闭和手动关闭都触发",
139
+ "持久通知 + 关闭回调:Notification.warning({ message: '警告', duration: null, key: 'w1', onClose: () => markAsRead() })",
140
+ "配合 key 程序关闭:Notification.close('w1') 也会触发 onClose"
141
+ ],
142
+ "commonMistakes": [
143
+ "期望 onClose 签名是 (e) => void——实际无参 () => void",
144
+ "传了 onClose 但没有显式关闭路径——duration=null 时通知不自动关闭,onClose 永不触发(除非用户点 × 或程序调用 close)",
145
+ "在 onClose 里再次调 Notification.open 期望实现替换效果——会新开一条通知,建议用 key 复用已有实例"
146
+ ]
147
+ },
148
+ "onClick": {
149
+ "signature": "() => void",
150
+ "asyncSupported": false,
151
+ "examples": [
152
+ "Notification.info({ message: '新消息', onClick: () => router.push('/messages') }) — 点击跳转",
153
+ "onClick 不关闭通知——需在 onClick 里手动调 Notification.close(key) 或让 duration 到期",
154
+ "onClick 和 btn 的 onClick 独立——通知区域点击 + 底部按钮点击是两个独立事件"
155
+ ],
156
+ "commonMistakes": [
157
+ "期望点击通知后自动关闭——onClick 不触发关闭,需在 onClick 里手动 Notification.close(args.key)",
158
+ "在 btn 里写关闭逻辑而不传 key——没有 key 就无法调 Notification.close,需预先生成 key",
159
+ "期望 onClick 阻止通知关闭——点击关闭按钮(×)触发的是关闭逻辑,不能被 onClick 拦截"
160
+ ]
161
+ }
162
+ },
163
+ "typescriptPitfalls": [
164
+ {
165
+ "issue": "duration 单位是秒,不是毫秒——与 Message 不一致是常见陷阱",
166
+ "wrong": "Notification.success({ message: '成功', duration: 3000 }) // 3000 秒后才关闭!不是 3 秒",
167
+ "right": "Notification.success({ message: '成功', duration: 3 }) // 3 秒后自动关闭"
168
+ },
169
+ {
170
+ "issue": "Notification 是命令式 API,default export 是 api 对象,不是 React 组件,不能写 JSX",
171
+ "wrong": "import Notification from '@para-ui/core/Notification'; return <Notification message='提示' />; // JSX 类型错误",
172
+ "right": "import Notification from '@para-ui/core/Notification'; Notification.info({ message: '提示' }); // 命令式调用"
173
+ },
174
+ {
175
+ "issue": "message 类型是 ReactNode,但 ArgsProps 中 message 是必填字段,不传会导致 TS 报错",
176
+ "wrong": "Notification.open({ description: '内容' }) // TS2345: Property 'message' is missing",
177
+ "right": "Notification.open({ message: '标题', description: '内容' }) // message 必填"
178
+ }
179
+ ],
180
+ "mapping": {
181
+ "realComponent": "Notification",
182
+ "adapter": null
183
+ }
184
+ }