@para-ui/core 2.2.5 → 2.2.7-beta

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 (348) hide show
  1. package/AutoBox/index.d.ts +34 -34
  2. package/AutoBox/index.js +203 -15
  3. package/AutoTips/index.d.ts +27 -27
  4. package/AutoTips/index.js +84 -15
  5. package/Breadcrumbs/index.d.ts +39 -39
  6. package/Breadcrumbs/index.js +227 -15
  7. package/Button/SplitButton.d.ts +62 -61
  8. package/Button/index.d.ts +71 -56
  9. package/Button/index.js +348 -14
  10. package/Button/lang/en_US.d.ts +4 -4
  11. package/Button/lang/index.d.ts +9 -9
  12. package/Button/lang/zh_CN.d.ts +4 -4
  13. package/ButtonGroup/index.d.ts +33 -33
  14. package/ButtonGroup/index.js +128 -14
  15. package/Carousel/index.d.ts +30 -30
  16. package/Carousel/index.js +74 -15
  17. package/Cascader/index.d.ts +52 -52
  18. package/Cascader/index.js +166 -15
  19. package/Cascader/lang/en_US.d.ts +4 -4
  20. package/Cascader/lang/index.d.ts +9 -9
  21. package/Cascader/lang/zh_CN.d.ts +4 -4
  22. package/Checkbox/index.d.ts +40 -40
  23. package/Checkbox/index.js +105 -14
  24. package/CheckboxGroup/index.d.ts +46 -46
  25. package/CheckboxGroup/index.js +138 -14
  26. package/Collapse/collapsePanel.d.ts +30 -30
  27. package/Collapse/index.d.ts +57 -57
  28. package/Collapse/index.js +171 -15
  29. package/Collapse/motion.d.ts +5 -5
  30. package/Collapse/util.d.ts +11 -11
  31. package/CollapseBox/index.d.ts +27 -27
  32. package/CollapseBox/index.js +164 -15
  33. package/CollapseBox/util.d.ts +5 -5
  34. package/ColorPicker/index.d.ts +4 -4
  35. package/ColorPicker/index.js +4 -1
  36. package/ComboSelect/WithTabsCombo/index.d.ts +11 -11
  37. package/ComboSelect/WithTabsCombo/interface.d.ts +141 -141
  38. package/ComboSelect/index.d.ts +11 -11
  39. package/ComboSelect/index.js +1803 -14
  40. package/ComboSelect/interface.d.ts +140 -143
  41. package/ComboSelect/lang/en_US.d.ts +8 -8
  42. package/ComboSelect/lang/index.d.ts +17 -17
  43. package/ComboSelect/lang/zh_CN.d.ts +8 -8
  44. package/ComboSelect/utils.d.ts +12 -12
  45. package/Container/index.d.ts +77 -77
  46. package/Container/index.js +239 -15
  47. package/DatePicker/PickerButton.d.ts +3 -3
  48. package/DatePicker/PickerTag.d.ts +3 -3
  49. package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -4
  50. package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -11
  51. package/DatePicker/generatePicker/index.d.ts +77 -77
  52. package/DatePicker/index.d.ts +18 -18
  53. package/DatePicker/index.js +733 -14
  54. package/DatePicker/lang/en_US.d.ts +3 -3
  55. package/DatePicker/lang/index.d.ts +7 -7
  56. package/DatePicker/lang/zh_CN.d.ts +3 -3
  57. package/DatePicker/util.d.ts +20 -20
  58. package/Desktop/index.d.ts +57 -55
  59. package/Desktop/index.js +853 -14
  60. package/Drawer/index.d.ts +11 -11
  61. package/Drawer/index.js +186 -14
  62. package/Drawer/interface.d.ts +83 -83
  63. package/Drawer/lang/en_US.d.ts +5 -5
  64. package/Drawer/lang/index.d.ts +11 -11
  65. package/Drawer/lang/zh_CN.d.ts +5 -5
  66. package/Dropdown/index.d.ts +25 -0
  67. package/Dropdown/index.js +67 -0
  68. package/Empty/images/index.d.ts +3 -2
  69. package/Empty/index.d.ts +30 -30
  70. package/Empty/index.js +644 -14
  71. package/Empty/lang/en_US.d.ts +6 -6
  72. package/Empty/lang/index.d.ts +13 -13
  73. package/Empty/lang/zh_CN.d.ts +6 -6
  74. package/Form/index.d.ts +181 -181
  75. package/Form/index.js +384 -14
  76. package/FormItem/compoments/defaultCompoments/index.d.ts +19 -19
  77. package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -8
  78. package/FormItem/compoments/formFile/index.d.ts +38 -38
  79. package/FormItem/compoments/formRadioGroup/index.d.ts +8 -8
  80. package/FormItem/compoments/formSelect/index.d.ts +18 -18
  81. package/FormItem/errorTips.d.ts +12 -12
  82. package/FormItem/index.d.ts +152 -152
  83. package/FormItem/index.js +81 -14
  84. package/FormItem/itemType.d.ts +42 -42
  85. package/FormItem/validateFunction.d.ts +15 -15
  86. package/FunctionModal/dialog.d.ts +58 -58
  87. package/FunctionModal/index.d.ts +8 -8
  88. package/FunctionModal/index.js +39 -14
  89. package/FunctionModal/modalContext.d.ts +15 -14
  90. package/GlobalContext/componentsProps.d.ts +19 -19
  91. package/GlobalContext/confirmLocale.d.ts +7 -7
  92. package/GlobalContext/index.d.ts +28 -28
  93. package/GlobalContext/index.js +41 -16
  94. package/GlobalContext/intl.d.ts +34 -34
  95. package/GlobalContext/useFormatMessage.d.ts +3 -3
  96. package/Help/index.d.ts +18 -20
  97. package/Help/index.js +39 -15
  98. package/HelperText/index.d.ts +19 -19
  99. package/HelperText/index.js +29 -15
  100. package/Hooks/useGlobalProps.d.ts +1 -1
  101. package/InputLang/index.d.ts +49 -49
  102. package/InputLang/index.js +270 -14
  103. package/InputNumber/index.d.ts +74 -74
  104. package/InputNumber/index.js +308 -14
  105. package/Label/index.d.ts +35 -35
  106. package/Label/index.js +81 -14
  107. package/Loading/index.d.ts +17 -17
  108. package/Loading/index.js +47 -15
  109. package/Menu/footerExpansion.d.ts +9 -9
  110. package/Menu/index.d.ts +10 -10
  111. package/Menu/index.js +1232 -14
  112. package/Menu/interface.d.ts +139 -139
  113. package/Menu/logo.d.ts +9 -9
  114. package/Menu/verticalMenuList.d.ts +14 -14
  115. package/Message/index.d.ts +73 -59
  116. package/Message/index.js +222 -15
  117. package/Modal/Confirm/index.d.ts +65 -66
  118. package/Modal/index.d.ts +90 -61
  119. package/Modal/index.js +443 -14
  120. package/Modal/lang/en_US.d.ts +5 -5
  121. package/Modal/lang/index.d.ts +11 -11
  122. package/Modal/lang/zh_CN.d.ts +5 -5
  123. package/MultiBox/index.d.ts +54 -54
  124. package/MultiBox/index.js +231 -14
  125. package/Notification/index.d.ts +52 -52
  126. package/Notification/index.js +266 -15
  127. package/OperateBtn/index.d.ts +59 -59
  128. package/OperateBtn/index.js +260 -14
  129. package/OperateBtn/lang/en_US.d.ts +4 -4
  130. package/OperateBtn/lang/index.d.ts +9 -9
  131. package/OperateBtn/lang/zh_CN.d.ts +4 -4
  132. package/PageHeader/horizontalMeun.d.ts +9 -9
  133. package/PageHeader/horizontalMeunRight.d.ts +9 -9
  134. package/PageHeader/index.d.ts +10 -10
  135. package/PageHeader/index.js +1171 -14
  136. package/PageHeader/interface.d.ts +167 -167
  137. package/Pagination/index.d.ts +33 -33
  138. package/Pagination/index.js +469 -14
  139. package/Pagination/lang/en_US.d.ts +8 -8
  140. package/Pagination/lang/index.d.ts +17 -17
  141. package/Pagination/lang/zh_CN.d.ts +8 -8
  142. package/ParauiProvider/index.d.ts +8 -12
  143. package/ParauiProvider/index.js +53 -15
  144. package/PopConfirm/index.d.ts +58 -56
  145. package/PopConfirm/index.js +189 -14
  146. package/PopConfirm/lang/en_US.d.ts +5 -5
  147. package/PopConfirm/lang/index.d.ts +11 -11
  148. package/PopConfirm/lang/zh_CN.d.ts +5 -5
  149. package/Popover/index.d.ts +14 -14
  150. package/Popover/index.js +66 -15
  151. package/Progress/Line.d.ts +47 -47
  152. package/Progress/Steps.d.ts +17 -17
  153. package/Progress/index.d.ts +81 -81
  154. package/Progress/index.js +358 -20
  155. package/Progress/utils.d.ts +6 -6
  156. package/Querying/images/index.d.ts +3 -2
  157. package/Querying/index.d.ts +26 -26
  158. package/Querying/index.js +762 -14
  159. package/Querying/lang/en_US.d.ts +4 -4
  160. package/Querying/lang/index.d.ts +9 -9
  161. package/Querying/lang/zh_CN.d.ts +4 -4
  162. package/Radio/index.d.ts +38 -38
  163. package/Radio/index.js +94 -14
  164. package/RadioGroup/index.d.ts +47 -47
  165. package/RadioGroup/index.js +128 -14
  166. package/Search/index.d.ts +56 -56
  167. package/Search/index.js +220 -14
  168. package/Select/index.d.ts +86 -86
  169. package/Select/index.js +1288 -14
  170. package/Select/lang/en_US.d.ts +5 -5
  171. package/Select/lang/index.d.ts +11 -11
  172. package/Select/lang/zh_CN.d.ts +5 -5
  173. package/SelectInput/index.d.ts +11 -11
  174. package/SelectInput/index.js +51 -14
  175. package/SingleBox/index.d.ts +42 -42
  176. package/SingleBox/index.js +194 -14
  177. package/Slider/index.d.ts +14 -14
  178. package/Slider/index.js +125 -15
  179. package/Slider/interface.d.ts +102 -102
  180. package/Split/index.d.ts +7 -7
  181. package/Split/index.js +134 -15
  182. package/Stepper/icons.d.ts +5 -5
  183. package/Stepper/index.d.ts +49 -39
  184. package/Stepper/index.js +99 -15
  185. package/Switch/index.d.ts +78 -78
  186. package/Switch/index.js +73 -14
  187. package/Table/index.d.ts +10 -10
  188. package/Table/index.js +2725 -14
  189. package/Table/interface.d.ts +202 -202
  190. package/Table/lang/en_US.d.ts +6 -6
  191. package/Table/lang/index.d.ts +13 -13
  192. package/Table/lang/zh_CN.d.ts +6 -6
  193. package/Table/tableBody.d.ts +9 -9
  194. package/Table/tableBodyElement/index.d.ts +15 -15
  195. package/Table/tableBodyInterface.d.ts +67 -67
  196. package/Table/tableContainer/index.d.ts +16 -16
  197. package/Table/tableElement/index.d.ts +17 -17
  198. package/Table/tableHead.d.ts +9 -9
  199. package/Table/tableHeadElement/index.d.ts +15 -15
  200. package/Table/tableHeadInterface.d.ts +26 -30
  201. package/Table/tablePagination.d.ts +9 -9
  202. package/Table/tablePaginationInterFace.d.ts +24 -24
  203. package/Table/tdElement/index.d.ts +15 -15
  204. package/Table/thElement/index.d.ts +15 -15
  205. package/Table/trElement/index.d.ts +15 -15
  206. package/Table/util.d.ts +16 -16
  207. package/Tabs/index.d.ts +69 -48
  208. package/Tabs/index.js +218 -14
  209. package/Tabs/lang/en_US.d.ts +4 -0
  210. package/Tabs/lang/index.d.ts +9 -0
  211. package/Tabs/lang/zh_CN.d.ts +4 -0
  212. package/Tag/TagGroup.d.ts +66 -66
  213. package/Tag/index.d.ts +34 -34
  214. package/Tag/index.js +286 -14
  215. package/Test/index.d.ts +3 -2
  216. package/Test/index.js +9 -16
  217. package/TextField/index.d.ts +93 -93
  218. package/TextField/index.js +686 -14
  219. package/TimePicker/index.d.ts +22 -22
  220. package/TimePicker/index.js +77 -14
  221. package/TimePicker/locale/en_US.d.ts +3 -3
  222. package/TimePicker/locale/zh_CN.d.ts +3 -3
  223. package/TimePicker/style/index.d.ts +1 -1
  224. package/Timeline/TimelineItem.d.ts +23 -0
  225. package/Timeline/index.d.ts +31 -22
  226. package/Timeline/index.js +150 -15
  227. package/ToggleButton/ToggleButtonGroup.d.ts +49 -49
  228. package/ToggleButton/index.d.ts +49 -49
  229. package/ToggleButton/index.js +200 -14
  230. package/Tooltip/index.d.ts +11 -14
  231. package/Tooltip/index.js +335 -15
  232. package/Tooltip/interface.d.ts +21 -0
  233. package/Tooltip/utils.d.ts +22 -0
  234. package/Transfer/index.d.ts +18 -17
  235. package/Transfer/index.js +343 -14
  236. package/Transfer/lang/en_US.d.ts +6 -6
  237. package/Transfer/lang/index.d.ts +13 -13
  238. package/Transfer/lang/zh_CN.d.ts +6 -6
  239. package/Tree/OperateBar/index.d.ts +13 -13
  240. package/Tree/Tree.d.ts +4 -4
  241. package/Tree/index.d.ts +5 -5
  242. package/Tree/index.js +35 -14
  243. package/Tree/interface.d.ts +209 -207
  244. package/Tree/lang/en_US.d.ts +8 -8
  245. package/Tree/lang/index.d.ts +17 -17
  246. package/Tree/lang/zh_CN.d.ts +8 -8
  247. package/Tree/utils/tools.d.ts +26 -26
  248. package/Tree/utils/treeUtil.d.ts +15 -15
  249. package/Upload/Dragger/index.d.ts +10 -10
  250. package/Upload/ErroTip/index.d.ts +13 -13
  251. package/Upload/ImageUpload/index.d.ts +14 -14
  252. package/Upload/ImgCrop/EasyCrop.d.ts +17 -17
  253. package/Upload/ImgCrop/constants.d.ts +7 -7
  254. package/Upload/ImgCrop/index.d.ts +6 -6
  255. package/Upload/ImgCrop/interface.d.ts +24 -24
  256. package/Upload/UploadList/index.d.ts +5 -5
  257. package/Upload/index.d.ts +15 -15
  258. package/Upload/index.js +1542 -14
  259. package/Upload/interface.d.ts +134 -134
  260. package/Upload/lang/en_US.d.ts +12 -12
  261. package/Upload/lang/index.d.ts +25 -25
  262. package/Upload/lang/zh_CN.d.ts +12 -12
  263. package/_verture/defineProperty-0590dc61.js +16 -0
  264. package/_verture/index-2c0ecd8d.js +778 -0
  265. package/_verture/index-342379c6.js +391 -0
  266. package/_verture/index-a369ca3f.js +4 -0
  267. package/_verture/index-e2881a53.js +16 -0
  268. package/_verture/index-ee85b1cd.js +1555 -0
  269. package/_verture/intl-336570e4.js +65 -0
  270. package/_verture/modalContext-e7cc8067.js +228 -0
  271. package/_verture/slicedToArray-d7722f4b.js +62 -0
  272. package/_verture/style-inject.es-300983ab.js +28 -0
  273. package/_verture/toConsumableArray-f8047a75.js +19 -0
  274. package/_verture/tslib.es6-55ed4bd2.js +38 -0
  275. package/_verture/typeof-498dd2b1.js +11 -0
  276. package/_verture/useFormatMessage-ac9d6acf.js +20 -0
  277. package/_verture/useGlobalProps-af9a2af6.js +12 -0
  278. package/index.d.ts +128 -128
  279. package/index.js +160 -19
  280. package/package.json +54 -21
  281. package/Popper/index.d.ts +0 -13
  282. package/Popper/index.js +0 -16
  283. package/README.md +0 -495
  284. package/cdn/AutoBox/index.js +0 -29
  285. package/cdn/AutoTips/index.js +0 -40
  286. package/cdn/Breadcrumbs/index.js +0 -53
  287. package/cdn/Button/index.js +0 -79
  288. package/cdn/ButtonGroup/index.js +0 -79
  289. package/cdn/Carousel/index.js +0 -6
  290. package/cdn/Cascader/index.js +0 -42
  291. package/cdn/Checkbox/index.js +0 -53
  292. package/cdn/CheckboxGroup/index.js +0 -53
  293. package/cdn/Collapse/index.js +0 -27
  294. package/cdn/CollapseBox/index.js +0 -1
  295. package/cdn/ColorPicker/index.js +0 -1
  296. package/cdn/ComboSelect/index.js +0 -438
  297. package/cdn/Container/index.js +0 -1
  298. package/cdn/DatePicker/index.js +0 -185
  299. package/cdn/Desktop/index.js +0 -24
  300. package/cdn/Drawer/index.js +0 -84
  301. package/cdn/Empty/index.js +0 -1
  302. package/cdn/Form/index.js +0 -477
  303. package/cdn/FormItem/index.js +0 -477
  304. package/cdn/FunctionModal/index.js +0 -144
  305. package/cdn/GlobalContext/index.js +0 -1
  306. package/cdn/Help/index.js +0 -53
  307. package/cdn/HelperText/index.js +0 -1
  308. package/cdn/InputLang/index.js +0 -144
  309. package/cdn/InputNumber/index.js +0 -118
  310. package/cdn/Label/index.js +0 -53
  311. package/cdn/Loading/index.js +0 -14
  312. package/cdn/Menu/index.js +0 -40
  313. package/cdn/Message/index.js +0 -53
  314. package/cdn/Modal/index.js +0 -144
  315. package/cdn/MultiBox/index.js +0 -131
  316. package/cdn/Notification/index.js +0 -66
  317. package/cdn/OperateBtn/index.js +0 -92
  318. package/cdn/PageHeader/index.js +0 -92
  319. package/cdn/Pagination/index.js +0 -214
  320. package/cdn/ParauiProvider/index.js +0 -9
  321. package/cdn/PopConfirm/index.js +0 -131
  322. package/cdn/Popover/index.js +0 -16
  323. package/cdn/Popper/index.js +0 -26
  324. package/cdn/Progress/index.js +0 -58
  325. package/cdn/Querying/index.js +0 -1
  326. package/cdn/Radio/index.js +0 -53
  327. package/cdn/RadioGroup/index.js +0 -53
  328. package/cdn/Search/index.js +0 -144
  329. package/cdn/Select/index.js +0 -131
  330. package/cdn/SelectInput/index.js +0 -131
  331. package/cdn/SingleBox/index.js +0 -131
  332. package/cdn/Slider/index.js +0 -16
  333. package/cdn/Split/index.js +0 -1
  334. package/cdn/Stepper/index.js +0 -154
  335. package/cdn/Switch/index.js +0 -71
  336. package/cdn/Table/index.js +0 -292
  337. package/cdn/Tabs/index.js +0 -165
  338. package/cdn/Tag/index.js +0 -27
  339. package/cdn/Test/index.js +0 -1
  340. package/cdn/TextField/index.js +0 -105
  341. package/cdn/TimePicker/index.js +0 -185
  342. package/cdn/Timeline/index.js +0 -16
  343. package/cdn/ToggleButton/index.js +0 -79
  344. package/cdn/Tooltip/index.js +0 -40
  345. package/cdn/Transfer/index.js +0 -170
  346. package/cdn/Tree/index.js +0 -170
  347. package/cdn/Upload/index.js +0 -252
  348. package/style.css +0 -72
