@para-ui/core 5.0.0-beta.11 → 5.0.0-beta.13

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 (650) 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/es/AlignBox/component.json +89 -0
  103. package/es/AlignBox/index.css +1 -1
  104. package/es/AlignBox/index.d.ts +6 -2
  105. package/es/AlignBox/index.js +1 -1
  106. package/es/AlignBox/style/index.css +1 -1
  107. package/es/Anchor/anchorMenu/index.d.ts +2 -1
  108. package/es/Anchor/anchorMenu/index.js +36 -33
  109. package/es/Anchor/component.json +130 -0
  110. package/es/Anchor/index.js +52 -49
  111. package/es/Anchor/type.d.ts +8 -4
  112. package/es/Argv/component.json +216 -0
  113. package/es/Argv/dataGenerator/index.js +1 -1
  114. package/es/Argv/index.d.ts +5 -6
  115. package/es/Argv/index.js +1 -1
  116. package/es/AutoBox/component.json +133 -0
  117. package/es/AutoBox/index.d.ts +3 -3
  118. package/es/AutoBox/index.js +1 -1
  119. package/es/AutoBox/protal.d.ts +2 -2
  120. package/es/AutoBox/protal.js +33 -30
  121. package/es/AutoButton/component.json +109 -0
  122. package/es/AutoButton/index.js +1 -1
  123. package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  124. package/es/AutoTips/autoTipsMultiline/index.js +1 -1
  125. package/es/AutoTips/component.json +121 -0
  126. package/es/AutoTips/index.js +1 -1
  127. package/es/Badge/component.json +92 -0
  128. package/es/Breadcrumbs/component.json +142 -0
  129. package/es/Breadcrumbs/index.js +1 -1
  130. package/es/Button/SplitButton.d.ts +2 -2
  131. package/es/Button/component.json +168 -0
  132. package/es/Button/index.js +44 -44
  133. package/es/ButtonGroup/component.json +132 -0
  134. package/es/ButtonGroup/index.d.ts +1 -1
  135. package/es/Card/component.json +162 -0
  136. package/es/Card/index.d.ts +2 -2
  137. package/es/Card/index.js +2 -2
  138. package/es/Carousel/component.json +142 -0
  139. package/es/Carousel/index.d.ts +1 -1
  140. package/es/Cascader/Cascader.js +1 -1
  141. package/es/Cascader/OptionList/Column.js +1 -1
  142. package/es/Cascader/OptionList/index.js +1 -1
  143. package/es/Cascader/component.json +196 -0
  144. package/es/Cascader/hooks/useEntities.js +7 -7
  145. package/es/Cascader/interface.d.ts +1 -0
  146. package/es/Cascader/utils/commonUtil.d.ts +1 -1
  147. package/es/Cascader/utils/commonUtil.js +16 -16
  148. package/es/Cascader/utils/treeUtil.d.ts +14 -5
  149. package/es/Cascader/utils/treeUtil.js +1 -1
  150. package/es/Checkbox/component.json +138 -0
  151. package/es/CheckboxGroup/component.json +152 -0
  152. package/es/CheckboxGroup/index.js +1 -1
  153. package/es/CodeEditor/component.json +189 -0
  154. package/es/CodeEditor/index.d.ts +11 -10
  155. package/es/CodeEditor/index.js +19 -19
  156. package/es/Collapse/component.json +166 -0
  157. package/es/Collapse/index.d.ts +1 -1
  158. package/es/Collapse/index.js +23 -22
  159. package/es/CollapseBox/component.json +84 -0
  160. package/es/CollapseLayout/component.json +155 -0
  161. package/es/ColorPicker/component.json +142 -0
  162. package/es/ComboSelect/component.json +181 -0
  163. package/es/ComboSelect/index.js +115 -109
  164. package/es/ComboSelect/interface.d.ts +2 -2
  165. package/es/ComboSelect/utils.d.ts +3 -3
  166. package/es/ComboSelect/utils.js +1 -1
  167. package/es/Container/component.json +111 -0
  168. package/es/ContentBox/component.json +81 -0
  169. package/es/CopyText/component.json +118 -0
  170. package/es/CycleSelector/component.json +98 -0
  171. package/es/CycleSelector/index.js +14 -13
  172. package/es/DatePicker/component.json +192 -0
  173. package/es/DatePicker/generatePicker/generateRangePicker.js +11 -11
  174. package/es/DatePicker/generatePicker/generateSinglePicker.js +2 -2
  175. package/es/Descriptions/component.json +142 -0
  176. package/es/Descriptions/index.d.ts +1 -1
  177. package/es/Desktop/component.json +171 -0
  178. package/es/Desktop/index.js +1 -1
  179. package/es/DragVerify/component.json +114 -0
  180. package/es/DragVerify/index.js +19 -19
  181. package/es/Drawer/component.json +200 -0
  182. package/es/Drawer/index.js +86 -86
  183. package/es/Drawer/interface.d.ts +1 -1
  184. package/es/Drawer/util.d.ts +1 -6
  185. package/es/Drawer/util.js +9 -6
  186. package/es/Dropdown/component.json +147 -0
  187. package/es/Dropdown/index.js +1 -1
  188. package/es/DynamicMultiBox/component.json +278 -0
  189. package/es/DynamicMultiBox/formItem.d.ts +1 -1
  190. package/es/DynamicMultiBox/index.js +1 -1
  191. package/es/DynamicMultiBox/rowForm.d.ts +2 -2
  192. package/es/Empty/component.json +123 -0
  193. package/es/Empty/index.css +1 -1
  194. package/es/Empty/index.d.ts +2 -2
  195. package/es/Empty/index.js +27 -26
  196. package/es/Empty/style/index.css +1 -1
  197. package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  198. package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  199. package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  200. package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
  201. package/es/FieldForm/Form.d.ts +2 -2
  202. package/es/FieldForm/Form.js +1 -1
  203. package/es/FieldForm/FormItemInput.js +1 -1
  204. package/es/FieldForm/FormItemLabel.js +1 -1
  205. package/es/FieldForm/FormList.d.ts +2 -2
  206. package/es/FieldForm/component.json +196 -0
  207. package/es/FieldForm/context.d.ts +5 -1
  208. package/es/FieldForm/context.js +2 -2
  209. package/es/FieldForm/hooks/useForm.d.ts +4 -3
  210. package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
  211. package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  212. package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
  213. package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
  214. package/es/FieldForm/hooks/useItemRef.js +6 -6
  215. package/es/Form/component.json +161 -0
  216. package/es/Form/index.d.ts +52 -49
  217. package/es/Form/index.js +1 -1
  218. package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  219. package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
  220. package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  221. package/es/FormItem/compoments/formFile/index.js +8 -8
  222. package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  223. package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
  224. package/es/FormItem/component.json +171 -0
  225. package/es/FormItem/index.d.ts +5 -5
  226. package/es/FormItem/index.js +23 -23
  227. package/es/FormItem/itemType.js +1 -1
  228. package/es/FunctionModal/component.json +197 -0
  229. package/es/FunctionModal/dialog.d.ts +1 -1
  230. package/es/FunctionModal/modalContext.d.ts +4 -1
  231. package/es/GlobalContext/confirmLocale.js +1 -1
  232. package/es/GlobalContext/index.js +1 -1
  233. package/es/Help/component.json +118 -0
  234. package/es/HelperText/component.json +126 -0
  235. package/es/Image/PreviewGroup.js +1 -1
  236. package/es/Image/component.json +165 -0
  237. package/es/Image/index.js +1 -1
  238. package/es/InputCode/component.json +191 -0
  239. package/es/InputCode/index.d.ts +2 -2
  240. package/es/InputLang/component.json +205 -0
  241. package/es/InputLang/index.js +2 -2
  242. package/es/InputNumber/component.json +162 -0
  243. package/es/Label/component.json +126 -0
  244. package/es/Label/index.d.ts +2 -2
  245. package/es/Loading/component.json +91 -0
  246. package/es/Menu/component.json +180 -0
  247. package/es/Menu/verticalMenuList.js +1 -1
  248. package/es/Message/component.json +246 -0
  249. package/es/Message/index.d.ts +2 -2
  250. package/es/Message/index.js +2 -2
  251. package/es/Modal/Confirm/index.d.ts +1 -1
  252. package/es/Modal/Confirm/index.js +1 -1
  253. package/es/Modal/component.json +277 -0
  254. package/es/Modal/index.d.ts +85 -5
  255. package/es/Modal/index.js +159 -122
  256. package/es/Modal/interface.d.ts +1 -0
  257. package/es/MultiBox/component.json +216 -0
  258. package/es/MultiBox/index.js +19 -14
  259. package/es/Notification/component.json +184 -0
  260. package/es/OperateBtn/component.json +134 -0
  261. package/es/OperateBtn/index.d.ts +3 -3
  262. package/es/PageHeader/component.json +112 -0
  263. package/es/PageHeader/horizontalMeun.js +1 -1
  264. package/es/PageHeader/horizontalMeunRight.js +1 -1
  265. package/es/Pagination/component.json +181 -0
  266. package/es/Pagination/index.js +15 -15
  267. package/es/ParauiProvider/index.js +1 -1
  268. package/es/PasswordRules/component.json +105 -0
  269. package/es/PasswordRules/index.d.ts +4 -4
  270. package/es/PopConfirm/component.json +227 -0
  271. package/es/PopConfirm/index.d.ts +1 -1
  272. package/es/PopConfirm/index.js +1 -1
  273. package/es/PopMenu/component.json +131 -0
  274. package/es/PopMenu/hooks.d.ts +1 -1
  275. package/es/PopMenu/index.js +8 -8
  276. package/es/Popover/component.json +165 -0
  277. package/es/Popover/index.js +1 -1
  278. package/es/Progress/component.json +161 -0
  279. package/es/Prompt/component.json +144 -0
  280. package/es/Querying/component.json +96 -0
  281. package/es/Querying/index.css +1 -1
  282. package/es/Querying/index.d.ts +2 -2
  283. package/es/Querying/index.js +20 -19
  284. package/es/Querying/style/index.css +1 -1
  285. package/es/QuickReply/QuickReplyCode/index.js +1 -1
  286. package/es/QuickReply/component.json +129 -0
  287. package/es/QuickReply/index.d.ts +1 -1
  288. package/es/Radio/component.json +136 -0
  289. package/es/RadioGroup/component.json +149 -0
  290. package/es/RangeInput/component.json +198 -0
  291. package/es/RangeInput/index.js +20 -20
  292. package/es/Result/component.json +104 -0
  293. package/es/ScrollBar/component.json +115 -0
  294. package/es/Search/component.json +177 -0
  295. package/es/Search/index.d.ts +1 -1
  296. package/es/Select/component.json +244 -0
  297. package/es/Select/index.js +114 -114
  298. package/es/SelectInput/component.json +184 -0
  299. package/es/Selector/component.json +203 -0
  300. package/es/Selector/index.js +56 -50
  301. package/es/Selector/interface.d.ts +2 -2
  302. package/es/Selector/selectorData/index.js +1 -1
  303. package/es/Selector/selectorMain/index.js +3 -3
  304. package/es/Selector/selectorNode/index.js +1 -1
  305. package/es/Selector/util.d.ts +3 -3
  306. package/es/Selector/util.js +6 -12
  307. package/es/SelectorPicker/component.json +179 -0
  308. package/es/SelectorPicker/index.d.ts +5 -5
  309. package/es/SelectorPicker/index.js +15 -15
  310. package/es/SingleBox/component.json +151 -0
  311. package/es/SingleBox/index.d.ts +2 -2
  312. package/es/Slider/component.json +181 -0
  313. package/es/SortBox/component.json +108 -0
  314. package/es/Status/component.json +104 -0
  315. package/es/Stepper/component.json +129 -0
  316. package/es/Stepper/index.d.ts +2 -2
  317. package/es/Switch/component.json +207 -0
  318. package/es/Switch/index.css +1 -1
  319. package/es/Switch/index.d.ts +3 -2
  320. package/es/Switch/index.js +60 -59
  321. package/es/Switch/style/index.css +1 -1
  322. package/es/Table/component.json +547 -0
  323. package/es/Table/index.d.ts +2 -2
  324. package/es/Table/index.js +385 -382
  325. package/es/Table/interface.d.ts +30 -0
  326. package/es/Table/tableHead.js +1 -1
  327. package/es/Table/util.d.ts +1 -1
  328. package/es/Table/util.js +3 -12
  329. package/es/Tabs/component.json +227 -0
  330. package/es/Tag/component.json +221 -0
  331. package/es/Tag/index.css +1 -1
  332. package/es/Tag/index.d.ts +1 -1
  333. package/es/Tag/index.js +20 -20
  334. package/es/Tag/style/index.css +1 -1
  335. package/es/TextEditor/component.json +186 -0
  336. package/es/TextEditor/index.d.ts +5 -5
  337. package/es/TextEditor/index.js +1 -1
  338. package/es/TextField/component.json +290 -0
  339. package/es/TextField/index.d.ts +2 -2
  340. package/es/TextField/index.js +1 -1
  341. package/es/TimePicker/component.json +176 -0
  342. package/es/Timeline/component.json +110 -0
  343. package/es/Title/component.json +156 -0
  344. package/es/ToggleButton/component.json +153 -0
  345. package/es/ToggleButton/index.js +1 -1
  346. package/es/Tooltip/component.json +176 -0
  347. package/es/Tooltip/index.js +58 -53
  348. package/es/Tooltip/interface.d.ts +14 -1
  349. package/es/Tooltip/utils.js +6 -6
  350. package/es/Transfer/component.json +157 -0
  351. package/es/Tree/OperateBar/index.js +1 -1
  352. package/es/Tree/Tree.js +3 -3
  353. package/es/Tree/component.json +512 -0
  354. package/es/Tree/interface.d.ts +1 -1
  355. package/es/Upload/component.json +450 -0
  356. package/es/Upload/util.js +1 -1
  357. package/es/Utils/snack-kit-shims.d.ts +18 -0
  358. package/es/Utils/snack-kit-shims.js +19 -0
  359. package/es/Utils/type.d.ts +0 -2
  360. package/es/_virtual/index.js +5 -3
  361. package/es/_virtual/index2.js +2 -5
  362. package/es/index.d.ts +2 -0
  363. package/es/index.js +1 -1
  364. package/es/locale/en_US.d.ts +361 -0
  365. package/es/locale/en_US.js +364 -0
  366. package/es/locale/index.d.ts +1 -723
  367. package/es/locale/index2.js +10 -0
  368. package/es/locale/zh_CN.d.ts +361 -0
  369. package/es/locale/zh_CN.js +364 -0
  370. package/es/node_modules/classnames/index.js +1 -1
  371. package/lib/AlignBox/component.json +89 -0
  372. package/lib/AlignBox/index.css +1 -1
  373. package/lib/AlignBox/index.d.ts +6 -2
  374. package/lib/AlignBox/index.js +1 -1
  375. package/lib/AlignBox/style/index.css +1 -1
  376. package/lib/Anchor/anchorMenu/index.d.ts +2 -1
  377. package/lib/Anchor/anchorMenu/index.js +1 -1
  378. package/lib/Anchor/component.json +130 -0
  379. package/lib/Anchor/index.js +1 -1
  380. package/lib/Anchor/type.d.ts +8 -4
  381. package/lib/Argv/component.json +216 -0
  382. package/lib/Argv/dataGenerator/index.js +1 -1
  383. package/lib/Argv/index.d.ts +5 -6
  384. package/lib/Argv/index.js +1 -1
  385. package/lib/AutoBox/component.json +133 -0
  386. package/lib/AutoBox/index.d.ts +3 -3
  387. package/lib/AutoBox/index.js +1 -1
  388. package/lib/AutoBox/protal.d.ts +2 -2
  389. package/lib/AutoBox/protal.js +1 -1
  390. package/lib/AutoButton/component.json +109 -0
  391. package/lib/AutoButton/index.js +1 -1
  392. package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  393. package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
  394. package/lib/AutoTips/component.json +121 -0
  395. package/lib/AutoTips/index.js +1 -1
  396. package/lib/Badge/component.json +92 -0
  397. package/lib/Breadcrumbs/component.json +142 -0
  398. package/lib/Breadcrumbs/index.js +1 -1
  399. package/lib/Button/SplitButton.d.ts +2 -2
  400. package/lib/Button/component.json +168 -0
  401. package/lib/Button/index.js +1 -1
  402. package/lib/ButtonGroup/component.json +132 -0
  403. package/lib/ButtonGroup/index.d.ts +1 -1
  404. package/lib/Card/component.json +162 -0
  405. package/lib/Card/index.d.ts +2 -2
  406. package/lib/Card/index.js +1 -1
  407. package/lib/Carousel/component.json +142 -0
  408. package/lib/Carousel/index.d.ts +1 -1
  409. package/lib/Cascader/Cascader.js +1 -1
  410. package/lib/Cascader/OptionList/Column.js +1 -1
  411. package/lib/Cascader/OptionList/index.js +1 -1
  412. package/lib/Cascader/component.json +196 -0
  413. package/lib/Cascader/hooks/useEntities.js +1 -1
  414. package/lib/Cascader/interface.d.ts +1 -0
  415. package/lib/Cascader/utils/commonUtil.d.ts +1 -1
  416. package/lib/Cascader/utils/commonUtil.js +1 -1
  417. package/lib/Cascader/utils/treeUtil.d.ts +14 -5
  418. package/lib/Cascader/utils/treeUtil.js +1 -1
  419. package/lib/Checkbox/component.json +138 -0
  420. package/lib/CheckboxGroup/component.json +152 -0
  421. package/lib/CheckboxGroup/index.js +1 -1
  422. package/lib/CodeEditor/component.json +189 -0
  423. package/lib/CodeEditor/index.d.ts +11 -10
  424. package/lib/CodeEditor/index.js +1 -1
  425. package/lib/Collapse/component.json +166 -0
  426. package/lib/Collapse/index.d.ts +1 -1
  427. package/lib/Collapse/index.js +1 -1
  428. package/lib/CollapseBox/component.json +84 -0
  429. package/lib/CollapseLayout/component.json +155 -0
  430. package/lib/ColorPicker/component.json +142 -0
  431. package/lib/ComboSelect/component.json +181 -0
  432. package/lib/ComboSelect/index.js +1 -1
  433. package/lib/ComboSelect/interface.d.ts +2 -2
  434. package/lib/ComboSelect/utils.d.ts +3 -3
  435. package/lib/ComboSelect/utils.js +1 -1
  436. package/lib/Container/component.json +111 -0
  437. package/lib/ContentBox/component.json +81 -0
  438. package/lib/CopyText/component.json +118 -0
  439. package/lib/CycleSelector/component.json +98 -0
  440. package/lib/CycleSelector/index.js +1 -1
  441. package/lib/DatePicker/component.json +192 -0
  442. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  443. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  444. package/lib/Descriptions/component.json +142 -0
  445. package/lib/Descriptions/index.d.ts +1 -1
  446. package/lib/Desktop/component.json +171 -0
  447. package/lib/Desktop/index.js +1 -1
  448. package/lib/DragVerify/component.json +114 -0
  449. package/lib/DragVerify/index.js +1 -1
  450. package/lib/Drawer/component.json +200 -0
  451. package/lib/Drawer/index.js +1 -1
  452. package/lib/Drawer/interface.d.ts +1 -1
  453. package/lib/Drawer/util.d.ts +1 -6
  454. package/lib/Drawer/util.js +1 -1
  455. package/lib/Dropdown/component.json +147 -0
  456. package/lib/Dropdown/index.js +1 -1
  457. package/lib/DynamicMultiBox/component.json +278 -0
  458. package/lib/DynamicMultiBox/formItem.d.ts +1 -1
  459. package/lib/DynamicMultiBox/index.js +1 -1
  460. package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
  461. package/lib/Empty/component.json +123 -0
  462. package/lib/Empty/index.css +1 -1
  463. package/lib/Empty/index.d.ts +2 -2
  464. package/lib/Empty/index.js +1 -1
  465. package/lib/Empty/style/index.css +1 -1
  466. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  467. package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  468. package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  469. package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
  470. package/lib/FieldForm/Form.d.ts +2 -2
  471. package/lib/FieldForm/Form.js +1 -1
  472. package/lib/FieldForm/FormItemInput.js +1 -1
  473. package/lib/FieldForm/FormItemLabel.js +1 -1
  474. package/lib/FieldForm/FormList.d.ts +2 -2
  475. package/lib/FieldForm/component.json +196 -0
  476. package/lib/FieldForm/context.d.ts +5 -1
  477. package/lib/FieldForm/context.js +1 -1
  478. package/lib/FieldForm/hooks/useForm.d.ts +4 -3
  479. package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
  480. package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  481. package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
  482. package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
  483. package/lib/FieldForm/hooks/useItemRef.js +1 -1
  484. package/lib/Form/component.json +161 -0
  485. package/lib/Form/index.d.ts +52 -49
  486. package/lib/Form/index.js +1 -1
  487. package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  488. package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
  489. package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  490. package/lib/FormItem/compoments/formFile/index.js +1 -1
  491. package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  492. package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
  493. package/lib/FormItem/component.json +171 -0
  494. package/lib/FormItem/index.d.ts +5 -5
  495. package/lib/FormItem/index.js +1 -1
  496. package/lib/FormItem/itemType.js +1 -1
  497. package/lib/FunctionModal/component.json +197 -0
  498. package/lib/FunctionModal/dialog.d.ts +1 -1
  499. package/lib/FunctionModal/modalContext.d.ts +4 -1
  500. package/lib/GlobalContext/confirmLocale.js +1 -1
  501. package/lib/GlobalContext/index.js +1 -1
  502. package/lib/Help/component.json +118 -0
  503. package/lib/HelperText/component.json +126 -0
  504. package/lib/Image/PreviewGroup.js +1 -1
  505. package/lib/Image/component.json +165 -0
  506. package/lib/Image/index.js +1 -1
  507. package/lib/InputCode/component.json +191 -0
  508. package/lib/InputCode/index.d.ts +2 -2
  509. package/lib/InputLang/component.json +205 -0
  510. package/lib/InputLang/index.js +1 -1
  511. package/lib/InputNumber/component.json +162 -0
  512. package/lib/Label/component.json +126 -0
  513. package/lib/Label/index.d.ts +2 -2
  514. package/lib/Loading/component.json +91 -0
  515. package/lib/Menu/component.json +180 -0
  516. package/lib/Menu/verticalMenuList.js +1 -1
  517. package/lib/Message/component.json +246 -0
  518. package/lib/Message/index.d.ts +2 -2
  519. package/lib/Message/index.js +1 -1
  520. package/lib/Modal/Confirm/index.d.ts +1 -1
  521. package/lib/Modal/Confirm/index.js +1 -1
  522. package/lib/Modal/component.json +277 -0
  523. package/lib/Modal/index.d.ts +85 -5
  524. package/lib/Modal/index.js +1 -1
  525. package/lib/Modal/interface.d.ts +1 -0
  526. package/lib/MultiBox/component.json +216 -0
  527. package/lib/MultiBox/index.js +1 -1
  528. package/lib/Notification/component.json +184 -0
  529. package/lib/OperateBtn/component.json +134 -0
  530. package/lib/OperateBtn/index.d.ts +3 -3
  531. package/lib/PageHeader/component.json +112 -0
  532. package/lib/PageHeader/horizontalMeun.js +1 -1
  533. package/lib/PageHeader/horizontalMeunRight.js +1 -1
  534. package/lib/Pagination/component.json +181 -0
  535. package/lib/Pagination/index.js +1 -1
  536. package/lib/ParauiProvider/index.js +1 -1
  537. package/lib/PasswordRules/component.json +105 -0
  538. package/lib/PasswordRules/index.d.ts +4 -4
  539. package/lib/PopConfirm/component.json +227 -0
  540. package/lib/PopConfirm/index.d.ts +1 -1
  541. package/lib/PopConfirm/index.js +1 -1
  542. package/lib/PopMenu/component.json +131 -0
  543. package/lib/PopMenu/hooks.d.ts +1 -1
  544. package/lib/PopMenu/index.js +1 -1
  545. package/lib/Popover/component.json +165 -0
  546. package/lib/Popover/index.js +1 -1
  547. package/lib/Progress/component.json +161 -0
  548. package/lib/Prompt/component.json +144 -0
  549. package/lib/Querying/component.json +96 -0
  550. package/lib/Querying/index.css +1 -1
  551. package/lib/Querying/index.d.ts +2 -2
  552. package/lib/Querying/index.js +1 -1
  553. package/lib/Querying/style/index.css +1 -1
  554. package/lib/QuickReply/QuickReplyCode/index.js +1 -1
  555. package/lib/QuickReply/component.json +129 -0
  556. package/lib/QuickReply/index.d.ts +1 -1
  557. package/lib/Radio/component.json +136 -0
  558. package/lib/RadioGroup/component.json +149 -0
  559. package/lib/RangeInput/component.json +198 -0
  560. package/lib/RangeInput/index.js +1 -1
  561. package/lib/Result/component.json +104 -0
  562. package/lib/ScrollBar/component.json +115 -0
  563. package/lib/Search/component.json +177 -0
  564. package/lib/Search/index.d.ts +1 -1
  565. package/lib/Select/component.json +244 -0
  566. package/lib/Select/index.js +1 -1
  567. package/lib/SelectInput/component.json +184 -0
  568. package/lib/Selector/component.json +203 -0
  569. package/lib/Selector/index.js +1 -1
  570. package/lib/Selector/interface.d.ts +2 -2
  571. package/lib/Selector/selectorData/index.js +1 -1
  572. package/lib/Selector/selectorMain/index.js +1 -1
  573. package/lib/Selector/selectorNode/index.js +1 -1
  574. package/lib/Selector/util.d.ts +3 -3
  575. package/lib/Selector/util.js +1 -1
  576. package/lib/SelectorPicker/component.json +179 -0
  577. package/lib/SelectorPicker/index.d.ts +5 -5
  578. package/lib/SelectorPicker/index.js +1 -1
  579. package/lib/SingleBox/component.json +151 -0
  580. package/lib/SingleBox/index.d.ts +2 -2
  581. package/lib/Slider/component.json +181 -0
  582. package/lib/SortBox/component.json +108 -0
  583. package/lib/Status/component.json +104 -0
  584. package/lib/Stepper/component.json +129 -0
  585. package/lib/Stepper/index.d.ts +2 -2
  586. package/lib/Switch/component.json +207 -0
  587. package/lib/Switch/index.css +1 -1
  588. package/lib/Switch/index.d.ts +3 -2
  589. package/lib/Switch/index.js +1 -1
  590. package/lib/Switch/style/index.css +1 -1
  591. package/lib/Table/component.json +547 -0
  592. package/lib/Table/index.d.ts +2 -2
  593. package/lib/Table/index.js +1 -1
  594. package/lib/Table/interface.d.ts +30 -0
  595. package/lib/Table/tableHead.js +1 -1
  596. package/lib/Table/util.d.ts +1 -1
  597. package/lib/Table/util.js +1 -1
  598. package/lib/Tabs/component.json +227 -0
  599. package/lib/Tag/component.json +221 -0
  600. package/lib/Tag/index.css +1 -1
  601. package/lib/Tag/index.d.ts +1 -1
  602. package/lib/Tag/index.js +1 -1
  603. package/lib/Tag/style/index.css +1 -1
  604. package/lib/TextEditor/component.json +186 -0
  605. package/lib/TextEditor/index.d.ts +5 -5
  606. package/lib/TextEditor/index.js +1 -1
  607. package/lib/TextField/component.json +290 -0
  608. package/lib/TextField/index.d.ts +2 -2
  609. package/lib/TextField/index.js +1 -1
  610. package/lib/TimePicker/component.json +176 -0
  611. package/lib/Timeline/component.json +110 -0
  612. package/lib/Title/component.json +156 -0
  613. package/lib/ToggleButton/component.json +153 -0
  614. package/lib/ToggleButton/index.js +1 -1
  615. package/lib/Tooltip/component.json +176 -0
  616. package/lib/Tooltip/index.js +1 -1
  617. package/lib/Tooltip/interface.d.ts +14 -1
  618. package/lib/Tooltip/utils.js +1 -1
  619. package/lib/Transfer/component.json +157 -0
  620. package/lib/Tree/OperateBar/index.js +2 -2
  621. package/lib/Tree/Tree.js +1 -1
  622. package/lib/Tree/component.json +512 -0
  623. package/lib/Tree/interface.d.ts +1 -1
  624. package/lib/Upload/component.json +450 -0
  625. package/lib/Upload/util.js +1 -1
  626. package/lib/Utils/snack-kit-shims.d.ts +18 -0
  627. package/lib/Utils/snack-kit-shims.js +2 -0
  628. package/lib/Utils/type.d.ts +0 -2
  629. package/lib/_virtual/index.js +1 -1
  630. package/lib/_virtual/index2.js +1 -1
  631. package/lib/index.d.ts +2 -0
  632. package/lib/index.js +1 -1
  633. package/lib/locale/en_US.d.ts +361 -0
  634. package/lib/locale/en_US.js +2 -0
  635. package/lib/locale/index.d.ts +1 -723
  636. package/lib/locale/index2.js +2 -0
  637. package/lib/locale/zh_CN.d.ts +361 -0
  638. package/lib/locale/zh_CN.js +2 -0
  639. package/lib/node_modules/classnames/index.js +1 -1
  640. package/package.json +11 -4
  641. package/es/_virtual/index3.js +0 -5
  642. package/es/_virtual/index4.js +0 -5
  643. package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
  644. package/lib/_virtual/index3.js +0 -2
  645. package/lib/_virtual/index4.js +0 -2
  646. package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
  647. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  648. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
  649. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  650. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
