@titaui/pc 1.11.4-1 → 1.11.4-10

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 (406) hide show
  1. package/lib/components/avatar/text-avatar/index.css +7 -0
  2. package/lib/components/avatar/text-avatar/index.js +32 -7
  3. package/lib/components/button/rect-btn/index.js +7 -7
  4. package/lib/components/change-okr-modal/Item.js +15 -15
  5. package/lib/components/communication/index.js +30 -29
  6. package/lib/components/date-picker/BodyItem.js +3 -3
  7. package/lib/components/date-picker/CalendarHeader.js +3 -3
  8. package/lib/components/delete-confirm-pop/ConfirmPop.js +3 -3
  9. package/lib/components/drawer/index.js +7 -6
  10. package/lib/components/dynamic/constant.js +13 -6
  11. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/dynamic-footer.js +243 -0
  12. package/lib/components/dynamic/dynamic-item/dynamic-ai-dialy/index.js +6 -2
  13. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.css +22 -7
  14. package/lib/components/dynamic/dynamic-item/dynamic-interview/index.js +6 -7
  15. package/lib/components/dynamic/dynamic-item/dynamic-interview/interview-content.js +19 -7
  16. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/img/wifi.svg +24 -0
  17. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/index.css +61 -0
  18. package/{es/pages/group-management/page-view/loading → lib/components/dynamic/dynamic-item/dynamic-interview-share}/index.js +40 -11
  19. package/lib/components/dynamic/dynamic-item/dynamic-interview-share/interview-content.js +69 -0
  20. package/lib/components/dynamic/dynamic-item/dynamic-kr/index.js +6 -6
  21. package/lib/components/dynamic/dynamic-item/dynamic-milestone/index.js +7 -7
  22. package/lib/components/dynamic/dynamic-item/dynamic-progress/index.js +11 -11
  23. package/lib/components/dynamic/dynamic-item/dynamic-reply/index.js +14 -14
  24. package/lib/components/dynamic/dynamic-item/dynamic-task/index.js +10 -10
  25. package/lib/components/dynamic/dynamic-item/index.js +34 -13
  26. package/lib/components/dynamic/dynamic-list/index.js +5 -13
  27. package/lib/components/e-priority/index.js +18 -12
  28. package/lib/components/eReport/eReportLists/reportList.js +3 -3
  29. package/lib/components/eReport/eReportShare/index.js +11 -11
  30. package/lib/components/emotions-selector/selector-pop.js +3 -3
  31. package/lib/components/ereport-list/index.js +3 -3
  32. package/lib/components/file-list/components/single-file/index.js +11 -11
  33. package/lib/components/form/form-fields/date/index.js +15 -11
  34. package/lib/components/form/form-fields/input/index.js +10 -10
  35. package/lib/components/form/form-fields/user/index.css +22 -2
  36. package/lib/components/form/form-fields/user/index.js +18 -8
  37. package/lib/components/form/form-fields/user/user-input.js +15 -6
  38. package/lib/components/icon-button-list/index.css +2 -57
  39. package/lib/components/icon-button-list/index.js +10 -7
  40. package/lib/components/img-viewer/index.css +10 -3
  41. package/lib/components/img-viewer/index.js +57 -18
  42. package/lib/components/mblog/components/MblogAction.js +3 -3
  43. package/lib/components/mblog/index.js +31 -30
  44. package/lib/components/menus/components/menu-tree/images/interview-menu/my-interview.svg +16 -0
  45. package/lib/components/menus/components/menu-tree/images/interview-menu/template.svg +16 -0
  46. package/lib/components/menus/components/menu-tree/images/interview-menu/todo.svg +16 -0
  47. package/lib/components/menus/components/menu-tree/index.css +4 -2
  48. package/lib/components/menus/components/menu-tree/tree-node/index.css +85 -1
  49. package/lib/components/menus/export-modules/interview-menus/constant.js +12 -12
  50. package/lib/components/menus/export-modules/interview-menus/index.css +7 -0
  51. package/lib/components/menus/export-modules/interview-menus/index.js +4 -2
  52. package/lib/components/nav-top/components/menu/index.js +14 -14
  53. package/lib/components/nav-top/components/user-message/components/inform/inform-item.js +25 -19
  54. package/lib/components/nav-top/components/user-message/components/remind/remind-item.js +48 -10
  55. package/lib/components/nav-top/components/user-message/constant.js +1 -0
  56. package/lib/components/nav-top/components/user-message/hrMessage.js +22 -19
  57. package/lib/components/nav-top/components/user-message/index.js +23 -20
  58. package/lib/components/nav-top/request.apis.js +3 -1
  59. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +7 -7
  60. package/lib/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/edit-pop.js +3 -3
  61. package/lib/components/okr-detail/detail-header/actions.js +62 -66
  62. package/lib/components/okr-detail/detail-header/index.css +2 -2
  63. package/lib/components/okr-detail/detail-header/index.js +205 -194
  64. package/lib/components/okr-detail/index.js +21 -19
  65. package/lib/components/okr-flow/child-node/index.css +67 -21
  66. package/lib/components/okr-flow/child-node/work-node.js +61 -24
  67. package/lib/components/okr-flow/empty/index.css +8 -1
  68. package/lib/components/okr-flow/export-modal/index.js +42 -18
  69. package/lib/components/okr-flow/export-modules/okr-search-panel/index.css +3 -1
  70. package/lib/components/okr-flow/export-modules/okr-search-panel/index.js +30 -24
  71. package/lib/components/okr-flow/images/loading-light.gif +0 -0
  72. package/lib/components/okr-flow/okr-map/index.js +43 -22
  73. package/lib/components/okr-flow/request-apis.js +15 -8
  74. package/lib/components/okr-flow/root-node/index.css +2 -2
  75. package/lib/components/okr-flow/root-node/index.js +26 -25
  76. package/lib/components/okr-flow/utils/index.js +45 -29
  77. package/lib/components/okr-flow/utils/tree-handler.js +29 -18
  78. package/lib/components/okr-review/components/ReviewItem/index.js +3 -3
  79. package/lib/components/okr-review/components/confirm-pop/ConfirmPop.js +3 -3
  80. package/lib/components/okrcase-library/index.css +6 -4
  81. package/lib/components/okrcase-library/okrcases-components/submitOkr-dialog.js +36 -30
  82. package/lib/components/pagination/index.css +3 -3
  83. package/lib/components/pagination/select.css +58 -23
  84. package/lib/components/period-selector/index.css +9 -3
  85. package/lib/components/period-selector/index.js +14 -11
  86. package/lib/components/picker/components/panels/date-panel/date-body.js +21 -19
  87. package/lib/components/picker/components/panels/date-panel/date-head.js +29 -8
  88. package/lib/components/picker/components/panels/month-panel/month-body.js +6 -4
  89. package/lib/components/picker/components/picker-trigger/index.css +15 -0
  90. package/lib/components/picker/components/picker-trigger/index.js +8 -8
  91. package/lib/components/popup/index.js +4 -4
  92. package/lib/components/radio/index.css +9 -9
  93. package/lib/components/range-selector-pop/RangeSelectorPop.js +3 -3
  94. package/lib/components/rich-editor/models/schema.js +6 -6
  95. package/lib/components/rich-editor/plugins/block/block-quote/index.js +8 -8
  96. package/lib/components/rich-editor/plugins/block/heading/index.js +8 -8
  97. package/lib/components/rich-editor/plugins/block/lists/index.js +14 -14
  98. package/lib/components/rich-editor/plugins/block/paragraph/index.js +5 -5
  99. package/lib/components/rich-editor/plugins/core/index.js +4 -4
  100. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -5
  101. package/lib/components/rich-editor/plugins/extension/placeholder/index.js +4 -4
  102. package/lib/components/rich-editor/plugins/inline/color/index.js +11 -11
  103. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +8 -8
  104. package/lib/components/rich-editor/plugins/inline/em/index.js +5 -5
  105. package/lib/components/rich-editor/plugins/inline/link/index.js +8 -8
  106. package/lib/components/rich-editor/plugins/inline/strong/index.js +8 -8
  107. package/lib/components/rich-editor/plugins/inline/under-line/index.js +8 -8
  108. package/lib/components/rich-editor/react/uiProvider.js +3 -3
  109. package/lib/components/rich-editor/ui/Popup/index.js +3 -3
  110. package/lib/components/scroll-container/index.js +423 -0
  111. package/lib/components/scroll-container/style.css +35 -0
  112. package/lib/components/scrollbar/scroll-mask/index.js +1 -1
  113. package/lib/components/select/Option.js +3 -3
  114. package/lib/components/superset-charts/components/chart/index.js +1 -1
  115. package/lib/components/superset-charts/utils/axios.js +5 -13
  116. package/{es/pages/group-management/page-view/group-empty.js → lib/components/survey-model/contact.js} +54 -27
  117. package/lib/components/survey-model/index.css +141 -0
  118. package/lib/components/survey-model/index.js +265 -0
  119. package/lib/components/survey-model/instance.js +86 -0
  120. package/lib/components/survey-model/request-api.js +80 -0
  121. package/lib/components/task-tree/helper.js +61 -0
  122. package/lib/components/task-tree/images/P1.svg +15 -0
  123. package/lib/components/task-tree/images/P2.svg +15 -0
  124. package/lib/components/task-tree/images/P3.svg +15 -0
  125. package/lib/components/task-tree/images/P4.svg +15 -0
  126. package/lib/components/task-tree/images/P5.svg +15 -0
  127. package/lib/components/task-tree/images/arrow.svg +9 -0
  128. package/lib/components/task-tree/images/empty-131.png +0 -0
  129. package/lib/components/task-tree/images/followed.svg +33 -0
  130. package/lib/components/task-tree/images/nice.svg +108 -0
  131. package/lib/components/task-tree/images/struc12.png +0 -0
  132. package/lib/components/task-tree/images/struc2.png +0 -0
  133. package/lib/components/task-tree/images/xialat-s.svg +13 -0
  134. package/lib/components/task-tree/index.js +22 -0
  135. package/lib/components/task-tree/mock.js +944 -0
  136. package/{es/components/okr-detail/e-list → lib/components/task-tree}/precls.js +1 -1
  137. package/lib/components/task-tree/request-apis.js +88 -0
  138. package/lib/components/task-tree/task-item-node/constant.js +45 -0
  139. package/{es/components/okr-detail/components/okr-tree/tree-node/default-node.js → lib/components/task-tree/task-item-node/e-empty.js} +13 -6
  140. package/{es/components/okr-detail/components/okr-tree/tree-node/e-node → lib/components/task-tree/task-item-node}/e-project.js +63 -51
  141. package/{es/components/e-status-dropdown/index.js → lib/components/task-tree/task-item-node/e-status-dropdown.js} +13 -13
  142. package/{es/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js → lib/components/task-tree/task-item-node/e-task.js} +138 -124
  143. package/{es/components/okr-detail/components/okr-tree/tree-node → lib/components/task-tree/task-item-node}/get-process-color.js +3 -3
  144. package/lib/components/task-tree/task-item-node/index.css +289 -0
  145. package/lib/components/task-tree/task-item-node/task-node-render.js +43 -0
  146. package/lib/components/task-tree/task-tree.css +16 -0
  147. package/{es/components/okr-detail/components/okr-tree/index.js → lib/components/task-tree/task-tree.js} +17 -16
  148. package/lib/components/time-picker/index.css +6 -0
  149. package/lib/components/time-picker/time-picker.js +27 -27
  150. package/lib/components/tita-chart/errorBoundary/index.js +3 -3
  151. package/lib/components/user-selector/select-tree/tree-nodes/tree-person-node/index.css +1 -0
  152. package/lib/components/wechat-btn/index.css +14 -0
  153. package/lib/components/wechat-btn/index.js +338 -0
  154. package/lib/components-v1/animate/AnimateChild.js +3 -3
  155. package/lib/components-v1/avatar/index.js +3 -3
  156. package/lib/components-v1/dropDownSelector/StatelessDropdown.js +3 -3
  157. package/lib/components-v1/progress/CircleProgress.js +3 -3
  158. package/lib/components-v1/radio/radio.js +3 -3
  159. package/lib/components-v1/radio/style/index.css +8 -8
  160. package/lib/components-v1/select/Option.js +3 -3
  161. package/lib/components-v1/userSelector/UserSelectorPop.js +3 -3
  162. package/lib/components-v1/userSelector/components/MultiMode/index.js +3 -3
  163. package/lib/components-v1/userSelector/components/UserItem.js +3 -3
  164. package/lib/index.js +99 -91
  165. package/lib/pages/okr-map/export-modules/okr-map/header/index.css +7 -2
  166. package/lib/pages/okr-map/export-modules/okr-map/header/index.js +73 -34
  167. package/lib/pages/okr-map/export-modules/okr-map/okr-map.js +65 -42
  168. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.css +26 -14
  169. package/lib/pages/okr-map/export-modules/share-okr-page/header/index.js +58 -13
  170. package/lib/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +28 -20
  171. package/lib/pages/okr-map/number-select/index.css +12 -9
  172. package/lib/pages/okr-map/number-select/index.js +3 -3
  173. package/lib/utils/auth.js +65 -8
  174. package/lib/utils/bs-global.js +18 -6
  175. package/lib/utils/open-data.js +63 -43
  176. package/package.json +6 -2
  177. package/.eslintignore +0 -3
  178. package/.eslintrc.js +0 -223
  179. package/.husky/pre-commit +0 -4
  180. package/.prettierignore +0 -31
  181. package/.prettierrc.js +0 -90
  182. package/.vscode/settings.json +0 -5
  183. package/es/components/cascader/time.js +0 -31
  184. package/es/components/common-share/request-apis.js +0 -56
  185. package/es/components/confidence/heart.js +0 -66
  186. package/es/components/create-okr-modal/fields/index.js +0 -17
  187. package/es/components/create-okr-modal/utils/getCreateOkrSurpassPercent.js +0 -154
  188. package/es/components/date-picker/BodyItem.js +0 -121
  189. package/es/components/date-picker/CalendarBody.js +0 -157
  190. package/es/components/date-picker/CalendarHeader.js +0 -187
  191. package/es/components/date-picker/index.js +0 -157
  192. package/es/components/date-range-picker/index.js +0 -210
  193. package/es/components/dialog/index.js +0 -119
  194. package/es/components/dialog-confirm/index.js +0 -154
  195. package/es/components/drop-selector/icon-item.js +0 -40
  196. package/es/components/drop-selector/index.js +0 -179
  197. package/es/components/dynamic/dynamic-like-ranking/mock.js +0 -84
  198. package/es/components/dynamic/dynamic-liking/mock.js +0 -83
  199. package/es/components/dynamic/dynamic-topping/request-api.js +0 -36
  200. package/es/components/e-priority/index.js +0 -88
  201. package/es/components/grid-layout/commen-components/index.js +0 -73
  202. package/es/components/grid-layout/image/could.js +0 -8
  203. package/es/components/grid-layout/image/lv.js +0 -8
  204. package/es/components/grid-layout/image/tita-mask.js +0 -8
  205. package/es/components/help-card/request-api.js +0 -35
  206. package/es/components/icon-button-list/index.js +0 -65
  207. package/es/components/menus/context.js +0 -18
  208. package/es/components/menus/precls.js +0 -8
  209. package/es/components/okr-detail/auth.js +0 -197
  210. package/es/components/okr-detail/components/ao-nice/index.js +0 -245
  211. package/es/components/okr-detail/components/block-line/index.js +0 -20
  212. package/es/components/okr-detail/components/header/index.js +0 -211
  213. package/es/components/okr-detail/components/icon-text/index.js +0 -116
  214. package/es/components/okr-detail/components/okr-tree/precls.js +0 -8
  215. package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-priority-dropdown.js +0 -88
  216. package/es/components/okr-detail/components/okr-tree/tree-node/e-node/e-status-dropdown.js +0 -98
  217. package/es/components/okr-detail/components/okr-tree/tree-node/index.js +0 -90
  218. package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/get-process-color.js +0 -46
  219. package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/index.js +0 -421
  220. package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/index.js +0 -54
  221. package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/kr-score-editor/style.js +0 -62
  222. package/es/components/okr-detail/components/okr-tree/tree-node/kr-node/range-picker-pop.js +0 -94
  223. package/es/components/okr-detail/components/okr-tree/tree-node/kr-parent-node/index.js +0 -273
  224. package/es/components/okr-detail/components/okr-tree/tree-node/o-child-node/index.js +0 -207
  225. package/es/components/okr-detail/components/okr-tree/tree-node/o-parent-node/index.js +0 -236
  226. package/es/components/okr-detail/components/padding-layout.js +0 -22
  227. package/es/components/okr-detail/components/tab-panel-content/index.js +0 -27
  228. package/es/components/okr-detail/context.js +0 -30
  229. package/es/components/okr-detail/e-list/index.js +0 -243
  230. package/es/components/okr-detail/e-list/search-form/fields/e-order.js +0 -172
  231. package/es/components/okr-detail/e-list/search-form/fields/e-status.js +0 -99
  232. package/es/components/okr-detail/e-list/search-form/fields/e-user.js +0 -49
  233. package/es/components/okr-detail/e-list/search-form/index.js +0 -143
  234. package/es/components/okr-detail/error-page/index.js +0 -33
  235. package/es/components/okr-detail/index.js +0 -428
  236. package/es/components/okr-detail/loading/index.js +0 -28
  237. package/es/components/okr-detail/okr-list/add-parent-okr.js +0 -37
  238. package/es/components/okr-detail/okr-list/create-kr-item/heart.js +0 -38
  239. package/es/components/okr-detail/okr-list/drag-order-kr.js +0 -62
  240. package/es/components/okr-detail/okr-list/empty/index.js +0 -48
  241. package/es/components/okr-detail/okr-list/index.js +0 -524
  242. package/es/components/okr-detail/okr-list/warp-parent-okr.js +0 -21
  243. package/es/components/okr-detail/store.js +0 -1
  244. package/es/components/okr-flow/child-node/fields/creator.js +0 -175
  245. package/es/components/okr-flow/child-node/fields/okrClassify.js +0 -31
  246. package/es/components/okr-flow/child-node/fields/okrType.js +0 -21
  247. package/es/components/okr-flow/child-node/helper.js +0 -35
  248. package/es/components/okr-flow/child-node/index.js +0 -110
  249. package/es/components/okr-flow/child-node/kr-node.js +0 -75
  250. package/es/components/okr-flow/child-node/work-node.js +0 -242
  251. package/es/components/okr-flow/context.js +0 -14
  252. package/es/components/okr-flow/empty/index.js +0 -29
  253. package/es/components/okr-flow/export-modules/okr-search-panel/index.js +0 -394
  254. package/es/components/okr-flow/index.js +0 -24
  255. package/es/components/okr-flow/mini-map/index.js +0 -112
  256. package/es/components/okr-flow/mini-map/map.js +0 -145
  257. package/es/components/okr-flow/mini-map/mini-node.js +0 -57
  258. package/es/components/okr-flow/mini-map/utils.js +0 -79
  259. package/es/components/okr-flow/okr-map/index.js +0 -192
  260. package/es/components/okr-flow/open-data/index.js +0 -115
  261. package/es/components/okr-flow/precls.js +0 -8
  262. package/es/components/okr-flow/request-apis.js +0 -118
  263. package/es/components/okr-flow/root-node/index.js +0 -229
  264. package/es/components/okr-flow/utils/config.js +0 -18
  265. package/es/components/okr-flow/utils/helper.js +0 -36
  266. package/es/components/okr-flow/utils/index.js +0 -66
  267. package/es/components/okr-flow/utils/tree-handler.js +0 -323
  268. package/es/components/okr-progress-modal/helper.js +0 -156
  269. package/es/components/okr-progress-modal/request-apis.js +0 -34
  270. package/es/components/okr-share/request-apis.js +0 -56
  271. package/es/components/okrcase-library/server/network.js +0 -407
  272. package/es/components/pagination/locale/en_US.js +0 -22
  273. package/es/components/pagination/locale/zh_CN.js +0 -22
  274. package/es/components/point-demo/drop-down-box/index.js +0 -159
  275. package/es/components/point-demo/index.js +0 -533
  276. package/es/components/point-demo/input/index.js +0 -176
  277. package/es/components/point-demo/point-demo.js +0 -75
  278. package/es/components/point-demo/popup/index.js +0 -113
  279. package/es/components/point-demo/popup/placement.js +0 -44
  280. package/es/components/range-picker-pop/index.js +0 -273
  281. package/es/components/scrollbar/simplebar/helpers.js +0 -59
  282. package/es/components/scrollbar/simplebar/index.js +0 -91
  283. package/es/components/scrollbar/simplebar/scrollbar-width.js +0 -47
  284. package/es/components/scrollbar/simplebar/simplebar.js +0 -852
  285. package/es/components/scrollbar/simplebar-react.js +0 -163
  286. package/es/components/search-dropdown/index.js +0 -40
  287. package/es/components/search-input/index.js +0 -126
  288. package/es/components/select/Option.js +0 -94
  289. package/es/components/select/index.js +0 -330
  290. package/es/components/selector-input/debounce.js +0 -36
  291. package/es/components/selector-input/index.js +0 -109
  292. package/es/components/slider-input/index.js +0 -119
  293. package/es/components/switch/index.js +0 -39
  294. package/es/components/table/index.js +0 -275
  295. package/es/components/tabs/index.js +0 -63
  296. package/es/components/task-relation-modal/tree-node/index.js +0 -58
  297. package/es/components/tita-chart/charts/img/could.js +0 -8
  298. package/es/components/tooltip/error-tip.js +0 -24
  299. package/es/components/tooltip/index.js +0 -21
  300. package/es/components/tree/index.js +0 -79
  301. package/es/components/tree/precls.js +0 -8
  302. package/es/components/upvote/request-apis.js +0 -45
  303. package/es/components/user-selector/action-btns/btn-cancel.js +0 -21
  304. package/es/components/user-selector/action-btns/btn-ok.js +0 -21
  305. package/es/components/user-selector/action-btns/index.js +0 -27
  306. package/es/components/user-selector/context.js +0 -18
  307. package/es/components/user-selector/empty/group.js +0 -55
  308. package/es/components/user-selector/empty/index.js +0 -28
  309. package/es/components/user-selector/export-modules/depart-search-selector/result-part.js +0 -41
  310. package/es/components/user-selector/export-modules/group-selector/index.js +0 -170
  311. package/es/components/user-selector/export-modules/group-selector/searched-panel.js +0 -68
  312. package/es/components/user-selector/export-modules/multiple-user-selector--bak/index.js +0 -246
  313. package/es/components/user-selector/index.js +0 -25
  314. package/es/components/user-selector/layout/index.js +0 -25
  315. package/es/components/user-selector/loading/index.js +0 -18
  316. package/es/components/user-selector/request-apis.js +0 -180
  317. package/es/components/user-selector/searched-panel/index.js +0 -139
  318. package/es/components/user-selector/searched-panel/result-part.js +0 -43
  319. package/es/components/user-selector/select-tree/selected-tree/index.js +0 -91
  320. package/es/components/user-selector/select-tree/tree-nodes/tree-depart-node/index.js +0 -48
  321. package/es/components/user-selector/select-tree/tree-nodes/tree-duties-node/index.js +0 -27
  322. package/es/components/user-selector/select-tree/tree-nodes/tree-group-node/index.js +0 -57
  323. package/es/components/user-selector/select-tree/tree-nodes/tree-person-node/index.js +0 -93
  324. package/es/components/user-selector/utils.js +0 -139
  325. package/es/components/viewer/ImageListRender.js +0 -143
  326. package/es/components/viewer/index.js +0 -168
  327. package/es/components/word-cloud/index.js +0 -109
  328. package/es/components/word-cloud/request-apis.js +0 -26
  329. package/es/components-v1/animate/AnimateChild.js +0 -76
  330. package/es/components-v1/animate/animate.js +0 -148
  331. package/es/components-v1/animate/index.js +0 -13
  332. package/es/components-v1/dom/index.js +0 -30
  333. package/es/components-v1/placement/index.js +0 -13
  334. package/es/components-v1/placement/placement.js +0 -111
  335. package/es/components-v1/placement/placementInner.js +0 -139
  336. package/es/components-v1/pop/Pop.js +0 -246
  337. package/es/components-v1/pop/PopInner.js +0 -163
  338. package/es/components-v1/pop/index.js +0 -13
  339. package/es/components-v1/progress/CircleProgress.js +0 -152
  340. package/es/components-v1/progress/LineProgress.js +0 -83
  341. package/es/components-v1/progress/index.js +0 -80
  342. package/es/components-v1/select/Option.js +0 -94
  343. package/es/components-v1/select/index.js +0 -330
  344. package/es/components-v1/utils/animate/animate.js +0 -103
  345. package/es/components-v1/utils/animate/event.js +0 -79
  346. package/es/components-v1/utils/dom/index.js +0 -30
  347. package/es/components-v1/utils/placement/autoAdjustPlacement.js +0 -93
  348. package/es/components-v1/utils/placement/getContainerVisibleArea.js +0 -22
  349. package/es/components-v1/utils/placement/getExpectPlacement.js +0 -49
  350. package/es/components-v1/utils/placement/getPlacementInContainer.js +0 -26
  351. package/es/components-v1/utils/placement/placement.js +0 -76
  352. package/es/index.js +0 -777
  353. package/es/pages/appointment-demo/drop-down-box/index.js +0 -159
  354. package/es/pages/appointment-demo/index.js +0 -649
  355. package/es/pages/appointment-demo/input/index.js +0 -176
  356. package/es/pages/appointment-demo/popup/index.js +0 -113
  357. package/es/pages/appointment-demo/popup/placement.js +0 -44
  358. package/es/pages/group-management/components/checkbox/index.js +0 -28
  359. package/es/pages/group-management/components/input-form/index.js +0 -174
  360. package/es/pages/group-management/components/radio/index.js +0 -21
  361. package/es/pages/group-management/components/table/index.js +0 -174
  362. package/es/pages/group-management/groupInterface.js +0 -293
  363. package/es/pages/group-management/index.js +0 -13
  364. package/es/pages/group-management/page-view/empty.js +0 -111
  365. package/es/pages/group-management/page-view/importGroupStaff/index.js +0 -208
  366. package/es/pages/group-management/page-view/index.js +0 -412
  367. package/es/pages/group-management/table/index.js +0 -104
  368. package/es/pages/group-management/tree/add-group-dialog/index.js +0 -153
  369. package/es/pages/group-management/tree/delete-group-dialog/index.js +0 -82
  370. package/es/pages/group-management/tree/edit-group-dialog/index.js +0 -155
  371. package/es/pages/group-management/tree/group-form/index.js +0 -207
  372. package/es/pages/group-management/tree/index.js +0 -168
  373. package/es/pages/group-management/tree/operation-panel.js +0 -41
  374. package/es/pages/group-management/tree/trigger-render.js +0 -99
  375. package/es/pages/like-ranking/mock.js +0 -366
  376. package/es/pages/okr-map/export-modules/index.js +0 -1
  377. package/es/pages/okr-map/export-modules/okr-map/header/index.js +0 -182
  378. package/es/pages/okr-map/export-modules/okr-map/header/show-kr-confirm.js +0 -47
  379. package/es/pages/okr-map/export-modules/okr-map/okr-map.js +0 -497
  380. package/es/pages/okr-map/export-modules/share-okr-page/header/index.js +0 -69
  381. package/es/pages/okr-map/export-modules/share-okr-page/share-okr-map.js +0 -168
  382. package/es/pages/okr-map/hooks/useStorage.js +0 -96
  383. package/es/pages/okr-map/index.js +0 -18
  384. package/es/pages/okr-map/level2-search/depart.js +0 -53
  385. package/es/pages/okr-map/level2-search/group.js +0 -69
  386. package/es/pages/okr-map/level2-search/index.js +0 -51
  387. package/es/pages/okr-map/level2-search/level2-input.js +0 -46
  388. package/es/pages/okr-map/level2-search/user.js +0 -54
  389. package/es/pages/okr-map/no-okr/index.js +0 -24
  390. package/es/pages/okr-map/number-select/index.js +0 -81
  391. package/es/pages/okr-map/open-data/index.js +0 -115
  392. package/es/pages/okr-map/precls.js +0 -8
  393. package/es/pages/okr-map/request-apis.js +0 -76
  394. package/es/pages/okr-map/share-dialog/index.js +0 -122
  395. package/es/pages/okr-map/unsupport-ie/index.js +0 -83
  396. package/es/pages/okr-map/utils.js +0 -51
  397. package/es/utils/auth.js +0 -294
  398. package/es/utils/bs-global.js +0 -114
  399. package/es/utils/local-storage.js +0 -42
  400. package/es/utils/mblog.js +0 -33
  401. package/es/utils/mock-bsglobal.js +0 -1837
  402. package/es/utils/open-data.js +0 -341
  403. package/es/utils/request-v1.js +0 -115
  404. package/es/utils/request.js +0 -183
  405. package/es/utils/tools.js +0 -286
  406. package/yarn-error.log +0 -21252