@@ -1,15 +1,227 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react"),require("@material-ui/core"),require("clsx"),require("@para-ui/icons/More"),require("@paraview/lib")):"function"==typeof define&&define.amd?define(["react","@material-ui/core","clsx","@para-ui/icons/More","@paraview/lib"],r):"object"==typeof exports?exports.ParaUI=r(require("react"),require("@material-ui/core"),require("clsx"),require("@para-ui/icons/More"),require("@paraview/lib")):e.ParaUI=r(e.react,e["@material-ui/core"],e.clsx,e["@para-ui/icons/More"],e["@paraview/lib"])}(self,(function(e,r,t,n,o){return function(){var i={2565:function(e,r,t){(r=t(3645)(!1)).push([e.id,".paraui-auto-tips{max-width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paraui-auto-tips>.auto-tips-content{display:inline;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paraui-auto-tips-tooltip>div{max-height:calc(100vh - 25px);overflow:auto}",""]),e.exports=r},4044:function(e,r,t){(r=t(3645)(!1)).push([e.id,".paraui-breadcrumbs{display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400;line-height:0;height:17px}.paraui-breadcrumbs.paraui-breadcrumbs-shrink{white-space:nowrap}.paraui-breadcrumbs>div{display:inline-block;line-height:17px;vertical-align:middle;color:rgba(46,55,67,.7)}.paraui-breadcrumbs>div svg{font-size:14px;vertical-align:middle;color:rgba(46,55,67,.7)}.paraui-breadcrumbs>div span{display:inline-block;line-height:0;vertical-align:middle;color:rgba(46,55,67,.7)}.paraui-breadcrumbs>div .paraui-auto-tips{line-height:0}.paraui-breadcrumbs>div .paraui-auto-tips .auto-tips-content{line-height:17px}.paraui-breadcrumbs>div .paraui-auto-tips span{line-height:17px}.paraui-breadcrumbs>.breadcrumbs-separator{user-select:none;margin:0 8px}.paraui-breadcrumbs>.breadcrumbs-item-click{cursor:pointer}.paraui-breadcrumbs>.breadcrumbs-item-click:hover{color:#3666d6}.paraui-breadcrumbs>.breadcrumbs-item-click:hover svg{color:#3666d6}.paraui-breadcrumbs>.breadcrumbs-item-click:hover span{color:#3666d6}.paraui-breadcrumbs>.breadcrumbs-item-disabled{color:rgba(46,55,67,.4)}.paraui-breadcrumbs>.more-breadcrumbs{cursor:pointer}.paraui-breadcrumbs>.current-breadcrumbs{color:rgba(46,55,67,.7);font-weight:700}.paraui-breadcrumbs-popover>.paraui-popover-paper{margin-top:8px;padding:0 12px;height:36px;line-height:36px;display:flex;align-items:center}",""]),e.exports=r},5845:function(e,r,t){(r=t(3645)(!1)).push([e.id,".paraui-popover-paper{box-shadow:0px 2px 8px 0px rgba(171,176,185,.4)}",""]),e.exports=r},9929:function(e,r,t){(r=t(3645)(!1)).push([e.id,".paraui-tooltip>div{padding-left:12px;padding-right:12px;font-size:14px;font-weight:400;color:#fff;background-color:rgba(46,55,67,.7)}.paraui-tooltip-left-right>div{margin:0 8px}.paraui-tooltip-top-bottom>div{margin:8px 0}",""]),e.exports=r},3645:function(e){"use strict";e.exports=function(e){var r=[];return r.toString=function(){return this.map((function(r){var t=function(e,r){var t=e[1]||"",n=e[3];if(!n)return t;if(r&&"function"==typeof btoa){var o=(a=n,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),i=n.sources.map((function(e){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(e," */")}));return[t].concat(i).concat([o]).join("\n")}var a,s,c;return[t].join("\n")}(r,e);return r[2]?"@media ".concat(r[2]," {").concat(t,"}"):t})).join("")},r.i=function(e,t,n){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(n)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&o[c[0]]||(t&&(c[2]?c[2]="".concat(t," and ").concat(c[2]):c[2]=t),r.push(c))}},r}},7418:function(e){"use strict";
2
- /*
3
- object-assign
4
- (c) Sindre Sorhus
5
- @license MIT
6
- */var r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(r).map((function(e){return r[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,c=o(e),u=1;u<arguments.length;u++){for(var l in a=Object(arguments[u]))t.call(a,l)&&(c[l]=a[l]);if(r){s=r(a);for(var p=0;p<s.length;p++)n.call(a,s[p])&&(c[s[p]]=a[s[p]])}}return c}},5251:function(e,r,t){"use strict";
7
- /** @license React v17.0.2
8
- * react-jsx-runtime.production.min.js
9
- *
10
- * Copyright (c) Facebook, Inc. and its affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- t(7418);var n=t(8156),o=60103;if(60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),i("react.fragment")}var a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,r,t){var n,i={},u=null,l=null;for(n in void 0!==t&&(u=""+t),void 0!==r.key&&(u=""+r.key),void 0!==r.ref&&(l=r.ref),r)s.call(r,n)&&!c.hasOwnProperty(n)&&(i[n]=r[n]);if(e&&e.defaultProps)for(n in r=e.defaultProps)void 0===i[n]&&(i[n]=r[n]);return{$$typeof:o,type:e,key:u,ref:l,props:i,_owner:a.current}}r.jsx=u,r.jsxs=u},5893:function(e,r,t){"use strict";e.exports=t(5251)},9271:function(e,r,t){var n=t(3379),o=t(2565);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},4047:function(e,r,t){var n=t(3379),o=t(4044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},8939:function(e,r,t){var n=t(3379),o=t(5845);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},2310:function(e,r,t){var n=t(3379),o=t(9929);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:("body","body"),singleton:!1};n(o,i);e.exports=o.locals||{}},3379:function(e,r,t){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},i=function(){var e={};return function(r){if(void 0===e[r]){var t=document.querySelector(r);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[r]=t}return e[r]}}(),a=[];function s(e){for(var r=-1,t=0;t<a.length;t++)if(a[t].identifier===e){r=t;break}return r}function c(e,r){for(var t={},n=[],o=0;o<e.length;o++){var i=e[o],c=r.base?i[0]+r.base:i[0],u=t[c]||0,l="".concat(c," ").concat(u);t[c]=u+1;var p=s(l),d={css:i[1],media:i[2],sourceMap:i[3]};-1!==p?(a[p].references++,a[p].updater(d)):a.push({identifier:l,updater:v(d,r),references:1}),n.push(l)}return n}function u(e){var r=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var o=t.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(e){r.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(r);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(r)}return r}var l,p=(l=[],function(e,r){return l[e]=r,l.filter(Boolean).join("\n")});function d(e,r,t,n){var o=t?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=p(r,o);else{var i=document.createTextNode(o),a=e.childNodes;a[r]&&e.removeChild(a[r]),a.length?e.insertBefore(i,a[r]):e.appendChild(i)}}function f(e,r,t){var n=t.css,o=t.media,i=t.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var b=null,m=0;function v(e,r){var t,n,o;if(r.singleton){var i=m++;t=b||(b=u(r)),n=d.bind(null,t,i,!1),o=d.bind(null,t,i,!0)}else t=u(r),n=f.bind(null,t,r),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)};return n(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;n(e=r)}else o()}}e.exports=function(e,r){(r=r||{}).singleton||"boolean"==typeof r.singleton||(r.singleton=o());var t=c(e=e||[],r);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<t.length;n++){var o=s(t[n]);a[o].references--}for(var i=c(e,r),u=0;u<t.length;u++){var l=s(t[u]);0===a[l].references&&(a[l].updater(),a.splice(l,1))}t=i}}}},7839:function(e,r,t){"use strict";var n=t(5893),o=t(8156),i=t(7371),a=(t(9271),function(){return a=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},a.apply(this,arguments)});r.default=function(e){var r=e.children,t=e.arrow,s=void 0!==t&&t,c=e.placement,u=void 0===c?"bottom-start":c,l=e.tips,p=void 0===l?"":l,d=e.className,f=void 0===d?"":d,b=e.beyondText,m=void 0===b||b,v=e.interactive,h=void 0===v||v,y=e.style,g=(0,o.useRef)(),x=(0,o.useState)(""),j=x[0],w=x[1];(0,o.useEffect)((function(){w(p)}),[p]);var O;return(0,n.jsx)("div",a({ref:g,className:(O="paraui-auto-tips",f&&(O+=" "+f),O),onMouseOver:function(){var e="";g.current&&g.current.scrollWidth>g.current.offsetWidth&&(e=p||(m?g.current.innerText:r)),w(e)},style:y},{children:(0,n.jsx)(i.default,a({arrow:s,title:j,placement:u,interactive:h,boundariesElement:"viewport",className:"paraui-auto-tips-tooltip"},{children:(0,n.jsx)("div",a({className:"auto-tips-content"},{children:r}))}))}))}},7083:function(e,r,t){"use strict";var n=t(5893),o=t(670),i=(t(8939),function(){return i=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},i.apply(this,arguments)}),a=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};r.default=function(e){var r,t=e.className,s=e.children,c=e.classes,u=e.style,l=a(e,["className","children","classes","style"]);return(0,n.jsx)(o.Popover,i({style:i({zIndex:1300},u),className:(r="paraui-popover",t&&(r+=" "+t),r),classes:{paper:c?"paraui-popover-paper ".concat(c):"paraui-popover-paper"}},l,{children:s}))}},7371:function(e,r,t){"use strict";var n=t(5893),o=t(670),i=t(5744),a=t.n(i),s=(t(2310),function(){return s=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},s.apply(this,arguments)}),c=function(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t};r.default=function(e){var r,t=e.placement,i=void 0===t?"top-start":t,u=e.className,l=e.arrow,p=void 0===l||l,d=e.PopperProps,f=e.boundariesElement,b=void 0===f?"scrollParent":f,m=c(e,["placement","className","arrow","PopperProps","boundariesElement"]),v=s(s({},e.classes),{popper:a()("paraui-tooltip",u,null===(r=e.classes)||void 0===r?void 0:r.popper,{"paraui-tooltip-left-right":(null==i?void 0:i.includes("left"))||(null==i?void 0:i.includes("right")),"paraui-tooltip-top-bottom":(null==i?void 0:i.includes("top"))||(null==i?void 0:i.includes("bottom"))})});return(0,n.jsx)(o.Tooltip,s({},m,{enterTouchDelay:0,arrow:p,placement:i,classes:v,PopperProps:s(s({},d),{modifiers:{preventOverflow:{boundariesElement:b}}})}))}},670:function(e){"use strict";e.exports=r},7037:function(e){"use strict";e.exports=n},8543:function(e){"use strict";e.exports=o},5744:function(e){"use strict";e.exports=t},8156:function(r){"use strict";r.exports=e}},a={};function s(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,exports:{}};return i[e](t,t.exports,s),t.exports}s.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(r,{a:r}),r},s.d=function(e,r){for(var t in r)s.o(r,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},s.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nc=void 0;var c={};return function(){"use strict";s.r(c),s.d(c,{Breadcrumbs:function(){return p}});var e=s(5893),r=s(8156),t=s(7083),n=s(7839),o=s(7037),i=s.n(o),a=s(8543),u=(s(4047),function(){return u=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},u.apply(this,arguments)}),l=function(e,r,t){if(t||2===arguments.length)for(var n,o=0,i=r.length;o<i;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))},p=function(o){var s=o.maxWidth,c=void 0===s?"":s,p=o.className,d=o.list,f=o.separator,b=void 0===f?"/":f,m=o.popoverClassName,v=o.isShrink,h=void 0===v||v,y=o.onClickItem,g=o.style,x=(0,r.useState)("breadcrumbs-"+(0,a.UUID)())[0],j=(0,r.useState)([]),w=j[0],O=j[1],S=(0,r.useState)(0),N=S[0],P=S[1],_=(0,r.useState)(!1),k=_[0],E=_[1],C=(0,r.useState)({})[0],M=(0,r.useRef)();(0,r.useEffect)((function(){setTimeout((function(){var e=document.querySelector("."+x);e&&P(e.offsetWidth)})),O(l([],d,!0))}),[d]),(0,r.useEffect)((function(){return h?(setTimeout((function(){T()})),window.addEventListener("resize",T)):window.removeEventListener("resize",T),function(){window.removeEventListener("resize",T)}}),[w,N,h]);var T=function(){if(!(d.length<=2||0===N)){var e=document.querySelector("."+x);if(e&&N)if(e.parentNode&&e.parentNode.offsetWidth>=N){if(!C.scroll)return;C.scroll=!1,O(l([],d,!0)),E(!1)}else{if(C.scroll)return;C.scroll=!0;var r=[];r.push(d[0]),r.push({more:"more-breadcrumbs"}),r.push(d[d.length-1]),O(l([],r,!0))}}},q=function(e){return function(){e.disabled||("more-breadcrumbs"===e.more?E(!0):y&&y(e))}},I=function(){E(!1)},R=function(){var e="paraui-breadcrumbs "+x;return h&&(e+=" paraui-breadcrumbs-shrink"),p&&(e+=" "+p),e},L=function(e,r,t){var n=" breadcrumbs-item";return r===t.length-1&&(n+=" current-breadcrumbs"),e.disabled?n+=" breadcrumbs-item-disabled":n+=" breadcrumbs-item-click",n},U=(0,r.useMemo)((function(){return k&&(0,e.jsx)(t.default,u({open:k,anchorEl:M.current,onClose:I,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:(n="paraui-breadcrumbs-popover",m&&(n+=" "+m),n)},{children:(0,e.jsx)("div",u({className:R()},{children:d.map((function(t,n){var o=d.length-1!==n;return(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({onClick:q(t),className:L(t,n,d)},{children:t.label})),o&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},n)}))}))}));var n}),[k,M,b,d,m]),W=function(e){var r={};return c&&(r.maxWidth=c),e.maxWidth&&(r.maxWidth=e.maxWidth),r};return(0,e.jsxs)("div",u({className:R(),style:g,ref:M},{children:[w.map((function(t,o){var a=w.length-1!==o;return"more-breadcrumbs"===t.more?(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({onClick:q(t),className:"more-breadcrumbs"},{children:(0,e.jsx)(i(),{})})),a&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},o):(0,e.jsxs)(r.Fragment,{children:[(0,e.jsx)("div",u({style:W(t),onClick:q(t),className:L(t,o,w)},{children:(0,e.jsx)(n.default,{children:t.label})})),a&&(0,e.jsx)("div",u({className:"breadcrumbs-separator"},{children:b}))]},o)})),U]}))};c.default=p}(),c}()}));
1
+ import { _ as _toConsumableArray } from '../_verture/toConsumableArray-f8047a75.js';
2
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-d7722f4b.js';
3
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
+ import { useState, useRef, useEffect, Fragment as Fragment$1 } from 'react';
5
+ import { Popover } from '../Popover/index.js';
6
+ import AutoTips from '../AutoTips/index.js';
7
+ import More from '@para-ui/icons/More';
8
+ import { UUID } from '@paraview/lib';
9
+ import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
10
+ import '../_verture/tslib.es6-55ed4bd2.js';
11
+ import '../Tooltip/index.js';
12
+ import 'rc-tooltip';
13
+ import 'rc-tooltip/lib/placements';
14
+ import 'clsx';
15
+
16
+ var css_248z = "@charset \"UTF-8\";\n/**\n * @author linhd\n * @date 2021年10月25日 14:58:12\n * @description 面包屑\n */\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-breadcrumbs {\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n line-height: 0;\n height: 17px;\n}\n.paraui-breadcrumbs.paraui-breadcrumbs-shrink {\n white-space: nowrap;\n}\n.paraui-breadcrumbs > div {\n display: inline-block;\n line-height: 17px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div svg {\n font-size: 14px;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div span {\n display: inline-block;\n line-height: 0;\n vertical-align: middle;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-breadcrumbs > div .paraui-auto-tips {\n line-height: 0;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips .auto-tips-content {\n line-height: 17px;\n}\n.paraui-breadcrumbs > div .paraui-auto-tips span {\n line-height: 17px;\n}\n.paraui-breadcrumbs > .breadcrumbs-separator {\n user-select: none;\n margin: 0 8px;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-click:hover span {\n color: rgb(54, 102, 214);\n}\n.paraui-breadcrumbs > .breadcrumbs-item-disabled {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-breadcrumbs > .more-breadcrumbs {\n cursor: pointer;\n}\n.paraui-breadcrumbs > .current-breadcrumbs {\n color: rgba(46, 55, 67, 0.7);\n font-weight: 700;\n}\n\n.paraui-breadcrumbs-popover > .paraui-popover-content > .paraui-popover-inner {\n display: flex;\n align-items: center;\n height: 36px;\n line-height: 0;\n padding: 0 12px;\n}";
17
+ styleInject(css_248z);
18
+
19
+ var Breadcrumbs = function Breadcrumbs(props) {
20
+ var _props$maxWidth = props.maxWidth,
21
+ maxWidth = _props$maxWidth === void 0 ? '' : _props$maxWidth,
22
+ className = props.className,
23
+ list = props.list,
24
+ _props$separator = props.separator,
25
+ separator = _props$separator === void 0 ? '/' : _props$separator,
26
+ popoverClassName = props.popoverClassName,
27
+ _props$isShrink = props.isShrink,
28
+ isShrink = _props$isShrink === void 0 ? true : _props$isShrink,
29
+ onClickItem = props.onClickItem,
30
+ style = props.style;
31
+
32
+ var _useState = useState('breadcrumbs-' + UUID()),
33
+ _useState2 = _slicedToArray(_useState, 1),
34
+ classStr = _useState2[0];
35
+
36
+ var _useState3 = useState([]),
37
+ _useState4 = _slicedToArray(_useState3, 2),
38
+ listCom = _useState4[0],
39
+ setListCom = _useState4[1];
40
+
41
+ var _useState5 = useState(0),
42
+ _useState6 = _slicedToArray(_useState5, 2),
43
+ oneNum = _useState6[0],
44
+ setOneNum = _useState6[1];
45
+
46
+ var _useState7 = useState(false),
47
+ _useState8 = _slicedToArray(_useState7, 2),
48
+ open = _useState8[0],
49
+ setOpen = _useState8[1];
50
+
51
+ var _useState9 = useState({}),
52
+ _useState10 = _slicedToArray(_useState9, 1),
53
+ constData = _useState10[0];
54
+
55
+ var ref = useRef();
56
+ useEffect(function () {
57
+ setTimeout(function () {
58
+ var dom = document.querySelector('.' + classStr);
59
+ if (dom) setOneNum(dom.offsetWidth);
60
+ });
61
+ setListCom(_toConsumableArray(list));
62
+ }, [list]);
63
+ useEffect(function () {
64
+ if (isShrink) {
65
+ setTimeout(function () {
66
+ changeSize();
67
+ });
68
+ window.addEventListener("resize", changeSize);
69
+ } else window.removeEventListener("resize", changeSize);
70
+
71
+ return function () {
72
+ window.removeEventListener("resize", changeSize);
73
+ };
74
+ }, [listCom, oneNum, isShrink]);
75
+
76
+ var changeSize = function changeSize() {
77
+ if (list.length <= 2 || oneNum === 0) return;
78
+ var refDom = document.querySelector('.' + classStr);
79
+
80
+ if (refDom && oneNum) {
81
+ if (refDom.parentNode && refDom.parentNode.offsetWidth >= oneNum) {
82
+ if (!constData.scroll) return;
83
+ constData.scroll = false;
84
+ setListCom(_toConsumableArray(list));
85
+ setOpen(false);
86
+ } else {
87
+ if (constData.scroll) return;
88
+ constData.scroll = true; // 滚动
89
+
90
+ var arr = [];
91
+ arr.push(list[0]);
92
+ arr.push({
93
+ more: 'more-breadcrumbs'
94
+ });
95
+ arr.push(list[list.length - 1]);
96
+ setListCom([].concat(arr));
97
+ }
98
+ }
99
+ }; // 点击菜单
100
+
101
+
102
+ var handleClick = function handleClick(item) {
103
+ return function () {
104
+ if (item.disabled) return;
105
+
106
+ if (item.more === 'more-breadcrumbs') {
107
+ setOpen(true);
108
+ } else {
109
+ if (onClickItem) onClickItem(item);
110
+ }
111
+ };
112
+ }; // 处理弹出框className
113
+
114
+
115
+ var popoverHandClass = function popoverHandClass() {
116
+ var str = 'paraui-breadcrumbs-popover';
117
+ if (popoverClassName) str += ' ' + popoverClassName;
118
+ return str;
119
+ }; // 关闭弹出菜单
120
+
121
+
122
+ var handleClose = function handleClose(bol) {
123
+ if (!bol) setOpen(false);
124
+ }; // 处理className
125
+
126
+
127
+ var handClass = function handClass() {
128
+ var str = 'paraui-breadcrumbs ' + classStr;
129
+ if (isShrink) str += ' paraui-breadcrumbs-shrink';
130
+ if (className) str += ' ' + className;
131
+ return str;
132
+ };
133
+
134
+ var handClassItem = function handClassItem(item, index, arr) {
135
+ var str = ' breadcrumbs-item';
136
+ if (index === arr.length - 1) str += ' current-breadcrumbs';
137
+ if (!item.disabled) str += ' breadcrumbs-item-click';else str += ' breadcrumbs-item-disabled';
138
+ return str;
139
+ };
140
+
141
+ var popoverContent = function popoverContent() {
142
+ return jsx("div", Object.assign({
143
+ className: handClass()
144
+ }, {
145
+ children: list.map(function (item, index) {
146
+ var showSeparator = list.length - 1 !== index;
147
+ return jsxs(Fragment$1, {
148
+ children: [jsx("div", Object.assign({
149
+ onClick: handleClick(item),
150
+ className: handClassItem(item, index, list)
151
+ }, {
152
+ children: item.label
153
+ })), showSeparator && jsx("div", Object.assign({
154
+ className: "breadcrumbs-separator"
155
+ }, {
156
+ children: separator
157
+ }))]
158
+ }, index);
159
+ })
160
+ }));
161
+ };
162
+
163
+ var handStyle = function handStyle(item) {
164
+ var obj = {};
165
+ if (maxWidth) obj.maxWidth = maxWidth;
166
+ if (item.maxWidth) obj.maxWidth = item.maxWidth;
167
+ return obj;
168
+ };
169
+
170
+ var handContent = function handContent() {
171
+ return jsx("div", Object.assign({
172
+ className: handClass(),
173
+ style: style,
174
+ ref: ref
175
+ }, {
176
+ children: listCom.map(function (item, index) {
177
+ var showSeparator = listCom.length - 1 !== index;
178
+
179
+ if (item.more === 'more-breadcrumbs') {
180
+ // 更多
181
+ return jsxs(Fragment$1, {
182
+ children: [jsx("div", Object.assign({
183
+ onClick: handleClick(item),
184
+ className: "more-breadcrumbs"
185
+ }, {
186
+ children: jsx(More, {})
187
+ })), showSeparator && jsx("div", Object.assign({
188
+ className: "breadcrumbs-separator"
189
+ }, {
190
+ children: separator
191
+ }))]
192
+ }, index);
193
+ }
194
+
195
+ return jsxs(Fragment$1, {
196
+ children: [jsx("div", Object.assign({
197
+ style: handStyle(item),
198
+ onClick: handleClick(item),
199
+ className: handClassItem(item, index, listCom)
200
+ }, {
201
+ children: jsx(AutoTips, {
202
+ children: item.label
203
+ })
204
+ })), showSeparator && jsx("div", Object.assign({
205
+ className: "breadcrumbs-separator"
206
+ }, {
207
+ children: separator
208
+ }))]
209
+ }, index);
210
+ })
211
+ }));
212
+ };
213
+
214
+ return jsx(Fragment, {
215
+ children: isShrink ? jsx(Popover, Object.assign({
216
+ placement: 'bottom-start',
217
+ visible: open,
218
+ content: popoverContent(),
219
+ onVisibleChange: handleClose,
220
+ overlayClassName: popoverHandClass()
221
+ }, {
222
+ children: handContent()
223
+ })) : handContent()
224
+ });
225
+ };
226
+
227
+ export { Breadcrumbs, Breadcrumbs as default };
@@ -1,61 +1,62 @@
1
- /**
2
- * @author Hanz
3
- * @date 2021/8/4 上午10:22
4
- * @description 分体式按钮组
5
- */
6
- import React from 'react';
7
- import { PopperPlacementType } from '@material-ui/core';
8
- import { ButtonProps } from '../Button';
9
- interface Option {
10
- /**
11
- * 按钮文字
12
- */
13
- label: string;
14
- /**
15
- * 按钮value
16
- */
17
- value?: any;
18
- /**
19
- * 禁用按钮
20
- */
21
- disabled?: boolean;
22
- [name: string]: any;
23
- }
24
- declare type GroupOption = Array<Option>;
25
- export interface SplitButtonProps {
26
- /**
27
- * 分体式按钮文本
28
- */
29
- buttonText?: React.ReactNode;
30
- /** 按钮选项数组 */
31
- options?: Option[] | GroupOption[];
32
- /** cls */
33
- className?: string;
34
- /** style */
35
- style?: React.CSSProperties;
36
- /** popperClassName */
37
- popperClassName?: string;
38
- /** popperStyle */
39
- popperStyle?: React.CSSProperties;
40
- /** 禁用按钮组 */
41
- disabled?: boolean;
42
- /** 浮层位置 */
43
- placement?: PopperPlacementType;
44
- /** button props */
45
- buttonProps?: ButtonProps;
46
- /**
47
- * click callback
48
- * @param option
49
- * @param evt
50
- */
51
- onClick?: (option: Option, evt?: React.MouseEvent<HTMLElement>) => void;
52
- /**
53
- * 自定义选项渲染
54
- * @param option
55
- */
56
- optionRender?: (option: Option) => React.ReactNode;
57
- /** 图标按钮 */
58
- iconButton?: boolean;
59
- }
60
- export default function SplitButton(props: SplitButtonProps): JSX.Element;
61
- export {};
1
+ /**
2
+ * @author Hanz
3
+ * @date 2021/8/4 上午10:22
4
+ * @description 分体式按钮组
5
+ */
6
+ import React from 'react';
7
+ import { ButtonProps } from '../Button';
8
+ import { Placement } from '../Dropdown';
9
+ import './index.scss';
10
+ interface Option {
11
+ /**
12
+ * 按钮文字
13
+ */
14
+ label: string;
15
+ /**
16
+ * 按钮value
17
+ */
18
+ value?: any;
19
+ /**
20
+ * 禁用按钮
21
+ */
22
+ disabled?: boolean;
23
+ [name: string]: any;
24
+ }
25
+ declare type GroupOption = Array<Option>;
26
+ export interface SplitButtonProps {
27
+ /**
28
+ * 分体式按钮文本
29
+ */
30
+ buttonText?: React.ReactNode;
31
+ /** 按钮选项数组 */
32
+ options?: Option[] | GroupOption[];
33
+ /** cls */
34
+ className?: string;
35
+ /** style */
36
+ style?: React.CSSProperties;
37
+ /** popperClassName */
38
+ popperClassName?: string;
39
+ /** popperStyle */
40
+ popperStyle?: React.CSSProperties;
41
+ /** 禁用按钮组 */
42
+ disabled?: boolean;
43
+ /** 浮层位置 */
44
+ placement?: Placement;
45
+ /** button props */
46
+ buttonProps?: ButtonProps;
47
+ /**
48
+ * click callback
49
+ * @param option
50
+ * @param evt
51
+ */
52
+ onClick?: (option: Option, evt?: React.MouseEvent<HTMLElement>) => void;
53
+ /**
54
+ * 自定义选项渲染
55
+ * @param option
56
+ */
57
+ optionRender?: (option: Option) => React.ReactNode;
58
+ /** 图标按钮 */
59
+ iconButton?: boolean;
60
+ }
61
+ export default function SplitButton(props: SplitButtonProps): JSX.Element;
62
+ export {};
package/Button/index.d.ts CHANGED
@@ -1,56 +1,71 @@
1
- /**
2
- * @author Hanz
3
- * @date 2021/8/4 上午10:21
4
- * @description 按钮
5
- */
6
- import React, { FunctionComponent } from 'react';
7
- import { ButtonProps as MuiButtonProps, IconButtonProps as MuiIconButtonProps } from "@material-ui/core";
8
- import { TooltipProps } from '../Tooltip';
9
- import SplitButton from "./SplitButton";
10
- import './index.scss';
11
- export interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {
12
- variant?: 'contained' | 'outlined' | 'text';
13
- /** 设置按钮载入状态 */
14
- loading?: boolean | {
15
- delay: number;
16
- };
17
- /**
18
- * 禁用时提示文字 disabled 为true有效
19
- */
20
- toolTipTitle?: NonNullable<React.ReactNode>;
21
- /**
22
- * tooltip props
23
- */
24
- TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
25
- /**
26
- * 设置危险按钮
27
- */
28
- danger?: boolean;
29
- }
30
- export interface IconButtonProps extends Omit<MuiIconButtonProps, 'size'> {
31
- /** 按钮形状 */
32
- variant?: 'contained' | 'outlined' | 'text';
33
- size?: 'small' | 'medium' | 'large';
34
- /** tooltip title */
35
- toolTipTitle?: NonNullable<React.ReactNode>;
36
- /** 设置按钮载入状态 */
37
- loading?: boolean | {
38
- delay: number;
39
- };
40
- /**
41
- * tooltip props
42
- */
43
- TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
44
- /**
45
- * 设置危险按钮
46
- */
47
- danger?: boolean;
48
- }
49
- declare const InternalButton: FunctionComponent<ButtonProps>;
50
- declare const IconButton: FunctionComponent<IconButtonProps>;
51
- declare type mergedButtonType = typeof InternalButton & {
52
- IconButton: typeof IconButton;
53
- SplitButton: typeof SplitButton;
54
- };
55
- export declare const Button: mergedButtonType;
56
- export default Button;
1
+ /**
2
+ * @author Hanz
3
+ * @date 2021/8/4 上午10:21
4
+ * @description 按钮
5
+ */
6
+ import React, { FunctionComponent } from 'react';
7
+ import { TooltipProps } from '../Tooltip';
8
+ import SplitButton from "./SplitButton";
9
+ import './index.scss';
10
+ export interface ButtonProps extends React.ButtonHTMLAttributes<any> {
11
+ variant?: 'contained' | 'outlined' | 'text';
12
+ /** 设置按钮载入状态 */
13
+ loading?: boolean | {
14
+ delay: number;
15
+ };
16
+ /**
17
+ * 禁用时提示文字 disabled 为true有效
18
+ */
19
+ toolTipTitle?: NonNullable<React.ReactNode>;
20
+ /**
21
+ * tooltip props
22
+ */
23
+ TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
24
+ /**
25
+ * 设置危险按钮
26
+ */
27
+ danger?: boolean;
28
+ /** content */
29
+ children?: React.ReactNode;
30
+ /** 禁用 */
31
+ disabled?: boolean;
32
+ /** 大小 */
33
+ size?: 'small' | 'medium' | 'large';
34
+ /** 后置图标 */
35
+ endIcon?: React.ReactNode;
36
+ /** 前置图标 */
37
+ startIcon?: React.ReactNode;
38
+ [name: string]: any;
39
+ }
40
+ export interface IconButtonProps extends React.ButtonHTMLAttributes<any> {
41
+ /** 按钮形状 */
42
+ variant?: 'contained' | 'outlined' | 'text';
43
+ size?: 'small' | 'medium' | 'large';
44
+ /** tooltip title */
45
+ toolTipTitle?: NonNullable<React.ReactNode>;
46
+ /** 设置按钮载入状态 */
47
+ loading?: boolean | {
48
+ delay: number;
49
+ };
50
+ /**
51
+ * tooltip props
52
+ */
53
+ TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
54
+ /**
55
+ * 设置危险按钮
56
+ */
57
+ danger?: boolean;
58
+ /** 禁用 */
59
+ disabled?: boolean;
60
+ /** content */
61
+ children?: React.ReactNode;
62
+ [name: string]: any;
63
+ }
64
+ declare const InternalButton: FunctionComponent<ButtonProps>;
65
+ declare const IconButton: FunctionComponent<IconButtonProps>;
66
+ declare type mergedButtonType = typeof InternalButton & {
67
+ IconButton: typeof IconButton;
68
+ SplitButton: typeof SplitButton;
69
+ };
70
+ export declare const Button: mergedButtonType;
71
+ export default Button;