@@ -1,4 +1,4 @@
1
- import { __module as s } from "../../_virtual/index4.js";
1
+ import { __module as s } from "../../_virtual/index2.js";
2
2
  var u;
3
3
  function c() {
4
4
  return u ? s.exports : (u = 1, (function(i) {
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "AlignBox",
3
+ "category": "Layout",
4
+ "description": "方向语义对齐容器:direction='horizontal'(默认)子元素水平排列+垂直居中;direction='vertical'子元素纵向堆叠+水平居中。根元素为 block 级 flex div,style/className 直接作用于该 flex 容器。",
5
+ "semantic": {
6
+ "intent": [
7
+ "方向对齐",
8
+ "水平排列容器",
9
+ "纵向堆叠容器"
10
+ ],
11
+ "useCases": [
12
+ "图标 + 文字 + 标签 一行内水平对齐(direction='horizontal')",
13
+ "字段纵向堆叠每行一个(direction='vertical')",
14
+ "卡片内简单的横向元素对齐"
15
+ ],
16
+ "riskLevel": "low"
17
+ },
18
+ "variants": {
19
+ "horizontal": {
20
+ "meaning": "**子元素水平排列 + 垂直居中** — `display:flex; align-items:center`;子元素按 row 排列,在交叉轴(垂直)居中。默认值。**主轴对齐默认 flex-start**(DEFECT-006):两端对齐 / 居中等需 className 或 style 追加 justify-content"
21
+ },
22
+ "vertical": {
23
+ "meaning": "**子元素纵向堆叠 + 水平居中** — `display:flex; flex-direction:column; align-items:center`;子元素从上到下堆叠,在交叉轴(水平)居中。**⚠️ DEFECT-007:子元素宽度 = 内容宽度**(align-items:center 收缩,非撑满容器);修复方案:① 给子元素自身加 `width:100%`(推荐):`<div style={{ width: '100%' }}>内容</div>`;② 或在 AlignBox 上加 `style={{ alignItems: 'stretch' }}` 覆盖。嵌套场景(vertical 包 horizontal):内层 AlignBox 必须加 `style={{ width: '100%' }}` 才能撑满父容器"
24
+ }
25
+ },
26
+ "states": [
27
+ "default"
28
+ ],
29
+ "idealProps": {
30
+ "direction": {
31
+ "type": "enum",
32
+ "values": [
33
+ "horizontal",
34
+ "vertical"
35
+ ],
36
+ "default": "horizontal",
37
+ "description": "子元素排列方向(字面 = 行为):`horizontal` = 水平排列 + 垂直居中(`display:flex; align-items:center`;主轴对齐默认 flex-start,需要两端对齐用 `style={{ justifyContent: 'space-between' }}`,需要右对齐用 `justifyContent: 'flex-end'`);`vertical` = 纵向堆叠 + 水平居中(`display:flex; flex-direction:column; align-items:center`)。**vertical 模式两个注意点**:① 子元素间**无默认 gap**——需要均匀间距时加 `style={{ gap: '8px' }}`(8px 紧凑 / 12px 标准 / 16px 宽松);② 子元素**宽度默认收缩至内容宽度**(DEFECT-007,align-items:center 副作用)——若子元素需要撑满父宽度,加 `style={{ alignItems: 'stretch' }}`(整体)或在每个子元素上加 `style={{ width: '100%' }}`(单独控制)。**2026-05-08 跨组件命名 epic §3.3 选项 I 重设计** — 替代旧 `alignType: 'vertical' | 'flex'`(BREAKING-CHANGES §A5)"
38
+ },
39
+ "children": {
40
+ "type": "ReactNode",
41
+ "description": "子元素;按 direction 控制的轴向排列"
42
+ },
43
+ "className": {
44
+ "type": "string",
45
+ "description": "外层根 div 的类名(AlignBox-DEFECT-003:src/AlignBox/index.tsx 实证)。常用于追加自定义样式覆盖,如 `flex-wrap: wrap` / `gap` / `justify-content` 等 direction 未提供的属性"
46
+ },
47
+ "style": {
48
+ "type": "React.CSSProperties",
49
+ "description": "外层根 div 的内联样式(AlignBox-DEFECT-003:src/AlignBox/index.tsx 实证)。**根 div 同时也是 flex 容器**(不存在两层 div 分离),因此 style 可直接传 flexWrap / gap / justifyContent 等 flex 属性,与 className 追加等效。常用示例:`style={{ flexWrap: 'wrap', gap: '8px' }}`(换行 + 间距);`style={{ justifyContent: 'space-between' }}`(两端对齐);`style={{ width: '100%' }}`(vertical 模式下覆盖 DEFECT-007 宽度收缩)"
50
+ }
51
+ },
52
+ "do": [
53
+ "需要『一行内水平排列 + 垂直居中』(图标 + 文字 + 标签)用 direction='horizontal'(默认值,可省略)",
54
+ "需要『子元素纵向堆叠 + 水平居中』(字段每行一个)用 direction='vertical'",
55
+ "vertical 模式需要子元素间均匀间距:加 `style={{ gap: '8px' }}`(8px 紧凑 / 12px 标准 / 16px 宽松)——vertical 本身无默认 gap",
56
+ "vertical 模式需要子元素撑满父宽度(卡片内容、表单字段):加 `style={{ alignItems: 'stretch' }}`——vertical 子元素默认宽度收缩至内容宽度(DEFECT-007)",
57
+ "horizontal 需要两端对齐:`style={{ justifyContent: 'space-between', width: '100%' }}`;需要右对齐:`style={{ justifyContent: 'flex-end' }}`——horizontal 默认 flex-start(左对齐)",
58
+ "需要 wrap / gap / justify-content 等 direction 未提供的 flex 属性,用 **className** 追加 *或* **style 内联**(两种方式等效,因为 style 直接作用于根 flex div):`style={{ flexWrap: 'wrap', gap: '8px', justifyContent: 'space-between' }}`",
59
+ "**业务方语义直觉 = direction 字面**:从 v6 开始 horizontal/vertical 即字面对齐 — 不再有命名错位"
60
+ ],
61
+ "dont": [
62
+ "过度嵌套 AlignBox",
63
+ "替代 CSS Grid/Flexbox 进行复杂布局",
64
+ "**不要再传旧 prop `alignType`** — 已 BREAKING 移除(BREAKING-CHANGES §A5);从 v5.x 之前升级请按以下映射:旧 `alignType='vertical'`(实为 inline vertical-align middle)→ 新 `direction='horizontal'`(语义最接近);旧 `alignType='flex'`(实为 flex row 居中)→ 新 `direction='horizontal'`(行为完全一致)。要用真正的纵向堆叠请显式传 `direction='vertical'`",
65
+ "不要假设 `direction='horizontal'` 自动 flex-wrap — src 仅 `display:flex; align-items:center`,无 wrap;要换行请加 className"
66
+ ],
67
+ "events": {},
68
+ "typescriptPitfalls": [
69
+ {
70
+ "issue": "direction 只接受 'horizontal' | 'vertical',不接受 antd flex 方向字符串",
71
+ "wrong": "<AlignBox direction='row'>...</AlignBox> // 'row' 不在联合类型中,TS 报错",
72
+ "right": "<AlignBox direction='horizontal'>...</AlignBox> // 水平排列用 'horizontal'"
73
+ },
74
+ {
75
+ "issue": "vertical 模式下子元素宽度默认收缩至内容宽度(align-items:center 副作用),需显式覆盖",
76
+ "wrong": "<AlignBox direction='vertical'><div className='full-row'>...</div></AlignBox> // 子 div 宽度收缩,不是撑满",
77
+ "right": "<AlignBox direction='vertical' style={{ alignItems: 'stretch' }}>...</AlignBox> // 或在子元素加 style={{ width: '100%' }}"
78
+ },
79
+ {
80
+ "issue": "style 和 className 直接作用于根 flex div,不存在两层 div 分离",
81
+ "wrong": "// 以为有内外两层 div,试图用 className 覆盖内层 flex 容器\n<AlignBox style={{ display: 'block' }}>...</AlignBox> // 覆盖 display 会破坏 flex 对齐",
82
+ "right": "// style 直接透传到根 flex div,追加 flex 属性即可\n<AlignBox style={{ gap: '8px', justifyContent: 'space-between' }}>...</AlignBox>"
83
+ }
84
+ ],
85
+ "mapping": {
86
+ "realComponent": "AlignBox",
87
+ "adapter": null
88
+ }
89
+ }
@@ -1 +1 @@
1
- @charset "UTF-8";.paraui-v4-align-box.paraui-v4-align-box-vertical *{vertical-align:middle}.paraui-v4-align-box.paraui-v4-align-box-flex{display:flex;align-items:center}
1
+ @charset "UTF-8";.paraui-v4-align-box.paraui-v4-align-box-horizontal{display:flex;align-items:center}.paraui-v4-align-box.paraui-v4-align-box-vertical{display:flex;flex-direction:column;align-items:center}
@@ -4,8 +4,12 @@ export interface AlignBoxProps {
4
4
  className?: string;
5
5
  /** style */
6
6
  style?: React.CSSProperties;
7
- /** 对齐方式 默认vertical */
8
- alignType?: 'vertical' | 'flex';
7
+ /**
8
+ * 子元素排列方向(字面 = 行为,2026-05-08 跨组件命名 epic §3.3 选项 I 重设计)
9
+ * - 'horizontal'(默认): display:flex; align-items:center — 子元素水平排列、垂直居中
10
+ * - 'vertical': display:flex; flex-direction:column; align-items:center — 子元素纵向堆叠、水平居中
11
+ */
12
+ direction?: 'horizontal' | 'vertical';
9
13
  children?: ReactNode;
10
14
  }
11
15
  declare const AlignBox: FunctionComponent<AlignBoxProps>;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const o=require("../_virtual/jsx-runtime.js"),u=require("clsx"),e=require("../GlobalContext/constant.js");;/* empty css */const a=s=>{const{className:r,style:t,children:i,alignType:l="vertical",...n}=s;return o.jsxRuntimeExports.jsx("div",{className:u(`${e.$prefixCls}-align-box ${e.$prefixCls}-align-box-${l}`,r),style:t,...n,children:i})};exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const l=require("../_virtual/jsx-runtime.js"),u=require("clsx"),e=require("../GlobalContext/constant.js");;/* empty css */const c=s=>{const{className:r,style:t,children:i,direction:o="horizontal",...n}=s;return l.jsxRuntimeExports.jsx("div",{className:u(`${e.$prefixCls}-align-box ${e.$prefixCls}-align-box-${o}`,r),style:t,...n,children:i})};exports.default=c;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- .paraui-v4-align-box.paraui-v4-align-box-vertical *{vertical-align:middle}.paraui-v4-align-box.paraui-v4-align-box-flex{display:flex;align-items:center}
1
+ .paraui-v4-align-box.paraui-v4-align-box-horizontal{display:flex;align-items:center}.paraui-v4-align-box.paraui-v4-align-box-vertical{display:flex;flex-direction:column;align-items:center}
@@ -8,7 +8,8 @@ interface IProps {
8
8
  isTree?: boolean;
9
9
  anchorMap?: AnchorMap;
10
10
  setAnchorMap?: (map: AnchorMap) => void;
11
- customPrefixIcon?: React.ReactNode;
11
+ /** R6 §6 类型放宽:静态 ReactNode 或函数形式 (item, isActive) => ReactNode */
12
+ customPrefixIcon?: React.ReactNode | ((item: AnchorItem, isActive: boolean) => React.ReactNode);
12
13
  onlyOneLevel?: boolean;
13
14
  }
14
15
  declare const AnchorMenu: (props: IProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const e=require("../../_virtual/jsx-runtime.js"),o=require("react"),g=require("clsx"),q=require("../../node_modules/@para-ui/icons/Down/index.js");;/* empty css */const k=require("../../AutoTips/index.js"),p=a=>{const{data:t,currentAnchorId:h,handleClick:l,level:c=0,isTree:u=!1,anchorMap:i={},setAnchorMap:E,customPrefixIcon:d,onlyOneLevel:v}=a,{id:x}=t,R=String(x)===String(h);o.useEffect(()=>{},[]);const M=o.useMemo(()=>{const n=[];for(let s=0;s<c;s++)n.push(e.jsxRuntimeExports.jsx("div",{className:"indent"},s));return n},[c]),m=(n,s)=>{n.stopPropagation();const r=i[s];r.expanded=!r.expanded,E?.({...i})},N=o.useMemo(()=>{const{name:n,id:s}=t,r=t.children&&t.children.length>0,f=u?r?e.jsxRuntimeExports.jsx("div",{className:"btn-down",onClick:j=>m(j,s),children:e.jsxRuntimeExports.jsx("div",{className:"icon icon-down",children:e.jsxRuntimeExports.jsx(q.Down,{})})}):e.jsxRuntimeExports.jsx("div",{className:"icon mr-6"}):d||e.jsxRuntimeExports.jsx(A,{});return e.jsxRuntimeExports.jsxs("div",{className:"item-content",onClick:j=>{},children:[f,e.jsxRuntimeExports.jsx("div",{className:"title",onClick:()=>l?.(s),children:e.jsxRuntimeExports.jsx(k.default,{children:n||""})})]})},[t,i,m,l,d,u]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:g("anchor-menu-item",{active:R,expanded:i?.[x]?.expanded}),children:[M,N]}),t.children&&i?.[x]?.expanded&&!v&&t.children.map(n=>o.createElement(p,{...a,data:n,key:n?.id,level:c+1}))]})},A=()=>e.jsxRuntimeExports.jsx("div",{className:"icon mr-6",children:e.jsxRuntimeExports.jsx("div",{className:"icon-point"})});exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const e=require("../../_virtual/jsx-runtime.js"),c=require("react"),g=require("clsx"),q=require("../../node_modules/@para-ui/icons/Down/index.js");;/* empty css */const k=require("../../AutoTips/index.js"),h=l=>{const{data:s,currentAnchorId:E,handleClick:u,level:d=0,isTree:m=!1,anchorMap:i={},setAnchorMap:v,customPrefixIcon:o,onlyOneLevel:R}=l,{id:x}=s,a=String(x)===String(E);c.useEffect(()=>{},[]);const f=c.useMemo(()=>{const n=[];for(let t=0;t<d;t++)n.push(e.jsxRuntimeExports.jsx("div",{className:"indent"},t));return n},[d]),j=(n,t)=>{n.stopPropagation();const r=i[t];r.expanded=!r.expanded,v?.({...i})},M=c.useMemo(()=>{const{name:n,id:t}=s,r=s.children&&s.children.length>0,N=m?r?e.jsxRuntimeExports.jsx("div",{className:"btn-down",onClick:p=>j(p,t),children:e.jsxRuntimeExports.jsx("div",{className:"icon icon-down",children:e.jsxRuntimeExports.jsx(q.Down,{})})}):e.jsxRuntimeExports.jsx("div",{className:"icon mr-6"}):o?typeof o=="function"?o(s,a):o:e.jsxRuntimeExports.jsx(A,{});return e.jsxRuntimeExports.jsxs("div",{className:"item-content",onClick:p=>{},children:[N,e.jsxRuntimeExports.jsx("div",{className:"title",onClick:()=>u?.(t),children:e.jsxRuntimeExports.jsx(k.default,{children:n||""})})]})},[s,i,j,u,o,m,a]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:g("anchor-menu-item",{active:a,expanded:i?.[x]?.expanded}),children:[f,M]}),s.children&&i?.[x]?.expanded&&!R&&s.children.map(n=>c.createElement(h,{...l,data:n,key:n?.id,level:d+1}))]})},A=()=>e.jsxRuntimeExports.jsx("div",{className:"icon mr-6",children:e.jsxRuntimeExports.jsx("div",{className:"icon-point"})});exports.default=h;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,130 @@
