@para-ui/core 5.0.0-beta.9 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (730) hide show
  1. package/AGENTS.md +315 -0
  2. package/AlignBox/component.json +89 -0
  3. package/Anchor/component.json +130 -0
  4. package/Argv/component.json +216 -0
  5. package/AutoBox/component.json +133 -0
  6. package/AutoButton/component.json +109 -0
  7. package/AutoTips/component.json +121 -0
  8. package/Badge/component.json +92 -0
  9. package/Breadcrumbs/component.json +142 -0
  10. package/Button/component.json +168 -0
  11. package/ButtonGroup/component.json +132 -0
  12. package/Card/component.json +162 -0
  13. package/Carousel/component.json +142 -0
  14. package/Cascader/component.json +196 -0
  15. package/Checkbox/component.json +138 -0
  16. package/CheckboxGroup/component.json +152 -0
  17. package/CodeEditor/component.json +189 -0
  18. package/Collapse/component.json +166 -0
  19. package/CollapseBox/component.json +84 -0
  20. package/CollapseLayout/component.json +155 -0
  21. package/ColorPicker/component.json +142 -0
  22. package/ComboSelect/component.json +181 -0
  23. package/Container/component.json +111 -0
  24. package/ContentBox/component.json +81 -0
  25. package/CopyText/component.json +118 -0
  26. package/CycleSelector/component.json +98 -0
  27. package/DatePicker/component.json +192 -0
  28. package/Descriptions/component.json +142 -0
  29. package/Desktop/component.json +171 -0
  30. package/DragVerify/component.json +114 -0
  31. package/Drawer/component.json +200 -0
  32. package/Dropdown/component.json +147 -0
  33. package/DynamicMultiBox/component.json +278 -0
  34. package/Empty/component.json +123 -0
  35. package/ExpressionInput/component.json +79 -0
  36. package/FieldForm/component.json +196 -0
  37. package/Form/component.json +161 -0
  38. package/FormItem/component.json +171 -0
  39. package/FunctionModal/component.json +197 -0
  40. package/Help/component.json +118 -0
  41. package/HelperText/component.json +126 -0
  42. package/Image/component.json +165 -0
  43. package/InputCode/component.json +191 -0
  44. package/InputLang/component.json +205 -0
  45. package/InputNumber/component.json +162 -0
  46. package/Label/component.json +126 -0
  47. package/Loading/component.json +91 -0
  48. package/Menu/component.json +180 -0
  49. package/Message/component.json +246 -0
  50. package/Modal/component.json +277 -0
  51. package/MultiBox/component.json +216 -0
  52. package/Notification/component.json +184 -0
  53. package/OperateBtn/component.json +134 -0
  54. package/PageHeader/component.json +112 -0
  55. package/Pagination/component.json +181 -0
  56. package/PasswordRules/component.json +105 -0
  57. package/PopConfirm/component.json +227 -0
  58. package/PopMenu/component.json +131 -0
  59. package/Popover/component.json +165 -0
  60. package/Progress/component.json +161 -0
  61. package/Prompt/component.json +144 -0
  62. package/Querying/component.json +96 -0
  63. package/QuickReply/component.json +129 -0
  64. package/Radio/component.json +136 -0
  65. package/RadioGroup/component.json +149 -0
  66. package/RangeInput/component.json +198 -0
  67. package/Result/component.json +104 -0
  68. package/ScrollBar/component.json +115 -0
  69. package/Search/component.json +177 -0
  70. package/Select/component.json +244 -0
  71. package/SelectInput/component.json +184 -0
  72. package/Selector/component.json +203 -0
  73. package/SelectorPicker/component.json +179 -0
  74. package/SingleBox/component.json +151 -0
  75. package/Slider/component.json +181 -0
  76. package/SortBox/component.json +108 -0
  77. package/Status/component.json +104 -0
  78. package/Stepper/component.json +129 -0
  79. package/Switch/component.json +207 -0
  80. package/Table/component.json +547 -0
  81. package/Tabs/component.json +227 -0
  82. package/Tag/component.json +221 -0
  83. package/TextEditor/component.json +186 -0
  84. package/TextField/component.json +290 -0
  85. package/TimePicker/component.json +176 -0
  86. package/Timeline/component.json +110 -0
  87. package/Title/component.json +156 -0
  88. package/ToggleButton/component.json +153 -0
  89. package/Tooltip/component.json +176 -0
  90. package/Transfer/component.json +157 -0
  91. package/Tree/component.json +512 -0
  92. package/Upload/component.json +450 -0
  93. package/ai-workflows/01-crud-list-multi-drawer.md +278 -0
  94. package/ai-workflows/02-rbac-operation-buttons.md +290 -0
  95. package/ai-workflows/03-complex-form-async-cascade.md +350 -0
  96. package/ai-workflows/04-array-field-form.md +281 -0
  97. package/ai-workflows/05-popconfirm-async-message-queue.md +333 -0
  98. package/ai-workflows/06-modal-drawer-form-workflow.md +385 -0
  99. package/ai-workflows/07-search-filter-table-trio.md +387 -0
  100. package/ai-workflows/08-table-advanced-features.md +365 -0
  101. package/ai-workflows/09-batch-operation-export-progress.md +367 -0
  102. package/ai-workflows/10-cross-component-state-coordination.md +412 -0
  103. package/es/AlignBox/component.json +89 -0
  104. package/es/AlignBox/index.css +1 -1
  105. package/es/AlignBox/index.d.ts +6 -2
  106. package/es/AlignBox/index.js +1 -1
  107. package/es/AlignBox/style/index.css +1 -1
  108. package/es/Anchor/anchorMenu/index.d.ts +2 -1
  109. package/es/Anchor/anchorMenu/index.js +36 -33
  110. package/es/Anchor/component.json +130 -0
  111. package/es/Anchor/index.js +52 -49
  112. package/es/Anchor/type.d.ts +8 -4
  113. package/es/Argv/batchEdit/index.js +1 -1
  114. package/es/Argv/component.json +216 -0
  115. package/es/Argv/dataGenerator/index.js +1 -1
  116. package/es/Argv/index.d.ts +5 -6
  117. package/es/Argv/index.js +1 -1
  118. package/es/AutoBox/component.json +133 -0
  119. package/es/AutoBox/index.d.ts +3 -3
  120. package/es/AutoBox/index.js +1 -1
  121. package/es/AutoBox/protal.d.ts +2 -2
  122. package/es/AutoBox/protal.js +33 -30
  123. package/es/AutoButton/component.json +109 -0
  124. package/es/AutoButton/index.js +1 -1
  125. package/es/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  126. package/es/AutoTips/autoTipsMultiline/index.js +1 -1
  127. package/es/AutoTips/component.json +121 -0
  128. package/es/AutoTips/index.js +1 -1
  129. package/es/Badge/component.json +92 -0
  130. package/es/Breadcrumbs/component.json +142 -0
  131. package/es/Breadcrumbs/index.js +1 -1
  132. package/es/Button/SplitButton.d.ts +2 -2
  133. package/es/Button/component.json +168 -0
  134. package/es/Button/index.js +44 -44
  135. package/es/ButtonGroup/component.json +132 -0
  136. package/es/ButtonGroup/index.d.ts +1 -1
  137. package/es/Card/component.json +162 -0
  138. package/es/Card/index.d.ts +2 -2
  139. package/es/Card/index.js +2 -2
  140. package/es/Carousel/component.json +142 -0
  141. package/es/Carousel/index.d.ts +1 -1
  142. package/es/Cascader/Cascader.js +1 -1
  143. package/es/Cascader/OptionList/Column.js +1 -1
  144. package/es/Cascader/OptionList/index.js +1 -1
  145. package/es/Cascader/component.json +196 -0
  146. package/es/Cascader/hooks/useEntities.js +7 -7
  147. package/es/Cascader/interface.d.ts +1 -0
  148. package/es/Cascader/utils/commonUtil.d.ts +1 -1
  149. package/es/Cascader/utils/commonUtil.js +16 -16
  150. package/es/Cascader/utils/treeUtil.d.ts +14 -5
  151. package/es/Cascader/utils/treeUtil.js +1 -1
  152. package/es/Checkbox/component.json +138 -0
  153. package/es/CheckboxGroup/component.json +152 -0
  154. package/es/CheckboxGroup/index.js +1 -1
  155. package/es/CodeEditor/component.json +189 -0
  156. package/es/CodeEditor/index.d.ts +11 -10
  157. package/es/CodeEditor/index.js +25 -25
  158. package/es/Collapse/component.json +166 -0
  159. package/es/Collapse/index.d.ts +1 -1
  160. package/es/Collapse/index.js +23 -22
  161. package/es/CollapseBox/component.json +84 -0
  162. package/es/CollapseLayout/component.json +155 -0
  163. package/es/ColorPicker/component.json +142 -0
  164. package/es/ComboSelect/component.json +181 -0
  165. package/es/ComboSelect/index.js +115 -109
  166. package/es/ComboSelect/interface.d.ts +2 -2
  167. package/es/ComboSelect/utils.d.ts +3 -3
  168. package/es/ComboSelect/utils.js +1 -1
  169. package/es/Container/component.json +111 -0
  170. package/es/ContentBox/component.json +81 -0
  171. package/es/CopyText/component.json +118 -0
  172. package/es/CycleSelector/component.json +98 -0
  173. package/es/CycleSelector/index.js +14 -13
  174. package/es/DatePicker/component.json +192 -0
  175. package/es/DatePicker/generatePicker/generateRangePicker.js +11 -11
  176. package/es/DatePicker/generatePicker/generateSinglePicker.js +2 -2
  177. package/es/Descriptions/component.json +142 -0
  178. package/es/Descriptions/index.d.ts +1 -1
  179. package/es/Desktop/component.json +171 -0
  180. package/es/Desktop/index.js +1 -1
  181. package/es/DragVerify/component.json +114 -0
  182. package/es/DragVerify/index.js +19 -19
  183. package/es/Drawer/component.json +200 -0
  184. package/es/Drawer/index.js +86 -86
  185. package/es/Drawer/interface.d.ts +1 -1
  186. package/es/Drawer/util.d.ts +1 -6
  187. package/es/Drawer/util.js +9 -6
  188. package/es/Dropdown/component.json +147 -0
  189. package/es/Dropdown/index.js +1 -1
  190. package/es/DynamicMultiBox/component.json +278 -0
  191. package/es/DynamicMultiBox/formItem.d.ts +1 -1
  192. package/es/DynamicMultiBox/index.js +1 -1
  193. package/es/DynamicMultiBox/rowForm.d.ts +2 -2
  194. package/es/Empty/component.json +123 -0
  195. package/es/Empty/index.css +1 -1
  196. package/es/Empty/index.d.ts +2 -2
  197. package/es/Empty/index.js +27 -26
  198. package/es/Empty/style/index.css +1 -1
  199. package/es/ExpressionInput/HighlightOverlay.d.ts +8 -0
  200. package/es/ExpressionInput/HighlightOverlay.js +27 -0
  201. package/es/ExpressionInput/Popup.d.ts +19 -0
  202. package/es/ExpressionInput/Popup.js +93 -0
  203. package/es/ExpressionInput/component.json +79 -0
  204. package/es/ExpressionInput/detectChainAtCursor.d.ts +17 -0
  205. package/es/ExpressionInput/detectChainAtCursor.js +31 -0
  206. package/es/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
  207. package/es/ExpressionInput/filterCandidatesByPartial.js +15 -0
  208. package/es/ExpressionInput/highlightSegments.d.ts +9 -0
  209. package/es/ExpressionInput/highlightSegments.js +14 -0
  210. package/es/ExpressionInput/index.css +1 -0
  211. package/es/ExpressionInput/index.d.ts +5 -0
  212. package/es/ExpressionInput/index.js +178 -0
  213. package/es/ExpressionInput/interface.d.ts +52 -0
  214. package/es/ExpressionInput/isExpressionValue.d.ts +5 -0
  215. package/es/ExpressionInput/isExpressionValue.js +18 -0
  216. package/es/ExpressionInput/lang/en_US.d.ts +4 -0
  217. package/es/ExpressionInput/lang/en_US.js +7 -0
  218. package/es/ExpressionInput/lang/index.d.ts +9 -0
  219. package/es/ExpressionInput/lang/index.js +10 -0
  220. package/es/ExpressionInput/lang/zh_CN.d.ts +4 -0
  221. package/es/ExpressionInput/lang/zh_CN.js +7 -0
  222. package/es/ExpressionInput/style/css.js +1 -0
  223. package/es/ExpressionInput/style/index.css +1 -0
  224. package/es/ExpressionInput/style/index.js +1 -0
  225. package/es/ExpressionInput/useExpressionInput.d.ts +26 -0
  226. package/es/ExpressionInput/useExpressionInput.js +59 -0
  227. package/es/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  228. package/es/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  229. package/es/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  230. package/es/FieldForm/FieldFormItem/index.d.ts +6 -6
  231. package/es/FieldForm/Form.d.ts +2 -2
  232. package/es/FieldForm/Form.js +1 -1
  233. package/es/FieldForm/FormItemInput.js +1 -1
  234. package/es/FieldForm/FormItemLabel.js +1 -1
  235. package/es/FieldForm/FormList.d.ts +2 -2
  236. package/es/FieldForm/component.json +196 -0
  237. package/es/FieldForm/context.d.ts +5 -1
  238. package/es/FieldForm/context.js +2 -2
  239. package/es/FieldForm/hooks/useForm.d.ts +4 -3
  240. package/es/FieldForm/hooks/useFormInstance.d.ts +1 -1
  241. package/es/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  242. package/es/FieldForm/hooks/useFormItemStatus.js +2 -2
  243. package/es/FieldForm/hooks/useItemRef.d.ts +1 -1
  244. package/es/FieldForm/hooks/useItemRef.js +6 -6
  245. package/es/Form/component.json +161 -0
  246. package/es/Form/index.d.ts +52 -49
  247. package/es/Form/index.js +1 -1
  248. package/es/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  249. package/es/FormItem/compoments/defaultCompoments/index.js +12 -11
  250. package/es/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  251. package/es/FormItem/compoments/formFile/index.js +8 -8
  252. package/es/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  253. package/es/FormItem/compoments/formSelect/index.d.ts +1 -1
  254. package/es/FormItem/component.json +171 -0
  255. package/es/FormItem/index.d.ts +5 -5
  256. package/es/FormItem/index.js +23 -23
  257. package/es/FormItem/itemType.js +1 -1
  258. package/es/FunctionModal/component.json +197 -0
  259. package/es/FunctionModal/dialog.d.ts +1 -1
  260. package/es/FunctionModal/modalContext.d.ts +4 -1
  261. package/es/GlobalContext/confirmLocale.js +1 -1
  262. package/es/GlobalContext/index.js +1 -1
  263. package/es/Help/component.json +118 -0
  264. package/es/HelperText/component.json +126 -0
  265. package/es/Image/PreviewGroup.js +1 -1
  266. package/es/Image/component.json +165 -0
  267. package/es/Image/index.js +1 -1
  268. package/es/InputCode/component.json +191 -0
  269. package/es/InputCode/index.d.ts +2 -2
  270. package/es/InputCode/index.js +1 -1
  271. package/es/InputLang/component.json +205 -0
  272. package/es/InputLang/index.js +2 -2
  273. package/es/InputNumber/component.json +162 -0
  274. package/es/InputNumber/index.d.ts +13 -7
  275. package/es/InputNumber/index.js +152 -144
  276. package/es/Label/component.json +126 -0
  277. package/es/Label/index.d.ts +2 -2
  278. package/es/Loading/component.json +91 -0
  279. package/es/Menu/component.json +180 -0
  280. package/es/Menu/verticalMenuList.js +1 -1
  281. package/es/Message/component.json +246 -0
  282. package/es/Message/index.d.ts +2 -2
  283. package/es/Message/index.js +19 -19
  284. package/es/Modal/Confirm/index.d.ts +1 -1
  285. package/es/Modal/Confirm/index.js +1 -1
  286. package/es/Modal/component.json +277 -0
  287. package/es/Modal/index.d.ts +85 -5
  288. package/es/Modal/index.js +159 -122
  289. package/es/Modal/interface.d.ts +1 -0
  290. package/es/MultiBox/component.json +216 -0
  291. package/es/MultiBox/index.js +19 -14
  292. package/es/Notification/component.json +184 -0
  293. package/es/OperateBtn/component.json +134 -0
  294. package/es/OperateBtn/index.d.ts +3 -3
  295. package/es/PageHeader/component.json +112 -0
  296. package/es/PageHeader/horizontalMeun.js +1 -1
  297. package/es/PageHeader/horizontalMeunRight.js +1 -1
  298. package/es/Pagination/component.json +181 -0
  299. package/es/Pagination/index.js +15 -15
  300. package/es/ParauiProvider/index.js +1 -1
  301. package/es/PasswordRules/component.json +105 -0
  302. package/es/PasswordRules/index.d.ts +4 -4
  303. package/es/PopConfirm/component.json +227 -0
  304. package/es/PopConfirm/index.d.ts +1 -1
  305. package/es/PopConfirm/index.js +1 -1
  306. package/es/PopMenu/component.json +131 -0
  307. package/es/PopMenu/hooks.d.ts +1 -1
  308. package/es/PopMenu/index.js +8 -8
  309. package/es/Popover/component.json +165 -0
  310. package/es/Popover/index.js +1 -1
  311. package/es/Progress/component.json +161 -0
  312. package/es/Prompt/component.json +144 -0
  313. package/es/Querying/component.json +96 -0
  314. package/es/Querying/index.css +1 -1
  315. package/es/Querying/index.d.ts +2 -2
  316. package/es/Querying/index.js +20 -19
  317. package/es/Querying/style/index.css +1 -1
  318. package/es/QuickReply/QuickReplyCode/index.js +1 -1
  319. package/es/QuickReply/component.json +129 -0
  320. package/es/QuickReply/index.d.ts +1 -1
  321. package/es/Radio/component.json +136 -0
  322. package/es/RadioGroup/component.json +149 -0
  323. package/es/RangeInput/component.json +198 -0
  324. package/es/RangeInput/index.d.ts +15 -7
  325. package/es/RangeInput/index.js +120 -103
  326. package/es/Result/component.json +104 -0
  327. package/es/ScrollBar/component.json +115 -0
  328. package/es/Search/component.json +177 -0
  329. package/es/Search/index.d.ts +1 -1
  330. package/es/Select/component.json +244 -0
  331. package/es/Select/index.d.ts +11 -8
  332. package/es/Select/index.js +441 -438
  333. package/es/SelectInput/component.json +184 -0
  334. package/es/SelectInput/index.d.ts +4 -4
  335. package/es/SelectInput/index.js +8 -8
  336. package/es/Selector/component.json +203 -0
  337. package/es/Selector/index.js +56 -50
  338. package/es/Selector/interface.d.ts +2 -2
  339. package/es/Selector/selectorData/index.js +1 -1
  340. package/es/Selector/selectorMain/index.js +3 -3
  341. package/es/Selector/selectorNode/index.js +1 -1
  342. package/es/Selector/util.d.ts +3 -3
  343. package/es/Selector/util.js +6 -12
  344. package/es/SelectorPicker/component.json +179 -0
  345. package/es/SelectorPicker/index.d.ts +5 -5
  346. package/es/SelectorPicker/index.js +15 -15
  347. package/es/SingleBox/component.json +151 -0
  348. package/es/SingleBox/index.d.ts +2 -2
  349. package/es/Slider/component.json +181 -0
  350. package/es/SortBox/component.json +108 -0
  351. package/es/Status/component.json +104 -0
  352. package/es/Stepper/component.json +129 -0
  353. package/es/Stepper/index.d.ts +2 -2
  354. package/es/Switch/component.json +207 -0
  355. package/es/Switch/index.css +1 -1
  356. package/es/Switch/index.d.ts +3 -2
  357. package/es/Switch/index.js +60 -59
  358. package/es/Switch/style/index.css +1 -1
  359. package/es/Table/component.json +547 -0
  360. package/es/Table/index.d.ts +2 -2
  361. package/es/Table/index.js +385 -382
  362. package/es/Table/interface.d.ts +30 -0
  363. package/es/Table/tableHead.js +1 -1
  364. package/es/Table/util.d.ts +1 -1
  365. package/es/Table/util.js +3 -12
  366. package/es/Tabs/component.json +227 -0
  367. package/es/Tag/component.json +221 -0
  368. package/es/Tag/index.css +1 -1
  369. package/es/Tag/index.d.ts +1 -1
  370. package/es/Tag/index.js +20 -20
  371. package/es/Tag/style/index.css +1 -1
  372. package/es/TextEditor/component.json +186 -0
  373. package/es/TextEditor/index.d.ts +5 -5
  374. package/es/TextEditor/index.js +1 -1
  375. package/es/TextField/component.json +290 -0
  376. package/es/TextField/index.d.ts +2 -2
  377. package/es/TextField/index.js +1 -1
  378. package/es/TimePicker/component.json +176 -0
  379. package/es/Timeline/component.json +110 -0
  380. package/es/Title/component.json +156 -0
  381. package/es/ToggleButton/component.json +153 -0
  382. package/es/ToggleButton/index.js +1 -1
  383. package/es/Tooltip/component.json +176 -0
  384. package/es/Tooltip/index.js +58 -53
  385. package/es/Tooltip/interface.d.ts +14 -1
  386. package/es/Tooltip/utils.js +6 -6
  387. package/es/Transfer/component.json +157 -0
  388. package/es/Tree/OperateBar/index.js +1 -1
  389. package/es/Tree/Tree.js +3 -3
  390. package/es/Tree/component.json +512 -0
  391. package/es/Tree/interface.d.ts +1 -1
  392. package/es/Upload/component.json +450 -0
  393. package/es/Upload/util.js +1 -1
  394. package/es/Utils/snack-kit-shims.d.ts +18 -0
  395. package/es/Utils/snack-kit-shims.js +19 -0
  396. package/es/Utils/type.d.ts +0 -6
  397. package/es/_virtual/index.js +5 -3
  398. package/es/_virtual/index2.js +2 -5
  399. package/es/index.d.ts +4 -0
  400. package/es/index.js +152 -150
  401. package/es/locale/en-US.d.ts +3 -0
  402. package/es/locale/en-US.js +3 -0
  403. package/es/locale/en_US.d.ts +361 -0
  404. package/es/locale/en_US.js +364 -0
  405. package/es/locale/index.d.ts +1 -723
  406. package/es/locale/index2.js +10 -0
  407. package/es/locale/zh-CN.d.ts +3 -0
  408. package/es/locale/zh-CN.js +3 -0
  409. package/es/locale/zh_CN.d.ts +361 -0
  410. package/es/locale/zh_CN.js +364 -0
  411. package/es/node_modules/classnames/index.js +1 -1
  412. package/lib/AlignBox/component.json +89 -0
  413. package/lib/AlignBox/index.css +1 -1
  414. package/lib/AlignBox/index.d.ts +6 -2
  415. package/lib/AlignBox/index.js +1 -1
  416. package/lib/AlignBox/style/index.css +1 -1
  417. package/lib/Anchor/anchorMenu/index.d.ts +2 -1
  418. package/lib/Anchor/anchorMenu/index.js +1 -1
  419. package/lib/Anchor/component.json +130 -0
  420. package/lib/Anchor/index.js +1 -1
  421. package/lib/Anchor/type.d.ts +8 -4
  422. package/lib/Argv/component.json +216 -0
  423. package/lib/Argv/dataGenerator/index.js +1 -1
  424. package/lib/Argv/index.d.ts +5 -6
  425. package/lib/Argv/index.js +1 -1
  426. package/lib/AutoBox/component.json +133 -0
  427. package/lib/AutoBox/index.d.ts +3 -3
  428. package/lib/AutoBox/index.js +1 -1
  429. package/lib/AutoBox/protal.d.ts +2 -2
  430. package/lib/AutoBox/protal.js +1 -1
  431. package/lib/AutoButton/component.json +109 -0
  432. package/lib/AutoButton/index.js +1 -1
  433. package/lib/AutoTips/autoTipsMultiline/index.d.ts +1 -1
  434. package/lib/AutoTips/autoTipsMultiline/index.js +1 -1
  435. package/lib/AutoTips/component.json +121 -0
  436. package/lib/AutoTips/index.js +1 -1
  437. package/lib/Badge/component.json +92 -0
  438. package/lib/Breadcrumbs/component.json +142 -0
  439. package/lib/Breadcrumbs/index.js +1 -1
  440. package/lib/Button/SplitButton.d.ts +2 -2
  441. package/lib/Button/component.json +168 -0
  442. package/lib/Button/index.js +1 -1
  443. package/lib/ButtonGroup/component.json +132 -0
  444. package/lib/ButtonGroup/index.d.ts +1 -1
  445. package/lib/Card/component.json +162 -0
  446. package/lib/Card/index.d.ts +2 -2
  447. package/lib/Card/index.js +1 -1
  448. package/lib/Carousel/component.json +142 -0
  449. package/lib/Carousel/index.d.ts +1 -1
  450. package/lib/Cascader/Cascader.js +1 -1
  451. package/lib/Cascader/OptionList/Column.js +1 -1
  452. package/lib/Cascader/OptionList/index.js +1 -1
  453. package/lib/Cascader/component.json +196 -0
  454. package/lib/Cascader/hooks/useEntities.js +1 -1
  455. package/lib/Cascader/interface.d.ts +1 -0
  456. package/lib/Cascader/utils/commonUtil.d.ts +1 -1
  457. package/lib/Cascader/utils/commonUtil.js +1 -1
  458. package/lib/Cascader/utils/treeUtil.d.ts +14 -5
  459. package/lib/Cascader/utils/treeUtil.js +1 -1
  460. package/lib/Checkbox/component.json +138 -0
  461. package/lib/CheckboxGroup/component.json +152 -0
  462. package/lib/CheckboxGroup/index.js +1 -1
  463. package/lib/CodeEditor/component.json +189 -0
  464. package/lib/CodeEditor/index.d.ts +11 -10
  465. package/lib/CodeEditor/index.js +1 -1
  466. package/lib/Collapse/component.json +166 -0
  467. package/lib/Collapse/index.d.ts +1 -1
  468. package/lib/Collapse/index.js +1 -1
  469. package/lib/CollapseBox/component.json +84 -0
  470. package/lib/CollapseLayout/component.json +155 -0
  471. package/lib/ColorPicker/component.json +142 -0
  472. package/lib/ComboSelect/component.json +181 -0
  473. package/lib/ComboSelect/index.js +1 -1
  474. package/lib/ComboSelect/interface.d.ts +2 -2
  475. package/lib/ComboSelect/utils.d.ts +3 -3
  476. package/lib/ComboSelect/utils.js +1 -1
  477. package/lib/Container/component.json +111 -0
  478. package/lib/ContentBox/component.json +81 -0
  479. package/lib/CopyText/component.json +118 -0
  480. package/lib/CycleSelector/component.json +98 -0
  481. package/lib/CycleSelector/index.js +1 -1
  482. package/lib/DatePicker/component.json +192 -0
  483. package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
  484. package/lib/DatePicker/generatePicker/generateSinglePicker.js +1 -1
  485. package/lib/Descriptions/component.json +142 -0
  486. package/lib/Descriptions/index.d.ts +1 -1
  487. package/lib/Desktop/component.json +171 -0
  488. package/lib/Desktop/index.js +1 -1
  489. package/lib/DragVerify/component.json +114 -0
  490. package/lib/DragVerify/index.js +1 -1
  491. package/lib/Drawer/component.json +200 -0
  492. package/lib/Drawer/index.js +1 -1
  493. package/lib/Drawer/interface.d.ts +1 -1
  494. package/lib/Drawer/util.d.ts +1 -6
  495. package/lib/Drawer/util.js +1 -1
  496. package/lib/Dropdown/component.json +147 -0
  497. package/lib/Dropdown/index.js +1 -1
  498. package/lib/DynamicMultiBox/component.json +278 -0
  499. package/lib/DynamicMultiBox/formItem.d.ts +1 -1
  500. package/lib/DynamicMultiBox/index.js +1 -1
  501. package/lib/DynamicMultiBox/rowForm.d.ts +2 -2
  502. package/lib/Empty/component.json +123 -0
  503. package/lib/Empty/index.css +1 -1
  504. package/lib/Empty/index.d.ts +2 -2
  505. package/lib/Empty/index.js +1 -1
  506. package/lib/Empty/style/index.css +1 -1
  507. package/lib/ExpressionInput/HighlightOverlay.d.ts +8 -0
  508. package/lib/ExpressionInput/HighlightOverlay.js +2 -0
  509. package/lib/ExpressionInput/Popup.d.ts +19 -0
  510. package/lib/ExpressionInput/Popup.js +2 -0
  511. package/lib/ExpressionInput/component.json +79 -0
  512. package/lib/ExpressionInput/detectChainAtCursor.d.ts +17 -0
  513. package/lib/ExpressionInput/detectChainAtCursor.js +2 -0
  514. package/lib/ExpressionInput/filterCandidatesByPartial.d.ts +2 -0
  515. package/lib/ExpressionInput/filterCandidatesByPartial.js +2 -0
  516. package/lib/ExpressionInput/highlightSegments.d.ts +9 -0
  517. package/lib/ExpressionInput/highlightSegments.js +2 -0
  518. package/lib/ExpressionInput/index.css +1 -0
  519. package/lib/ExpressionInput/index.d.ts +5 -0
  520. package/lib/ExpressionInput/index.js +2 -0
  521. package/lib/ExpressionInput/interface.d.ts +52 -0
  522. package/lib/ExpressionInput/isExpressionValue.d.ts +5 -0
  523. package/lib/ExpressionInput/isExpressionValue.js +2 -0
  524. package/lib/ExpressionInput/lang/en_US.d.ts +4 -0
  525. package/lib/ExpressionInput/lang/en_US.js +2 -0
  526. package/lib/ExpressionInput/lang/index.d.ts +9 -0
  527. package/lib/ExpressionInput/lang/index.js +2 -0
  528. package/lib/ExpressionInput/lang/zh_CN.d.ts +4 -0
  529. package/lib/ExpressionInput/lang/zh_CN.js +2 -0
  530. package/lib/ExpressionInput/style/css.js +1 -0
  531. package/lib/ExpressionInput/style/index.css +1 -0
  532. package/lib/ExpressionInput/style/index.js +1 -0
  533. package/lib/ExpressionInput/useExpressionInput.d.ts +26 -0
  534. package/lib/ExpressionInput/useExpressionInput.js +2 -0
  535. package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
  536. package/lib/FieldForm/FieldFormItem/MemoInput.d.ts +2 -2
  537. package/lib/FieldForm/FieldFormItem/StatusProvider.js +1 -1
  538. package/lib/FieldForm/FieldFormItem/index.d.ts +6 -6
  539. package/lib/FieldForm/Form.d.ts +2 -2
  540. package/lib/FieldForm/Form.js +1 -1
  541. package/lib/FieldForm/FormItemInput.js +1 -1
  542. package/lib/FieldForm/FormItemLabel.js +1 -1
  543. package/lib/FieldForm/FormList.d.ts +2 -2
  544. package/lib/FieldForm/component.json +196 -0
  545. package/lib/FieldForm/context.d.ts +5 -1
  546. package/lib/FieldForm/context.js +1 -1
  547. package/lib/FieldForm/hooks/useForm.d.ts +4 -3
  548. package/lib/FieldForm/hooks/useFormInstance.d.ts +1 -1
  549. package/lib/FieldForm/hooks/useFormItemStatus.d.ts +9 -5
  550. package/lib/FieldForm/hooks/useFormItemStatus.js +1 -1
  551. package/lib/FieldForm/hooks/useItemRef.d.ts +1 -1
  552. package/lib/FieldForm/hooks/useItemRef.js +1 -1
  553. package/lib/Form/component.json +161 -0
  554. package/lib/Form/index.d.ts +52 -49
  555. package/lib/Form/index.js +1 -1
  556. package/lib/FormItem/compoments/defaultCompoments/index.d.ts +5 -5
  557. package/lib/FormItem/compoments/defaultCompoments/index.js +1 -1
  558. package/lib/FormItem/compoments/formCheckboxGroup/index.d.ts +2 -2
  559. package/lib/FormItem/compoments/formFile/index.js +1 -1
  560. package/lib/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
  561. package/lib/FormItem/compoments/formSelect/index.d.ts +1 -1
  562. package/lib/FormItem/component.json +171 -0
  563. package/lib/FormItem/index.d.ts +5 -5
  564. package/lib/FormItem/index.js +1 -1
  565. package/lib/FormItem/itemType.js +1 -1
  566. package/lib/FunctionModal/component.json +197 -0
  567. package/lib/FunctionModal/dialog.d.ts +1 -1
  568. package/lib/FunctionModal/modalContext.d.ts +4 -1
  569. package/lib/GlobalContext/confirmLocale.js +1 -1
  570. package/lib/GlobalContext/index.js +1 -1
  571. package/lib/Help/component.json +118 -0
  572. package/lib/HelperText/component.json +126 -0
  573. package/lib/Image/PreviewGroup.js +1 -1
  574. package/lib/Image/component.json +165 -0
  575. package/lib/Image/index.js +1 -1
  576. package/lib/InputCode/component.json +191 -0
  577. package/lib/InputCode/index.d.ts +2 -2
  578. package/lib/InputLang/component.json +205 -0
  579. package/lib/InputLang/index.js +1 -1
  580. package/lib/InputNumber/component.json +162 -0
  581. package/lib/InputNumber/index.d.ts +13 -7
  582. package/lib/InputNumber/index.js +1 -1
  583. package/lib/Label/component.json +126 -0
  584. package/lib/Label/index.d.ts +2 -2
  585. package/lib/Loading/component.json +91 -0
  586. package/lib/Menu/component.json +180 -0
  587. package/lib/Menu/verticalMenuList.js +1 -1
  588. package/lib/Message/component.json +246 -0
  589. package/lib/Message/index.d.ts +2 -2
  590. package/lib/Message/index.js +1 -1
  591. package/lib/Modal/Confirm/index.d.ts +1 -1
  592. package/lib/Modal/Confirm/index.js +1 -1
  593. package/lib/Modal/component.json +277 -0
  594. package/lib/Modal/index.d.ts +85 -5
  595. package/lib/Modal/index.js +1 -1
  596. package/lib/Modal/interface.d.ts +1 -0
  597. package/lib/MultiBox/component.json +216 -0
  598. package/lib/MultiBox/index.js +1 -1
  599. package/lib/Notification/component.json +184 -0
  600. package/lib/OperateBtn/component.json +134 -0
  601. package/lib/OperateBtn/index.d.ts +3 -3
  602. package/lib/PageHeader/component.json +112 -0
  603. package/lib/PageHeader/horizontalMeun.js +1 -1
  604. package/lib/PageHeader/horizontalMeunRight.js +1 -1
  605. package/lib/Pagination/component.json +181 -0
  606. package/lib/Pagination/index.js +1 -1
  607. package/lib/ParauiProvider/index.js +1 -1
  608. package/lib/PasswordRules/component.json +105 -0
  609. package/lib/PasswordRules/index.d.ts +4 -4
  610. package/lib/PopConfirm/component.json +227 -0
  611. package/lib/PopConfirm/index.d.ts +1 -1
  612. package/lib/PopConfirm/index.js +1 -1
  613. package/lib/PopMenu/component.json +131 -0
  614. package/lib/PopMenu/hooks.d.ts +1 -1
  615. package/lib/PopMenu/index.js +1 -1
  616. package/lib/Popover/component.json +165 -0
  617. package/lib/Popover/index.js +1 -1
  618. package/lib/Progress/component.json +161 -0
  619. package/lib/Prompt/component.json +144 -0
  620. package/lib/Querying/component.json +96 -0
  621. package/lib/Querying/index.css +1 -1
  622. package/lib/Querying/index.d.ts +2 -2
  623. package/lib/Querying/index.js +1 -1
  624. package/lib/Querying/style/index.css +1 -1
  625. package/lib/QuickReply/QuickReplyCode/index.js +1 -1
  626. package/lib/QuickReply/component.json +129 -0
  627. package/lib/QuickReply/index.d.ts +1 -1
  628. package/lib/Radio/component.json +136 -0
  629. package/lib/RadioGroup/component.json +149 -0
  630. package/lib/RangeInput/component.json +198 -0
  631. package/lib/RangeInput/index.d.ts +15 -7
  632. package/lib/RangeInput/index.js +1 -1
  633. package/lib/Result/component.json +104 -0
  634. package/lib/ScrollBar/component.json +115 -0
  635. package/lib/Search/component.json +177 -0
  636. package/lib/Search/index.d.ts +1 -1
  637. package/lib/Select/component.json +244 -0
  638. package/lib/Select/index.d.ts +11 -8
  639. package/lib/Select/index.js +1 -1
  640. package/lib/SelectInput/component.json +184 -0
  641. package/lib/SelectInput/index.d.ts +4 -4
  642. package/lib/SelectInput/index.js +1 -1
  643. package/lib/Selector/component.json +203 -0
  644. package/lib/Selector/index.js +1 -1
  645. package/lib/Selector/interface.d.ts +2 -2
  646. package/lib/Selector/selectorData/index.js +1 -1
  647. package/lib/Selector/selectorMain/index.js +1 -1
  648. package/lib/Selector/selectorNode/index.js +1 -1
  649. package/lib/Selector/util.d.ts +3 -3
  650. package/lib/Selector/util.js +1 -1
  651. package/lib/SelectorPicker/component.json +179 -0
  652. package/lib/SelectorPicker/index.d.ts +5 -5
  653. package/lib/SelectorPicker/index.js +1 -1
  654. package/lib/SingleBox/component.json +151 -0
  655. package/lib/SingleBox/index.d.ts +2 -2
  656. package/lib/Slider/component.json +181 -0
  657. package/lib/SortBox/component.json +108 -0
  658. package/lib/Status/component.json +104 -0
  659. package/lib/Stepper/component.json +129 -0
  660. package/lib/Stepper/index.d.ts +2 -2
  661. package/lib/Switch/component.json +207 -0
  662. package/lib/Switch/index.css +1 -1
  663. package/lib/Switch/index.d.ts +3 -2
  664. package/lib/Switch/index.js +1 -1
  665. package/lib/Switch/style/index.css +1 -1
  666. package/lib/Table/component.json +547 -0
  667. package/lib/Table/index.d.ts +2 -2
  668. package/lib/Table/index.js +1 -1
  669. package/lib/Table/interface.d.ts +30 -0
  670. package/lib/Table/tableHead.js +1 -1
  671. package/lib/Table/util.d.ts +1 -1
  672. package/lib/Table/util.js +1 -1
  673. package/lib/Tabs/component.json +227 -0
  674. package/lib/Tag/component.json +221 -0
  675. package/lib/Tag/index.css +1 -1
  676. package/lib/Tag/index.d.ts +1 -1
  677. package/lib/Tag/index.js +1 -1
  678. package/lib/Tag/style/index.css +1 -1
  679. package/lib/TextEditor/component.json +186 -0
  680. package/lib/TextEditor/index.d.ts +5 -5
  681. package/lib/TextEditor/index.js +1 -1
  682. package/lib/TextField/component.json +290 -0
  683. package/lib/TextField/index.d.ts +2 -2
  684. package/lib/TextField/index.js +1 -1
  685. package/lib/TimePicker/component.json +176 -0
  686. package/lib/Timeline/component.json +110 -0
  687. package/lib/Title/component.json +156 -0
  688. package/lib/ToggleButton/component.json +153 -0
  689. package/lib/ToggleButton/index.js +1 -1
  690. package/lib/Tooltip/component.json +176 -0
  691. package/lib/Tooltip/index.js +1 -1
  692. package/lib/Tooltip/interface.d.ts +14 -1
  693. package/lib/Tooltip/utils.js +1 -1
  694. package/lib/Transfer/component.json +157 -0
  695. package/lib/Tree/OperateBar/index.js +2 -2
  696. package/lib/Tree/Tree.js +1 -1
  697. package/lib/Tree/component.json +512 -0
  698. package/lib/Tree/interface.d.ts +1 -1
  699. package/lib/Upload/component.json +450 -0
  700. package/lib/Upload/util.js +1 -1
  701. package/lib/Utils/snack-kit-shims.d.ts +18 -0
  702. package/lib/Utils/snack-kit-shims.js +2 -0
  703. package/lib/Utils/type.d.ts +0 -6
  704. package/lib/_virtual/index.js +1 -1
  705. package/lib/_virtual/index2.js +1 -1
  706. package/lib/index.d.ts +4 -0
  707. package/lib/index.js +1 -1
  708. package/lib/locale/en-US.d.ts +3 -0
  709. package/lib/locale/en-US.js +1 -1
  710. package/lib/locale/en_US.d.ts +361 -0
  711. package/lib/locale/en_US.js +2 -0
  712. package/lib/locale/index.d.ts +1 -723
  713. package/lib/locale/index2.js +2 -0
  714. package/lib/locale/zh-CN.d.ts +3 -0
  715. package/lib/locale/zh-CN.js +1 -1
  716. package/lib/locale/zh_CN.d.ts +361 -0
  717. package/lib/locale/zh_CN.js +2 -0
  718. package/lib/node_modules/classnames/index.js +1 -1
  719. package/package.json +24 -4
  720. package/es/_virtual/index3.js +0 -5
  721. package/es/_virtual/index4.js +0 -5
  722. package/es/node_modules/@para-snack/core/dist/index.js +0 -5231
  723. package/lib/_virtual/index3.js +0 -2
  724. package/lib/_virtual/index4.js +0 -2
  725. package/lib/node_modules/@para-snack/core/dist/index.js +0 -20
  726. /package/es/{InputCode → CodeEditor}/index.css +0 -0
  727. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  728. /package/es/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
  729. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.d.ts +0 -0
  730. /package/lib/{Utils/Hooks → Hooks}/useResizeObserver.js +0 -0
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "AutoButton",
3
+ "category": "General",
4
+ "description": "自适应按钮组,根据容器宽度自动折叠超出的按钮到'更多'下拉弹层,list 每项支持 buttonType 切换图标/分割/普通三种形态",
5
+ "semantic": {
6
+ "intent": [
7
+ "按钮收纳",
8
+ "响应式操作"
9
+ ],
10
+ "useCases": [
11
+ "操作栏",
12
+ "批量操作",
13
+ "编辑器工具栏"
14
+ ],
15
+ "riskLevel": "low"
16
+ },
17
+ "variants": {
18
+ "default": {
19
+ "meaning": "默认样式"
20
+ }
21
+ },
22
+ "states": [
23
+ "default",
24
+ "expanded"
25
+ ],
26
+ "idealProps": {
27
+ "list": {
28
+ "type": "array",
29
+ "description": "按钮项数据数组,每项为 AutoButtonItemProps(union: ButtonProps | IconButtonProps | SplitButtonProps + 扩展 buttonType/popConfirmProps)"
30
+ },
31
+ "marginRight": {
32
+ "type": "string",
33
+ "default": "16px",
34
+ "description": "按钮间右间距"
35
+ },
36
+ "moreProps": {
37
+ "type": "object",
38
+ "objectShape": {
39
+ "buttonType": { "type": "'icon'", "description": "强制图标模式(不显示文字)" },
40
+ "icon": { "type": "ReactNode", "description": "自定义'更多'图标(默认 MoreVert)" },
41
+ "children": { "type": "ReactNode", "description": "自定义'更多'按钮文字内容" }
42
+ },
43
+ "description": "溢出折叠后'更多'按钮的展示形态({ buttonType?: 'icon'; icon?: ReactNode; children?: ReactNode })"
44
+ },
45
+ "morePlacement": {
46
+ "type": "string",
47
+ "default": "bottomLeft",
48
+ "description": "'更多'浮层弹出位置(透传 Dropdown placement)"
49
+ },
50
+ "moreMaxWidth": {
51
+ "type": "string",
52
+ "default": "500px",
53
+ "description": "'更多'浮层最大宽度,超出自动换行"
54
+ },
55
+ "trigger": {
56
+ "type": "array",
57
+ "default": "['hover']",
58
+ "description": "'更多'浮层触发方式数组('click' | 'hover' | 'contextMenu')[]"
59
+ }
60
+ },
61
+ "do": [
62
+ "在工具栏中使用收纳溢出按钮",
63
+ "保持主要操作可见,把低频操作放到 list 后面让其优先被折叠",
64
+ "每个 list 项用 buttonType 区分形态:不传=普通按钮 / 'icon'=图标按钮 / 'split'=分割按钮",
65
+ "需要二次确认时用 list 项的 popConfirmProps 属性透传 PopConfirm 参数"
66
+ ],
67
+ "dont": [
68
+ "主要操作被收纳进更多(应调整 list 顺序)",
69
+ "按钮过多时不分优先级",
70
+ "在 list 每项上传 buttonType='split' 时忘记提供 options 字段——split 按钮的子项来自 options"
71
+ ],
72
+ "events": {
73
+ "list[].onClick": {
74
+ "signature": "(event: React.MouseEvent<HTMLButtonElement>) => void",
75
+ "asyncSupported": false,
76
+ "examples": [
77
+ "每项 onClick 挂在 AutoButtonItemProps 上:list={[{ children: '编辑', onClick: handleEdit }]}",
78
+ "溢出后在'更多'弹层中点击时,AutoButton 内部会代理调用该项的 onClick",
79
+ "需要区分是哪个按钮被点击:在每项的 onClick 闭包里引用各自的业务 id"
80
+ ],
81
+ "commonMistakes": [
82
+ "期望 AutoButton 暴露统一 onItemClick(index, item) 回调——AutoButton 无此 prop,onClick 挂在每项上",
83
+ "buttonType='split' 的子项点击时,src 会把 parentItem.onClick 也触发一次——注意避免重复处理",
84
+ "弹层中点击时 event.currentTarget 是弹层内 Button,不是原始按钮 DOM,不要依赖 currentTarget 做 DOM 查找"
85
+ ]
86
+ }
87
+ },
88
+ "typescriptPitfalls": [
89
+ {
90
+ "issue": "AutoButtonItemProps 是 ButtonProps | IconButtonProps | SplitButtonProps 的 union,TypeScript 需要用 buttonType 做类型守卫",
91
+ "wrong": "// 直接访问 split 专属字段\nconst item: AutoButtonItemProps = { buttonType: 'split', options: [...] }; // options 不在 ButtonProps 上,TS 报错",
92
+ "right": "// 断言为具体类型\nimport type { SplitButtonProps } from '@para-ui/core/Button';\nconst item: AutoButtonItemProps = { buttonType: 'split', ...(splitProps as SplitButtonProps) };"
93
+ },
94
+ {
95
+ "issue": "trigger prop 是数组类型,不是字符串,与部分其他组件的字符串 trigger 不同",
96
+ "wrong": "<AutoButton list={list} trigger='hover' /> // 期望字符串,实际是 string[] 类型报错",
97
+ "right": "<AutoButton list={list} trigger={['hover']} /> // 数组形式"
98
+ },
99
+ {
100
+ "issue": "list 的 popConfirmProps 是可选字段,传了但 items 没有此字段时 TypeScript 不报错(union 类型),但 runtime 才生效",
101
+ "wrong": "// 误以为所有 list 项都有 popConfirmProps 类型定义,直接访问\nconst confirm = item.popConfirmProps; // 可能 undefined,需要 ?. 操作符",
102
+ "right": "const confirm = (item as AutoButtonItemProps).popConfirmProps; // 先断言再访问,配合 ?. 操作符"
103
+ }
104
+ ],
105
+ "mapping": {
106
+ "realComponent": "AutoButton",
107
+ "adapter": null
108
+ }
109
+ }
@@ -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"),u=require("react"),l=require("../Button/index.js"),D=require("../AutoTips/index.js"),F=require("../PopConfirm/index.js"),S=require("../node_modules/@para-ui/icons/MoreVert/index.js"),g=require("../GlobalContext/constant.js"),w=require("../Dropdown/index.js"),I=require("../Tooltip/index.js"),E=require("clsx"),W=require("../GlobalContext/useFormatMessage.js"),O=require("./lang/index.js"),z=require("../Utils/Hooks/useResizeObserver.js");;/* empty css */const B=q=>{const{className:y,style:C,list:o,marginRight:x="16px",moreProps:v,morePlacement:P="bottomLeft",moreMaxWidth:M="500px",trigger:T=["hover"]}=q,N=W.default("AutoButton",O.default),[s,m]=u.useState(null),c=u.useRef(null),a=u.useRef({timer:null});z.default({dom:c.current,cb:()=>f()}),u.useEffect(()=>{f()},[o]);const f=()=>{a.current.timer&&clearTimeout(a.current.timer),a.current.timer=setTimeout(()=>{m(o.length),o.length>1&&j()},100)},j=t=>{if(t===null||t===0)return;t===void 0&&(t=o.length);const e=c.current;if(e&&e.scrollWidth>e.clientWidth){const n=Number(t)-1;m(n),j(n)}},_=(t,e,n)=>{if(n){n.onClick&&n.onClick(e);return}t.onClick&&t.onClick(e)},h=(t,e,n)=>r.jsxRuntimeExports.jsx(l.Button,{variant:"text",disabled:t.disabled,loading:t.loading,className:E("item-btn",{"item-btn-disabled":t.disabled}),onClick:i=>{t.disabled||_(t,i,n)},children:r.jsxRuntimeExports.jsx(D.default,{placement:"top-start",children:t[e]})}),b=(t,e,n)=>t.disabled&&t.disabledTooltip?r.jsxRuntimeExports.jsx(I.Tooltip,{disabled:!0,...t.disabledTooltip,children:h(t,e,n)}):h(t,e,n),$=()=>r.jsxRuntimeExports.jsx("div",{className:"auto-button-dropdown-content",style:{maxWidth:M},children:o&&o.map((t,e)=>s!==null&&s>e?null:t.buttonType!=="split"?r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,b(t,"children"))},e):r.jsxRuntimeExports.jsx(u.Fragment,{children:t.options?.map((n,i)=>Array.isArray(n)?null:r.jsxRuntimeExports.jsx(u.Fragment,{children:d(n,b(n,"label",t))},`${e}-${i}`))},e))}),k=()=>{if(!(s!==null&&o.length>s))return null;const{buttonType:t,icon:e=r.jsxRuntimeExports.jsx(S.MoreVert,{}),children:n=N({id:"more"})}=v||{};let i=r.jsxRuntimeExports.jsx(l.Button,{variant:"outlined",startIcon:e,className:"auto-button-more",children:n});return t==="icon"&&(i=r.jsxRuntimeExports.jsx(l.Button.IconButton,{variant:"outlined",className:"auto-button-more",children:e})),r.jsxRuntimeExports.jsx(w.Dropdown,{overlayClassName:`${g.$prefixCls}-auto-button-dropdown`,overlay:$(),placement:P,trigger:T,children:i})},d=(t,e)=>t.popConfirmProps?r.jsxRuntimeExports.jsx(F.PopConfirm,{...t.popConfirmProps,children:e}):e;return r.jsxRuntimeExports.jsxs("div",{className:E(y,`${g.$prefixCls}-auto-button`),style:C,ref:c,children:[o.map((t,e)=>{if(s!==null&&s<=e)return null;const{buttonType:n,popConfirmProps:i,...A}=t;let p=l.Button;const R={marginRight:s===e+1?0:x};return s!==null&&o.length>s&&(R.marginRight=x),n==="icon"&&(p=l.Button.IconButton),n==="split"&&(p=l.Button.SplitButton),r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,r.jsxRuntimeExports.jsx(p,{...A,style:R}))},e)}),k()]})};exports.AutoButton=B;exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),u=require("react"),l=require("../Button/index.js"),D=require("../AutoTips/index.js"),F=require("../PopConfirm/index.js"),S=require("../node_modules/@para-ui/icons/MoreVert/index.js"),g=require("../GlobalContext/constant.js"),w=require("../Dropdown/index.js"),I=require("../Tooltip/index.js"),E=require("clsx"),W=require("../GlobalContext/useFormatMessage.js"),O=require("./lang/index.js"),z=require("../Hooks/useResizeObserver.js");;/* empty css */const B=q=>{const{className:y,style:C,list:o,marginRight:x="16px",moreProps:v,morePlacement:P="bottomLeft",moreMaxWidth:M="500px",trigger:T=["hover"]}=q,N=W.default("AutoButton",O.default),[s,m]=u.useState(null),c=u.useRef(null),a=u.useRef({timer:null});z.default({dom:c.current,cb:()=>f()}),u.useEffect(()=>{f()},[o]);const f=()=>{a.current.timer&&clearTimeout(a.current.timer),a.current.timer=setTimeout(()=>{m(o.length),o.length>1&&j()},100)},j=t=>{if(t===null||t===0)return;t===void 0&&(t=o.length);const e=c.current;if(e&&e.scrollWidth>e.clientWidth){const n=Number(t)-1;m(n),j(n)}},_=(t,e,n)=>{if(n){n.onClick&&n.onClick(e);return}t.onClick&&t.onClick(e)},h=(t,e,n)=>r.jsxRuntimeExports.jsx(l.Button,{variant:"text",disabled:t.disabled,loading:t.loading,className:E("item-btn",{"item-btn-disabled":t.disabled}),onClick:i=>{t.disabled||_(t,i,n)},children:r.jsxRuntimeExports.jsx(D.default,{placement:"top-start",children:t[e]})}),b=(t,e,n)=>t.disabled&&t.disabledTooltip?r.jsxRuntimeExports.jsx(I.Tooltip,{disabled:!0,...t.disabledTooltip,children:h(t,e,n)}):h(t,e,n),$=()=>r.jsxRuntimeExports.jsx("div",{className:"auto-button-dropdown-content",style:{maxWidth:M},children:o&&o.map((t,e)=>s!==null&&s>e?null:t.buttonType!=="split"?r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,b(t,"children"))},e):r.jsxRuntimeExports.jsx(u.Fragment,{children:t.options?.map((n,i)=>Array.isArray(n)?null:r.jsxRuntimeExports.jsx(u.Fragment,{children:d(n,b(n,"label",t))},`${e}-${i}`))},e))}),k=()=>{if(!(s!==null&&o.length>s))return null;const{buttonType:t,icon:e=r.jsxRuntimeExports.jsx(S.MoreVert,{}),children:n=N({id:"more"})}=v||{};let i=r.jsxRuntimeExports.jsx(l.Button,{variant:"outlined",startIcon:e,className:"auto-button-more",children:n});return t==="icon"&&(i=r.jsxRuntimeExports.jsx(l.Button.IconButton,{variant:"outlined",className:"auto-button-more",children:e})),r.jsxRuntimeExports.jsx(w.Dropdown,{overlayClassName:`${g.$prefixCls}-auto-button-dropdown`,overlay:$(),placement:P,trigger:T,children:i})},d=(t,e)=>t.popConfirmProps?r.jsxRuntimeExports.jsx(F.PopConfirm,{...t.popConfirmProps,children:e}):e;return r.jsxRuntimeExports.jsxs("div",{className:E(y,`${g.$prefixCls}-auto-button`),style:C,ref:c,children:[o.map((t,e)=>{if(s!==null&&s<=e)return null;const{buttonType:n,popConfirmProps:i,...A}=t;let p=l.Button;const R={marginRight:s===e+1?0:x};return s!==null&&o.length>s&&(R.marginRight=x),n==="icon"&&(p=l.Button.IconButton),n==="split"&&(p=l.Button.SplitButton),r.jsxRuntimeExports.jsx(u.Fragment,{children:d(t,r.jsxRuntimeExports.jsx(p,{...A,style:R}))},e)}),k()]})};exports.AutoButton=B;exports.default=B;
2
2
  //# sourceMappingURL=index.js.map
