@para-ui/core 2.2.7-beta → 2.2.9

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 +15 -203
  3. package/AutoTips/index.d.ts +27 -27
  4. package/AutoTips/index.js +15 -84
  5. package/Breadcrumbs/index.d.ts +39 -39
  6. package/Breadcrumbs/index.js +15 -227
  7. package/Button/SplitButton.d.ts +61 -62
  8. package/Button/index.d.ts +56 -71
  9. package/Button/index.js +14 -348
  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 +14 -128
  15. package/Carousel/index.d.ts +30 -30
  16. package/Carousel/index.js +15 -74
  17. package/Cascader/index.d.ts +52 -52
  18. package/Cascader/index.js +15 -166
  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 +14 -105
  24. package/CheckboxGroup/index.d.ts +46 -46
  25. package/CheckboxGroup/index.js +14 -138
  26. package/Collapse/collapsePanel.d.ts +30 -30
  27. package/Collapse/index.d.ts +57 -57
  28. package/Collapse/index.js +15 -171
  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 +15 -164
  33. package/CollapseBox/util.d.ts +5 -5
  34. package/ColorPicker/index.d.ts +4 -4
  35. package/ColorPicker/index.js +1 -4
  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 +14 -1803
  40. package/ComboSelect/interface.d.ts +143 -140
  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 +15 -239
  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 +14 -733
  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 +55 -57
  59. package/Desktop/index.js +14 -853
  60. package/Drawer/index.d.ts +11 -11
  61. package/Drawer/index.js +14 -186
  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/Empty/images/index.d.ts +2 -3
  67. package/Empty/index.d.ts +30 -30
  68. package/Empty/index.js +14 -644
  69. package/Empty/lang/en_US.d.ts +6 -6
  70. package/Empty/lang/index.d.ts +13 -13
  71. package/Empty/lang/zh_CN.d.ts +6 -6
  72. package/Form/index.d.ts +181 -181
  73. package/Form/index.js +14 -384
  74. package/FormItem/compoments/defaultCompoments/index.d.ts +19 -19
  75. package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -8
  76. package/FormItem/compoments/formFile/index.d.ts +38 -38
  77. package/FormItem/compoments/formRadioGroup/index.d.ts +8 -8
  78. package/FormItem/compoments/formSelect/index.d.ts +18 -18
  79. package/FormItem/errorTips.d.ts +12 -12
  80. package/FormItem/index.d.ts +152 -152
  81. package/FormItem/index.js +14 -81
  82. package/FormItem/itemType.d.ts +42 -42
  83. package/FormItem/validateFunction.d.ts +15 -15
  84. package/FunctionModal/dialog.d.ts +58 -58
  85. package/FunctionModal/index.d.ts +8 -8
  86. package/FunctionModal/index.js +14 -39
  87. package/FunctionModal/modalContext.d.ts +14 -15
  88. package/GlobalContext/componentsProps.d.ts +19 -19
  89. package/GlobalContext/confirmLocale.d.ts +7 -7
  90. package/GlobalContext/index.d.ts +28 -28
  91. package/GlobalContext/index.js +16 -41
  92. package/GlobalContext/intl.d.ts +34 -34
  93. package/GlobalContext/useFormatMessage.d.ts +3 -3
  94. package/Help/index.d.ts +20 -18
  95. package/Help/index.js +15 -39
  96. package/HelperText/index.d.ts +19 -19
  97. package/HelperText/index.js +15 -29
  98. package/Hooks/useGlobalProps.d.ts +1 -1
  99. package/InputLang/index.d.ts +49 -49
  100. package/InputLang/index.js +14 -270
  101. package/InputNumber/index.d.ts +74 -74
  102. package/InputNumber/index.js +14 -308
  103. package/Label/index.d.ts +35 -35
  104. package/Label/index.js +14 -81
  105. package/Loading/index.d.ts +17 -17
  106. package/Loading/index.js +15 -47
  107. package/Menu/footerExpansion.d.ts +9 -9
  108. package/Menu/index.d.ts +10 -10
  109. package/Menu/index.js +14 -1232
  110. package/Menu/interface.d.ts +139 -139
  111. package/Menu/logo.d.ts +9 -9
  112. package/Menu/verticalMenuList.d.ts +14 -14
  113. package/Message/index.d.ts +73 -73
  114. package/Message/index.js +15 -222
  115. package/Modal/Confirm/index.d.ts +66 -65
  116. package/Modal/index.d.ts +61 -90
  117. package/Modal/index.js +14 -443
  118. package/Modal/lang/en_US.d.ts +5 -5
  119. package/Modal/lang/index.d.ts +11 -11
  120. package/Modal/lang/zh_CN.d.ts +5 -5
  121. package/MultiBox/index.d.ts +54 -54
  122. package/MultiBox/index.js +14 -231
  123. package/Notification/index.d.ts +52 -52
  124. package/Notification/index.js +15 -266
  125. package/OperateBtn/index.d.ts +59 -59
  126. package/OperateBtn/index.js +14 -260
  127. package/OperateBtn/lang/en_US.d.ts +4 -4
  128. package/OperateBtn/lang/index.d.ts +9 -9
  129. package/OperateBtn/lang/zh_CN.d.ts +4 -4
  130. package/PageHeader/horizontalMeun.d.ts +9 -9
  131. package/PageHeader/horizontalMeunRight.d.ts +9 -9
  132. package/PageHeader/index.d.ts +10 -10
  133. package/PageHeader/index.js +14 -1171
  134. package/PageHeader/interface.d.ts +167 -167
  135. package/Pagination/index.d.ts +33 -33
  136. package/Pagination/index.js +14 -469
  137. package/Pagination/lang/en_US.d.ts +8 -8
  138. package/Pagination/lang/index.d.ts +17 -17
  139. package/Pagination/lang/zh_CN.d.ts +8 -8
  140. package/ParauiProvider/index.d.ts +12 -8
  141. package/ParauiProvider/index.js +15 -53
  142. package/PopConfirm/index.d.ts +56 -58
  143. package/PopConfirm/index.js +14 -189
  144. package/PopConfirm/lang/en_US.d.ts +5 -5
  145. package/PopConfirm/lang/index.d.ts +11 -11
  146. package/PopConfirm/lang/zh_CN.d.ts +5 -5
  147. package/Popover/index.d.ts +14 -14
  148. package/Popover/index.js +15 -66
  149. package/Popper/index.d.ts +13 -0
  150. package/Popper/index.js +16 -0
  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 +20 -358
  155. package/Progress/utils.d.ts +6 -6
  156. package/Querying/images/index.d.ts +2 -3
  157. package/Querying/index.d.ts +26 -26
  158. package/Querying/index.js +14 -762
  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/README.md +518 -0
  163. package/Radio/index.d.ts +38 -38
  164. package/Radio/index.js +14 -94
  165. package/RadioGroup/index.d.ts +47 -47
  166. package/RadioGroup/index.js +14 -128
  167. package/Search/index.d.ts +56 -56
  168. package/Search/index.js +14 -220
  169. package/Select/index.d.ts +86 -86
  170. package/Select/index.js +14 -1288
  171. package/Select/lang/en_US.d.ts +5 -5
  172. package/Select/lang/index.d.ts +11 -11
  173. package/Select/lang/zh_CN.d.ts +5 -5
  174. package/SelectInput/index.d.ts +11 -11
  175. package/SelectInput/index.js +14 -51
  176. package/SingleBox/index.d.ts +42 -42
  177. package/SingleBox/index.js +14 -194
  178. package/Slider/index.d.ts +14 -14
  179. package/Slider/index.js +15 -125
  180. package/Slider/interface.d.ts +102 -102
  181. package/Split/index.d.ts +7 -7
  182. package/Split/index.js +15 -134
  183. package/Stepper/icons.d.ts +5 -5
  184. package/Stepper/index.d.ts +39 -49
  185. package/Stepper/index.js +15 -99
  186. package/Switch/index.d.ts +78 -78
  187. package/Switch/index.js +14 -73
  188. package/Table/index.d.ts +10 -10
  189. package/Table/index.js +14 -2725
  190. package/Table/interface.d.ts +202 -202
  191. package/Table/lang/en_US.d.ts +6 -6
  192. package/Table/lang/index.d.ts +13 -13
  193. package/Table/lang/zh_CN.d.ts +6 -6
  194. package/Table/tableBody.d.ts +9 -9
  195. package/Table/tableBodyElement/index.d.ts +15 -15
  196. package/Table/tableBodyInterface.d.ts +67 -67
  197. package/Table/tableContainer/index.d.ts +16 -16
  198. package/Table/tableElement/index.d.ts +17 -17
  199. package/Table/tableHead.d.ts +9 -9
  200. package/Table/tableHeadElement/index.d.ts +15 -15
  201. package/Table/tableHeadInterface.d.ts +30 -26
  202. package/Table/tablePagination.d.ts +9 -9
  203. package/Table/tablePaginationInterFace.d.ts +24 -24
  204. package/Table/tdElement/index.d.ts +15 -15
  205. package/Table/thElement/index.d.ts +15 -15
  206. package/Table/trElement/index.d.ts +15 -15
  207. package/Table/util.d.ts +16 -16
  208. package/Tabs/index.d.ts +48 -69
  209. package/Tabs/index.js +14 -218
  210. package/Tag/TagGroup.d.ts +66 -66
  211. package/Tag/index.d.ts +34 -34
  212. package/Tag/index.js +14 -286
  213. package/Test/index.d.ts +2 -3
  214. package/Test/index.js +16 -9
  215. package/TextField/index.d.ts +93 -93
  216. package/TextField/index.js +14 -686
  217. package/TimePicker/index.d.ts +22 -22
  218. package/TimePicker/index.js +14 -77
  219. package/TimePicker/locale/en_US.d.ts +3 -3
  220. package/TimePicker/locale/zh_CN.d.ts +3 -3
  221. package/TimePicker/style/index.d.ts +1 -1
  222. package/Timeline/index.d.ts +22 -31
  223. package/Timeline/index.js +15 -150
  224. package/ToggleButton/ToggleButtonGroup.d.ts +49 -49
  225. package/ToggleButton/index.d.ts +49 -49
  226. package/ToggleButton/index.js +14 -200
  227. package/Tooltip/index.d.ts +14 -11
  228. package/Tooltip/index.js +15 -335
  229. package/Transfer/index.d.ts +17 -18
  230. package/Transfer/index.js +14 -343
  231. package/Transfer/lang/en_US.d.ts +6 -6
  232. package/Transfer/lang/index.d.ts +13 -13
  233. package/Transfer/lang/zh_CN.d.ts +6 -6
  234. package/Tree/OperateBar/index.d.ts +13 -13
  235. package/Tree/Tree.d.ts +4 -4
  236. package/Tree/index.d.ts +5 -5
  237. package/Tree/index.js +14 -35
  238. package/Tree/interface.d.ts +207 -209
  239. package/Tree/lang/en_US.d.ts +8 -8
  240. package/Tree/lang/index.d.ts +17 -17
  241. package/Tree/lang/zh_CN.d.ts +8 -8
  242. package/Tree/utils/tools.d.ts +26 -26
  243. package/Tree/utils/treeUtil.d.ts +15 -15
  244. package/Upload/Dragger/index.d.ts +10 -10
  245. package/Upload/ErroTip/index.d.ts +13 -13
  246. package/Upload/ImageUpload/index.d.ts +14 -14
  247. package/Upload/ImgCrop/EasyCrop.d.ts +17 -17
  248. package/Upload/ImgCrop/constants.d.ts +7 -7
  249. package/Upload/ImgCrop/index.d.ts +6 -6
  250. package/Upload/ImgCrop/interface.d.ts +24 -24
  251. package/Upload/UploadList/index.d.ts +5 -5
  252. package/Upload/index.d.ts +15 -15
  253. package/Upload/index.js +14 -1542
  254. package/Upload/interface.d.ts +134 -134
  255. package/Upload/lang/en_US.d.ts +12 -12
  256. package/Upload/lang/index.d.ts +25 -25
  257. package/Upload/lang/zh_CN.d.ts +12 -12
  258. package/cdn/AutoBox/index.js +29 -0
  259. package/cdn/AutoTips/index.js +40 -0
  260. package/cdn/Breadcrumbs/index.js +53 -0
  261. package/cdn/Button/index.js +79 -0
  262. package/cdn/ButtonGroup/index.js +79 -0
  263. package/cdn/Carousel/index.js +6 -0
  264. package/cdn/Cascader/index.js +42 -0
  265. package/cdn/Checkbox/index.js +53 -0
  266. package/cdn/CheckboxGroup/index.js +53 -0
  267. package/cdn/Collapse/index.js +27 -0
  268. package/cdn/CollapseBox/index.js +1 -0
  269. package/cdn/ColorPicker/index.js +1 -0
  270. package/cdn/ComboSelect/index.js +438 -0
  271. package/cdn/Container/index.js +1 -0
  272. package/cdn/DatePicker/index.js +185 -0
  273. package/cdn/Desktop/index.js +24 -0
  274. package/cdn/Drawer/index.js +84 -0
  275. package/cdn/Empty/index.js +1 -0
  276. package/cdn/Form/index.js +477 -0
  277. package/cdn/FormItem/index.js +477 -0
  278. package/cdn/FunctionModal/index.js +144 -0
  279. package/cdn/GlobalContext/index.js +1 -0
  280. package/cdn/Help/index.js +53 -0
  281. package/cdn/HelperText/index.js +1 -0
  282. package/cdn/InputLang/index.js +144 -0
  283. package/cdn/InputNumber/index.js +118 -0
  284. package/cdn/Label/index.js +53 -0
  285. package/cdn/Loading/index.js +14 -0
  286. package/cdn/Menu/index.js +40 -0
  287. package/cdn/Message/index.js +53 -0
  288. package/cdn/Modal/index.js +144 -0
  289. package/cdn/MultiBox/index.js +131 -0
  290. package/cdn/Notification/index.js +66 -0
  291. package/cdn/OperateBtn/index.js +92 -0
  292. package/cdn/PageHeader/index.js +92 -0
  293. package/cdn/Pagination/index.js +214 -0
  294. package/cdn/ParauiProvider/index.js +9 -0
  295. package/cdn/PopConfirm/index.js +131 -0
  296. package/cdn/Popover/index.js +16 -0
  297. package/cdn/Popper/index.js +26 -0
  298. package/cdn/Progress/index.js +58 -0
  299. package/cdn/Querying/index.js +1 -0
  300. package/cdn/Radio/index.js +53 -0
  301. package/cdn/RadioGroup/index.js +53 -0
  302. package/cdn/Search/index.js +144 -0
  303. package/cdn/Select/index.js +131 -0
  304. package/cdn/SelectInput/index.js +131 -0
  305. package/cdn/SingleBox/index.js +131 -0
  306. package/cdn/Slider/index.js +16 -0
  307. package/cdn/Split/index.js +1 -0
  308. package/cdn/Stepper/index.js +154 -0
  309. package/cdn/Switch/index.js +71 -0
  310. package/cdn/Table/index.js +292 -0
  311. package/cdn/Tabs/index.js +165 -0
  312. package/cdn/Tag/index.js +27 -0
  313. package/cdn/Test/index.js +1 -0
  314. package/cdn/TextField/index.js +105 -0
  315. package/cdn/TimePicker/index.js +185 -0
  316. package/cdn/Timeline/index.js +16 -0
  317. package/cdn/ToggleButton/index.js +79 -0
  318. package/cdn/Tooltip/index.js +40 -0
  319. package/cdn/Transfer/index.js +170 -0
  320. package/cdn/Tree/index.js +170 -0
  321. package/cdn/Upload/index.js +252 -0
  322. package/index.d.ts +128 -128
  323. package/index.js +19 -160
  324. package/package.json +21 -54
  325. package/style.css +72 -0
  326. package/Dropdown/index.d.ts +0 -25
  327. package/Dropdown/index.js +0 -67
  328. package/Tabs/lang/en_US.d.ts +0 -4
  329. package/Tabs/lang/index.d.ts +0 -9
  330. package/Tabs/lang/zh_CN.d.ts +0 -4
  331. package/Timeline/TimelineItem.d.ts +0 -23
  332. package/Tooltip/interface.d.ts +0 -21
  333. package/Tooltip/utils.d.ts +0 -22
  334. package/_verture/defineProperty-0590dc61.js +0 -16
  335. package/_verture/index-2c0ecd8d.js +0 -778
  336. package/_verture/index-342379c6.js +0 -391
  337. package/_verture/index-a369ca3f.js +0 -4
  338. package/_verture/index-e2881a53.js +0 -16
  339. package/_verture/index-ee85b1cd.js +0 -1555
  340. package/_verture/intl-336570e4.js +0 -65
  341. package/_verture/modalContext-e7cc8067.js +0 -228
  342. package/_verture/slicedToArray-d7722f4b.js +0 -62
  343. package/_verture/style-inject.es-300983ab.js +0 -28
  344. package/_verture/toConsumableArray-f8047a75.js +0 -19
  345. package/_verture/tslib.es6-55ed4bd2.js +0 -38
  346. package/_verture/typeof-498dd2b1.js +0 -11
  347. package/_verture/useFormatMessage-ac9d6acf.js +0 -20
  348. package/_verture/useGlobalProps-af9a2af6.js +0 -12
@@ -1,227 +1,15 @@
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
+ !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,62 +1,61 @@
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 {};
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 {};
package/Button/index.d.ts CHANGED
@@ -1,71 +1,56 @@
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;
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;