1
+ {
2
+ "name": "Anchor",
3
+ "category": "Navigation",
4
+ "description": "页面内锚点导航——自动生成目录侧栏并监听内容区滚动高亮目录项,点击目录项内置滚动定位行为。高度约束写在 Anchor 直接父 div 上,无限高度时内部不产生滚动。",
5
+ "semantic": {
6
+ "intent": [
7
+ "快速定位",
8
+ "内容索引"
9
+ ],
10
+ "useCases": [
11
+ "长文档",
12
+ "API 文档",
13
+ "单页应用"
14
+ ],
15
+ "riskLevel": "low"
16
+ },
17
+ "variants": {
18
+ "default": {
19
+ "meaning": "标准锚点"
20
+ }
21
+ },
22
+ "states": [
23
+ "active",
24
+ "default"
25
+ ],
26
+ "idealProps": {
27
+ "children": {
28
+ "type": "ReactNode",
29
+ "description": "内容区,放置带 `id` 属性的各章节 div;Anchor 通过监听滚动位置高亮左侧目录。⚠️ children 是必需的,缺少会导致锚点无法定位",
30
+ "required": true
31
+ },
32
+ "list": {
33
+ "type": "AnchorItem[]",
34
+ "typeDefinition": "interface AnchorItem { name: string; id: string; children?: AnchorItem[]; expanded?: boolean }",
35
+ "description": "目录数据源。**AnchorItem 字段一览(仅 name + id 必填)**:① name: string — 侧栏显示文案;② id: string — 对应 children 内章节 `<div id={item.id}>` 的 DOM id(Anchor 内部用 id 定位高亮,大小写必须精确一致;建议仅用字母/数字/-/_,避免 CSS 选择器特殊字符;若业务数据字段是 href='#intro',映射时去掉 # 前缀:`id: s.href.replace(/^#/, '')`);③ children?: AnchorItem[] — 多级嵌套(自动渲染为缩进树,建议 ≤3 级;递归时复用同一映射函数);④ expanded?: boolean — 该项初始展开态(default false;⚠️ 与 allExpanded prop 完全独立:allExpanded 控制顶部「全部展开」按钮可见性,不等于初始全展开;初始全展开需对每个含 children 的 AnchorItem 设 expanded:true)。完整 TS 定义:interface AnchorItem { name: string; id: string; children?: AnchorItem[]; expanded?: boolean }(parentId 是 Anchor 内部字段,业务传 list 时无需提供)。"
36
+ },
37
+ "scrollId": {
38
+ "type": "string",
39
+ "default": "\"paraui-v4-anchor-scroll-id\"",
40
+ "description": "**Anchor 内部自动创建的滚动容器 DOM id**——业务方只需传一个全局唯一字符串,Anchor 会在渲染时自动创建 `<div id={scrollId}>` 并把 children 放入其中;**不需要在 children 外部或内部手动创建该 div**。Anchor 对此 div 监听 scroll 事件 + 用 `[id]` 选择器定位高亮目录项。单页只有一个 Anchor 时可省略(默认 'paraui-v4-anchor-scroll-id');同页多个 Anchor 实例必须各自传不同的 scrollId 以隔离滚动监听。scrollId 查找:Anchor 内部用 `document.getElementById(scrollId)` 获取滚动容器——正常渲染后此 div 必然存在,无需业务方手动创建。"
41
+ },
42
+ "title": {
43
+ "type": "ReactNode",
44
+ "description": "目录标题;只有传 title 才显示折叠按钮 / 全部展开按钮 / search 搜索框。**(R6 §6 类型放宽:从 string → ReactNode)**——支持嵌入徽标 / 计数 / 动态状态文本(如 `<span>目录<Tag>当前: intro</Tag></span>`)。string 是 ReactNode 子集,完全向后兼容旧 string 用法。详见 BREAKING-CHANGES §维护规则边界(类型 widening 不入档)+ discussions/Anchor-title-reactnode.md"
45
+ },
46
+ "placement": {
47
+ "type": "'left' | 'right'",
48
+ "values": ["left", "right"],
49
+ "default": "'right'",
50
+ "description": "目录位于内容的左侧还是右侧。⚠️ 默认 'right'(目录在右侧);要实现左侧目录须显式传 placement='left'"
51
+ },
52
+ "search": {
53
+ "type": "boolean",
54
+ "default": false,
55
+ "description": "目录是否带搜索框(按 name 模糊匹配)。需配合 title 使用。"
56
+ },
57
+ "allExpanded": {
58
+ "type": "boolean",
59
+ "default": true,
60
+ "description": "顶部『全部展开』按钮是否启用(控制按钮可见性,不影响 `list[].expanded` 的初始值)。仅在 list 含 children 且传了 title 时生效。\n\n**⚠️ 命名歧义警告(R15+R16 双轮再现 · 3/6 sub-agent 混淆)**:allExpanded 命名容易被理解为「初始全展开」(类似 defaultExpandAll),但实际含义是「全部展开」**按钮**的可见性控制开关:\n- `allExpanded=true`(默认)→ 顶部出现「全部展开」按钮,用户**点击按钮后**才展开全部目录项\n- `allExpanded=false` → 隐藏「全部展开」按钮\n- **若要初始全展开(组件挂载即全展开)**:对 list[] 中每个含 children 的 AnchorItem 设置 `expanded: true`,与 allExpanded prop 无关\n\n**R17 路线图**:正在评审 src rename `allExpanded → expandedAll`(BREAKING,更准确地表达「控制展开按钮」含义),详见 `discussions/Anchor-allExpanded-naming-epic.md`;R17 拍板前 allExpanded 继续有效,0 BREAKING。"
61
+ },
62
+ "listWidth": {
63
+ "type": "number",
64
+ "description": "目录列表宽度(px);不传时默认 140px。"
65
+ },
66
+ "customPrefixIcon": {
67
+ "type": "ReactNode | ((item: AnchorItem, isActive: boolean) => ReactNode)",
68
+ "description": "自定义目录每项的前缀图标。**(R6 §6 类型放宽:从 ReactNode → ReactNode | function)**:<br>- **静态 ReactNode** — 所有目录项共用同一前缀图标(原行为,完全向后兼容)<br>- **函数形式 `(item, isActive) => ReactNode`** — 按当前激活态返回不同 ReactNode(墨水点指示器 / 激活态指示符 / 复选框联动等);函数版每次激活变化触发 list 重渲染,内部 AnchorListMemo 已优化。<br>**初始激活态说明**:页面 mount 时 Anchor 不主动激活任何目录项——需要用户滚动(或点击)触发第一次 scroll 事件后才会激活;初始激活项由滚动位置决定(内部算法:找第一个 offsetTop >= scrollTop 的 [id] 元素)。若需要初始激活特定项,可在 mount 后手动调用 `document.getElementById(SCROLL_ID)?.dispatchEvent(new Event('scroll'))` 触发一次。<br>**业务方仍可走激活态 CSS 联动**(向后兼容):Anchor 内部对激活目录项加 className `.anchor-menu-item.active`(无 prefixCls 前缀,见 src/Anchor/anchorMenu/index.scss:14);可在外层 style 选择器 `:global(.anchor-menu-item.active) [data-ink-dot] { visibility: visible }` 联动。但函数形式更直接、类型安全。详见 discussions/Anchor-customPrefixIcon-function.md(R6 实施选项 B 类型 widening)"
69
+ }
70
+ },
71
+ "do": [
72
+ "在长页面(如文档)右侧提供 Anchor",
73
+ "Anchor 标题应简洁",
74
+ "把章节 DOM 作为 children 直接传入:`<Anchor list={list} scrollId='xxx'>{sections.map(s => <div id={s.id}>...</div>)}</Anchor>`",
75
+ "list[].id 必须与 children 中对应章节 div 的 id 完全一致(含大小写);建议仅使用 CSS selector 安全字符",
76
+ "业务侧 `{ href, title }` 数据派生 list 时使用 `sections.map(s => ({ name: s.title, id: s.href.replace(/^#/, '') }))` 映射;多级数据写递归映射函数(参见 docs/view/anchor/codeString.ts hrefMappingDemo / nestedMappingDemo)",
77
+ "Anchor 内部滚动容器需要由父级提供有限高度(如 `style={{ height: 400 }}` 或外层 wrapper 设 `height: 100vh`)才能产生滚动;外层高度无限时内容不会滚动,stickyDemo 也无法体现『内容滚动而目录吸顶』效果",
78
+ "需要把激活 id 还原成业务 href 时:用 useEffect 监听 activeId 变化 + 业务侧维护 id->href 反向 map(参见 codeString.ts notifyParentDemo)",
79
+ "需要『吸顶 / 滚动偏移头部 / 激活回调』时:用外层 div 包 `position: sticky; top: 0` 实现吸顶(**前置条件:外层必须有滚动祖先——body 高度 > 视口、或某 wrapper 设了 `overflow:auto/scroll`;⚠️ `overflow:auto/scroll` 是合法滚动祖先,不会导致 sticky 失效——仅 `overflow:hidden` 的祖先会使 sticky 退化为 relative;flex 容器中配合 `alignSelf: flex-start` 避免 stretch 拉满高度**;缺少任一条件则 sticky 退化为 relative);用 `<section style={{ scrollMarginTop: headerOffset }}>` **写在每个章节元素自身** 实现偏移;用容器自定义 `addEventListener('scroll', ...)` 计算激活章节并 onChange 通知父组件——这些不是 Anchor 内置能力"
80
+ ],
81
+ "dont": [
82
+ "Anchor 嵌套层级过深 (>3级) —— 设计/视觉建议;src 实现层 formatList 递归无硬限制,违反仅触发缩进过深视觉异常",
83
+ "内容过少的页面使用 Anchor",
84
+ "不要传 `targetOffset` / `affix` / `showInkInFixed` / `onChange` / `items` / `onClick` 等 prop——这些 prop 在 AnchorProps 中不存在,传入会被 React 忽略且能力不会生效",
85
+ "不要在 children 内再包一层 `<div id={scrollId}>` 自管理滚动——Anchor 已内部包了 `<div id={scrollId}>`",
86
+ "不要把 `scrollPaddingTop` 写在 children 内的 wrapper 上——`scrollPaddingTop` 仅对滚动容器生效(即 Anchor 内部 `<div id={scrollId}>`,外部无法直接访问);偏移请用 `scrollMarginTop` 写在**每个章节元素自身**上"
87
+ ],
88
+ "events": {
89
+ "onClickItem (via AnchorMenu internal)": {
90
+ "signature": "内部点击目录项时调用 handleClick(id: string),无外部事件 prop",
91
+ "asyncSupported": false,
92
+ "examples": [
93
+ "点击目录项时 Anchor 内部调用 scrollTo 滚动到对应章节,无需业务方处理",
94
+ "需要监听激活变化时,用外层 wrapper 的 addEventListener('scroll', ...) 计算当前 id",
95
+ "需要把 activeId 回传父组件:用 useEffect 监听 scrollId 容器的 scroll 事件 + 业务侧 id→href 反向 map"
96
+ ],
97
+ "commonMistakes": [
98
+ "传 onChange prop 期望激活目录项变化时被回调——Anchor 不存在 onChange prop",
99
+ "传 onClick prop 期望拦截目录项点击——AnchorProps 无此 prop,传入会被 React 忽略",
100
+ "期望 customPrefixIcon 在点击瞬间触发回调——它只是渲染函数,激活态变化驱动重渲染"
101
+ ]
102
+ }
103
+ },
104
+ "typescriptPitfalls": [
105
+ {
106
+ "issue": "AnchorItem 无法从 @para-ui/core/Anchor 直接命名导出——Anchor/index.tsx 只有默认导出,AnchorItem 定义在 Anchor/type.ts",
107
+ "wrong": "import type { AnchorItem } from '@para-ui/core/Anchor'; // TS2614: 无此命名导出",
108
+ "right": "import type { AnchorItem } from '@para-ui/core/Anchor/type'; // 从 type.ts 子路径导入"
109
+ },
110
+ {
111
+ "issue": "AnchorItem 的 id 必须与 children 内章节 div 的 DOM id 完全一致(大小写敏感)",
112
+ "wrong": "// list: [{ name: '介绍', id: 'Introduction' }]\n// children: <div id='introduction'> // 大小写不同,无法高亮",
113
+ "right": "// 保持一致且使用 CSS selector 安全字符\n// list: [{ name: '介绍', id: 'introduction' }]\n// children: <div id='introduction'>..."
114
+ },
115
+ {
116
+ "issue": "title prop 从 string 扩宽到 ReactNode,但 allExpanded 是控制按钮可见性,不是初始全展开",
117
+ "wrong": "// 以为 allExpanded=true 会初始展开所有目录项\n<Anchor allExpanded={true} list={tree} /> // 实际只是显示'全部展开'按钮",
118
+ "right": "// 初始全展开需要对每个含 children 的 AnchorItem 设 expanded: true\nconst tree = data.map(item => ({ ...item, expanded: true, children: item.children?.map(c => ({ ...c, expanded: true })) }))"
119
+ },
120
+ {
121
+ "issue": "customPrefixIcon 函数形式的参数类型必须显式标注,避免 noImplicitAny 报错",
122
+ "wrong": "// 内联函数不标注类型\n<Anchor customPrefixIcon={(item, isActive) => <span />} /> // TS7006: item 隐式 any",
123
+ "right": "import type { AnchorItem } from '@para-ui/core/Anchor';\n<Anchor customPrefixIcon={(item: AnchorItem, isActive: boolean) => <span style={{ color: isActive ? 'blue' : 'gray' }}>•</span>} />"
124
+ }
125
+ ],
126
+ "mapping": {
127
+ "realComponent": "Anchor",
128
+ "adapter": null
129
+ }
130
+ }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const s=require("../_virtual/jsx-runtime.js"),n=require("react"),y=require("clsx"),S=require("../GlobalContext/constant.js"),Q=require("./anchorMenu/index.js"),B=require("../node_modules/@para-ui/icons/ToRight/index.js"),F=require("../node_modules/@para-ui/icons/ToLeft/index.js"),U=require("../node_modules/@para-ui/icons/PreviewOpen/index.js"),X=require("../Search/index.js"),Y=require("../GlobalContext/useFormatMessage.js"),Z=require("./lang/index.js"),_=require("@paraview/lib");;/* empty css */const ee=q=>{const{style:W,className:z,title:E="",scrollId:R=`${S.$prefixCls}-anchor-scroll-id`,list:d=[],listClassName:I,scrollClassName:D,placement:i="right",allExpanded:G=!0,search:H=!1,customPrefixIcon:$,listWidth:p}=q,J=Y.default("Anchor",Z.default),[C,L]=n.useState(""),[m,K]=n.useState(!1),[h,g]=n.useState({}),[T,M]=n.useState(!1),[N,O]=n.useState(""),[f,v]=n.useState(null),o=n.useRef({currentAnchorId:"",anchorList:d,anchorMap:{},searchValue:"",scrolling:!1}),V=T?"50px":p?`${p+20}px`:"160px";n.useEffect(()=>{o.current.anchorList=d;const e={};let r=!1;const c=(x,a="")=>{x.forEach(t=>{(t?.expanded===void 0||t?.expanded===null)&&(t.expanded=!1),a&&(t.parentId=a),e[t.id]=t,t.children&&(r=!0,c(t.children,t.id))})};c(d),K(r),o.current.anchorMap=e,g(e)},[d]),n.useEffect(()=>{const e=document.getElementById(R),r=_.throttle(async()=>{if(o.current.scrolling)return;const c=e?.querySelectorAll("[id]")||[],a=Array.from(c).map(l=>({id:l.id,offsetTop:l.offsetTop-(e?.offsetTop||0)}));let t=0,u="";const A=a.find(l=>(t<l.offsetTop&&(t=l.offsetTop,u=l.id),l.offsetTop>=(e?.scrollTop||0)));if(A?.id!==o.current.currentAnchorId){let l=A?.id||"";e?.scrollTop&&!A?.id&&(l=u),L(l)}},300);return r(),e?.addEventListener("scroll",r,{passive:!0}),()=>{e?.addEventListener("scroll",r)}},[]);const k=e=>{const r=document.getElementById(R),c=r?.querySelectorAll("[id]")||[],x=Array.from(c).findIndex(t=>String(t.id)===String(e)),a=c[x];a&&(L(e),o.current.currentAnchorId=e,o.current.scrolling=!0,setTimeout(()=>{o.current.scrolling=!1},1e3),r?.scrollTo({top:a?.offsetTop||0-(r?.offsetTop||0),behavior:"smooth"}))},b=()=>{Object.keys(h).forEach(e=>{h[e].expanded=!0}),g({...h})},j=n.useMemo(()=>_.debounce(async()=>{const e=o.current.searchValue;if(!e){v(null);return}const r=o.current.anchorList||[],c=[],x=(a,t="")=>{a.forEach(u=>{u?.name?.indexOf(e)>-1&&c.push(u),u.children&&x(u.children,u.id)})};x(r),v(c)},200),[]),w=n.useMemo(()=>E?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:"anchor-menu-title",children:[s.jsxRuntimeExports.jsx("div",{className:"title",children:E}),s.jsxRuntimeExports.jsxs("div",{className:"opera-area",children:[m&&G&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(U.PreviewOpen,{onClick:b}),s.jsxRuntimeExports.jsx("div",{className:"split-line"})]}),s.jsxRuntimeExports.jsx("div",{onClick:()=>M(!0),children:i==="left"?s.jsxRuntimeExports.jsx(F.ToLeft,{}):s.jsxRuntimeExports.jsx(B.ToRight,{})})]})]}),H&&s.jsxRuntimeExports.jsx(X.Search,{size:"small",value:N,onChange:e=>{O(e),o.current.searchValue=e,j()},onClickRightIcon:j,onEnter:j,onClear:()=>{O(""),o.current.searchValue="",v(null)},placeholder:J("pleaseEnter"),style:{padding:"0 4px",marginBottom:"6px"}})]}):null,[E,m,N,b,j]),P=n.useMemo(()=>{if(!d?.length)return null;if(T)return s.jsxRuntimeExports.jsx("div",{className:"collapse-icon-area",onClick:()=>M(!1),children:i==="left"?s.jsxRuntimeExports.jsx(B.ToRight,{}):s.jsxRuntimeExports.jsx(F.ToLeft,{})});const e=f||d;return s.jsxRuntimeExports.jsxs("div",{className:y("anchor-menu-list",I),style:{width:p?`${p}px`:"140px"},children:[w,e.map((r,c)=>s.jsxRuntimeExports.jsx(Q.default,{data:r,currentAnchorId:C,handleClick:k,isTree:f?!1:m,anchorMap:h,setAnchorMap:g,customPrefixIcon:$,onlyOneLevel:!!f},r?.id))]})},[d,C,I,k,m,w,h,$,T,f]);return s.jsxRuntimeExports.jsxs("div",{className:y(`${S.$prefixCls}-anchor`,z,{[`${S.$prefixCls}-anchor-${i}`]:i}),style:W,children:[i==="left"&&P,s.jsxRuntimeExports.jsx("div",{id:R,className:y("anchor-scroll",D),style:{paddingLeft:i==="left"?V:"0",paddingRight:i==="right"?V:"0"},children:q.children}),i==="right"&&P]})};exports.default=ee;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const s=require("../_virtual/jsx-runtime.js"),n=require("react"),y=require("clsx"),S=require("../GlobalContext/constant.js"),U=require("./anchorMenu/index.js"),F=require("../node_modules/@para-ui/icons/ToRight/index.js"),_=require("../node_modules/@para-ui/icons/ToLeft/index.js"),X=require("../node_modules/@para-ui/icons/PreviewOpen/index.js"),Y=require("../Search/index.js"),Z=require("../GlobalContext/useFormatMessage.js"),ee=require("./lang/index.js"),D=require("@snack-kit/lib");;/* empty css */const se=q=>{const{style:W,className:z,title:E="",scrollId:R=`${S.$prefixCls}-anchor-scroll-id`,list:d=[],listClassName:I,scrollClassName:G,placement:i="right",allExpanded:H=!0,search:J=!1,customPrefixIcon:C,listWidth:p}=q,K=Z.default("Anchor",ee.default),[L,M]=n.useState(""),[m,Q]=n.useState(!1),[h,g]=n.useState({}),[T,$]=n.useState(!1),[N,O]=n.useState(""),[f,v]=n.useState(null),o=n.useRef({currentAnchorId:"",anchorList:d,anchorMap:{},searchValue:"",scrolling:!1}),V=T?"50px":p?`${p+20}px`:"160px";n.useEffect(()=>{o.current.anchorList=d;const e={};let r=!1;const c=(x,l="")=>{x.forEach(t=>{(t?.expanded===void 0||t?.expanded===null)&&(t.expanded=!1),l&&(t.parentId=l),e[t.id]=t,t.children&&(r=!0,c(t.children,t.id))})};c(d),Q(r),o.current.anchorMap=e,g(e)},[d]),n.useEffect(()=>{const e=document.getElementById(R),r=D.Throttle(async()=>{if(o.current.scrolling)return;const c=e?.querySelectorAll("[id]")||[],l=Array.from(c).map(a=>{const B=a;return{id:B.id,offsetTop:B.offsetTop-(e?.offsetTop||0)}});let t=0,u="";const A=l.find(a=>(t<a.offsetTop&&(t=a.offsetTop,u=a.id),a.offsetTop>=(e?.scrollTop||0)));if(A?.id!==o.current.currentAnchorId){let a=A?.id||"";e?.scrollTop&&!A?.id&&(a=u),M(a)}},300);return r(),e?.addEventListener("scroll",r,{passive:!0}),()=>{e?.addEventListener("scroll",r)}},[]);const b=e=>{const r=document.getElementById(R),c=r?.querySelectorAll("[id]")||[],x=Array.from(c).findIndex(t=>String(t.id)===String(e)),l=c[x];l&&(M(e),o.current.currentAnchorId=e,o.current.scrolling=!0,setTimeout(()=>{o.current.scrolling=!1},1e3),r?.scrollTo({top:l?.offsetTop||0-(r?.offsetTop||0),behavior:"smooth"}))},k=()=>{Object.keys(h).forEach(e=>{h[e].expanded=!0}),g({...h})},j=n.useMemo(()=>D.Debounce(async()=>{const e=o.current.searchValue;if(!e){v(null);return}const r=o.current.anchorList||[],c=[],x=(l,t="")=>{l.forEach(u=>{u?.name?.indexOf(e)>-1&&c.push(u),u.children&&x(u.children,u.id)})};x(r),v(c)},200),[]),w=n.useMemo(()=>E?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsxs("div",{className:"anchor-menu-title",children:[s.jsxRuntimeExports.jsx("div",{className:"title",children:E}),s.jsxRuntimeExports.jsxs("div",{className:"opera-area",children:[m&&H&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(X.PreviewOpen,{onClick:k}),s.jsxRuntimeExports.jsx("div",{className:"split-line"})]}),s.jsxRuntimeExports.jsx("div",{onClick:()=>$(!0),children:i==="left"?s.jsxRuntimeExports.jsx(_.ToLeft,{}):s.jsxRuntimeExports.jsx(F.ToRight,{})})]})]}),J&&s.jsxRuntimeExports.jsx(Y.Search,{size:"small",value:N,onChange:e=>{O(e),o.current.searchValue=e,j()},onClickRightIcon:j,onEnter:j,onClear:()=>{O(""),o.current.searchValue="",v(null)},placeholder:K("pleaseEnter"),style:{padding:"0 4px",marginBottom:"6px"}})]}):null,[E,m,N,k,j]),P=n.useMemo(()=>{if(!d?.length)return null;if(T)return s.jsxRuntimeExports.jsx("div",{className:"collapse-icon-area",onClick:()=>$(!1),children:i==="left"?s.jsxRuntimeExports.jsx(F.ToRight,{}):s.jsxRuntimeExports.jsx(_.ToLeft,{})});const e=f||d;return s.jsxRuntimeExports.jsxs("div",{className:y("anchor-menu-list",I),style:{width:p?`${p}px`:"140px"},children:[w,e.map((r,c)=>s.jsxRuntimeExports.jsx(U.default,{data:r,currentAnchorId:L,handleClick:b,isTree:f?!1:m,anchorMap:h,setAnchorMap:g,customPrefixIcon:C,onlyOneLevel:!!f},r?.id))]})},[d,L,I,b,m,w,h,C,T,f]);return s.jsxRuntimeExports.jsxs("div",{className:y(`${S.$prefixCls}-anchor`,z,{[`${S.$prefixCls}-anchor-${i}`]:i}),style:W,children:[i==="left"&&P,s.jsxRuntimeExports.jsx("div",{id:R,className:y("anchor-scroll",G),style:{paddingLeft:i==="left"?V:"0",paddingRight:i==="right"?V:"0"},children:q.children}),i==="right"&&P]})};exports.default=se;
2
2
  //# sourceMappingURL=index.js.map