@@ -6,7 +6,7 @@ export interface AutoTipsMultilineProps extends Omit<AutoTipsProps, 'children'>
6
6
  /** 行数 */
7
7
  line?: number;
8
8
  /** 刷新 */
9
- refresh?: any;
9
+ refresh?: () => void;
10
10
  }
11
11
  declare const AutoTipsMultiline: FunctionComponent<AutoTipsMultilineProps>;
12
12
  export default AutoTipsMultiline;
@@ -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"),l=require("react"),f=require("../../GlobalContext/constant.js"),M=require("../../Tooltip/index.js"),w=require("../../Utils/Hooks/useResizeObserver.js");;/* empty css */const y=v=>{const{children:t,arrow:b=!1,placement:E="bottom-start",tips:d="",className:h="",interactive:T=!0,tipMaxWidth:O,line:m=2,refresh:A,style:C}=v,a=l.useRef(null),u=l.useRef([]),[x,N]=l.useState(),o=l.useRef({line:m,tips:d});o.current.line=m,o.current.tips=d;const[W,g]=l.useState("");w.default({dom:a.current,cb:()=>R()}),l.useEffect(()=>{R()},[t,A]);const R=()=>{if(!t)return;const e=[];let s=!1;const i=a?.current?.clientWidth||0;let p=0,c=0;for(let n=0;n<u.current.length;n++){const j=u.current[n].offsetWidth;if(p+=j,p>i)if(e.length<o.current.line-1)e.push(t.slice(c,n)),c=n,p=j,n===u.current.length-1&&(e.length<o.current.line||(s=!0,g(o.current.tips||t)),e.push(t.slice(c,t.length)));else{s=!0,g(o.current.tips||t),e.push(t.slice(c,t.length));break}else n===u.current.length-1&&e.push(t.slice(c,t.length))}N({lineArr:e,showTooltip:s})},$=l.useMemo(()=>(u.current=[],r.jsxRuntimeExports.jsx("div",{className:"hidden",children:t?.split("").map((e,s)=>r.jsxRuntimeExports.jsx("span",{ref:i=>i&&u.current.push(i),children:e},s))})),[t]),q=()=>{if(navigator.userAgent.indexOf("Safari")>-1)return!0},S=()=>{let e=`${f.$prefixCls}-auto-tips-multiline`;return q()&&(e+=` ${f.$prefixCls}-auto-tips-multiline-safari`),h&&(e+=` ${h}`),e};return r.jsxRuntimeExports.jsx("div",{ref:a,className:S(),style:C,children:r.jsxRuntimeExports.jsx(M.Tooltip,{arrow:b,title:W,placement:E,interactive:T,boundariesElement:"viewport",overlayClassName:`${f.$prefixCls}-auto-tips-multiline-tooltip`,children:r.jsxRuntimeExports.jsxs("div",{className:"auto-tips-multiline-content-box",children:[r.jsxRuntimeExports.jsx("div",{className:"auto-tips-multiline-content",children:x?.lineArr.map((e,s)=>{let i="line-text";return s===x.lineArr.length-1&&(i+=" last-line"),r.jsxRuntimeExports.jsx("div",{className:i,children:e},s)})}),$]})})})};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../../_virtual/jsx-runtime.js"),l=require("react"),f=require("../../GlobalContext/constant.js"),M=require("../../Tooltip/index.js"),w=require("../../Hooks/useResizeObserver.js");;/* empty css */const y=v=>{const{children:t,arrow:b=!1,placement:E="bottom-start",tips:d="",className:h="",interactive:T=!0,tipMaxWidth:O,line:m=2,refresh:A,style:C}=v,a=l.useRef(null),u=l.useRef([]),[x,N]=l.useState(),o=l.useRef({line:m,tips:d});o.current.line=m,o.current.tips=d;const[W,g]=l.useState("");w.default({dom:a.current,cb:()=>R()}),l.useEffect(()=>{R()},[t,A]);const R=()=>{if(!t)return;const e=[];let s=!1;const i=a?.current?.clientWidth||0;let p=0,c=0;for(let n=0;n<u.current.length;n++){const j=u.current[n].offsetWidth;if(p+=j,p>i)if(e.length<o.current.line-1)e.push(t.slice(c,n)),c=n,p=j,n===u.current.length-1&&(e.length<o.current.line||(s=!0,g(o.current.tips||t)),e.push(t.slice(c,t.length)));else{s=!0,g(o.current.tips||t),e.push(t.slice(c,t.length));break}else n===u.current.length-1&&e.push(t.slice(c,t.length))}N({lineArr:e,showTooltip:s})},$=l.useMemo(()=>(u.current=[],r.jsxRuntimeExports.jsx("div",{className:"hidden",children:t?.split("").map((e,s)=>r.jsxRuntimeExports.jsx("span",{ref:i=>i&&u.current.push(i),children:e},s))})),[t]),q=()=>{if(navigator.userAgent.indexOf("Safari")>-1)return!0},S=()=>{let e=`${f.$prefixCls}-auto-tips-multiline`;return q()&&(e+=` ${f.$prefixCls}-auto-tips-multiline-safari`),h&&(e+=` ${h}`),e};return r.jsxRuntimeExports.jsx("div",{ref:a,className:S(),style:C,children:r.jsxRuntimeExports.jsx(M.Tooltip,{arrow:b,title:W,placement:E,interactive:T,boundariesElement:"viewport",overlayClassName:`${f.$prefixCls}-auto-tips-multiline-tooltip`,children:r.jsxRuntimeExports.jsxs("div",{className:"auto-tips-multiline-content-box",children:[r.jsxRuntimeExports.jsx("div",{className:"auto-tips-multiline-content",children:x?.lineArr.map((e,s)=>{let i="line-text";return s===x.lineArr.length-1&&(i+=" last-line"),r.jsxRuntimeExports.jsx("div",{className:i,children:e},s)})}),$]})})})};exports.default=y;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,121 @@
1
+ {
2
+ "name": "AutoTips",
3
+ "category": "Data Display",
4
+ "description": "文本溢出自动提示——内容超出容器宽度时自动弹出 Tooltip,不超出时不显示;beyondText 控制 Tooltip 显示文本还是原始 children 节点",
5
+ "semantic": {
6
+ "intent": [
7
+ "溢出提示",
8
+ "文本截断"
9
+ ],
10
+ "useCases": [
11
+ "表格单元格",
12
+ "列表项",
13
+ "标签"
14
+ ],
15
+ "riskLevel": "low"
16
+ },
17
+ "variants": {
18
+ "default": {
19
+ "meaning": "默认样式"
20
+ }
21
+ },
22
+ "states": [
23
+ "default",
24
+ "overflow"
25
+ ],
26
+ "idealProps": {
27
+ "children": {
28
+ "type": "ReactNode",
29
+ "description": "被截断的内容;单行模式不限制类型,多行模式(AutoTipsMultiline)限制为 string"
30
+ },
31
+ "tips": {
32
+ "type": "ReactNode",
33
+ "description": "超出时 Tooltip 显示的内容。**不传时**:beyondText=true(默认)显示 tipsElm.innerText;beyondText=false 显示原始 children。**传了 tips**:超出时直接显示 tips,忽略 beyondText"
34
+ },
35
+ "beyondText": {
36
+ "type": "boolean",
37
+ "default": true,
38
+ "description": "未传 tips 时的 Tooltip 内容:true=显示文本(innerText);false=显示原始 children 节点"
39
+ },
40
+ "placement": {
41
+ "type": "enum",
42
+ "values": [
43
+ "top",
44
+ "top-start",
45
+ "top-end",
46
+ "bottom",
47
+ "bottom-start",
48
+ "bottom-end",
49
+ "left",
50
+ "left-start",
51
+ "left-end",
52
+ "right",
53
+ "right-start",
54
+ "right-end"
55
+ ],
56
+ "default": "bottom-start",
57
+ "description": "Tooltip 弹出方向(默认 bottom-start)"
58
+ },
59
+ "tipMaxWidth": {
60
+ "type": "number | string",
61
+ "description": "Tooltip 最大宽度"
62
+ },
63
+ "arrow": {
64
+ "type": "boolean",
65
+ "default": false,
66
+ "description": "Tooltip 是否显示箭头"
67
+ },
68
+ "interactive": {
69
+ "type": "boolean",
70
+ "default": true,
71
+ "description": "Tooltip 是否可交互(鼠标移入 Tooltip 不消失)"
72
+ }
73
+ },
74
+ "do": [
75
+ "在表格单元格中自动处理长文本截断+提示",
76
+ "设置合理的 tipMaxWidth 避免 Tooltip 过宽",
77
+ "多行截断场景使用导出的 AutoTipsMultiline 子组件(children 需为 string)"
78
+ ],
79
+ "dont": [
80
+ "在短文本场景中滥用(AutoTips 每次 hover 都做宽度比较,短文本无截断时 Tooltip 不会弹,但有轻微性能开销)",
81
+ "tip 内容过于复杂(Tooltip 本身宽度有限,复杂节点用 Popover)",
82
+ "在多行模式(AutoTipsMultiline)下传 ReactNode 类型 children——多行限制为 string"
83
+ ],
84
+ "events": {
85
+ "onMouseOver (内部)": {
86
+ "signature": "内部 onMouseOver 事件,无对外暴露",
87
+ "asyncSupported": false,
88
+ "examples": [
89
+ "鼠标悬停时 AutoTips 内部调用 mouseHover() 比较 tipsElm 与 textElm 宽度决定是否展示 Tooltip",
90
+ "超出宽度时自动设置 tTips state,Tooltip title 随之更新",
91
+ "不超出时 tTips 为空字符串,Tooltip 不渲染弹层"
92
+ ],
93
+ "commonMistakes": [
94
+ "期望传 onOverflow 回调在超出时得到通知——AutoTips 不暴露此事件,如需监听请用 ResizeObserver 自行比较",
95
+ "期望 tips prop 变化时立即更新 Tooltip 内容——tips 变化会通过 useEffect 更新 tTips state,下次 hover 才生效",
96
+ "在 SSR 场景中使用 AutoTips——依赖 getBoundingClientRect(),SSR 下无 DOM 会报错"
97
+ ]
98
+ }
99
+ },
100
+ "typescriptPitfalls": [
101
+ {
102
+ "issue": "placement 的完整枚举是带方向后缀的 MUI Popper 风格(如 'top-start'),不是简单的 'top'/'bottom'",
103
+ "wrong": "<AutoTips placement='topLeft'>...</AutoTips> // 'topLeft' 不在联合类型,TS 报错",
104
+ "right": "<AutoTips placement='top-start'>...</AutoTips> // 使用连字符形式"
105
+ },
106
+ {
107
+ "issue": "AutoTips 导出了 AutoTipsMultiline 子组件,但二者 props 不同——多行模式 children 必须为 string",
108
+ "wrong": "import AutoTips from '@para-ui/core/AutoTips';\n// 误用 AutoTips(单行)做多行截断\n<AutoTips style={{ WebkitLineClamp: 2 }}><ReactNode/></AutoTips> // 多行截断行为不可靠",
109
+ "right": "import { AutoTipsMultiline } from '@para-ui/core/AutoTips';\n<AutoTipsMultiline line={2}>{'长文本字符串'}</AutoTipsMultiline>"
110
+ },
111
+ {
112
+ "issue": "tips 不传时 tTips 由 mouseHover 计算,初始为空字符串——不要用 tips='' 期望清空提示",
113
+ "wrong": "<AutoTips tips=''>文本内容</AutoTips> // tips='' 等价于 tips=undefined,超出时仍显示 innerText",
114
+ "right": "// 不传 tips 让 AutoTips 自动提取文本\n<AutoTips>文本内容</AutoTips>"
115
+ }
116
+ ],
117
+ "mapping": {
118
+ "realComponent": "AutoTips",
119
+ "adapter": null
120
+ }
121
+ }
@@ -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"),i=require("react"),C=require("../Tooltip/index.js"),o=require("../GlobalContext/constant.js"),w=require("@paraview/lib"),b=require("./autoTipsMultiline/index.js");;/* empty css */const M=m=>{const{children:r,arrow:E=!1,placement:h="bottom-start",tips:t="",className:u="",beyondText:l=!0,interactive:v=!0,tipMaxWidth:R,style:T}=m,a=i.useRef(null),c=i.useRef(null),[g,d]=i.useState("");i.useEffect(()=>{d(t)},[t]);const $=()=>{let e="";const s=a.current,f=c.current;if(!s||!f)return;const p=s.getBoundingClientRect(),x=f.getBoundingClientRect();w.isIE()?p.width>x.width&&(t?e=t:e=l?s.innerText:r):x.width>p.width&&(t?e=t:e=l?s.innerText:r),d(e)},j=()=>{const e=navigator.userAgent;if(/^((?!chrome|android).)*safari/i.test(e))return!0},q=()=>{let e=`${o.$prefixCls}-auto-tips`;return j()&&(e+=` ${o.$prefixCls}-auto-tips-safari`),u&&(e+=` ${u}`),e};return n.jsxRuntimeExports.jsx(C.Tooltip,{arrow:E,title:g,placement:h,interactive:v,boundariesElement:"viewport",overlayClassName:`${o.$prefixCls}-auto-tips-tooltip`,maxWidth:R,children:n.jsxRuntimeExports.jsx("div",{ref:a,className:q(),onMouseOver:$,style:T,children:n.jsxRuntimeExports.jsx("div",{className:"auto-tips-content",ref:c,children:r})})})};exports.AutoTipsMultiline=b.default;exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),i=require("react"),$=require("../Tooltip/index.js"),o=require("../GlobalContext/constant.js"),w=require("../Utils/snack-kit-shims.js"),b=require("./autoTipsMultiline/index.js");;/* empty css */const M=m=>{const{children:n,arrow:h=!1,placement:E="bottom-start",tips:t="",className:u="",beyondText:l=!0,interactive:v=!0,tipMaxWidth:R,style:T}=m,a=i.useRef(null),c=i.useRef(null),[g,d]=i.useState("");i.useEffect(()=>{d(t)},[t]);const j=()=>{let e="";const s=a.current,f=c.current;if(!s||!f)return;const p=s.getBoundingClientRect(),x=f.getBoundingClientRect();w.isIE()?p.width>x.width&&(t?e=t:e=l?s.innerText:n):x.width>p.width&&(t?e=t:e=l?s.innerText:n),d(e)},q=()=>{const e=navigator.userAgent;if(/^((?!chrome|android).)*safari/i.test(e))return!0},C=()=>{let e=`${o.$prefixCls}-auto-tips`;return q()&&(e+=` ${o.$prefixCls}-auto-tips-safari`),u&&(e+=` ${u}`),e};return r.jsxRuntimeExports.jsx($.Tooltip,{arrow:h,title:g,placement:E,interactive:v,boundariesElement:"viewport",overlayClassName:`${o.$prefixCls}-auto-tips-tooltip`,maxWidth:R,children:r.jsxRuntimeExports.jsx("div",{ref:a,className:C(),onMouseOver:j,style:T,children:r.jsxRuntimeExports.jsx("div",{className:"auto-tips-content",ref:c,children:n})})})};exports.AutoTipsMultiline=b.default;exports.default=M;
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "Badge",
3
+ "category": "Data Display",
4
+ "description": "出现在子元素角部的标记节点。**注意:不接受 antd 风格的 count / dot / maxCount / overflowCount 这些 prop**——本组件用 sign 作为核心标记内容(ReactNode),不传 sign 时退化为小圆点;传 null 时不显示",
5
+ "semantic": {
6
+ "intent": [
7
+ "展示数量",
8
+ "展示状态",
9
+ "吸引注意"
10
+ ],
11
+ "useCases": [
12
+ "消息计数",
13
+ "在线状态",
14
+ "新功能标记"
15
+ ],
16
+ "riskLevel": "low"
17
+ },
18
+ "variants": {
19
+ "default": {
20
+ "meaning": "默认(带 sign 内容时按 sign 渲染;不传 sign 退化为小圆点)"
21
+ }
22
+ },
23
+ "states": [
24
+ "visible",
25
+ "hidden"
26
+ ],
27
+ "idealProps": {
28
+ "children": {
29
+ "type": "ReactNode",
30
+ "description": "被徽标包裹的目标元素,Badge 会在其右上角(或 placement 指定位置)叠加徽标显示",
31
+ "required": false
32
+ },
33
+ "sign": {
34
+ "type": "ReactNode",
35
+ "description": "标记内容。**核心 prop**:传数字 / 字符串显示文本徽标;不传退化为小圆点;传 null 时整个徽标不显示(用于条件展示)"
36
+ },
37
+ "backgroundColor": {
38
+ "type": "string",
39
+ "description": "徽标背景色(CSS 颜色字符串)"
40
+ },
41
+ "color": {
42
+ "type": "string",
43
+ "description": "徽标文字色(CSS 颜色字符串)"
44
+ },
45
+ "offset": {
46
+ "type": "[number, number]",
47
+ "description": "徽标相对默认位置的像素偏移 [x, y]"
48
+ },
49
+ "placement": {
50
+ "type": "enum",
51
+ "values": [
52
+ "top-left",
53
+ "top-right",
54
+ "bottom-left",
55
+ "bottom-right"
56
+ ],
57
+ "default": "top-right",
58
+ "description": "徽标在子元素四角的位置"
59
+ }
60
+ },
61
+ "do": [
62
+ "用 sign 传 ReactNode 作为标记(数字 / 短字符串 / 状态点)",
63
+ "条件展示:传 sign={null} 隐藏徽标但保留 children 占位",
64
+ "超过 999 的数字自动显示 '999+',无需业务方手动判断"
65
+ ],
66
+ "dont": [
67
+ "传 count / dot / maxCount / overflowCount / status——这些 antd 风格 prop 不存在",
68
+ "把核心内容放到 children——children 是被标记的目标元素,不是徽标本身"
69
+ ],
70
+ "events": {},
71
+ "typescriptPitfalls": [
72
+ {
73
+ "issue": "sign 是 ReactNode 而非数字,传 null 和不传 sign 含义不同",
74
+ "wrong": "// 期望隐藏徽标,传 sign={0} 却仍然显示数字 0\n<Badge sign={0}>图标</Badge> // 0 是数字,显示'0'文本徽标",
75
+ "right": "// 传 null 才能隐藏徽标\n<Badge sign={null}>图标</Badge> // handleType 返回 'null',handleSign 返回 null 不渲染"
76
+ },
77
+ {
78
+ "issue": "offset 是 [number, number] 元组,不是对象 { x, y }",
79
+ "wrong": "<Badge offset={{ x: 4, y: -4 }}>图标</Badge> // TS 类型报错:期望 [number, number]",
80
+ "right": "<Badge offset={[4, -4]}>图标</Badge> // [offsetX, offsetY],正数向右/向下"
81
+ },
82
+ {
83
+ "issue": "不要传 antd 风格的 count / dot / maxCount / overflowCount prop——它们不存在于 BadgeProps",
84
+ "wrong": "<Badge count={5} dot={false}>图标</Badge> // count/dot 不在 BadgeProps,静默失效",
85
+ "right": "<Badge sign={5}>图标</Badge> // para-ui 用 sign 作为核心标记内容"
86
+ }
87
+ ],
88
+ "mapping": {
89
+ "realComponent": "Badge",
90
+ "adapter": null
91
+ }
92
+ }
@@ -0,0 +1,142 @@
1
+ {
2
+ "name": "Breadcrumbs",
3
+ "category": "Navigation",
4
+ "description": "面包屑导航,显示当前页面在系统层级结构中的位置;内置自适应收缩:容器宽度不足时自动折叠中间项到'更多'弹层",
5
+ "semantic": {
6
+ "intent": [
7
+ "展示路径",
8
+ "向上导航",
9
+ "定位上下文"
10
+ ],
11
+ "useCases": [
12
+ "多级菜单",
13
+ "详情页",
14
+ "层级浏览"
15
+ ],
16
+ "riskLevel": "low"
17
+ },
18
+ "variants": {
19
+ "default": {
20
+ "meaning": "标准面包屑"
21
+ }
22
+ },
23
+ "states": [
24
+ "default"
25
+ ],
26
+ "idealProps": {
27
+ "list": {
28
+ "type": "listOptions[]",
29
+ "typeDefinition": "interface listOptions { label: ReactNode; maxWidth?: string; disabled?: boolean; [name: string]: any }",
30
+ "description": "路由数据列表。**每项必填 label**(显示文案,ReactNode);disabled=true 时该项不可点击;maxWidth 覆盖单项最大宽度(默认用顶层 maxWidth)。**末尾项(最后一项)自动不可点击**(src:154 实证)"
31
+ },
32
+ "separator": {
33
+ "type": "string",
34
+ "default": "/",
35
+ "description": "分隔符(src:38 interface 实证:类型为 string,不是 ReactNode)"
36
+ },
37
+ "maxWidth": {
38
+ "type": "string",
39
+ "default": "160px",
40
+ "description": "每项最大宽度(px),超出则内部 AutoTips 自动截断显示省略号"
41
+ },
42
+ "isShrink": {
43
+ "type": "boolean",
44
+ "default": true,
45
+ "description": "是否启用自适应收缩(容器宽度不足时折叠中间项到'更多'弹层)"
46
+ },
47
+ "minNum": {
48
+ "type": "number",
49
+ "default": 2,
50
+ "description": "收缩时最少保留显示的项数(末尾 N 项始终显示)"
51
+ },
52
+ "isBack": {
53
+ "type": "boolean",
54
+ "default": false,
55
+ "description": "是否显示返回按钮(在面包屑右侧)"
56
+ },
57
+ "backRender": {
58
+ "type": "ReactNode",
59
+ "description": "自定义返回按钮内容(不传时显示默认返回图标 + 文字)"
60
+ },
61
+ "onClickItem": {
62
+ "type": "(ops: listOptions) => void",
63
+ "description": "点击非末尾且非 disabled 项时的回调(末尾项和 disabled 项不触发)"
64
+ },
65
+ "onBack": {
66
+ "type": "() => void",
67
+ "description": "点击返回按钮的回调;不传时默认点击 list 倒数第二项"
68
+ },
69
+ "trigger": {
70
+ "type": "'hover' | 'click'",
71
+ "default": "hover",
72
+ "description": "收缩弹层的触发方式"
73
+ },
74
+ "placement": {
75
+ "type": "string",
76
+ "default": "bottomLeft",
77
+ "description": "收缩弹层的弹出位置"
78
+ }
79
+ },
80
+ "do": [
81
+ "在层级较深的系统中提供 Breadcrumbs",
82
+ "保持层级路径清晰,避免过深 (>5级)",
83
+ "list 末尾项自动不可点击,无需手动设 disabled",
84
+ "需要返回上级功能用 isBack=true,需要自定义返回行为用 onBack 回调"
85
+ ],
86
+ "dont": [
87
+ "在扁平化结构的站点强行使用 Breadcrumbs",
88
+ "Breadcrumbs 替代主导航",
89
+ "传 separator={<Icon />} ReactNode 类型——src interface 类型为 string,传 ReactNode 会有 TS 警告"
90
+ ],
91
+ "events": {
92
+ "onClickItem": {
93
+ "signature": "(ops: listOptions) => void",
94
+ "asyncSupported": false,
95
+ "examples": [
96
+ "点击面包屑项导航:onClickItem={(item) => router.push(item.path)}",
97
+ "传入回调时只有非末尾、非 disabled 的项才触发(src:154 实证)",
98
+ "结合 list 的扩展字段:onClickItem={(item) => { if (item.href) window.location.href = item.href; }}"
99
+ ],
100
+ "commonMistakes": [
101
+ "期望末尾项也能 onClickItem——末尾项(list.length-1 === index)在 src:154 被拦截,永远不触发",
102
+ "把路由信息放到 onClickItem 回调参数之外——item 是 listOptions 对象,可通过索引签名携带任意业务字段",
103
+ "期望 onClickItem 携带 index 参数——签名只有 (ops: listOptions),无 index;需要 index 请在 list 中嵌入业务 id"
104
+ ]
105
+ },
106
+ "onBack": {
107
+ "signature": "() => void",
108
+ "asyncSupported": false,
109
+ "examples": [
110
+ "自定义返回行为:onBack={() => navigate(-1)}",
111
+ "不传时默认点击 list 倒数第二项(触发 onClickItem)",
112
+ "配合 isBack=true 使用:<Breadcrumbs isBack onBack={handleBack} />"
113
+ ],
114
+ "commonMistakes": [
115
+ "传了 onBack 但忘传 isBack=true——onBack 存在但不显示返回按钮,回调永远不触发",
116
+ "期望 onBack 携带当前最后一项——回调无参数,最后一项可从 list[list.length-1] 直接取",
117
+ "同时期望 onBack 和返回按钮的默认行为(点 list[-2])——传了 onBack 就完全覆盖默认行为"
118
+ ]
119
+ }
120
+ },
121
+ "typescriptPitfalls": [
122
+ {
123
+ "issue": "separator 类型为 string,不支持 ReactNode,传 ReactNode 会有 TS 报错",
124
+ "wrong": "<Breadcrumbs separator={<ChevronRight />} list={list} /> // TS: ReactNode 不可分配给 string",
125
+ "right": "<Breadcrumbs separator='>' list={list} /> // 只接受字符串"
126
+ },
127
+ {
128
+ "issue": "listOptions 有索引签名 [name: string]: any,但 label 是必填字段,不传会导致运行时显示空白",
129
+ "wrong": "const list = [{ path: '/home' }, { path: '/detail' }]; // 缺少 label,显示空白",
130
+ "right": "const list: listOptions[] = [{ label: '首页', path: '/home' }, { label: '详情', path: '/detail' }];"
131
+ },
132
+ {
133
+ "issue": "disabled 字段是 listOptions 可选属性(boolean),但 TypeScript 在索引签名下不强制检查类型",
134
+ "wrong": "const list = [{ label: '返回', disabled: 'true' }]; // 字符串 'true' 在 runtime 按 truthy 处理,但语义错",
135
+ "right": "const list: listOptions[] = [{ label: '返回', disabled: true }]; // 显式声明 listOptions[] 让 TS 检查"
136
+ }
137
+ ],
138
+ "mapping": {
139
+ "realComponent": "Breadcrumbs",
140
+ "adapter": null
141
+ }
142
+ }
@@ -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"),u=require("react"),D=require("../Popover/index.js"),H=require("../AutoTips/index.js"),L=require("../node_modules/@para-ui/icons/More/index.js"),O=require("../node_modules/@para-ui/icons/Return/index.js"),l=require("../GlobalContext/constant.js"),z=require("../GlobalContext/useFormatMessage.js"),I=require("./lang/index.js"),G=require("../Utils/Hooks/useResizeObserver.js");;/* empty css */const $=q=>{const{maxWidth:S="160px",className:p,list:c,separator:f="/",popoverClassName:j,isShrink:o=!0,isBack:m=!1,minNum:R=2,trigger:A="hover",placement:M="bottomLeft",backRender:k,onClickItem:E,onBack:g,style:y}=q,W=z.default("Breadcrumbs",I.default),[v,N]=u.useState(!1),[d,x]=u.useState([]),i=u.useRef(null),e=u.useRef({minNum:R,isBack:m,isShrink:o,timer:null,showMore:!1,hideArr:[],hidePos:0,list:c});e.current.isBack=m,e.current.showMore=v,e.current.isShrink=o,e.current.minNum=R,e.current.list=c,G.default({dom:i.current,cb:()=>h()}),u.useEffect(()=>()=>{e.current.timer&&clearTimeout(e.current.timer)},[]),u.useEffect(()=>{const r=new Array(e.current.list.length).fill(!1);e.current.hideArr=r,x(r),h()},[c]);const b=(r,s)=>()=>{e.current.list.length-1===s||r.disabled||E&&E(r)},B=()=>{if(g)return g();if(e.current.list.length<2)return;const r=e.current.list[e.current.list.length-2];b(r,e.current.list.length-2)()},a=()=>{i.current?.classList?.remove(`${l.$prefixCls}-breadcrumbs-calculation`)},h=r=>{if(!e.current.isShrink)return a();if(e.current.timer&&clearTimeout(e.current.timer),!r){e.current.hidePos=0,e.current.showMore=!1;const s=new Array(e.current.list.length).fill(!1);e.current.hideArr=s,x(s),N(!1)}if(e.current.list.length<=e.current.minNum+1||e.current.hidePos===e.current.list.length-e.current.minNum-1)return a();i.current&&(i.current.classList.add(`${l.$prefixCls}-breadcrumbs-calculation`),e.current.timer=setTimeout(()=>{if(!i.current)return;const s=i.current.clientWidth,n=i.current.querySelector(".breadcrumbs-list"),F=n?n.clientWidth:0,C=i.current.querySelector(".breadcrumbs-back"),_=e.current.isBack&&C?C.clientWidth:0;s>F+_?a():(e.current.hidePos+=1,e.current.hideArr[e.current.hidePos]=!0,x([...e.current.hideArr]),N(!0),h(!0))},50))},P=()=>t.jsxRuntimeExports.jsx("div",{className:"breadcrumbs-popover-content",children:c.map((r,s)=>{if(!d[s])return null;let n="breadcrumbs-popover-content-item";return s!==c.length-1&&!r.disabled&&(n+=" breadcrumbs-popover-content-item-click"),s===c.length-1&&(n+=" breadcrumbs-popover-content-item-current"),r.disabled&&(n+=" breadcrumbs-popover-content-item-disabled"),t.jsxRuntimeExports.jsx("div",{className:n,onClick:b(r,s),children:r.label},s)})}),w=()=>{let r=`${l.$prefixCls}-breadcrumbs-popover`;return j&&(r+=` ${j}`),r},T=()=>{let r=`${l.$prefixCls}-breadcrumbs`;return o&&(r+=` ${l.$prefixCls}-breadcrumbs-shrink`),p&&(r+=` ${p}`),r};return t.jsxRuntimeExports.jsxs("div",{className:T(),style:y,ref:i,children:[t.jsxRuntimeExports.jsx("ul",{className:"breadcrumbs-list",children:c.map((r,s)=>{if(d[s])return;let n="breadcrumbs-item";return s===c.length-1&&(n+=" breadcrumbs-item-current"),s!==c.length-1&&!r.disabled&&(n+=" breadcrumbs-item-click"),r.disabled&&(n+=" breadcrumbs-item-disabled"),t.jsxRuntimeExports.jsxs(u.Fragment,{children:[t.jsxRuntimeExports.jsx("li",{className:n,style:{maxWidth:r.maxWidth||S},onClick:b(r,s),children:t.jsxRuntimeExports.jsx(H.default,{children:t.jsxRuntimeExports.jsx("span",{className:"breadcrumbs-item-content",children:r.label})})}),s!==c.length-1&&t.jsxRuntimeExports.jsx("li",{className:"separator",children:f}),v&&s===0&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(D.Popover,{content:P(),overlayClassName:w(),trigger:A,placement:M,destroyTooltipOnHide:!0,children:t.jsxRuntimeExports.jsx("li",{className:"breadcrumbs-item-more",children:t.jsxRuntimeExports.jsx(L.More,{})})}),!d[c.length-1]&&t.jsxRuntimeExports.jsx("li",{className:"separator",children:f})]})]},s)})}),m&&t.jsxRuntimeExports.jsxs("div",{className:"breadcrumbs-back",children:[t.jsxRuntimeExports.jsx("span",{className:"line"}),t.jsxRuntimeExports.jsx("div",{className:"breadcrumbs-back-content",onClick:B,children:k||t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(O.Return,{}),t.jsxRuntimeExports.jsx("span",{children:W({id:"back"})})]})})]})]})};exports.Breadcrumbs=$;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"),u=require("react"),D=require("../Popover/index.js"),H=require("../AutoTips/index.js"),L=require("../node_modules/@para-ui/icons/More/index.js"),O=require("../node_modules/@para-ui/icons/Return/index.js"),l=require("../GlobalContext/constant.js"),z=require("../GlobalContext/useFormatMessage.js"),I=require("./lang/index.js"),G=require("../Hooks/useResizeObserver.js");;/* empty css */const $=q=>{const{maxWidth:S="160px",className:p,list:c,separator:f="/",popoverClassName:j,isShrink:o=!0,isBack:m=!1,minNum:R=2,trigger:A="hover",placement:M="bottomLeft",backRender:k,onClickItem:E,onBack:g,style:y}=q,W=z.default("Breadcrumbs",I.default),[v,N]=u.useState(!1),[d,x]=u.useState([]),i=u.useRef(null),e=u.useRef({minNum:R,isBack:m,isShrink:o,timer:null,showMore:!1,hideArr:[],hidePos:0,list:c});e.current.isBack=m,e.current.showMore=v,e.current.isShrink=o,e.current.minNum=R,e.current.list=c,G.default({dom:i.current,cb:()=>h()}),u.useEffect(()=>()=>{e.current.timer&&clearTimeout(e.current.timer)},[]),u.useEffect(()=>{const r=new Array(e.current.list.length).fill(!1);e.current.hideArr=r,x(r),h()},[c]);const b=(r,s)=>()=>{e.current.list.length-1===s||r.disabled||E&&E(r)},B=()=>{if(g)return g();if(e.current.list.length<2)return;const r=e.current.list[e.current.list.length-2];b(r,e.current.list.length-2)()},a=()=>{i.current?.classList?.remove(`${l.$prefixCls}-breadcrumbs-calculation`)},h=r=>{if(!e.current.isShrink)return a();if(e.current.timer&&clearTimeout(e.current.timer),!r){e.current.hidePos=0,e.current.showMore=!1;const s=new Array(e.current.list.length).fill(!1);e.current.hideArr=s,x(s),N(!1)}if(e.current.list.length<=e.current.minNum+1||e.current.hidePos===e.current.list.length-e.current.minNum-1)return a();i.current&&(i.current.classList.add(`${l.$prefixCls}-breadcrumbs-calculation`),e.current.timer=setTimeout(()=>{if(!i.current)return;const s=i.current.clientWidth,n=i.current.querySelector(".breadcrumbs-list"),F=n?n.clientWidth:0,C=i.current.querySelector(".breadcrumbs-back"),_=e.current.isBack&&C?C.clientWidth:0;s>F+_?a():(e.current.hidePos+=1,e.current.hideArr[e.current.hidePos]=!0,x([...e.current.hideArr]),N(!0),h(!0))},50))},P=()=>t.jsxRuntimeExports.jsx("div",{className:"breadcrumbs-popover-content",children:c.map((r,s)=>{if(!d[s])return null;let n="breadcrumbs-popover-content-item";return s!==c.length-1&&!r.disabled&&(n+=" breadcrumbs-popover-content-item-click"),s===c.length-1&&(n+=" breadcrumbs-popover-content-item-current"),r.disabled&&(n+=" breadcrumbs-popover-content-item-disabled"),t.jsxRuntimeExports.jsx("div",{className:n,onClick:b(r,s),children:r.label},s)})}),w=()=>{let r=`${l.$prefixCls}-breadcrumbs-popover`;return j&&(r+=` ${j}`),r},T=()=>{let r=`${l.$prefixCls}-breadcrumbs`;return o&&(r+=` ${l.$prefixCls}-breadcrumbs-shrink`),p&&(r+=` ${p}`),r};return t.jsxRuntimeExports.jsxs("div",{className:T(),style:y,ref:i,children:[t.jsxRuntimeExports.jsx("ul",{className:"breadcrumbs-list",children:c.map((r,s)=>{if(d[s])return;let n="breadcrumbs-item";return s===c.length-1&&(n+=" breadcrumbs-item-current"),s!==c.length-1&&!r.disabled&&(n+=" breadcrumbs-item-click"),r.disabled&&(n+=" breadcrumbs-item-disabled"),t.jsxRuntimeExports.jsxs(u.Fragment,{children:[t.jsxRuntimeExports.jsx("li",{className:n,style:{maxWidth:r.maxWidth||S},onClick:b(r,s),children:t.jsxRuntimeExports.jsx(H.default,{children:t.jsxRuntimeExports.jsx("span",{className:"breadcrumbs-item-content",children:r.label})})}),s!==c.length-1&&t.jsxRuntimeExports.jsx("li",{className:"separator",children:f}),v&&s===0&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(D.Popover,{content:P(),overlayClassName:w(),trigger:A,placement:M,destroyTooltipOnHide:!0,children:t.jsxRuntimeExports.jsx("li",{className:"breadcrumbs-item-more",children:t.jsxRuntimeExports.jsx(L.More,{})})}),!d[c.length-1]&&t.jsxRuntimeExports.jsx("li",{className:"separator",children:f})]})]},s)})}),m&&t.jsxRuntimeExports.jsxs("div",{className:"breadcrumbs-back",children:[t.jsxRuntimeExports.jsx("span",{className:"line"}),t.jsxRuntimeExports.jsx("div",{className:"breadcrumbs-back-content",onClick:B,children:k||t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(O.Return,{}),t.jsxRuntimeExports.jsx("span",{children:W({id:"back"})})]})})]})]})};exports.Breadcrumbs=$;exports.default=$;
2
2
  //# sourceMappingURL=index.js.map
@@ -12,7 +12,7 @@ interface Option {
12
12
  /**
13
13
  * 按钮value
14
14
  */
15
- value?: any;
15
+ value?: unknown;
16
16
  /**
17
17
  * 禁用按钮
18
18
  */
@@ -23,7 +23,7 @@ interface Option {
23
23
  disabledTooltip?: TooltipProps;
24
24
  /** 气泡确认框参数 */
25
25
  popConfirmProps?: PopConfirmProps;
26
- [name: string]: any;
26
+ [name: string]: unknown;
27
27
  }
28
28
  type GroupOption = Array<Option>;
29
29
  export interface SplitButtonProps {