@titaui/pc 1.6.12 → 1.6.16

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 (309) hide show
  1. package/lib/components/avatar/index.js +1 -1
  2. package/lib/components/button/icon-btn/index.css +2 -0
  3. package/lib/components/button/index.js +1 -1
  4. package/lib/components/button/rect-btn/index.css +21 -0
  5. package/lib/components/button/rect-btn/index.js +8 -8
  6. package/lib/components/button/text-btn/index.css +33 -0
  7. package/lib/components/button/text-btn/index.js +52 -2
  8. package/lib/components/change-okr/styledComponents.js +1 -1
  9. package/lib/components/communication/style.js +1 -1
  10. package/lib/components/create-okr/constant.js +1 -1
  11. package/lib/components/create-okr/createSuccessCmp.js +6 -2
  12. package/lib/components/create-okr/fields/index.js +1 -1
  13. package/lib/components/create-okr/index.js +16 -1
  14. package/lib/components/create-okr/request-api.js +1 -1
  15. package/lib/components/create-okr/style.js +1 -1
  16. package/lib/components/create-okr/utils/helper.js +1 -1
  17. package/lib/components/delete-confirm-pop/style.js +1 -1
  18. package/lib/components/dialog/index.css +1 -0
  19. package/lib/components/dropdown-layer/index.js +1 -1
  20. package/lib/components/dynamic/components/title/index.css +2 -2
  21. package/lib/components/dynamic/constant.js +3 -2
  22. package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/dynamic-milestone.png +0 -0
  23. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.css +7 -1
  24. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +4 -21
  25. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.css +4 -0
  26. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +4 -2
  27. package/lib/components/dynamic/dynamic-item/dynamic-project/img/dynamic-project.png +0 -0
  28. package/lib/components/dynamic/dynamic-item/dynamic-project/index.css +7 -1
  29. package/lib/components/dynamic/dynamic-item/dynamic-project/index.js +4 -7
  30. package/lib/components/dynamic/dynamic-item/dynamic-task/constant.js +1 -35
  31. package/lib/components/dynamic/dynamic-item/dynamic-task/img/dynamic-task.png +0 -0
  32. package/lib/components/dynamic/dynamic-item/dynamic-task/index.css +7 -1
  33. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +17 -7
  34. package/lib/components/dynamic/dynamic-like-ranking/index.css +2 -3
  35. package/lib/components/dynamic/dynamic-like-ranking/index.js +11 -6
  36. package/lib/components/dynamic/dynamic-liking/index.css +1 -2
  37. package/lib/components/dynamic/dynamic-liking/item.js +2 -20
  38. package/lib/components/dynamic/dynamic-list/index.js +7 -1
  39. package/lib/components/dynamic/dynamic-topping/index.css +1 -1
  40. package/lib/components/dynamic/dynamic-topping/request-api.js +1 -1
  41. package/lib/components/dynamic/dynamic.js +7 -4
  42. package/lib/components/dynamic/export-module/index.js +1 -1
  43. package/lib/components/dynamic/index.js +1 -1
  44. package/lib/components/dynamic/new-ui.css +206 -0
  45. package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +2 -2
  46. package/lib/components/dynamic/quick-operation/components/create-okr/index.js +2 -2
  47. package/lib/components/dynamic/quick-operation/components/create-share/index.js +2 -2
  48. package/lib/components/dynamic/quick-operation/components/create-task/index.js +2 -2
  49. package/lib/components/dynamic/quick-operation/img/okr.png +0 -0
  50. package/lib/components/dynamic/quick-operation/img/send-announcement.png +0 -0
  51. package/lib/components/dynamic/quick-operation/img/send-share.png +0 -0
  52. package/lib/components/dynamic/quick-operation/img/task.png +0 -0
  53. package/lib/components/dynamic/request-api.js +1 -1
  54. package/lib/components/dynamic/util.js +2 -2
  55. package/lib/components/eReport/eReportLists/style.js +1 -1
  56. package/lib/components/eReport/eReportShare/style.js +1 -1
  57. package/lib/components/eReport/eReportShare/toast/style.js +1 -1
  58. package/lib/components/edit-kr-wight/style/index.js +1 -1
  59. package/lib/components/emotionsSelector/style.js +1 -1
  60. package/lib/components/file-list/components/single-file/index.css +2 -2
  61. package/lib/components/file-list/components/single-file/index.js +1 -1
  62. package/lib/components/file-list/index.js +1 -1
  63. package/lib/components/form/form-fields/radios/index.css +5 -0
  64. package/lib/components/form/form-fields/radios/index.js +34 -5
  65. package/lib/components/form/index.js +1 -1
  66. package/lib/components/grid-page/commen-components/index.js +4 -4
  67. package/lib/components/grid-page/commen-components/scroll-tips.js +1 -1
  68. package/lib/components/grid-page/util/network.js +1 -1
  69. package/lib/components/help-card/index.css +17 -17
  70. package/lib/components/help-card/index.js +35 -31
  71. package/lib/components/help-card/request-api.js +2 -2
  72. package/lib/components/img-viewer/index.css +4 -0
  73. package/lib/components/img-viewer/index.js +2 -1
  74. package/lib/components/mblog/common/index.js +3 -3
  75. package/lib/components/mblog/style.js +1 -1
  76. package/lib/components/menus/components/drag-resize/index.css +4 -4
  77. package/lib/components/menus/components/drag-resize/index.js +35 -30
  78. package/lib/components/menus/components/flip-menu-card/index.css +7 -3
  79. package/lib/components/menus/components/flip-menu-card/index.js +42 -30
  80. package/lib/components/menus/components/menu-card/index.js +1 -6
  81. package/lib/components/menus/components/menu-close-btn/index.css +2 -1
  82. package/lib/components/menus/components/menu-tree/images/appraisal-menu/KH-help.svg +10 -0
  83. package/lib/components/menus/components/menu-tree/images/appraisal-menu/mypingjia.svg +10 -0
  84. package/lib/components/menus/components/menu-tree/images/loading-node.gif +0 -0
  85. package/lib/components/menus/components/menu-tree/images/okr-menu/cases.svg +9 -0
  86. package/lib/components/menus/components/menu-tree/images/okr-menu/{rw-zx.svg → panel.svg} +0 -0
  87. package/lib/components/menus/components/menu-tree/index.js +5 -4
  88. package/lib/components/menus/components/menu-tree/tree-node/avatar/index.css +49 -0
  89. package/lib/components/menus/components/menu-tree/tree-node/avatar/index.js +72 -0
  90. package/lib/components/menus/components/menu-tree/tree-node/company-all-node.js +2 -1
  91. package/lib/components/menus/components/menu-tree/tree-node/compony-node/index.js +5 -2
  92. package/lib/components/menus/components/menu-tree/tree-node/depart-node/index.js +9 -4
  93. package/lib/components/menus/components/menu-tree/tree-node/follower-node/index.css +47 -0
  94. package/lib/components/menus/components/menu-tree/tree-node/follower-node/index.js +67 -0
  95. package/lib/components/menus/components/menu-tree/tree-node/group-name-node.js +2 -1
  96. package/lib/components/menus/components/menu-tree/tree-node/index.css +126 -13
  97. package/lib/components/menus/components/menu-tree/tree-node/index.js +19 -0
  98. package/lib/components/menus/components/menu-tree/tree-node/loading-node.js +27 -0
  99. package/lib/components/menus/components/menu-tree/tree-node/menu-item-node.js +2 -1
  100. package/lib/components/menus/components/menu-tree/tree-node/menu-node.js +2 -1
  101. package/lib/components/menus/components/menu-tree/tree-node/no-follower-node.js +25 -0
  102. package/lib/components/menus/components/menu-tree/tree-node/user-concern-node.js +9 -4
  103. package/lib/components/menus/components/menu-tree/tree-node/user-node/index.css +3 -1
  104. package/lib/components/menus/components/menu-tree/tree-node/user-node/index.js +12 -42
  105. package/lib/components/menus/export-modules/appraisal-menus/datas.js +58 -19
  106. package/lib/components/menus/export-modules/depart-menus/index.js +34 -7
  107. package/lib/components/menus/export-modules/okr-menus/datas.js +109 -4
  108. package/lib/components/menus/export-modules/okr-menus/index.css +0 -1
  109. package/lib/components/menus/export-modules/okr-menus/index.js +73 -20
  110. package/lib/components/menus/export-modules/subordinate-menus/index.js +12 -4
  111. package/lib/components/menus/index.js +1 -1
  112. package/lib/components/menus/request-apis.js +22 -5
  113. package/lib/components/nav-top/components/menu/index.css +1 -0
  114. package/lib/components/nav-top/components/menu/index.js +7 -5
  115. package/lib/components/nav-top/components/user-message/components/empty/index.js +1 -1
  116. package/lib/components/nav-top/components/user-message/components/inform/index.css +29 -6
  117. package/lib/components/nav-top/components/user-message/components/inform/index.js +116 -111
  118. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +133 -0
  119. package/lib/components/nav-top/components/user-message/components/red-pack/index.css +40 -0
  120. package/lib/components/nav-top/components/user-message/components/red-pack/index.js +105 -0
  121. package/lib/components/nav-top/components/user-message/components/red-pack/request-api.js +14 -0
  122. package/lib/components/nav-top/components/user-message/components/remind/index.css +26 -8
  123. package/lib/components/nav-top/components/user-message/components/remind/index.js +67 -60
  124. package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +71 -0
  125. package/lib/components/nav-top/components/user-message/components/reply/index.css +28 -6
  126. package/lib/components/nav-top/components/user-message/components/reply/index.js +118 -63
  127. package/lib/components/nav-top/components/user-message/components/reply/reply-item.js +75 -0
  128. package/lib/components/nav-top/components/user-message/components/tab-title/index.js +5 -4
  129. package/lib/components/nav-top/components/user-message/components/todos/index.css +26 -12
  130. package/lib/components/nav-top/components/user-message/components/todos/index.js +118 -59
  131. package/lib/components/nav-top/components/user-message/components/todos/todo-item.js +70 -0
  132. package/lib/components/nav-top/components/user-message/constant.js +2 -19
  133. package/lib/components/nav-top/components/user-message/images/loading.gif +0 -0
  134. package/lib/components/nav-top/components/user-message/images/msg-reward.png +0 -0
  135. package/lib/components/nav-top/components/user-message/index.css +41 -4
  136. package/lib/components/nav-top/components/user-message/index.js +89 -100
  137. package/lib/components/nav-top/components/user-message/msg/index.css +5 -30
  138. package/lib/components/nav-top/components/user-message/msg/index.js +28 -22
  139. package/lib/components/nav-top/components/user-message/utils.js +31 -0
  140. package/lib/components/nav-top/components/user-own-menu/index.css +2 -1
  141. package/lib/components/nav-top/components/user-own-menu/index.js +5 -7
  142. package/lib/components/nav-top/components/user-own-menu/utils.js +63 -0
  143. package/lib/components/nav-top/constant.js +2 -10
  144. package/lib/components/nav-top/index.css +55 -0
  145. package/lib/components/nav-top/index.js +14 -13
  146. package/lib/components/nav-top/request.apis.js +50 -0
  147. package/lib/components/nav-top/utils.js +10 -70
  148. package/lib/components/okr-detail/auth.js +1 -1
  149. package/lib/components/okr-detail/base-info/util.js +1 -1
  150. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/constant.js +1 -1
  151. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +1 -1
  152. package/lib/components/okr-detail/context.js +1 -1
  153. package/lib/components/okr-detail/detail-header/actions.js +2 -2
  154. package/lib/components/okr-detail/detail-header/delete-confirm/style.js +1 -1
  155. package/lib/components/okr-detail/detail-header/enums.js +1 -1
  156. package/lib/components/okr-detail/e-list/constant.js +1 -1
  157. package/lib/components/okr-detail/e-list/util.js +1 -1
  158. package/lib/components/okr-detail/okr-list/create-kr-item/style.js +1 -1
  159. package/lib/components/okr-detail/okr-list/drag-order-kr.js +1 -1
  160. package/lib/components/okr-detail/okr-list/index.js +2 -1
  161. package/lib/components/okr-detail/request-apis.js +1 -1
  162. package/lib/components/okr-detail/schedule/util.js +1 -1
  163. package/lib/components/okr-filter-drawer/filter-button.js +1 -0
  164. package/lib/components/okr-filter-drawer/filter-form.js +189 -0
  165. package/lib/components/okr-filter-drawer/index.css +45 -0
  166. package/lib/components/okr-filter-drawer/index.js +54 -0
  167. package/lib/components/okr-flow/index.js +1 -1
  168. package/lib/components/okr-flow/mini-map/utils.js +1 -1
  169. package/lib/components/okr-flow/open-data/index.js +1 -1
  170. package/lib/components/okr-flow/request-apis.js +1 -1
  171. package/lib/components/okr-flow/utils/config.js +1 -1
  172. package/lib/components/okr-flow/utils/index.js +1 -1
  173. package/lib/components/okr-flow/utils/tree-handler.js +1 -1
  174. package/lib/components/okr-progress/request-apis.js +1 -1
  175. package/lib/components/okr-progress/util.js +1 -1
  176. package/lib/components/okr-progress-detail/utils.js +1 -1
  177. package/lib/components/okr-progress-modal/helper.js +1 -1
  178. package/lib/components/okr-progress-modal/style.js +1 -1
  179. package/lib/components/okr-progress-modal/textarea/style.js +1 -1
  180. package/lib/components/okr-review/ReviewPop/components/ReviewBody/style.js +1 -1
  181. package/lib/components/okr-review/ReviewPop/style.js +1 -1
  182. package/lib/components/okr-review/components/ReviewItem/style.js +1 -1
  183. package/lib/components/okr-review/components/confirm-pop/style.js +1 -1
  184. package/lib/components/okr-review/style.js +1 -1
  185. package/lib/components/okr-share/common-painter/utils.js +1 -1
  186. package/lib/components/okr-share/pink-card/images.js +1 -1
  187. package/lib/components/okr-share/request-apis.js +1 -1
  188. package/lib/components/okrcase-library/index.css +1 -1
  189. package/lib/components/okrcase-library/index.js +6 -1
  190. package/lib/components/okrcase-library/new-ui.css +52 -0
  191. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +1 -1
  192. package/lib/components/okrcase-library/server/network.js +1 -1
  193. package/lib/components/open-data-painter/index.js +1 -1
  194. package/lib/components/operation-records/style.js +1 -1
  195. package/lib/components/pagination/index.css +6 -12
  196. package/lib/components/period-selector/common.js +2 -2
  197. package/lib/components/period-selector/components/button/style.js +1 -1
  198. package/lib/components/period-selector/components/selector/style.js +1 -1
  199. package/lib/components/period-selector/helper/index.js +1 -1
  200. package/lib/components/period-selector/mockData.js +1 -1
  201. package/lib/components/period-selector/style.js +1 -1
  202. package/lib/components/photo-card/components/card/index.css +83 -100
  203. package/lib/components/photo-card/components/card/index.js +119 -63
  204. package/lib/components/photo-card/data.js +5 -5
  205. package/lib/components/photo-card/images/assistant.svg +40 -0
  206. package/lib/components/photo-card/images/back-manager.svg +40 -0
  207. package/lib/components/photo-card/images/boss.svg +38 -0
  208. package/lib/components/photo-card/images/depart-leader.svg +40 -0
  209. package/lib/components/photo-card/images/super-manager.svg +40 -0
  210. package/lib/components/photo-card/index.css +15 -14
  211. package/lib/components/photo-card/index.js +59 -15
  212. package/lib/components/pop-down-notification/components/SuccessRender.js +1 -1
  213. package/lib/components/pop-down-notification/style/index.js +1 -1
  214. package/lib/components/praise-record/style.js +1 -1
  215. package/lib/components/progress/index.js +1 -1
  216. package/lib/components/publish-dynamic-modal/requist-api.js +1 -1
  217. package/lib/components/radio/radio.js +1 -1
  218. package/lib/components/tabs/index.js +1 -1
  219. package/lib/components/task-relation/helper.js +1 -1
  220. package/lib/components/task-relation/request-api.js +1 -1
  221. package/lib/components/tita-chart/index.js +4 -4
  222. package/lib/components/tita-chart/util/index.js +12 -12
  223. package/lib/components/tita-chart/util/utils.js +1 -1
  224. package/lib/components/tooltip/index.js +1 -1
  225. package/lib/components/tree/index.js +1 -3
  226. package/lib/components/update-modal/img/background.png +0 -0
  227. package/lib/components/update-modal/img/rocket.png +0 -0
  228. package/lib/components/update-modal/index.css +80 -0
  229. package/lib/components/update-modal/index.js +83 -0
  230. package/lib/components/update-modal/request-api.js +17 -0
  231. package/lib/components/upload/style.js +1 -1
  232. package/lib/components/upload/util.js +1 -1
  233. package/lib/components/upvote/request-apis.js +1 -1
  234. package/lib/components/user-selector/index.js +1 -1
  235. package/lib/components/user-selector/request-apis.js +1 -1
  236. package/lib/components/user-selector/utils.js +1 -1
  237. package/lib/components/version-change-modal/request-api.js +1 -1
  238. package/lib/components/viewer/index.js +1 -1
  239. package/lib/components-v1/avatar/styles.js +1 -1
  240. package/lib/components-v1/buttonv2/style/style.js +1 -1
  241. package/lib/components-v1/input/Input.js +1 -1
  242. package/lib/components-v1/input/InputNumber.js +1 -1
  243. package/lib/components-v1/input/style/index.js +1 -1
  244. package/lib/components-v1/popConfirm/style.js +1 -1
  245. package/lib/components-v1/tabs/style.js +1 -1
  246. package/lib/components-v1/textarea/style.js +1 -1
  247. package/lib/components-v1/userSelector/UserSelectorPop.js +1 -1
  248. package/lib/components-v1/userSelector/style.js +1 -1
  249. package/lib/hooks/useLocalStorage.js +37 -0
  250. package/lib/index.js +18 -4
  251. package/lib/pages/aha2021/index.css +25 -1
  252. package/lib/pages/aha2021/index.js +10 -4
  253. package/lib/pages/group-management/components/PopDownNotification/components/SuccessRender.js +1 -1
  254. package/lib/pages/group-management/components/PopDownNotification/style/index.js +1 -1
  255. package/lib/pages/group-management/components/openData/index.js +1 -1
  256. package/lib/pages/group-management/groupInterface.js +10 -10
  257. package/lib/pages/home-page/components/data-list/table/columns/index.js +1 -1
  258. package/lib/pages/new-okr-list/context.js +14 -0
  259. package/lib/pages/new-okr-list/header/comments.js +104 -0
  260. package/lib/pages/new-okr-list/header/create-okr.js +61 -0
  261. package/lib/pages/new-okr-list/header/depart-title.js +59 -0
  262. package/lib/pages/new-okr-list/header/filter.js +95 -0
  263. package/lib/pages/new-okr-list/header/index.css +118 -0
  264. package/lib/pages/new-okr-list/header/index.js +133 -0
  265. package/lib/pages/new-okr-list/header/relation-title.js +28 -0
  266. package/lib/pages/new-okr-list/header/user-title.js +26 -0
  267. package/lib/pages/new-okr-list/index.css +10 -0
  268. package/lib/pages/new-okr-list/index.js +208 -0
  269. package/lib/pages/new-okr-list/interface.js +5 -0
  270. package/lib/pages/new-okr-list/keyword-search/index.css +71 -0
  271. package/lib/pages/new-okr-list/keyword-search/index.js +106 -0
  272. package/lib/pages/new-okr-list/list/index.css +0 -0
  273. package/lib/pages/new-okr-list/list/index.js +47 -0
  274. package/lib/pages/new-okr-list/precls.js +8 -0
  275. package/lib/pages/new-okr-list/request-api.js +158 -0
  276. package/lib/pages/new-okr-list/theme.css +7 -0
  277. package/lib/pages/okr-map/hooks/useStorage.js +1 -1
  278. package/lib/pages/okr-map/open-data/index.js +1 -1
  279. package/lib/pages/okr-map/request-apis.js +1 -1
  280. package/lib/pages/okr-map/utils.js +2 -1
  281. package/lib/utils/auth.js +1 -1
  282. package/lib/utils/bs-global.js +1 -1
  283. package/lib/utils/format-time.js +1 -1
  284. package/lib/utils/helpers.js +1 -1
  285. package/lib/utils/local-storage.js +40 -0
  286. package/lib/utils/mblog.js +1 -1
  287. package/lib/utils/open-data.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/request-v1.js +2 -2
  290. package/lib/utils/request.js +1 -1
  291. package/lib/utils/roundWeight.js +2 -2
  292. package/lib/utils/tools.js +4 -3
  293. package/package.json +3 -2
  294. package/lib/components/dynamic/dynamic-item/components/icon/index.css +0 -10
  295. package/lib/components/dynamic/dynamic-item/components/icon/index.js +0 -35
  296. package/lib/components/dynamic/dynamic-item/dynamic-milestone/img/milestone.png +0 -0
  297. package/lib/components/dynamic/dynamic-item/dynamic-project/img/project.png +0 -0
  298. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-cancel.png +0 -0
  299. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-delay.png +0 -0
  300. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-done.png +0 -0
  301. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-pause.png +0 -0
  302. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-progress.png +0 -0
  303. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unaccept.png +0 -0
  304. package/lib/components/dynamic/dynamic-item/dynamic-task/img/task-unstart.png +0 -0
  305. package/lib/components/dynamic/quick-operation/img/create-announcement.png +0 -0
  306. package/lib/components/dynamic/quick-operation/img/create-okr.png +0 -0
  307. package/lib/components/dynamic/quick-operation/img/create-share.png +0 -0
  308. package/lib/components/dynamic/quick-operation/img/create-task.png +0 -0
  309. package/lib/components/nav-top/mock.js +0 -36