@@ -18,8 +18,8 @@ export interface AnchorProps {
18
18
  style?: React.CSSProperties;
19
19
  /** 类名 */
20
20
  className?: string;
21
- /** 标题 */
22
- title?: string;
21
+ /** 标题(R6 §6 类型放宽:string → ReactNode,支持嵌入徽标/计数/动态状态文本;string 是 ReactNode 子集,完全向后兼容) */
22
+ title?: ReactNode;
23
23
  /** 滚动盒子Id */
24
24
  scrollId?: string;
25
25
  /** 子元素 */
@@ -31,8 +31,12 @@ export interface AnchorProps {
31
31
  /** 位置 */
32
32
  placement?: 'left' | 'right';
33
33
  /** 默认展示的锚点 */
34
- /** 自定义前缀符号 */
35
- customPrefixIcon?: ReactNode;
34
+ /**
35
+ * 自定义前缀符号(R6 §6 类型放宽):
36
+ * - 静态 ReactNode — 所有目录项共用同一前缀图标(原行为)
37
+ * - 函数形式 `(item, isActive) => ReactNode` — 按当前激活态返回不同 ReactNode(墨水点指示器等激活态联动场景);函数版本每次激活变化触发 list 重渲染,内部 AnchorListMemo 已优化
38
+ */
39
+ customPrefixIcon?: ReactNode | ((item: AnchorItem, isActive: boolean) => ReactNode);
36
40
  /** 全部展开功能是否开启 */
37
41
  allExpanded?: boolean;
38
42
  /** 是否带目录搜索 */
@@ -0,0 +1,216 @@
1
+ {
2
+ "name": "Argv",
3
+ "category": "Data Entry",
4
+ "description": "动态参数键值对编辑器。用户可以增删行、编辑每行的 key/value,value 支持多类型(string/number/boolean/object)。典型场景:命令行参数配置、环境变量编辑、动态配置项。**重要:这是一个'对象 ⇄ 列表'双形态组件,内部数据形态是 IArgvItem[],外部数据形态可以是对象(Record<string,any>)或列表(IArgvItem[]),通过两套不同的 prop 通道分别接入(见 controlledChannels)**",
5
+ "semantic": {
6
+ "intent": [
7
+ "动态键值对编辑",
8
+ "参数配置",
9
+ "可增删行的表单"
10
+ ],
11
+ "useCases": [
12
+ "命令行参数配置面板(CLI argv 编辑)",
13
+ "环境变量编辑器(KEY=VALUE 列表)",
14
+ "HTTP Header / Query 参数编辑",
15
+ "动态配置项编辑(配置中心场景)",
16
+ "脚本变量定义"
17
+ ],
18
+ "riskLevel": "normal"
19
+ },
20
+ "protocolSummary": "**双形态受控对**:外部可用 **对象形态**(defaultValue: Record<string,any> + onChange: (val: Record<string,any>) => void,**onChange 防抖 200ms**)或 **列表形态**(list: IArgvItem[] + onListChange: (val: IArgvItem[]) => void,**无防抖**)接入数据。defaultValue 仅 mount + 引用变化时灌入(不受控);list 是受控通道(每次变化都会被同步)。两套通道可同时存在(各自独立 fire)。**无 value/values prop,无 schema/argSchema prop——这是常见误解**",
21
+ "controlledChannels": {
22
+ "objectMode": {
23
+ "in": "defaultValue: Record<string, any>",
24
+ "out": "onChange: (val: Record<string, any>) => void",
25
+ "behavior": "**非受控**:defaultValue 引用变化时(useEffect 依赖)重置内部 state,父层 setState 后再传入相同引用不会重置。onChange 内部 200ms 防抖,返回值已经 formatDataToObject 转成普通对象(丢弃空 key 项)",
26
+ "whenToUse": "外部数据天然是对象(API 返回的 config 对象、env vars 对象),且不需要严格受控(用户编辑过程中父层不需要插队覆盖)"
27
+ },
28
+ "listMode": {
29
+ "in": "list: IArgvItem[]",
30
+ "out": "onListChange: (val: IArgvItem[]) => void",
31
+ "behavior": "**受控**:list 每次变化都会被同步进内部 state(useEffect 依赖 list 引用)。onListChange 无防抖,每次按键 / 增删行立即 fire,返回原始 IArgvItem[](保留空 key 项,保留类型元数据)",
32
+ "whenToUse": "需要保留输入过程中间态(空 key 行、未填值)、需要保留类型元数据(dataType=string/number/boolean/object)、或父层做严格受控(每次输入都过父层 reducer)"
33
+ },
34
+ "bothModes": "list 和 defaultValue 可以同时传(list 会覆盖 defaultValue 的初始化效果);onChange 和 onListChange 可同时监听,两个回调都会触发,**但 onChange 因防抖会延迟 200ms 且只回传对象形态**"
35
+ },
36
+ "dataFlow": {
37
+ "objectToList": "**formatObjectToData(obj: Record<string,any>): IArgvItem[]** — Object.keys 遍历, 每个 [k,v] 转换成 IArgvItem(自动推断 dataType: typeof v)。导出函数,可在父层提前调用",
38
+ "listToObject": "**formatDataToObject(list: IArgvItem[]): Record<string,any>** — 遍历 list, 跳过 item.key 为空的项, 用 item.key 作为对象 key, formatGeneratorToData 还原 value。导出函数",
39
+ "validate": "**checkArgvData(list: IArgvItem[], intl: Function): { error: boolean, detail: Record<string,string>[] }** — 校验每行 key 非空 + value 格式正确,返回的 detail 可以直接喂给 errors prop"
40
+ },
41
+ "variants": {
42
+ "default": {
43
+ "meaning": "默认样式(无 variant 切换,样式由 size/disabled 等控制)"
44
+ }
45
+ },
46
+ "states": [
47
+ "default",
48
+ "disabled",
49
+ "error"
50
+ ],
51
+ "idealProps": {
52
+ "list": {
53
+ "type": "IArgvItem[]",
54
+ "description": "**受控形态的数据通道**。每项结构: `{ key: string, data: IDataGeneratorValue }`,其中 `IDataGeneratorValue = { dataType: 'string' | 'number' | 'boolean' | 'object', data: any }`。**与 onListChange 配对使用,无防抖**。如果同时传了 defaultValue,list 优先级更高(list 引用变化会覆盖)",
55
+ "shape": {
56
+ "key": "string — 参数名(显示在左侧 TextField)。允许空字符串,但 formatDataToObject 转对象时会被跳过",
57
+ "data": "IDataGeneratorValue — 参数值容器,含 dataType (类型选择器) + data (实际值,类型与 dataType 联动)"
58
+ }
59
+ },
60
+ "onListChange": {
61
+ "type": "(val: IArgvItem[]) => void",
62
+ "description": "**列表形态变化回调,无防抖**。每次按键 / 增删行 / 类型切换都立即触发。返回完整 IArgvItem[](保留空 key 项)。如果只想拿对象形态结果,用 onChange",
63
+ "pairsWith": "list"
64
+ },
65
+ "defaultValue": {
66
+ "type": "Record<string, any>",
67
+ "description": "**对象形态的初始值,非受控**。组件 mount 时 + 引用变化时(useEffect 依赖)灌入,父层用 setState 重新传相同引用不会重置(常见坑:误以为 defaultValue 是受控,见 commonMisconceptions.M1)。内部用 formatObjectToData 自动推断每个 value 的 dataType",
68
+ "controlled": false
69
+ },
70
+ "onChange": {
71
+ "type": "(val: Record<string, any>) => void",
72
+ "description": "**对象形态变化回调,内部 200ms 防抖**。返回值已经 formatDataToObject 转成普通对象(item.key 空的行被跳过, item.data 还原成对应 dataType 的原始值)。**适合保存到 state 但不适合做严格受控**(防抖期间输入和 state 不同步)",
73
+ "pairsWith": "defaultValue"
74
+ },
75
+ "errors": {
76
+ "type": "Record<string, string>[]",
77
+ "description": "**按 list 行索引对齐**(errors[0] 对应 list[0],以此类推)。**不是按 key 名映射**(常见误解,见 commonMisconceptions.M3)。每项结构 `{ key?: string, value?: string }`: `key` 字段填非空字符串时,该行左侧 TextField 红框 + 显示该字符串作为 helperText;`value` 字段填非空字符串时,该行右侧 DataGenerator 红框 + 显示该字符串。如不需要某行/某列显示错误就不填或填空字符串",
78
+ "shape": {
79
+ "[index].key": "string | undefined — 该行 key 列的错误文案(空字符串/undefined = 无错误)",
80
+ "[index].value": "string | undefined — 该行 value 列的错误文案"
81
+ },
82
+ "tip": "直接消费 checkArgvData(list, intl).detail 即可,无需手工拼装"
83
+ },
84
+ "disabled": {
85
+ "type": "boolean",
86
+ "default": false,
87
+ "description": "**整体禁用**:禁用所有 TextField + DataGenerator,屏蔽新增按钮(点击 add 时 early return)、屏蔽删除按钮(点击 del 时 early return)。不存在子字段单独禁用——若需更细颗粒度,改用底层 TextField + DataGenerator 自行编排"
88
+ },
89
+ "label": {
90
+ "type": "LabelProps['label']",
91
+ "description": "顶部标题文本(string 或 ReactNode)。不传时显示 i18n 默认值('环境变量' / 'Environment Variable')。注意这是顶层 label,**不是每行的 label**(每行只有 key/value 两个 TextField,无独立 label 位)"
92
+ },
93
+ "labelProps": {
94
+ "type": "LabelProps",
95
+ "description": "传给顶部 Label 组件的完整 props(覆盖默认 label),用于调整 required / tooltip / labelWidth 等。`label` 字段会被外层 label prop 覆盖(外层优先)"
96
+ },
97
+ "className": {
98
+ "type": "string",
99
+ "description": "外层 div 的 className"
100
+ },
101
+ "style": {
102
+ "type": "React.CSSProperties",
103
+ "description": "外层 div 的 style"
104
+ }
105
+ },
106
+ "commonMisconceptions": {
107
+ "M1": {
108
+ "wrong": "把 defaultValue 当受控 prop 用: `<Argv defaultValue={state} onChange={setState} />` 期望父层 setState 后 Argv 内部跟着更新",
109
+ "result": "defaultValue 只在引用变化时灌入,父层 setState 后 React 重渲传入新引用确实会重置——但**正在编辑的行会被清空**(useEffect 重跑 formatObjectToData),导致用户输入丢失",
110
+ "fix": "需要严格受控就用 **list + onListChange**(列表形态、受控、无防抖);只需保存最终结果用 defaultValue + onChange(对象形态、非受控、防抖)。**不要混用**"
111
+ },
112
+ "M2": {
113
+ "wrong": "想给 Argv 传 schema / argSchema 限制可选 key 列表或字段类型: `<Argv schema={...} />`",
114
+ "result": "Argv **不存在 schema / argSchema prop**——传入会被 TypeScript 直接报错。Argv 是自由键值对编辑器,没有内置 schema 约束",
115
+ "fix": "需要约束 key 白名单:在父层 onListChange 里过滤;需要约束 value 类型:Argv 内部已有 DataGenerator 让用户选 dataType(string/number/boolean/object);需要强 schema(必填 + 正则等):换用 FieldForm + FieldForm.Item rules"
116
+ },
117
+ "M3": {
118
+ "wrong": "errors 按 key 名映射: `errors={{ username: '必填', email: '格式错' }}` (Record<string,string>)",
119
+ "result": "类型不匹配——errors 是 `Record<string, string>[]` 数组,**按 list 行索引对齐**,不是按字段名映射。传错形态会导致 errors[index] 取值为 undefined,所有行都不显示错误",
120
+ "fix": "用 `errors={[{key: '', value: '必填'}, {key: '重复', value: ''}]}` 或直接 `errors={checkArgvData(list, intl).detail}`(detail 已经是正确形态)"
121
+ },
122
+ "M4": {
123
+ "wrong": "想用 `value` / `values` prop 做受控: `<Argv value={data} onChange={setData} />`",
124
+ "result": "Argv **无 value 也无 values prop**——TypeScript 报错。常见的受控套路在 Argv 上不直接成立",
125
+ "fix": "Argv 的受控通道叫 **list + onListChange**(命名上 list 替代了 value 角色,IArgvItem[] 替代了 普通对象)。如果父层数据是普通对象,可以在父层用 formatObjectToData / formatDataToObject 工具函数转换"
126
+ },
127
+ "M5": {
128
+ "wrong": "同时监听 onChange 和 onListChange 并期望它们的回调时机一致",
129
+ "result": "**onListChange 立即触发,onChange 防抖 200ms**——按键过程中两个 callback 看到的数据可能短暂不一致,且 onChange 收到的是对象形态(过滤了空 key 项),onListChange 收到的是列表形态(保留全部)",
130
+ "fix": "通常只监听一个:严格受控用 onListChange,只关心最终对象结果用 onChange。如必须两个都监听,理解 200ms 时差是预期行为"
131
+ }
132
+ },
133
+ "completeExample": "// 标准用法:list 受控模式 + errors 校验\nimport React, { useState, useMemo } from 'react';\nimport Argv, { IArgvItem, checkArgvData } from '@para-ui/core/Argv';\nimport useFormatMessage from '@para-ui/core/GlobalContext/useFormatMessage';\n\nconst Demo: React.FC = () => {\n const [list, setList] = useState<IArgvItem[]>([\n { key: 'NODE_ENV', data: { dataType: 'string', data: 'production' } },\n { key: 'PORT', data: { dataType: 'number', data: 3000 } },\n { key: 'DEBUG', data: { dataType: 'boolean', data: false } }\n ]);\n const intl = useFormatMessage('Argv');\n // 校验:返回 { error: boolean, detail: errors 形态 }\n const validation = useMemo(() => checkArgvData(list, intl), [list, intl]);\n return (\n <div>\n <Argv\n label='环境变量配置'\n list={list}\n onListChange={setList}\n errors={validation.detail}\n />\n <button disabled={validation.error}>保存</button>\n </div>\n );\n};\nexport default Demo;",
134
+ "utilities": {
135
+ "formatObjectToData": {
136
+ "import": "import { formatObjectToData } from '@para-ui/core/Argv';",
137
+ "signature": "(data: Record<string, any>) => IArgvItem[]",
138
+ "purpose": "把普通对象转成 IArgvItem[](自动推断 dataType)。父层有对象形态数据但想用 list 受控通道时用"
139
+ },
140
+ "formatDataToObject": {
141
+ "import": "import { formatDataToObject } from '@para-ui/core/Argv';",
142
+ "signature": "(data: IArgvItem[]) => Record<string, any>",
143
+ "purpose": "把 IArgvItem[] 转回普通对象(跳过空 key,还原 dataType)。保存到后端时用"
144
+ },
145
+ "checkArgvData": {
146
+ "import": "import { checkArgvData } from '@para-ui/core/Argv';",
147
+ "signature": "(data: IArgvItem[], intl: Function) => { error: boolean, detail: Record<string,string>[] }",
148
+ "purpose": "内置校验:每行 key 非空 + value 格式正确。detail 可以直接喂给 errors prop"
149
+ }
150
+ },
151
+ "do": [
152
+ "需要严格受控(中途插队 / 实时同步):用 **list + onListChange**(列表形态、无防抖)",
153
+ "只需保存最终结果到父层 state:用 **defaultValue + onChange**(对象形态、200ms 防抖)",
154
+ "errors 直接消费 **checkArgvData(list, intl).detail**,无需手工拼装",
155
+ "保存到后端前用 **formatDataToObject(list)** 转成对象形态",
156
+ "理解'对象 ⇄ 列表'两套通道是平级且独立的,不要混用"
157
+ ],
158
+ "dont": [
159
+ "**不要**给 Argv 传 schema / argSchema / value / values prop——这些都不存在(见 commonMisconceptions M2/M4)",
160
+ "**不要**把 defaultValue 当受控 prop 用——会导致编辑过程中数据被清空(M1)",
161
+ "**不要**按 key 名映射 errors——errors 按行索引对齐(M3)",
162
+ "**不要**期望 onChange 和 onListChange 时机一致——前者有 200ms 防抖(M5)",
163
+ "参数过多(>10 行)不分组用同一个 Argv——考虑分多个 Argv 或换 FieldForm"
164
+ ],
165
+ "events": {
166
+ "onChange": {
167
+ "signature": "(val: Record<string, any>) => void",
168
+ "asyncSupported": false,
169
+ "examples": [
170
+ "对象形态回调,内部 200ms 防抖,适合保存到 state 但不适合严格受控",
171
+ "返回值已经 formatDataToObject 转换,跳过空 key 项,还原 dataType 原始值",
172
+ "async 场景可直接 await 包裹:const save = async (val) => { await api.save(val); setDirty(false); }"
173
+ ],
174
+ "commonMistakes": [
175
+ "期望 onChange 和 onListChange 在同一帧触发——onChange 有 200ms 防抖,onListChange 立即触发,两者不同步",
176
+ "期望 onChange 回传 IArgvItem[] 列表形态——onChange 返回普通对象 Record<string,any>,要列表形态用 onListChange",
177
+ "把 onChange 当受控 prop 配合 defaultValue 用——defaultValue 非受控,引用不变不触发重置,严格受控用 list+onListChange"
178
+ ]
179
+ },
180
+ "onListChange": {
181
+ "signature": "(val: IArgvItem[]) => void",
182
+ "asyncSupported": false,
183
+ "examples": [
184
+ "每次按键 / 增删行 / 类型切换立即触发,无防抖,适合严格受控场景",
185
+ "返回完整 IArgvItem[](保留空 key 行),可直接回传给 list prop 实现受控循环",
186
+ "结合 checkArgvData 做实时校验:onListChange={val => { setList(val); setErrors(checkArgvData(val, intl).detail); }}"
187
+ ],
188
+ "commonMistakes": [
189
+ "期望 onListChange 返回对象形态——它返回 IArgvItem[],要对象形态用 onChange 或 formatDataToObject",
190
+ "onListChange 频率比 onChange 高,如果 handler 有重计算逻辑应加 useMemo/useCallback 避免性能问题",
191
+ "同时传 list 和 defaultValue 但期望 onListChange 只触发一次——list 引用变化会触发,defaultValue 也会灌入,两套通道独立"
192
+ ]
193
+ }
194
+ },
195
+ "typescriptPitfalls": [
196
+ {
197
+ "issue": "errors prop 是按行索引对齐的数组,不是按 key 名映射的对象",
198
+ "wrong": "// 错误:按字段名映射\n<Argv errors={{ NODE_ENV: '必填', PORT: '格式错' }} /> // TS 类型报错:期望数组",
199
+ "right": "// 正确:按 list 行索引对齐\n<Argv errors={[{ key: '', value: '必填' }, { key: '重复', value: '' }]} />\n// 或直接消费 checkArgvData 结果\n<Argv errors={checkArgvData(list, intl).detail} />"
200
+ },
201
+ {
202
+ "issue": "Argv 无 value / values prop,受控通道叫 list + onListChange",
203
+ "wrong": "// antd/MUI 风格受控写法\n<Argv value={data} onChange={setData} /> // TS 报错:value 不在 ArgvProps",
204
+ "right": "// para-ui Argv 受控写法\n<Argv list={list} onListChange={setList} />"
205
+ },
206
+ {
207
+ "issue": "IArgvItem.data.dataType 是字符串联合类型,不能传任意字符串",
208
+ "wrong": "const item: IArgvItem = { key: 'PORT', data: { dataType: 'int', data: 3000 } }; // 'int' 不在联合类型",
209
+ "right": "const item: IArgvItem = { key: 'PORT', data: { dataType: 'number', data: 3000 } }; // 只有 'string'|'number'|'boolean'|'object'"
210
+ }
211
+ ],
212
+ "mapping": {
213
+ "realComponent": "Argv",
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 n=require("../../_virtual/jsx-runtime.js"),u=require("react"),N=require("../../TextField/index.js"),M=require("../../Select/index.js"),y=require("./config.js"),D=require("../../node_modules/@para-ui/icons/ExpandPart/index.js"),w=require("../../InputNumber/index.js"),G=require("../../Modal/index.js"),I=require("../../Message/index.js"),_=require("../../GlobalContext/useFormatMessage.js"),O=require("../lang/index.js"),F=require("@paraview/lib");;/* empty css */const J=e=>{const{defaultValue:i,value:t,disabled:o,onChange:d,error:p,helperText:f,placeholderTextField:T}=e,E=_.default("Argv",O.default),[s,x]=u.useState({dataType:"string",data:""}),[S,m]=u.useState(!1),[g,j]=u.useState(""),v=u.useRef({dataMapping:{...y.defaultInputValueMapping},uuid:F.UUID()});u.useEffect(()=>{i!==void 0&&x(i)},[]),u.useEffect(()=>{t!==void 0&&x(t)},[t]);const q=a=>{const r=a;if(r!==s.dataType){const h=v.current.dataMapping[r]??"",b={...s,dataType:r,data:h};x(b),d&&d(b)}},c=a=>{const r={...s,data:a};x(r),d&&d(r);const l=s.dataType,h=v.current.dataMapping;h[l]=a},C=u.useMemo(()=>{const{dataType:a,data:r}=s;if(a==="number"){const l=Number(r);return n.jsxRuntimeExports.jsx(w.InputNumber,{placeholder:T,disabled:o,className:"data-input",value:l,onChange:c,error:p,helperText:f})}return a==="boolean"?n.jsxRuntimeExports.jsx(M.default,{disabled:o,className:"data-input",list:y.booleanSelectList,value:r,onChange:c,error:p,helperText:f}):n.jsxRuntimeExports.jsx(N.TextField,{placeholder:T,className:"data-input",multiline:!0,value:r,rightIcon:n.jsxRuntimeExports.jsx(D.ExpandPart,{}),onClickIcon:()=>{m(!0),j(r)},onChange:l=>c(l.target.value),rows:1,resize:!1,error:p,helperText:f})},[s,c,p,f]),R=()=>{if(s.dataType==="string"&&(c(g),m(!1)),s.dataType==="object")try{const a=JSON.parse(g);c(g),m(!1)}catch{I.Message.warn(E("formatErrorJson"))}};return n.jsxRuntimeExports.jsxs("div",{className:"argv-data-generator",children:[n.jsxRuntimeExports.jsxs("div",{className:"data-generator-content",children:[n.jsxRuntimeExports.jsx(M.default,{disabled:o,className:"datatype-select",list:y.dataTypeSelectList,value:s?.dataType,onChange:q}),C]}),n.jsxRuntimeExports.jsx(G.Modal,{open:S,hideHeader:!0,size:"auto",onCancel:()=>m(!1),onOk:R,children:n.jsxRuntimeExports.jsx("div",{style:{width:"600px",height:"auto",paddingTop:"20px"},children:n.jsxRuntimeExports.jsx(N.TextField,{disabled:o,multiline:!0,rows:12,value:g||"",onChange:a=>j(a.target.value)})})})]})},V=e=>{const{dataType:i,data:t}=e;switch(i){case"number":return!isNaN(Number(t));case"boolean":return!0;case"string":return!0;case"object":try{return JSON.parse(t),!0}catch{return!1}default:return!1}},k=e=>{if(!e)return"";const{dataType:i,data:t}=e;switch(i){case"number":return Number(t);case"boolean":return!!t;case"string":return t;case"object":try{return JSON.parse(t)}catch{return{}}default:return t}},$=e=>typeof e=="number"?{dataType:"number",data:e}:typeof e=="boolean"?{dataType:"boolean",data:e}:typeof e=="string"?{dataType:"string",data:e}:typeof e=="object"?{dataType:"object",data:JSON.stringify(e)}:{dataType:"string",data:""};exports.checkGeneratorData=V;exports.default=J;exports.formatDataToGenerator=$;exports.formatGeneratorToData=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const n=require("../../_virtual/jsx-runtime.js"),u=require("react"),N=require("../../TextField/index.js"),M=require("../../Select/index.js"),y=require("./config.js"),D=require("../../node_modules/@para-ui/icons/ExpandPart/index.js"),w=require("../../InputNumber/index.js"),G=require("../../Modal/index.js"),I=require("../../Message/index.js"),_=require("../../GlobalContext/useFormatMessage.js"),O=require("../lang/index.js"),F=require("@snack-kit/lib");;/* empty css */const J=e=>{const{defaultValue:i,value:t,disabled:o,onChange:d,error:p,helperText:f,placeholderTextField:T}=e,E=_.default("Argv",O.default),[s,x]=u.useState({dataType:"string",data:""}),[S,m]=u.useState(!1),[g,j]=u.useState(""),b=u.useRef({dataMapping:{...y.defaultInputValueMapping},uuid:F.UUID()});u.useEffect(()=>{i!==void 0&&x(i)},[]),u.useEffect(()=>{t!==void 0&&x(t)},[t]);const q=a=>{const r=a;if(r!==s.dataType){const h=b.current.dataMapping[r]??"",v={...s,dataType:r,data:h};x(v),d&&d(v)}},c=a=>{const r={...s,data:a};x(r),d&&d(r);const l=s.dataType,h=b.current.dataMapping;h[l]=a},C=u.useMemo(()=>{const{dataType:a,data:r}=s;if(a==="number"){const l=Number(r);return n.jsxRuntimeExports.jsx(w.InputNumber,{placeholder:T,disabled:o,className:"data-input",value:l,onChange:c,error:p,helperText:f})}return a==="boolean"?n.jsxRuntimeExports.jsx(M.default,{disabled:o,className:"data-input",list:y.booleanSelectList,value:r,onChange:c,error:p,helperText:f}):n.jsxRuntimeExports.jsx(N.TextField,{placeholder:T,className:"data-input",multiline:!0,value:r,rightIcon:n.jsxRuntimeExports.jsx(D.ExpandPart,{}),onClickIcon:()=>{m(!0),j(r)},onChange:l=>c(l.target.value),rows:1,resize:!1,error:p,helperText:f})},[s,c,p,f]),R=()=>{if(s.dataType==="string"&&(c(g),m(!1)),s.dataType==="object")try{const a=JSON.parse(g);c(g),m(!1)}catch{I.Message.warn(E("formatErrorJson"))}};return n.jsxRuntimeExports.jsxs("div",{className:"argv-data-generator",children:[n.jsxRuntimeExports.jsxs("div",{className:"data-generator-content",children:[n.jsxRuntimeExports.jsx(M.default,{disabled:o,className:"datatype-select",list:y.dataTypeSelectList,value:s?.dataType,onChange:q}),C]}),n.jsxRuntimeExports.jsx(G.Modal,{open:S,hideHeader:!0,size:"auto",onCancel:()=>m(!1),onOk:R,children:n.jsxRuntimeExports.jsx("div",{style:{width:"600px",height:"auto",paddingTop:"20px"},children:n.jsxRuntimeExports.jsx(N.TextField,{disabled:o,multiline:!0,rows:12,value:g||"",onChange:a=>j(a.target.value)})})})]})},V=e=>{const{dataType:i,data:t}=e;switch(i){case"number":return!isNaN(Number(t));case"boolean":return!0;case"string":return!0;case"object":try{return JSON.parse(t),!0}catch{return!1}default:return!1}},k=e=>{if(!e)return"";const{dataType:i,data:t}=e;switch(i){case"number":return Number(t);case"boolean":return!!t;case"string":return t;case"object":try{return JSON.parse(t)}catch{return{}}default:return t}},z=e=>typeof e=="number"?{dataType:"number",data:e}:typeof e=="boolean"?{dataType:"boolean",data:e}:typeof e=="string"?{dataType:"string",data:e}:typeof e=="object"?{dataType:"object",data:JSON.stringify(e)}:{dataType:"string",data:""};exports.checkGeneratorData=V;exports.default=J;exports.formatDataToGenerator=z;exports.formatGeneratorToData=k;
2
2
  //# sourceMappingURL=index.js.map