@@ -1,852 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _lodash = _interopRequireDefault(require("lodash.throttle"));
9
-
10
- var _lodash2 = _interopRequireDefault(require("lodash.debounce"));
11
-
12
- var _lodash3 = _interopRequireDefault(require("lodash.memoize"));
13
-
14
- var _resizeObserverPolyfill = _interopRequireDefault(require("resize-observer-polyfill"));
15
-
16
- var _canUseDom = _interopRequireDefault(require("can-use-dom"));
17
-
18
- var _scrollbarWidth = _interopRequireDefault(require("./scrollbar-width"));
19
-
20
- var _helpers = require("./helpers");
21
-
22
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
-
24
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
-
26
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
-
28
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
-
30
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
-
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
35
-
36
- var SimpleBar = /*#__PURE__*/function () {
37
- function SimpleBar(element, options) {
38
- var _this = this;
39
-
40
- _classCallCheck(this, SimpleBar);
41
-
42
- this.onScroll = function () {
43
- var elWindow = (0, _helpers.getElementWindow)(_this.el);
44
-
45
- if (!_this.scrollXTicking) {
46
- elWindow.requestAnimationFrame(_this.scrollX);
47
- _this.scrollXTicking = true;
48
- }
49
-
50
- if (!_this.scrollYTicking) {
51
- elWindow.requestAnimationFrame(_this.scrollY);
52
- _this.scrollYTicking = true;
53
- }
54
- };
55
-
56
- this.scrollX = function () {
57
- if (_this.axis.x.isOverflowing) {
58
- _this.showScrollbar("x");
59
-
60
- _this.positionScrollbar("x");
61
- }
62
-
63
- _this.scrollXTicking = false;
64
- };
65
-
66
- this.scrollY = function () {
67
- if (_this.axis.y.isOverflowing) {
68
- _this.showScrollbar("y");
69
-
70
- _this.positionScrollbar("y");
71
- }
72
-
73
- _this.scrollYTicking = false;
74
- };
75
-
76
- this.onMouseEnter = function () {
77
- _this.showScrollbar("x");
78
-
79
- _this.showScrollbar("y");
80
- };
81
-
82
- this.onMouseMove = function (e) {
83
- _this.mouseX = e.clientX;
84
- _this.mouseY = e.clientY;
85
-
86
- if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
87
- _this.onMouseMoveForAxis("x");
88
- }
89
-
90
- if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
91
- _this.onMouseMoveForAxis("y");
92
- }
93
- };
94
-
95
- this.onMouseLeave = function () {
96
- _this.onMouseMove.cancel();
97
-
98
- if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
99
- _this.onMouseLeaveForAxis("x");
100
- }
101
-
102
- if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
103
- _this.onMouseLeaveForAxis("y");
104
- }
105
-
106
- _this.mouseX = -1;
107
- _this.mouseY = -1;
108
- };
109
-
110
- this.onWindowResize = function () {
111
- // Recalculate scrollbarWidth in case it's a zoom
112
- _this.scrollbarWidth = _this.getScrollbarWidth();
113
-
114
- _this.hideNativeScrollbar();
115
- };
116
-
117
- this.hideScrollbars = function () {
118
- _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
119
- _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
120
-
121
- if (!_this.isWithinBounds(_this.axis.y.track.rect)) {
122
- _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible);
123
-
124
- _this.axis.y.isVisible = false;
125
- }
126
-
127
- if (!_this.isWithinBounds(_this.axis.x.track.rect)) {
128
- _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible);
129
-
130
- _this.axis.x.isVisible = false;
131
- }
132
- };
133
-
134
- this.onPointerEvent = function (e) {
135
- var isWithinTrackXBounds;
136
- var isWithinTrackYBounds;
137
- _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
138
- _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
139
-
140
- if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
141
- isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect);
142
- }
143
-
144
- if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
145
- isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect);
146
- } // If any pointer event is called on the scrollbar
147
-
148
-
149
- if (isWithinTrackXBounds || isWithinTrackYBounds) {
150
- // Preventing the event's default action stops text being
151
- // selectable during the drag.
152
- e.preventDefault(); // Prevent event leaking
153
-
154
- e.stopPropagation();
155
-
156
- if (e.type === "mousedown") {
157
- if (isWithinTrackXBounds) {
158
- _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect();
159
-
160
- if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) {
161
- _this.onDragStart(e, "x");
162
- } else {
163
- _this.onTrackClick(e, "x");
164
- }
165
- }
166
-
167
- if (isWithinTrackYBounds) {
168
- _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect();
169
-
170
- if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) {
171
- _this.onDragStart(e, "y");
172
- } else {
173
- _this.onTrackClick(e, "y");
174
- }
175
- }
176
- }
177
- }
178
- };
179
-
180
- this.drag = function (e) {
181
- var eventOffset;
182
- var track = _this.axis[_this.draggedAxis].track;
183
- var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr];
184
- var scrollbar = _this.axis[_this.draggedAxis].scrollbar;
185
- var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr];
186
- var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10);
187
- e.preventDefault();
188
- e.stopPropagation();
189
-
190
- if (_this.draggedAxis === "y") {
191
- eventOffset = e.pageY;
192
- } else {
193
- eventOffset = e.pageX;
194
- } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
195
-
196
-
197
- var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width.
198
-
199
- var dragPerc = dragPos / (trackSize - scrollbar.size); // Scroll the content by the same percentage.
200
-
201
- var scrollPos = dragPerc * (contentSize - hostSize); // Fix browsers inconsistency on RTL
202
-
203
- if (_this.draggedAxis === "x") {
204
- scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos;
205
- scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos;
206
- }
207
-
208
- _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos;
209
- };
210
-
211
- this.onEndDrag = function (e) {
212
- var elDocument = (0, _helpers.getElementDocument)(_this.el);
213
- var elWindow = (0, _helpers.getElementWindow)(_this.el);
214
- e.preventDefault();
215
- e.stopPropagation();
216
-
217
- _this.el.classList.remove(_this.classNames.dragging);
218
-
219
- elDocument.removeEventListener("mousemove", _this.drag, true);
220
- elDocument.removeEventListener("mouseup", _this.onEndDrag, true);
221
- _this.removePreventClickId = elWindow.setTimeout(function () {
222
- // Remove these asynchronously so we still suppress click events
223
- // generated simultaneously with mouseup.
224
- elDocument.removeEventListener("click", _this.preventClick, true);
225
- elDocument.removeEventListener("dblclick", _this.preventClick, true);
226
- _this.removePreventClickId = null;
227
- });
228
- };
229
-
230
- this.preventClick = function (e) {
231
- e.preventDefault();
232
- e.stopPropagation();
233
- };
234
-
235
- this.el = element;
236
- this.minScrollbarWidth = 20;
237
- this.options = _objectSpread(_objectSpread({}, SimpleBar.defaultOptions), options);
238
- this.classNames = _objectSpread(_objectSpread({}, SimpleBar.defaultOptions.classNames), this.options.classNames);
239
- this.axis = {
240
- x: {
241
- scrollOffsetAttr: "scrollLeft",
242
- sizeAttr: "width",
243
- scrollSizeAttr: "scrollWidth",
244
- offsetSizeAttr: "offsetWidth",
245
- offsetAttr: "left",
246
- overflowAttr: "overflowX",
247
- dragOffset: 0,
248
- isOverflowing: true,
249
- isVisible: false,
250
- forceVisible: false,
251
- track: {},
252
- scrollbar: {}
253
- },
254
- y: {
255
- scrollOffsetAttr: "scrollTop",
256
- sizeAttr: "height",
257
- scrollSizeAttr: "scrollHeight",
258
- offsetSizeAttr: "offsetHeight",
259
- offsetAttr: "top",
260
- overflowAttr: "overflowY",
261
- dragOffset: 0,
262
- isOverflowing: true,
263
- isVisible: false,
264
- forceVisible: false,
265
- track: {},
266
- scrollbar: {}
267
- }
268
- };
269
- this.removePreventClickId = null; // Don't re-instantiate over an existing one
270
-
271
- if (SimpleBar.instances.has(this.el)) {
272
- return;
273
- } // Tita TODO: 修改 64 到 1,解决卡顿问题
274
-
275
-
276
- this.recalculate = (0, _lodash["default"])(this.recalculate.bind(this), 1);
277
- this.onMouseMove = (0, _lodash["default"])(this.onMouseMove.bind(this), 64);
278
- this.hideScrollbars = (0, _lodash2["default"])(this.hideScrollbars.bind(this), this.options.timeout);
279
- this.onWindowResize = (0, _lodash2["default"])(this.onWindowResize.bind(this), 64, {
280
- leading: true
281
- });
282
- SimpleBar.getRtlHelpers = (0, _lodash3["default"])(SimpleBar.getRtlHelpers);
283
- this.init();
284
- }
285
- /**
286
- * Static properties
287
- */
288
-
289
- /**
290
- * Helper to fix browsers inconsistency on RTL:
291
- * - Firefox inverts the scrollbar initial position
292
- * - IE11 inverts both scrollbar position and scrolling offset
293
- * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634
294
- */
295
-
296
-
297
- _createClass(SimpleBar, [{
298
- key: "init",
299
- value: function init() {
300
- // Save a reference to the instance, so we know this DOM node has already been instancied
301
- SimpleBar.instances.set(this.el, this); // We stop here on server-side
302
-
303
- if (_canUseDom["default"]) {
304
- this.initDOM();
305
- this.setAccessibilityAttributes();
306
- this.scrollbarWidth = this.getScrollbarWidth();
307
- this.recalculate();
308
- this.initListeners();
309
- }
310
- }
311
- }, {
312
- key: "initDOM",
313
- value: function initDOM() {
314
- var _this2 = this;
315
-
316
- // make sure this element doesn't have the elements yet
317
- if (Array.prototype.filter.call(this.el.children, function (child) {
318
- return child.classList.contains(_this2.classNames.wrapper);
319
- }).length) {
320
- // assume that element has his DOM already initiated
321
- this.wrapperEl = this.el.querySelector(".".concat(this.classNames.wrapper));
322
- this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(".".concat(this.classNames.contentWrapper));
323
- this.contentEl = this.options.contentNode || this.el.querySelector(".".concat(this.classNames.contentEl));
324
- this.offsetEl = this.el.querySelector(".".concat(this.classNames.offset));
325
- this.maskEl = this.el.querySelector(".".concat(this.classNames.mask));
326
- this.placeholderEl = this.findChild(this.wrapperEl, ".".concat(this.classNames.placeholder));
327
- this.heightAutoObserverWrapperEl = this.el.querySelector(".".concat(this.classNames.heightAutoObserverWrapperEl));
328
- this.heightAutoObserverEl = this.el.querySelector(".".concat(this.classNames.heightAutoObserverEl));
329
- this.axis.x.track.el = this.findChild(this.el, ".".concat(this.classNames.track, ".").concat(this.classNames.horizontal));
330
- this.axis.y.track.el = this.findChild(this.el, ".".concat(this.classNames.track, ".").concat(this.classNames.vertical));
331
- } else {
332
- // Prepare DOM
333
- this.wrapperEl = document.createElement("div");
334
- this.contentWrapperEl = document.createElement("div");
335
- this.offsetEl = document.createElement("div");
336
- this.maskEl = document.createElement("div");
337
- this.contentEl = document.createElement("div");
338
- this.placeholderEl = document.createElement("div");
339
- this.heightAutoObserverWrapperEl = document.createElement("div");
340
- this.heightAutoObserverEl = document.createElement("div");
341
- this.wrapperEl.classList.add(this.classNames.wrapper);
342
- this.contentWrapperEl.classList.add(this.classNames.contentWrapper);
343
- this.offsetEl.classList.add(this.classNames.offset);
344
- this.maskEl.classList.add(this.classNames.mask);
345
- this.contentEl.classList.add(this.classNames.contentEl);
346
- this.placeholderEl.classList.add(this.classNames.placeholder);
347
- this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl);
348
- this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);
349
-
350
- while (this.el.firstChild) {
351
- this.contentEl.appendChild(this.el.firstChild);
352
- }
353
-
354
- this.contentWrapperEl.appendChild(this.contentEl);
355
- this.offsetEl.appendChild(this.contentWrapperEl);
356
- this.maskEl.appendChild(this.offsetEl);
357
- this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);
358
- this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);
359
- this.wrapperEl.appendChild(this.maskEl);
360
- this.wrapperEl.appendChild(this.placeholderEl);
361
- this.el.appendChild(this.wrapperEl);
362
- }
363
-
364
- if (!this.axis.x.track.el || !this.axis.y.track.el) {
365
- var track = document.createElement("div");
366
- var scrollbar = document.createElement("div");
367
- track.classList.add(this.classNames.track);
368
- scrollbar.classList.add(this.classNames.scrollbar);
369
- track.appendChild(scrollbar);
370
- this.axis.x.track.el = track.cloneNode(true);
371
- this.axis.x.track.el.classList.add(this.classNames.horizontal);
372
- this.axis.y.track.el = track.cloneNode(true);
373
- this.axis.y.track.el.classList.add(this.classNames.vertical);
374
- this.el.appendChild(this.axis.x.track.el);
375
- this.el.appendChild(this.axis.y.track.el);
376
- }
377
-
378
- this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector(".".concat(this.classNames.scrollbar));
379
- this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector(".".concat(this.classNames.scrollbar));
380
-
381
- if (!this.options.autoHide) {
382
- this.axis.x.scrollbar.el.classList.add(this.classNames.visible);
383
- this.axis.y.scrollbar.el.classList.add(this.classNames.visible);
384
- }
385
-
386
- this.el.setAttribute("data-simplebar", "init");
387
- }
388
- }, {
389
- key: "setAccessibilityAttributes",
390
- value: function setAccessibilityAttributes() {
391
- var ariaLabel = this.options.ariaLabel || "scrollable content";
392
- this.contentWrapperEl.setAttribute("tabindex", "0");
393
- this.contentWrapperEl.setAttribute("role", "region");
394
- this.contentWrapperEl.setAttribute("aria-label", ariaLabel);
395
- }
396
- }, {
397
- key: "initListeners",
398
- value: function initListeners() {
399
- var _this3 = this;
400
-
401
- var elWindow = (0, _helpers.getElementWindow)(this.el); // Event listeners
402
-
403
- if (this.options.autoHide) {
404
- this.el.addEventListener("mouseenter", this.onMouseEnter);
405
- }
406
-
407
- ["mousedown", "click", "dblclick"].forEach(function (e) {
408
- _this3.el.addEventListener(e, _this3.onPointerEvent, true);
409
- });
410
- ["touchstart", "touchend", "touchmove"].forEach(function (e) {
411
- _this3.el.addEventListener(e, _this3.onPointerEvent, {
412
- capture: true,
413
- passive: true
414
- });
415
- });
416
- this.el.addEventListener("mousemove", this.onMouseMove);
417
- this.el.addEventListener("mouseleave", this.onMouseLeave);
418
- this.contentWrapperEl.addEventListener("scroll", this.onScroll); // Browser zoom triggers a window resize
419
-
420
- elWindow.addEventListener("resize", this.onWindowResize); // Hack for https://github.com/WICG/ResizeObserver/issues/38
421
-
422
- var resizeObserverStarted = false;
423
- var resizeObserver = elWindow.ResizeObserver || _resizeObserverPolyfill["default"];
424
- this.resizeObserver = new resizeObserver(function () {
425
- if (!resizeObserverStarted) return;
426
-
427
- _this3.recalculate();
428
- });
429
- this.resizeObserver.observe(this.el);
430
- this.resizeObserver.observe(this.contentEl);
431
- elWindow.requestAnimationFrame(function () {
432
- resizeObserverStarted = true;
433
- }); // This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver.
434
-
435
- this.mutationObserver = new elWindow.MutationObserver(this.recalculate);
436
- this.mutationObserver.observe(this.contentEl, {
437
- childList: true,
438
- subtree: true,
439
- characterData: true
440
- });
441
- }
442
- }, {
443
- key: "recalculate",
444
- value: function recalculate() {
445
- var elWindow = (0, _helpers.getElementWindow)(this.el);
446
- this.elStyles = elWindow.getComputedStyle(this.el);
447
- this.isRtl = this.elStyles.direction === "rtl";
448
- var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1;
449
- var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1;
450
- var contentElOffsetWidth = this.contentEl.offsetWidth;
451
- var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth;
452
- var elOverflowX = this.elStyles.overflowX;
453
- var elOverflowY = this.elStyles.overflowY;
454
- this.contentEl.style.padding = "".concat(this.elStyles.paddingTop, " ").concat(this.elStyles.paddingRight, " ").concat(this.elStyles.paddingBottom, " ").concat(this.elStyles.paddingLeft);
455
- this.wrapperEl.style.margin = "-".concat(this.elStyles.paddingTop, " -").concat(this.elStyles.paddingRight, " -").concat(this.elStyles.paddingBottom, " -").concat(this.elStyles.paddingLeft);
456
- var contentElScrollHeight = this.contentEl.scrollHeight;
457
- var contentElScrollWidth = this.contentEl.scrollWidth;
458
- this.contentWrapperEl.style.height = isHeightAuto ? "auto" : "100%"; // Determine placeholder size
459
-
460
- this.placeholderEl.style.width = isWidthAuto ? "".concat(contentElOffsetWidth, "px") : "auto";
461
- this.placeholderEl.style.height = "".concat(contentElScrollHeight, "px");
462
- var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight;
463
- this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth;
464
- this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow
465
-
466
- this.axis.x.isOverflowing = elOverflowX === "hidden" ? false : this.axis.x.isOverflowing;
467
- this.axis.y.isOverflowing = elOverflowY === "hidden" ? false : this.axis.y.isOverflowing;
468
- this.axis.x.forceVisible = this.options.forceVisible === "x" || this.options.forceVisible === true;
469
- this.axis.y.forceVisible = this.options.forceVisible === "y" || this.options.forceVisible === true;
470
- this.hideNativeScrollbar(); // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset)
471
-
472
- var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0;
473
- var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
474
- this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar;
475
- this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar;
476
- this.axis.x.scrollbar.size = this.getScrollbarSize("x");
477
- this.axis.y.scrollbar.size = this.getScrollbarSize("y");
478
- this.axis.x.scrollbar.el.style.width = "".concat(this.axis.x.scrollbar.size, "px");
479
- this.axis.y.scrollbar.el.style.height = "".concat(this.axis.y.scrollbar.size, "px");
480
- this.positionScrollbar("x");
481
- this.positionScrollbar("y");
482
- this.toggleTrackVisibility("x");
483
- this.toggleTrackVisibility("y");
484
- }
485
- /**
486
- * Calculate scrollbar size
487
- */
488
-
489
- }, {
490
- key: "getScrollbarSize",
491
- value: function getScrollbarSize() {
492
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
493
-
494
- if (!this.axis[axis].isOverflowing) {
495
- return 0;
496
- }
497
-
498
- var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr];
499
- var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
500
- var scrollbarSize;
501
- var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle.
502
-
503
- scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);
504
-
505
- if (this.options.scrollbarMaxSize) {
506
- scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize);
507
- }
508
-
509
- return scrollbarSize;
510
- }
511
- }, {
512
- key: "positionScrollbar",
513
- value: function positionScrollbar() {
514
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
515
-
516
- if (!this.axis[axis].isOverflowing) {
517
- return;
518
- }
519
-
520
- var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr];
521
- var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
522
- var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
523
- var scrollbar = this.axis[axis].scrollbar;
524
- var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
525
- scrollOffset = axis === "x" && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset;
526
- var scrollPourcent = scrollOffset / (contentSize - hostSize);
527
- var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent);
528
- handleOffset = axis === "x" && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset;
529
- scrollbar.el.style.transform = axis === "x" ? "translate3d(".concat(handleOffset, "px, 0, 0)") : "translate3d(0, ".concat(handleOffset, "px, 0)");
530
- }
531
- }, {
532
- key: "toggleTrackVisibility",
533
- value: function toggleTrackVisibility() {
534
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
535
- var track = this.axis[axis].track.el;
536
- var scrollbar = this.axis[axis].scrollbar.el;
537
-
538
- if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) {
539
- track.style.visibility = "visible";
540
- this.contentWrapperEl.style[this.axis[axis].overflowAttr] = "scroll";
541
- } else {
542
- track.style.visibility = "hidden";
543
- this.contentWrapperEl.style[this.axis[axis].overflowAttr] = "hidden";
544
- } // Even if forceVisible is enabled, scrollbar itself should be hidden
545
-
546
-
547
- if (this.axis[axis].isOverflowing) {
548
- scrollbar.style.display = "block";
549
- } else {
550
- scrollbar.style.display = "none";
551
- }
552
- }
553
- }, {
554
- key: "hideNativeScrollbar",
555
- value: function hideNativeScrollbar() {
556
- this.offsetEl.style[this.isRtl ? "left" : "right"] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-".concat(this.scrollbarWidth, "px") : 0;
557
- this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-".concat(this.scrollbarWidth, "px") : 0;
558
- }
559
- /**
560
- * On scroll event handling
561
- */
562
-
563
- }, {
564
- key: "onMouseMoveForAxis",
565
- value: function onMouseMoveForAxis() {
566
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
567
- this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect();
568
- this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
569
- var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect);
570
-
571
- if (isWithinScrollbarBoundsX) {
572
- this.axis[axis].scrollbar.el.classList.add(this.classNames.hover);
573
- } else {
574
- this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
575
- }
576
-
577
- if (this.isWithinBounds(this.axis[axis].track.rect)) {
578
- this.showScrollbar(axis);
579
- this.axis[axis].track.el.classList.add(this.classNames.hover);
580
- } else {
581
- this.axis[axis].track.el.classList.remove(this.classNames.hover);
582
- }
583
- }
584
- }, {
585
- key: "onMouseLeaveForAxis",
586
- value: function onMouseLeaveForAxis() {
587
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
588
- this.axis[axis].track.el.classList.remove(this.classNames.hover);
589
- this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
590
- }
591
- }, {
592
- key: "showScrollbar",
593
- value:
594
- /**
595
- * Show scrollbar
596
- */
597
- function showScrollbar() {
598
- var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "y";
599
- var scrollbar = this.axis[axis].scrollbar.el;
600
-
601
- if (!this.axis[axis].isVisible) {
602
- scrollbar.classList.add(this.classNames.visible);
603
- this.axis[axis].isVisible = true;
604
- }
605
-
606
- if (this.options.autoHide) {
607
- this.hideScrollbars();
608
- }
609
- }
610
- /**
611
- * Hide Scrollbar
612
- */
613
-
614
- }, {
615
- key: "onDragStart",
616
- value:
617
- /**
618
- * on scrollbar handle drag movement starts
619
- */
620
- function onDragStart(e) {
621
- var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "y";
622
- var elDocument = (0, _helpers.getElementDocument)(this.el);
623
- var elWindow = (0, _helpers.getElementWindow)(this.el);
624
- var scrollbar = this.axis[axis].scrollbar; // Measure how far the user's mouse is from the top of the scrollbar drag handle.
625
-
626
- var eventOffset = axis === "y" ? e.pageY : e.pageX;
627
- this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr];
628
- this.draggedAxis = axis;
629
- this.el.classList.add(this.classNames.dragging);
630
- elDocument.addEventListener("mousemove", this.drag, true);
631
- elDocument.addEventListener("mouseup", this.onEndDrag, true);
632
-
633
- if (this.removePreventClickId === null) {
634
- elDocument.addEventListener("click", this.preventClick, true);
635
- elDocument.addEventListener("dblclick", this.preventClick, true);
636
- } else {
637
- elWindow.clearTimeout(this.removePreventClickId);
638
- this.removePreventClickId = null;
639
- }
640
- }
641
- /**
642
- * Drag scrollbar handle
643
- */
644
-
645
- }, {
646
- key: "onTrackClick",
647
- value: function onTrackClick(e) {
648
- var _this4 = this;
649
-
650
- var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "y";
651
- if (!this.options.clickOnTrack) return;
652
- var elWindow = (0, _helpers.getElementWindow)(this.el);
653
- this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
654
- var scrollbar = this.axis[axis].scrollbar;
655
- var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr];
656
- var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
657
- var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
658
- var t = axis === "y" ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset;
659
- var dir = t < 0 ? -1 : 1;
660
- var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize;
661
-
662
- var scrollTo = function scrollTo() {
663
- if (dir === -1) {
664
- if (scrolled > scrollSize) {
665
- scrolled -= _this4.options.clickOnTrackSpeed;
666
-
667
- _this4.contentWrapperEl.scrollTo(_defineProperty({}, _this4.axis[axis].offsetAttr, scrolled));
668
-
669
- elWindow.requestAnimationFrame(scrollTo);
670
- }
671
- } else if (scrolled < scrollSize) {
672
- scrolled += _this4.options.clickOnTrackSpeed;
673
-
674
- _this4.contentWrapperEl.scrollTo(_defineProperty({}, _this4.axis[axis].offsetAttr, scrolled));
675
-
676
- elWindow.requestAnimationFrame(scrollTo);
677
- }
678
- };
679
-
680
- scrollTo();
681
- }
682
- /**
683
- * Getter for content element
684
- */
685
-
686
- }, {
687
- key: "getContentElement",
688
- value: function getContentElement() {
689
- return this.contentEl;
690
- }
691
- /**
692
- * Getter for original scrolling element
693
- */
694
-
695
- }, {
696
- key: "getScrollElement",
697
- value: function getScrollElement() {
698
- return this.contentWrapperEl;
699
- }
700
- }, {
701
- key: "getScrollbarWidth",
702
- value: function getScrollbarWidth() {
703
- // Try/catch for FF 56 throwing on undefined computedStyles
704
- try {
705
- // Detect browsers supporting CSS scrollbar styling and do not calculate
706
- if (getComputedStyle(this.contentWrapperEl, "::-webkit-scrollbar").display === "none" || "scrollbarWidth" in document.documentElement.style || "-ms-overflow-style" in document.documentElement.style) {
707
- return 0;
708
- }
709
-
710
- return (0, _scrollbarWidth["default"])(this.el);
711
- } catch (e) {
712
- return (0, _scrollbarWidth["default"])(this.el);
713
- }
714
- }
715
- }, {
716
- key: "removeListeners",
717
- value: function removeListeners() {
718
- var _this5 = this;
719
-
720
- var elWindow = (0, _helpers.getElementWindow)(this.el); // Event listeners
721
-
722
- if (this.options.autoHide) {
723
- this.el.removeEventListener("mouseenter", this.onMouseEnter);
724
- }
725
-
726
- ["mousedown", "click", "dblclick"].forEach(function (e) {
727
- _this5.el.removeEventListener(e, _this5.onPointerEvent, true);
728
- });
729
- ["touchstart", "touchend", "touchmove"].forEach(function (e) {
730
- _this5.el.removeEventListener(e, _this5.onPointerEvent, {
731
- capture: true,
732
- passive: true
733
- });
734
- });
735
- this.el.removeEventListener("mousemove", this.onMouseMove);
736
- this.el.removeEventListener("mouseleave", this.onMouseLeave);
737
-
738
- if (this.contentWrapperEl) {
739
- this.contentWrapperEl.removeEventListener("scroll", this.onScroll);
740
- }
741
-
742
- elWindow.removeEventListener("resize", this.onWindowResize);
743
-
744
- if (this.mutationObserver) {
745
- this.mutationObserver.disconnect();
746
- }
747
-
748
- if (this.resizeObserver) {
749
- this.resizeObserver.disconnect();
750
- } // Cancel all debounced functions
751
-
752
-
753
- this.recalculate.cancel();
754
- this.onMouseMove.cancel();
755
- this.hideScrollbars.cancel();
756
- this.onWindowResize.cancel();
757
- }
758
- /**
759
- * UnMount mutation observer and delete SimpleBar instance from DOM element
760
- */
761
-
762
- }, {
763
- key: "unMount",
764
- value: function unMount() {
765
- this.removeListeners();
766
- SimpleBar.instances["delete"](this.el);
767
- }
768
- /**
769
- * Check if mouse is within bounds
770
- */
771
-
772
- }, {
773
- key: "isWithinBounds",
774
- value: function isWithinBounds(bbox) {
775
- return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;
776
- }
777
- /**
778
- * Find element children matches query
779
- */
780
-
781
- }, {
782
- key: "findChild",
783
- value: function findChild(el, query) {
784
- var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
785
- return Array.prototype.filter.call(el.children, function (child) {
786
- return matches.call(child, query);
787
- })[0];
788
- }
789
- }], [{
790
- key: "getRtlHelpers",
791
- value: function getRtlHelpers() {
792
- var dummyDiv = document.createElement("div");
793
- dummyDiv.innerHTML = "<div class=\"hs-dummy-scrollbar-size\"><div style=\"height: 200%; width: 200%; margin: 10px 0;\"></div></div>";
794
- var scrollbarDummyEl = dummyDiv.firstElementChild;
795
- document.body.appendChild(scrollbarDummyEl);
796
- var dummyContainerChild = scrollbarDummyEl.firstElementChild;
797
- scrollbarDummyEl.scrollLeft = 0;
798
- var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl);
799
- var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild);
800
- scrollbarDummyEl.scrollLeft = 999;
801
- var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild);
802
- return {
803
- // determines if the scrolling is responding with negative values
804
- isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0,
805
- // determines if the origin scrollbar position is inverted or not (positioned on left or right)
806
- isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left
807
- };
808
- }
809
- }, {
810
- key: "getOffset",
811
- value: function getOffset(el) {
812
- var rect = el.getBoundingClientRect();
813
- var elDocument = (0, _helpers.getElementDocument)(el);
814
- var elWindow = (0, _helpers.getElementWindow)(el);
815
- return {
816
- top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop),
817
- left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft)
818
- };
819
- }
820
- }]);
821
-
822
- return SimpleBar;
823
- }();
824
-
825
- exports["default"] = SimpleBar;
826
- SimpleBar.defaultOptions = {
827
- autoHide: true,
828
- forceVisible: false,
829
- clickOnTrack: true,
830
- clickOnTrackSpeed: 40,
831
- classNames: {
832
- contentEl: "simplebar-content",
833
- contentWrapper: "simplebar-content-wrapper",
834
- offset: "simplebar-offset",
835
- mask: "simplebar-mask",
836
- wrapper: "simplebar-wrapper",
837
- placeholder: "simplebar-placeholder",
838
- scrollbar: "simplebar-scrollbar",
839
- track: "simplebar-track",
840
- heightAutoObserverWrapperEl: "simplebar-height-auto-observer-wrapper",
841
- heightAutoObserverEl: "simplebar-height-auto-observer",
842
- visible: "simplebar-visible",
843
- horizontal: "simplebar-horizontal",
844
- vertical: "simplebar-vertical",
845
- hover: "simplebar-hover",
846
- dragging: "simplebar-dragging"
847
- },
848
- scrollbarMinSize: 25,
849
- scrollbarMaxSize: 0,
850
- timeout: 1000
851
- };
852
- SimpleBar.instances = new WeakMap();