@@ -14,8 +14,8 @@
14
14
  }
15
15
 
16
16
  .titaui-new-file-list-single-file__file-preview-img {
17
- width: 180px;
18
- height: 180px;
17
+ max-width: 180px;
18
+ max-height: 180px;
19
19
  border-radius: 8px;
20
20
  }
21
21
 
@@ -97,7 +97,7 @@ var SingleFile = function SingleFile(_ref) {
97
97
  }
98
98
  }, isImg && /*#__PURE__*/_react["default"].createElement("img", {
99
99
  className: prefix + "__file-preview-img",
100
- src: data.bigImageUrl || data.smallImageUrl
100
+ src: data.previewUrl || data.bigImageUrl
101
101
  }), !isImg && /*#__PURE__*/_react["default"].createElement("div", {
102
102
  className: prefix + "__file-preview-other"
103
103
  }, /*#__PURE__*/_react["default"].createElement("img", {
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.SingleFile = exports["default"] = void 0;
8
+ exports["default"] = exports.SingleFile = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -14,6 +14,11 @@
14
14
  color: red;
15
15
  }
16
16
 
17
+ .form-field-radio__radios {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ }
21
+
17
22
  .form-field-radio__radios .tita-radio {
18
23
  margin-right: 8px;
19
24
  }
@@ -17,6 +17,18 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
+
22
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+
24
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
+
26
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
+
28
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
+
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
+
20
32
  var prefixCls = 'form-field-radio';
21
33
 
22
34
  var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
@@ -26,7 +38,22 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
26
38
  onChange = props.onChange,
27
39
  radios = props.radios,
28
40
  require = props.require,
29
- value = props.value;
41
+ value = props.value,
42
+ radioClass = props.radioClass;
43
+
44
+ var _useState = (0, _react.useState)(value),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ activedValue = _useState2[0],
47
+ setActivedValue = _useState2[1];
48
+
49
+ var onChangeHandler = function onChangeHandler(activedkey) {
50
+ onChange && onChange(activedkey);
51
+ setActivedValue(activedkey);
52
+ };
53
+
54
+ (0, _react.useEffect)(function () {
55
+ setActivedValue(value);
56
+ }, [value]);
30
57
  (0, _react.useImperativeHandle)(ref, function () {
31
58
  return {};
32
59
  });
@@ -41,12 +68,14 @@ var _default = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
41
68
  }, "*")), /*#__PURE__*/_react["default"].createElement("div", {
42
69
  className: "".concat(prefixCls, "__radios")
43
70
  }, radios.map(function (radio) {
44
- return /*#__PURE__*/_react["default"].createElement(_radio.Radio, {
71
+ return /*#__PURE__*/_react["default"].createElement("div", {
72
+ className: "".concat(prefixCls, "__radios-item ").concat(radioClass)
73
+ }, /*#__PURE__*/_react["default"].createElement(_radio.Radio, {
45
74
  key: radio.value,
46
75
  value: radio.value,
47
- onChange: onChange,
48
- checked: radio.value == value
49
- }, radio.label);
76
+ onChange: onChangeHandler,
77
+ checked: radio.value == activedValue
78
+ }, radio.label));
50
79
  })));
51
80
  });
52
81
 
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.FormFields = exports["default"] = void 0;
8
+ exports["default"] = exports.FormFields = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -15,16 +15,16 @@ Object.defineProperty(exports, "CardContainer", {
15
15
  return _cardContain["default"];
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "CardTitle", {
18
+ Object.defineProperty(exports, "CardFlexContent", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _cardTitle["default"];
21
+ return _carditemFlexcontent["default"];
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "CardFlexContent", {
24
+ Object.defineProperty(exports, "CardTitle", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _carditemFlexcontent["default"];
27
+ return _cardTitle["default"];
28
28
  }
29
29
  });
30
30
  Object.defineProperty(exports, "DataItem", {
@@ -5,8 +5,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = ScrollTips;
9
8
  exports.AvatarTips = void 0;
9
+ exports["default"] = ScrollTips;
10
10
 
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getIsCompanyOKREmpty = exports.getEssay = exports["default"] = exports.queryParams = void 0;
6
+ exports.queryParams = exports.getIsCompanyOKREmpty = exports.getEssay = exports["default"] = void 0;
7
7
 
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
 
@@ -36,7 +36,7 @@
36
36
  box-shadow: 0px 0px 16px 0px rgba(127, 145, 180, 0.1);
37
37
  }
38
38
 
39
- .help-card-header {
39
+ .help-card__header {
40
40
  width: 332px;
41
41
  height: 72px;
42
42
  background: #5C8EFF;
@@ -48,7 +48,7 @@
48
48
  color: #FFFFFF;
49
49
  }
50
50
 
51
- .help-card-header-avatar {
51
+ .help-card__header-avatar {
52
52
  width: 40px;
53
53
  height: 40px;
54
54
  background: #03C2FC;
@@ -57,13 +57,13 @@
57
57
  border-radius: 50%;
58
58
  }
59
59
 
60
- .help-card-body {
60
+ .help-card__body {
61
61
  box-sizing: border-box;
62
62
  padding: 0 20px;
63
63
  margin: 24px 0 30px;
64
64
  }
65
65
 
66
- .help-card-body-item {
66
+ .help-card__body-item {
67
67
  box-sizing: border-box;
68
68
  width: 292px;
69
69
  height: 148px;
@@ -73,13 +73,13 @@
73
73
  background: rgba(240, 244, 250, 0.6) url("./image/question.svg") 100% 100% no-repeat;
74
74
  }
75
75
 
76
- .help-card-body-item-title {
76
+ .help-card__body-item-title {
77
77
  display: flex;
78
78
  justify-content: space-between;
79
79
  align-items: center;
80
80
  }
81
81
 
82
- .help-card-body-item-title-left {
82
+ .help-card__body-item-title-left {
83
83
  width: 64px;
84
84
  height: 24px;
85
85
  font-size: 16px;
@@ -89,7 +89,7 @@
89
89
  position: relative;
90
90
  }
91
91
 
92
- .help-card-body-item-title-left::before {
92
+ .help-card__body-item-title-left::before {
93
93
  content: '';
94
94
  width: 81px;
95
95
  height: 7px;
@@ -100,7 +100,7 @@
100
100
  bottom: 0;
101
101
  }
102
102
 
103
- .help-card-body-item-title-right {
103
+ .help-card__body-item-title-right {
104
104
  cursor: pointer;
105
105
  font-size: 12px;
106
106
  font-weight: 400;
@@ -108,11 +108,11 @@
108
108
  line-height: 22px;
109
109
  }
110
110
 
111
- .help-card-body-item-title-right > .tu-icon-gengxin1 {
111
+ .help-card__body-item-title-right > .tu-icon-gengxin1 {
112
112
  margin-right: 4px;
113
113
  }
114
114
 
115
- .help-card-body-item-content-item {
115
+ .help-card__body-item-content-item {
116
116
  cursor: pointer;
117
117
  margin-top: 12px;
118
118
  font-weight: 400;
@@ -121,7 +121,7 @@
121
121
  line-height: 22px;
122
122
  }
123
123
 
124
- .help-card-footer {
124
+ .help-card__footer {
125
125
  width: 332px;
126
126
  height: 86px;
127
127
  background: #FFFFFF;
@@ -133,7 +133,7 @@
133
133
  justify-content: space-between;
134
134
  }
135
135
 
136
- .help-card-footer-item {
136
+ .help-card__footer-item {
137
137
  width: 77px;
138
138
  height: 62px;
139
139
  display: flex;
@@ -147,7 +147,7 @@
147
147
  cursor: pointer;
148
148
  }
149
149
 
150
- .help-card-footer-item > img {
150
+ .help-card__footer-item > img {
151
151
  width: 20px;
152
152
  height: 20px;
153
153
  margin-bottom: 5px;
@@ -156,16 +156,16 @@
156
156
  .tita-popup-zoom-left-bottom-enter,
157
157
  .tita-popup-zoom-left-bottom-appear {
158
158
  opacity: 0;
159
- animation-duration: 0.3s;
159
+ animation-duration: 0.2s;
160
160
  animation-fill-mode: both;
161
- animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
161
+ animation-timing-function: linear;
162
162
  animation-play-state: paused;
163
163
  }
164
164
 
165
165
  .tita-popup-zoom-left-bottom-leave {
166
- animation-duration: 0.3s;
166
+ animation-duration: 0.2s;
167
167
  animation-fill-mode: both;
168
- animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05);
168
+ animation-timing-function: linear;
169
169
  animation-play-state: paused;
170
170
  }
171
171
 
@@ -53,20 +53,25 @@ var HelpCard = function HelpCard(_ref) {
53
53
  visible = _useState2[0],
54
54
  setVisible = _useState2[1];
55
55
 
56
- var _useState3 = (0, _react.useState)(false),
56
+ var _useState3 = (0, _react.useState)(1),
57
57
  _useState4 = _slicedToArray(_useState3, 2),
58
- pointVisible = _useState4[0],
59
- setPointVisible = _useState4[1];
58
+ pageNum = _useState4[0],
59
+ setPageNum = _useState4[1];
60
60
 
61
- var _useState5 = (0, _react.useState)([]),
61
+ var _useState5 = (0, _react.useState)(false),
62
62
  _useState6 = _slicedToArray(_useState5, 2),
63
- listType1 = _useState6[0],
64
- setListType1 = _useState6[1];
63
+ pointVisible = _useState6[0],
64
+ setPointVisible = _useState6[1];
65
65
 
66
66
  var _useState7 = (0, _react.useState)([]),
67
67
  _useState8 = _slicedToArray(_useState7, 2),
68
- listType2 = _useState8[0],
69
- setListType2 = _useState8[1];
68
+ listType1 = _useState8[0],
69
+ setListType1 = _useState8[1];
70
+
71
+ var _useState9 = (0, _react.useState)([]),
72
+ _useState10 = _slicedToArray(_useState9, 2),
73
+ listType2 = _useState10[0],
74
+ setListType2 = _useState10[1];
70
75
 
71
76
  var isTrial = (0, _bsGlobal.getVersion)() == 1;
72
77
  var userId = window.BSGlobal && window.BSGlobal.loginUserInfo.Id || 0;
@@ -105,9 +110,8 @@ var HelpCard = function HelpCard(_ref) {
105
110
  };
106
111
 
107
112
  (0, _react.useEffect)(function () {
108
- (0, _requestApi.getQuestionList)().then(function (res) {
109
- console.log(res);
110
- formatQuestionList(res.Data);
113
+ (0, _requestApi.getQuestionList)(pageNum).then(function (res) {
114
+ console.log(res); // formatQuestionList(res.Data);
111
115
  });
112
116
  }, []);
113
117
 
@@ -175,76 +179,76 @@ var HelpCard = function HelpCard(_ref) {
175
179
  return /*#__PURE__*/_react["default"].createElement("div", {
176
180
  className: preCls
177
181
  }, /*#__PURE__*/_react["default"].createElement("div", {
178
- className: "".concat(preCls, "-header")
182
+ className: "".concat(preCls, "__header")
179
183
  }, /*#__PURE__*/_react["default"].createElement("div", {
180
- className: "".concat(preCls, "-header-avatar")
184
+ className: "".concat(preCls, "__header-avatar")
181
185
  }), "Tita\u5C0F\u52A9\u624B"), /*#__PURE__*/_react["default"].createElement("div", {
182
- className: "".concat(preCls, "-body")
186
+ className: "".concat(preCls, "__body")
183
187
  }, /*#__PURE__*/_react["default"].createElement("div", {
184
- className: "".concat(preCls, "-body-item")
188
+ className: "".concat(preCls, "__body-item")
185
189
  }, /*#__PURE__*/_react["default"].createElement("div", {
186
- className: "".concat(preCls, "-body-item-title")
190
+ className: "".concat(preCls, "__body-item-title")
187
191
  }, /*#__PURE__*/_react["default"].createElement("div", {
188
- className: "".concat(preCls, "-body-item-title-left")
192
+ className: "".concat(preCls, "__body-item-title-left")
189
193
  }, "\u731C\u4F60\u60F3\u95EE"), /*#__PURE__*/_react["default"].createElement("div", {
190
- className: "".concat(preCls, "-body-item-title-right")
194
+ className: "".concat(preCls, "__body-item-title-right")
191
195
  }, /*#__PURE__*/_react["default"].createElement("span", {
192
196
  className: "tu-icon-gengxin1",
193
197
  onClick: chageBatch
194
198
  }), "\u6362\u4E00\u6279")), /*#__PURE__*/_react["default"].createElement("div", {
195
- className: "".concat(preCls, "-body-item-content")
199
+ className: "".concat(preCls, "__body-item-content")
196
200
  }, listType1.map(function (item, key) {
197
201
  return /*#__PURE__*/_react["default"].createElement("div", {
198
- className: "".concat(preCls, "-body-item-content-item"),
202
+ className: "".concat(preCls, "__body-item-content-item"),
199
203
  onClick: function onClick() {
200
204
  return handleSkip(item.questionUrl);
201
205
  },
202
206
  key: key
203
207
  }, item.questionName);
204
208
  }))), /*#__PURE__*/_react["default"].createElement("div", {
205
- className: "".concat(preCls, "-body-item")
209
+ className: "".concat(preCls, "__body-item")
206
210
  }, /*#__PURE__*/_react["default"].createElement("div", {
207
- className: "".concat(preCls, "-body-item-title")
211
+ className: "".concat(preCls, "__body-item-title")
208
212
  }, /*#__PURE__*/_react["default"].createElement("div", {
209
- className: "".concat(preCls, "-body-item-title-left")
213
+ className: "".concat(preCls, "__body-item-title-left")
210
214
  }, "\u5E38\u89C1\u95EE\u9898")), /*#__PURE__*/_react["default"].createElement("div", {
211
- className: "".concat(preCls, "-body-item-content")
215
+ className: "".concat(preCls, "__body-item-content")
212
216
  }, listType2.map(function (item, key) {
213
217
  return /*#__PURE__*/_react["default"].createElement("div", {
214
- className: "".concat(preCls, "-body-item-content-item"),
218
+ className: "".concat(preCls, "__body-item-content-item"),
215
219
  onClick: function onClick() {
216
220
  return handleSkip(item.questionUrl);
217
221
  },
218
222
  key: key
219
223
  }, item.questionName);
220
224
  })))), /*#__PURE__*/_react["default"].createElement("div", {
221
- className: "".concat(preCls, "-footer")
225
+ className: "".concat(preCls, "__footer")
222
226
  }, isTrial && /*#__PURE__*/_react["default"].createElement("div", {
223
- className: "".concat(preCls, "-footer-item"),
227
+ className: "".concat(preCls, "__footer-item"),
224
228
  onClick: handlePoint
225
229
  }, /*#__PURE__*/_react["default"].createElement("img", {
226
230
  src: require("./image/yuyueyanshi.svg"),
227
231
  alt: "\u9884\u7EA6\u6F14\u793A"
228
232
  }), "\u9884\u7EA6\u6F14\u793A"), /*#__PURE__*/_react["default"].createElement("div", {
229
- className: "".concat(preCls, "-footer-item"),
233
+ className: "".concat(preCls, "__footer-item"),
230
234
  onClick: handleHelpCenter
231
235
  }, /*#__PURE__*/_react["default"].createElement("img", {
232
236
  src: require("./image/helpzx.svg"),
233
237
  alt: "\u5E2E\u52A9\u4E2D\u5FC3"
234
238
  }), "\u5E2E\u52A9\u4E2D\u5FC3"), !isTrial && /*#__PURE__*/_react["default"].createElement("div", {
235
- className: "".concat(preCls, "-footer-item"),
239
+ className: "".concat(preCls, "__footer-item"),
236
240
  onClick: handleUpgrade
237
241
  }, /*#__PURE__*/_react["default"].createElement("img", {
238
242
  src: require("./image/yuyueyanshi.svg"),
239
243
  alt: "\u5347\u7EA7\u901A\u77E5"
240
244
  }), "\u5347\u7EA7\u901A\u77E5"), !(0, _openData.isPlatform)("feishu") && /*#__PURE__*/_react["default"].createElement("div", {
241
- className: "".concat(preCls, "-footer-item"),
245
+ className: "".concat(preCls, "__footer-item"),
242
246
  onClick: handleKnowledgeCommunity
243
247
  }, /*#__PURE__*/_react["default"].createElement("img", {
244
248
  src: require("./image/okr-shequ.svg"),
245
249
  alt: "\u77E5\u8BC6\u793E\u533A"
246
250
  }), "\u77E5\u8BC6\u793E\u533A"), !(0, _openData.isPlatform)("feishu") && !(0, _openData.isPlatform)("dd") && /*#__PURE__*/_react["default"].createElement("div", {
247
- className: "".concat(preCls, "-footer-item"),
251
+ className: "".concat(preCls, "__footer-item"),
248
252
  onClick: handleCustomerService
249
253
  }, /*#__PURE__*/_react["default"].createElement("img", {
250
254
  src: require("./image/kefu1.svg"),
@@ -19,14 +19,14 @@ var requestDomain = function requestDomain() {
19
19
  return "".concat(location.protocol, "//www.tita.gift");
20
20
  };
21
21
 
22
- var getQuestionList = function getQuestionList() {
22
+ var getQuestionList = function getQuestionList(pageNum) {
23
23
  var source = (0, _bsGlobal.getSource)();
24
24
 
25
25
  if (source !== 860 || source !== 861 || source !== 862) {
26
26
  source = 0;
27
27
  }
28
28
 
29
- return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/const/question?source=").concat(source)).then(function (res) {
29
+ return _axios["default"].get("".concat(requestDomain(), "/api/v1/").concat(tenantId, "/").concat(userId, "/const/question?source=").concat(source, "&pageSize=", 3, "&pageNum=").concat(pageNum)).then(function (res) {
30
30
  return res.data;
31
31
  });
32
32
  };
@@ -78,6 +78,10 @@
78
78
  background: #f7f9fb;
79
79
  }
80
80
 
81
+ .titaui-img-viewer__body-img {
82
+ max-width: 800px;
83
+ }
84
+
81
85
  .titaui-img-viewer__body-operate-btn {
82
86
  position: absolute;
83
87
  width: 48px;
@@ -188,8 +188,9 @@ var ImgViewer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
188
188
  transform: "rotate(".concat(currentRotateDeg, "deg)")
189
189
  }
190
190
  }, /*#__PURE__*/_react["default"].createElement("img", {
191
+ className: prefix + '__body-img',
191
192
  ref: imgRef,
192
- src: currentImgData.bigImageUrl,
193
+ src: currentImgData.previewUrl || currentImgData.bigImageUrl,
193
194
  style: {
194
195
  transform: "scale(".concat(currentScale, ")")
195
196
  }
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.textareaAutoResizing = textareaAutoResizing;
7
- exports.insertTextAtPointer = insertTextAtPointer;
8
6
  exports.dealWithLoadedFileTips = dealWithLoadedFileTips;
9
7
  exports.generateSelectedMark = generateSelectedMark;
10
8
  exports.getByteLen = getByteLen;
11
- exports.htmlEncodeByRegExp = htmlEncodeByRegExp;
12
9
  exports.htmlDecodeByRegExp = htmlDecodeByRegExp;
10
+ exports.htmlEncodeByRegExp = htmlEncodeByRegExp;
11
+ exports.insertTextAtPointer = insertTextAtPointer;
12
+ exports.textareaAutoResizing = textareaAutoResizing;
13
13
 
14
14
  // 修改textarea高度
15
15
  function textareaAutoResizing(id, initialTextHeight) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DragEffect = exports.PreviewBox = exports.BtnPrivate = exports.BtnConfirm = exports.BtnCancel = exports.RightBtn = exports.RightBtnGroupWrapper = exports.IconSpan = exports.LeftBtn = exports.LeftBtnGroupWrapper = exports.MblogActionWrapper = exports.Tips = exports.Textarea = exports.TextareaWrapper = exports.Label = exports.LabelWrapper = exports.DivMblogContent = exports.MBlogBox = void 0;
6
+ exports.Tips = exports.TextareaWrapper = exports.Textarea = exports.RightBtnGroupWrapper = exports.RightBtn = exports.PreviewBox = exports.MblogActionWrapper = exports.MBlogBox = exports.LeftBtnGroupWrapper = exports.LeftBtn = exports.LabelWrapper = exports.Label = exports.IconSpan = exports.DragEffect = exports.DivMblogContent = exports.BtnPrivate = exports.BtnConfirm = exports.BtnCancel = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
@@ -1,13 +1,13 @@
1
- .titaui-drag-width {
1
+ .titaui-drag-resize__bar {
2
2
  display: inline-block;
3
3
  position: absolute;
4
4
  width: 10px;
5
- height: calc(100% - 12px);
6
- top: 8px;
5
+ height: calc(100% - 52px);
6
+ top: 40px;
7
7
  right: -5px;
8
8
  }
9
9
 
10
- .titaui-drag-width__darg {
10
+ .titaui-drag-resize__bar-darg {
11
11
  position: absolute;
12
12
  width: 3px;
13
13
  height: 100%;
@@ -19,32 +19,20 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
19
 
20
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
-
24
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
25
-
26
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
-
28
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
29
-
30
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
31
-
32
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
-
34
- var preCls = 'titaui-drag-width';
22
+ var preCls = 'titaui-drag-resize';
35
23
 
36
24
  var _default = function _default(props) {
37
- var container = props.container;
25
+ var children = props.children,
26
+ _props$defaultWidth = props.defaultWidth,
27
+ defaultWidth = _props$defaultWidth === void 0 ? 180 : _props$defaultWidth,
28
+ _props$onResize = props.onResize,
29
+ onResize = _props$onResize === void 0 ? function () {} : _props$onResize,
30
+ _props$minWidth = props.minWidth,
31
+ minWidth = _props$minWidth === void 0 ? 180 : _props$minWidth,
32
+ _props$maxWidth = props.maxWidth,
33
+ maxWidth = _props$maxWidth === void 0 ? 600 : _props$maxWidth;
38
34
  var dragRef = (0, _react.useRef)();
39
-
40
- var _useState = (0, _react.useState)(180),
41
- _useState2 = _slicedToArray(_useState, 1),
42
- minWidth = _useState2[0];
43
-
44
- var _useState3 = (0, _react.useState)(600),
45
- _useState4 = _slicedToArray(_useState3, 1),
46
- maxWidth = _useState4[0]; // 拖拽
47
-
35
+ var container = (0, _react.useRef)(); // 拖拽
48
36
 
49
37
  (0, _react.useEffect)(function () {
50
38
  var m_pos;
@@ -55,23 +43,40 @@ var _default = function _default(props) {
55
43
  var width = parseInt(getComputedStyle(container.current, '').width) - dx;
56
44
  if (width < minWidth) return;
57
45
  if (width > maxWidth) return;
58
- container.current.style.width = parseInt(getComputedStyle(container.current, '').width) - dx + 'px';
46
+ container.current.style.width = "".concat(width, "px");
47
+ onResize({
48
+ width: width
49
+ });
59
50
  };
60
51
 
61
52
  dragRef.current.addEventListener('mousedown', function (e) {
62
53
  m_pos = e.x;
63
54
  document.addEventListener('mousemove', resize, false);
64
55
  }, false);
65
- document.addEventListener('mouseup', function () {
66
- document.removeEventListener('mousemove', resize, false);
67
- }, false);
56
+
57
+ var removeHandler = function removeHandler() {
58
+ return document.removeEventListener('mousemove', resize, false);
59
+ };
60
+
61
+ document.addEventListener('mouseup', removeHandler, false);
62
+ return function () {
63
+ document.removeEventListener('mouseup', removeHandler);
64
+ };
68
65
  }, []);
69
66
  return /*#__PURE__*/_react["default"].createElement("div", {
70
- className: (0, _classnames["default"])(preCls)
67
+ ref: container,
68
+ className: (0, _classnames["default"])(preCls),
69
+ style: {
70
+ 'width': defaultWidth
71
+ }
72
+ }, /*#__PURE__*/_react["default"].createElement("div", {
73
+ className: (0, _classnames["default"])("".concat(preCls, "__container"))
74
+ }, children), /*#__PURE__*/_react["default"].createElement("div", {
75
+ className: (0, _classnames["default"])("".concat(preCls, "__bar"))
71
76
  }, /*#__PURE__*/_react["default"].createElement("div", {
72
77
  ref: dragRef,
73
- className: (0, _classnames["default"])("".concat(preCls, "__darg"))
74
- }));
78
+ className: (0, _classnames["default"])("".concat(preCls, "__bar-darg"))
79
+ })));
75
80
  };
76
81
 
77
82
  exports["default"] = _default;