@opensumi/ide-components 2.12.1-next-079c1930

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 (360) hide show
  1. package/README.md +65 -0
  2. package/dist/index.css +1 -0
  3. package/dist/index.js +26330 -0
  4. package/lib/badge/index.d.ts +4 -0
  5. package/lib/badge/index.d.ts.map +1 -0
  6. package/lib/badge/index.js +13 -0
  7. package/lib/badge/index.js.map +1 -0
  8. package/lib/badge/styles.less +17 -0
  9. package/lib/button/index.d.ts +54 -0
  10. package/lib/button/index.d.ts.map +1 -0
  11. package/lib/button/index.js +68 -0
  12. package/lib/button/index.js.map +1 -0
  13. package/lib/button/style.less +251 -0
  14. package/lib/checkbox/index.d.ts +9 -0
  15. package/lib/checkbox/index.d.ts.map +1 -0
  16. package/lib/checkbox/index.js +27 -0
  17. package/lib/checkbox/index.js.map +1 -0
  18. package/lib/checkbox/style.less +80 -0
  19. package/lib/common.d.ts +7 -0
  20. package/lib/common.d.ts.map +1 -0
  21. package/lib/common.js +11 -0
  22. package/lib/common.js.map +1 -0
  23. package/lib/dialog/index.d.ts +26 -0
  24. package/lib/dialog/index.d.ts.map +1 -0
  25. package/lib/dialog/index.js +28 -0
  26. package/lib/dialog/index.js.map +1 -0
  27. package/lib/dialog/styles.less +85 -0
  28. package/lib/dropdown/dropdown.d.ts +48 -0
  29. package/lib/dropdown/dropdown.d.ts.map +1 -0
  30. package/lib/dropdown/dropdown.js +80 -0
  31. package/lib/dropdown/dropdown.js.map +1 -0
  32. package/lib/dropdown/index.d.ts +5 -0
  33. package/lib/dropdown/index.d.ts.map +1 -0
  34. package/lib/dropdown/index.js +8 -0
  35. package/lib/dropdown/index.js.map +1 -0
  36. package/lib/dropdown/style.less +254 -0
  37. package/lib/icon/icon.d.ts +33 -0
  38. package/lib/icon/icon.d.ts.map +1 -0
  39. package/lib/icon/icon.js +71 -0
  40. package/lib/icon/icon.js.map +1 -0
  41. package/lib/icon/iconfont/iconManager.d.ts +187 -0
  42. package/lib/icon/iconfont/iconManager.d.ts.map +1 -0
  43. package/lib/icon/iconfont/iconManager.js +67 -0
  44. package/lib/icon/iconfont/iconManager.js.map +1 -0
  45. package/lib/icon/iconfont/iconMap.d.ts +160 -0
  46. package/lib/icon/iconfont/iconMap.d.ts.map +1 -0
  47. package/lib/icon/iconfont/iconMap.js +165 -0
  48. package/lib/icon/iconfont/iconMap.js.map +1 -0
  49. package/lib/icon/iconfont/iconfont.css +646 -0
  50. package/lib/icon/iconfont/iconfont.eot +0 -0
  51. package/lib/icon/iconfont/iconfont.html +1522 -0
  52. package/lib/icon/iconfont/iconfont.svg +333 -0
  53. package/lib/icon/iconfont/iconfont.ttf +0 -0
  54. package/lib/icon/iconfont/iconfont.woff +0 -0
  55. package/lib/icon/iconfont/iconfont.woff2 +0 -0
  56. package/lib/icon/iconfont-cn.d.ts +15 -0
  57. package/lib/icon/iconfont-cn.d.ts.map +1 -0
  58. package/lib/icon/iconfont-cn.js +78 -0
  59. package/lib/icon/iconfont-cn.js.map +1 -0
  60. package/lib/icon/index.d.ts +4 -0
  61. package/lib/icon/index.d.ts.map +1 -0
  62. package/lib/icon/index.js +9 -0
  63. package/lib/icon/index.js.map +1 -0
  64. package/lib/icon/styles.less +105 -0
  65. package/lib/icon/util.d.ts +29 -0
  66. package/lib/icon/util.d.ts.map +1 -0
  67. package/lib/icon/util.js +53 -0
  68. package/lib/icon/util.js.map +1 -0
  69. package/lib/index.d.ts +20 -0
  70. package/lib/index.d.ts.map +1 -0
  71. package/lib/index.js +23 -0
  72. package/lib/index.js.map +1 -0
  73. package/lib/input/HistoryInputBox.d.ts +38 -0
  74. package/lib/input/HistoryInputBox.d.ts.map +1 -0
  75. package/lib/input/HistoryInputBox.js +114 -0
  76. package/lib/input/HistoryInputBox.js.map +1 -0
  77. package/lib/input/Input.d.ts +43 -0
  78. package/lib/input/Input.d.ts.map +1 -0
  79. package/lib/input/Input.js +124 -0
  80. package/lib/input/Input.js.map +1 -0
  81. package/lib/input/ProxiedInput.d.ts +8 -0
  82. package/lib/input/ProxiedInput.d.ts.map +1 -0
  83. package/lib/input/ProxiedInput.js +67 -0
  84. package/lib/input/ProxiedInput.js.map +1 -0
  85. package/lib/input/TextArea.d.ts +6 -0
  86. package/lib/input/TextArea.d.ts.map +1 -0
  87. package/lib/input/TextArea.js +11 -0
  88. package/lib/input/TextArea.js.map +1 -0
  89. package/lib/input/ValidateInput.d.ts +20 -0
  90. package/lib/input/ValidateInput.d.ts.map +1 -0
  91. package/lib/input/ValidateInput.js +59 -0
  92. package/lib/input/ValidateInput.js.map +1 -0
  93. package/lib/input/index.d.ts +5 -0
  94. package/lib/input/index.d.ts.map +1 -0
  95. package/lib/input/index.js +8 -0
  96. package/lib/input/index.js.map +1 -0
  97. package/lib/input/input.less +83 -0
  98. package/lib/input/validate-input.less +88 -0
  99. package/lib/locale-context-provider.d.ts +16 -0
  100. package/lib/locale-context-provider.d.ts.map +1 -0
  101. package/lib/locale-context-provider.js +26 -0
  102. package/lib/locale-context-provider.js.map +1 -0
  103. package/lib/menu/MenuContext.d.ts +8 -0
  104. package/lib/menu/MenuContext.d.ts.map +1 -0
  105. package/lib/menu/MenuContext.js +8 -0
  106. package/lib/menu/MenuContext.js.map +1 -0
  107. package/lib/menu/MenuItem.d.ts +29 -0
  108. package/lib/menu/MenuItem.d.ts.map +1 -0
  109. package/lib/menu/MenuItem.js +32 -0
  110. package/lib/menu/MenuItem.js.map +1 -0
  111. package/lib/menu/SubMenu.d.ts +30 -0
  112. package/lib/menu/SubMenu.d.ts.map +1 -0
  113. package/lib/menu/SubMenu.js +28 -0
  114. package/lib/menu/SubMenu.js.map +1 -0
  115. package/lib/menu/index.d.ts +64 -0
  116. package/lib/menu/index.d.ts.map +1 -0
  117. package/lib/menu/index.js +203 -0
  118. package/lib/menu/index.js.map +1 -0
  119. package/lib/menu/style.less +513 -0
  120. package/lib/message/index.d.ts +10 -0
  121. package/lib/message/index.d.ts.map +1 -0
  122. package/lib/message/index.js +21 -0
  123. package/lib/message/index.js.map +1 -0
  124. package/lib/message/message.d.ts +42 -0
  125. package/lib/message/message.d.ts.map +1 -0
  126. package/lib/message/message.js +128 -0
  127. package/lib/message/message.js.map +1 -0
  128. package/lib/message/style.less +76 -0
  129. package/lib/modal/Modal.d.ts +127 -0
  130. package/lib/modal/Modal.d.ts.map +1 -0
  131. package/lib/modal/Modal.js +87 -0
  132. package/lib/modal/Modal.js.map +1 -0
  133. package/lib/modal/index.d.ts +5 -0
  134. package/lib/modal/index.d.ts.map +1 -0
  135. package/lib/modal/index.js +8 -0
  136. package/lib/modal/index.js.map +1 -0
  137. package/lib/modal/locale.d.ts +8 -0
  138. package/lib/modal/locale.d.ts.map +1 -0
  139. package/lib/modal/locale.js +23 -0
  140. package/lib/modal/locale.js.map +1 -0
  141. package/lib/modal/style.less +168 -0
  142. package/lib/notification/index.d.ts +8 -0
  143. package/lib/notification/index.d.ts.map +1 -0
  144. package/lib/notification/index.js +80 -0
  145. package/lib/notification/index.js.map +1 -0
  146. package/lib/notification/notification.d.ts +44 -0
  147. package/lib/notification/notification.d.ts.map +1 -0
  148. package/lib/notification/notification.js +156 -0
  149. package/lib/notification/notification.js.map +1 -0
  150. package/lib/notification/notification.less +231 -0
  151. package/lib/overlay/index.d.ts +19 -0
  152. package/lib/overlay/index.d.ts.map +1 -0
  153. package/lib/overlay/index.js +13 -0
  154. package/lib/overlay/index.js.map +1 -0
  155. package/lib/overlay/styles.less +44 -0
  156. package/lib/popover/index.d.ts +28 -0
  157. package/lib/popover/index.d.ts.map +1 -0
  158. package/lib/popover/index.js +127 -0
  159. package/lib/popover/index.js.map +1 -0
  160. package/lib/popover/styles.less +135 -0
  161. package/lib/recycle-list/RecycleList.d.ts +105 -0
  162. package/lib/recycle-list/RecycleList.d.ts.map +1 -0
  163. package/lib/recycle-list/RecycleList.js +253 -0
  164. package/lib/recycle-list/RecycleList.js.map +1 -0
  165. package/lib/recycle-list/index.d.ts +2 -0
  166. package/lib/recycle-list/index.d.ts.map +1 -0
  167. package/lib/recycle-list/index.js +5 -0
  168. package/lib/recycle-list/index.js.map +1 -0
  169. package/lib/recycle-tree/RecycleTree.d.ts +254 -0
  170. package/lib/recycle-tree/RecycleTree.d.ts.map +1 -0
  171. package/lib/recycle-tree/RecycleTree.js +635 -0
  172. package/lib/recycle-tree/RecycleTree.js.map +1 -0
  173. package/lib/recycle-tree/TreeNodeRendererWrap.d.ts +37 -0
  174. package/lib/recycle-tree/TreeNodeRendererWrap.d.ts.map +1 -0
  175. package/lib/recycle-tree/TreeNodeRendererWrap.js +18 -0
  176. package/lib/recycle-tree/TreeNodeRendererWrap.js.map +1 -0
  177. package/lib/recycle-tree/decorators/Adaptive/index.d.ts +10 -0
  178. package/lib/recycle-tree/decorators/Adaptive/index.d.ts.map +1 -0
  179. package/lib/recycle-tree/decorators/Adaptive/index.js +97 -0
  180. package/lib/recycle-tree/decorators/Adaptive/index.js.map +1 -0
  181. package/lib/recycle-tree/decorators/Filter/filter.less +11 -0
  182. package/lib/recycle-tree/decorators/Filter/index.d.ts +26 -0
  183. package/lib/recycle-tree/decorators/Filter/index.d.ts.map +1 -0
  184. package/lib/recycle-tree/decorators/Filter/index.js +53 -0
  185. package/lib/recycle-tree/decorators/Filter/index.js.map +1 -0
  186. package/lib/recycle-tree/decorators/index.d.ts +3 -0
  187. package/lib/recycle-tree/decorators/index.d.ts.map +1 -0
  188. package/lib/recycle-tree/decorators/index.js +6 -0
  189. package/lib/recycle-tree/decorators/index.js.map +1 -0
  190. package/lib/recycle-tree/index.d.ts +7 -0
  191. package/lib/recycle-tree/index.d.ts.map +1 -0
  192. package/lib/recycle-tree/index.js +10 -0
  193. package/lib/recycle-tree/index.js.map +1 -0
  194. package/lib/recycle-tree/prompt/NewPromptHandle.d.ts +12 -0
  195. package/lib/recycle-tree/prompt/NewPromptHandle.d.ts.map +1 -0
  196. package/lib/recycle-tree/prompt/NewPromptHandle.js +21 -0
  197. package/lib/recycle-tree/prompt/NewPromptHandle.js.map +1 -0
  198. package/lib/recycle-tree/prompt/PromptHandle.d.ts +59 -0
  199. package/lib/recycle-tree/prompt/PromptHandle.d.ts.map +1 -0
  200. package/lib/recycle-tree/prompt/PromptHandle.js +200 -0
  201. package/lib/recycle-tree/prompt/PromptHandle.js.map +1 -0
  202. package/lib/recycle-tree/prompt/RenamePromptHandle.d.ts +10 -0
  203. package/lib/recycle-tree/prompt/RenamePromptHandle.d.ts.map +1 -0
  204. package/lib/recycle-tree/prompt/RenamePromptHandle.js +21 -0
  205. package/lib/recycle-tree/prompt/RenamePromptHandle.js.map +1 -0
  206. package/lib/recycle-tree/prompt/index.d.ts +4 -0
  207. package/lib/recycle-tree/prompt/index.d.ts.map +1 -0
  208. package/lib/recycle-tree/prompt/index.js +7 -0
  209. package/lib/recycle-tree/prompt/index.js.map +1 -0
  210. package/lib/recycle-tree/tree/Tree.d.ts +20 -0
  211. package/lib/recycle-tree/tree/Tree.d.ts.map +1 -0
  212. package/lib/recycle-tree/tree/Tree.js +43 -0
  213. package/lib/recycle-tree/tree/Tree.js.map +1 -0
  214. package/lib/recycle-tree/tree/TreeNode.d.ts +222 -0
  215. package/lib/recycle-tree/tree/TreeNode.d.ts.map +1 -0
  216. package/lib/recycle-tree/tree/TreeNode.js +1099 -0
  217. package/lib/recycle-tree/tree/TreeNode.js.map +1 -0
  218. package/lib/recycle-tree/tree/decoration/CompositeDecoration.d.ts +60 -0
  219. package/lib/recycle-tree/tree/decoration/CompositeDecoration.d.ts.map +1 -0
  220. package/lib/recycle-tree/tree/decoration/CompositeDecoration.js +328 -0
  221. package/lib/recycle-tree/tree/decoration/CompositeDecoration.js.map +1 -0
  222. package/lib/recycle-tree/tree/decoration/Decoration.d.ts +79 -0
  223. package/lib/recycle-tree/tree/decoration/Decoration.d.ts.map +1 -0
  224. package/lib/recycle-tree/tree/decoration/Decoration.js +183 -0
  225. package/lib/recycle-tree/tree/decoration/Decoration.js.map +1 -0
  226. package/lib/recycle-tree/tree/decoration/DecorationManager.d.ts +34 -0
  227. package/lib/recycle-tree/tree/decoration/DecorationManager.d.ts.map +1 -0
  228. package/lib/recycle-tree/tree/decoration/DecorationManager.js +166 -0
  229. package/lib/recycle-tree/tree/decoration/DecorationManager.js.map +1 -0
  230. package/lib/recycle-tree/tree/decoration/index.d.ts +4 -0
  231. package/lib/recycle-tree/tree/decoration/index.d.ts.map +1 -0
  232. package/lib/recycle-tree/tree/decoration/index.js +7 -0
  233. package/lib/recycle-tree/tree/decoration/index.js.map +1 -0
  234. package/lib/recycle-tree/tree/index.d.ts +5 -0
  235. package/lib/recycle-tree/tree/index.d.ts.map +1 -0
  236. package/lib/recycle-tree/tree/index.js +8 -0
  237. package/lib/recycle-tree/tree/index.js.map +1 -0
  238. package/lib/recycle-tree/tree/model/TreeModel.d.ts +50 -0
  239. package/lib/recycle-tree/tree/model/TreeModel.d.ts.map +1 -0
  240. package/lib/recycle-tree/tree/model/TreeModel.js +81 -0
  241. package/lib/recycle-tree/tree/model/TreeModel.js.map +1 -0
  242. package/lib/recycle-tree/tree/model/index.d.ts +2 -0
  243. package/lib/recycle-tree/tree/model/index.d.ts.map +1 -0
  244. package/lib/recycle-tree/tree/model/index.js +5 -0
  245. package/lib/recycle-tree/tree/model/index.js.map +1 -0
  246. package/lib/recycle-tree/tree/model/treeState/TreeStateManager.d.ts +65 -0
  247. package/lib/recycle-tree/tree/model/treeState/TreeStateManager.d.ts.map +1 -0
  248. package/lib/recycle-tree/tree/model/treeState/TreeStateManager.js +191 -0
  249. package/lib/recycle-tree/tree/model/treeState/TreeStateManager.js.map +1 -0
  250. package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.d.ts +15 -0
  251. package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.d.ts.map +1 -0
  252. package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.js +104 -0
  253. package/lib/recycle-tree/tree/model/treeState/TreeStateWatcher.js.map +1 -0
  254. package/lib/recycle-tree/tree/model/treeState/index.d.ts +4 -0
  255. package/lib/recycle-tree/tree/model/treeState/index.d.ts.map +1 -0
  256. package/lib/recycle-tree/tree/model/treeState/index.js +8 -0
  257. package/lib/recycle-tree/tree/model/treeState/index.js.map +1 -0
  258. package/lib/recycle-tree/tree/model/treeState/types.d.ts +21 -0
  259. package/lib/recycle-tree/tree/model/treeState/types.d.ts.map +1 -0
  260. package/lib/recycle-tree/tree/model/treeState/types.js +18 -0
  261. package/lib/recycle-tree/tree/model/treeState/types.js.map +1 -0
  262. package/lib/recycle-tree/types/index.d.ts +4 -0
  263. package/lib/recycle-tree/types/index.d.ts.map +1 -0
  264. package/lib/recycle-tree/types/index.js +7 -0
  265. package/lib/recycle-tree/types/index.js.map +1 -0
  266. package/lib/recycle-tree/types/tree-node.d.ts +70 -0
  267. package/lib/recycle-tree/types/tree-node.d.ts.map +1 -0
  268. package/lib/recycle-tree/types/tree-node.js +11 -0
  269. package/lib/recycle-tree/types/tree-node.js.map +1 -0
  270. package/lib/recycle-tree/types/tree.d.ts +8 -0
  271. package/lib/recycle-tree/types/tree.d.ts.map +1 -0
  272. package/lib/recycle-tree/types/tree.js +3 -0
  273. package/lib/recycle-tree/types/tree.js.map +1 -0
  274. package/lib/recycle-tree/types/watcher.d.ts +114 -0
  275. package/lib/recycle-tree/types/watcher.d.ts.map +1 -0
  276. package/lib/recycle-tree/types/watcher.js +46 -0
  277. package/lib/recycle-tree/types/watcher.js.map +1 -0
  278. package/lib/scrollbars/index.d.ts +14 -0
  279. package/lib/scrollbars/index.d.ts.map +1 -0
  280. package/lib/scrollbars/index.js +52 -0
  281. package/lib/scrollbars/index.js.map +1 -0
  282. package/lib/scrollbars/styles.less +46 -0
  283. package/lib/select/index.d.ts +119 -0
  284. package/lib/select/index.d.ts.map +1 -0
  285. package/lib/select/index.js +327 -0
  286. package/lib/select/index.js.map +1 -0
  287. package/lib/select/style.less +224 -0
  288. package/lib/style/base.less +542 -0
  289. package/lib/style/index.less +14 -0
  290. package/lib/style/mixins.less +135 -0
  291. package/lib/style/motion/fade.less +31 -0
  292. package/lib/style/motion/move.less +120 -0
  293. package/lib/style/motion/other.less +45 -0
  294. package/lib/style/motion/slide.less +120 -0
  295. package/lib/style/motion/swing.less +34 -0
  296. package/lib/style/motion/zoom.less +162 -0
  297. package/lib/style/variable.less +204 -0
  298. package/lib/tabs/index.d.ts +12 -0
  299. package/lib/tabs/index.d.ts.map +1 -0
  300. package/lib/tabs/index.js +24 -0
  301. package/lib/tabs/index.js.map +1 -0
  302. package/lib/tabs/style.less +34 -0
  303. package/lib/tooltip/index.d.ts +7 -0
  304. package/lib/tooltip/index.d.ts.map +1 -0
  305. package/lib/tooltip/index.js +58 -0
  306. package/lib/tooltip/index.js.map +1 -0
  307. package/lib/tooltip/style.less +41 -0
  308. package/lib/utils/deprecated.d.ts +3 -0
  309. package/lib/utils/deprecated.d.ts.map +1 -0
  310. package/lib/utils/deprecated.js +18 -0
  311. package/lib/utils/deprecated.js.map +1 -0
  312. package/lib/utils/disposable.d.ts +37 -0
  313. package/lib/utils/disposable.d.ts.map +1 -0
  314. package/lib/utils/disposable.js +140 -0
  315. package/lib/utils/disposable.js.map +1 -0
  316. package/lib/utils/event.d.ts +189 -0
  317. package/lib/utils/event.d.ts.map +1 -0
  318. package/lib/utils/event.js +569 -0
  319. package/lib/utils/event.js.map +1 -0
  320. package/lib/utils/index.d.ts +10 -0
  321. package/lib/utils/index.d.ts.map +1 -0
  322. package/lib/utils/index.js +13 -0
  323. package/lib/utils/index.js.map +1 -0
  324. package/lib/utils/iterator.d.ts +14 -0
  325. package/lib/utils/iterator.d.ts.map +1 -0
  326. package/lib/utils/iterator.js +9 -0
  327. package/lib/utils/iterator.js.map +1 -0
  328. package/lib/utils/linkedList.d.ts +18 -0
  329. package/lib/utils/linkedList.d.ts.map +1 -0
  330. package/lib/utils/linkedList.js +139 -0
  331. package/lib/utils/linkedList.js.map +1 -0
  332. package/lib/utils/motion.d.ts +24 -0
  333. package/lib/utils/motion.d.ts.map +1 -0
  334. package/lib/utils/motion.js +17 -0
  335. package/lib/utils/motion.js.map +1 -0
  336. package/lib/utils/os.d.ts +4 -0
  337. package/lib/utils/os.d.ts.map +1 -0
  338. package/lib/utils/os.js +22 -0
  339. package/lib/utils/os.js.map +1 -0
  340. package/lib/utils/path.d.ts +92 -0
  341. package/lib/utils/path.d.ts.map +1 -0
  342. package/lib/utils/path.js +1712 -0
  343. package/lib/utils/path.js.map +1 -0
  344. package/lib/utils/process.d.ts +6 -0
  345. package/lib/utils/process.d.ts.map +1 -0
  346. package/lib/utils/process.js +17 -0
  347. package/lib/utils/process.js.map +1 -0
  348. package/lib/utils/raf.d.ts +10 -0
  349. package/lib/utils/raf.d.ts.map +1 -0
  350. package/lib/utils/raf.js +33 -0
  351. package/lib/utils/raf.js.map +1 -0
  352. package/lib/utils/type.d.ts +4 -0
  353. package/lib/utils/type.d.ts.map +1 -0
  354. package/lib/utils/type.js +9 -0
  355. package/lib/utils/type.js.map +1 -0
  356. package/lib/utils/warning.d.ts +8 -0
  357. package/lib/utils/warning.d.ts.map +1 -0
  358. package/lib/utils/warning.js +40 -0
  359. package/lib/utils/warning.js.map +1 -0
  360. package/package.json +36 -0
@@ -0,0 +1,114 @@
1
+ import { ITreeNode, ICompositeTreeNode, ITreeNodeOrCompositeTreeNode } from './tree-node';
2
+ import { IDisposable } from '../../utils';
3
+ export declare enum TreeNodeEvent {
4
+ WillChangeExpansionState = 1,
5
+ DidChangeExpansionState = 2,
6
+ WillChangeParent = 3,
7
+ DidChangeParent = 4,
8
+ WillDispose = 5,
9
+ DidDispose = 6,
10
+ BranchDidUpdate = 7,
11
+ DidChangePath = 8,
12
+ DidProcessWatchEvent = 9,
13
+ WillProcessWatchEvent = 10,
14
+ DidChangeMetadata = 11,
15
+ DidResolveChildren = 12,
16
+ WillResolveChildren = 13
17
+ }
18
+ export declare enum WatchEvent {
19
+ /**
20
+ * 节点添加事件
21
+ */
22
+ Added = 1,
23
+ /**
24
+ * 节点移除事件
25
+ */
26
+ Removed = 2,
27
+ /**
28
+ * 避免过多的调用该事件
29
+ * 该事件会执行较大成本的节点刷新
30
+ */
31
+ Changed = 3,
32
+ /**
33
+ * 节点移动事件
34
+ */
35
+ Moved = 4
36
+ }
37
+ export interface IWatcherChangeEvent {
38
+ type: WatchEvent.Changed;
39
+ /**
40
+ * 改变的节点路径
41
+ */
42
+ path: string;
43
+ }
44
+ export interface IWatcherAddEvent {
45
+ type: WatchEvent.Added;
46
+ /**
47
+ * 改变的节点ID,这里一般为父节点ID
48
+ */
49
+ id: number;
50
+ /**
51
+ * 添加的节点
52
+ */
53
+ node: ITreeNode;
54
+ }
55
+ export interface IWatcherRemoveEvent {
56
+ type: WatchEvent.Removed;
57
+ /**
58
+ * 移除的节点路径
59
+ */
60
+ path: string;
61
+ }
62
+ export interface IWatcherMoveEvent {
63
+ type: WatchEvent.Moved;
64
+ /**
65
+ * 旧父节点路径
66
+ */
67
+ oldPath: string;
68
+ /**
69
+ * 新父节点路径
70
+ */
71
+ newPath: string;
72
+ }
73
+ export declare enum MetadataChangeType {
74
+ Added = 1,
75
+ Updated = 2,
76
+ Removed = 3
77
+ }
78
+ export interface IMetadataChange {
79
+ type: MetadataChangeType;
80
+ key: string;
81
+ prevValue: any;
82
+ value: any;
83
+ }
84
+ export interface IWatcherInfo {
85
+ terminator: IWatchTerminator;
86
+ callback: IWatcherCallback;
87
+ }
88
+ export declare type IWatchTerminator = (path?: string) => void;
89
+ export declare type IWatcherCallback = (event: IWatcherEvent) => void;
90
+ export declare type IWatcherEvent = IWatcherChangeEvent | IWatcherAddEvent | IWatcherRemoveEvent | IWatcherMoveEvent;
91
+ /**
92
+ * 每个根节点都包含一个在根节点创建同时传入的`TreeSupervisor`
93
+ *
94
+ * 其存在是为了便于事件委派发生在树中某处以及其他共享内容(在树中共享,但对于每个“根”都是唯一的)事件
95
+ */
96
+ export interface ITreeWatcher {
97
+ onWatchEvent(path: string, callback: IWatcherCallback): IWatchTerminator;
98
+ on(event: TreeNodeEvent, callback: any): any;
99
+ notifyWillChangeParent(target: ITreeNodeOrCompositeTreeNode, prevParent: ICompositeTreeNode, newParent: ICompositeTreeNode): any;
100
+ notifyDidChangeParent(target: ITreeNodeOrCompositeTreeNode, prevParent: ICompositeTreeNode, newParent: ICompositeTreeNode): any;
101
+ notifyWillDispose(target: ITreeNodeOrCompositeTreeNode): any;
102
+ notifyDidDispose(target: ITreeNodeOrCompositeTreeNode): any;
103
+ notifyWillProcessWatchEvent(target: ICompositeTreeNode, event: IWatcherEvent): any;
104
+ notifyDidProcessWatchEvent(target: ICompositeTreeNode, event: IWatcherEvent): any;
105
+ notifyWillChangeExpansionState(target: ICompositeTreeNode, nowExpanded: boolean): any;
106
+ notifyDidChangeExpansionState(target: ICompositeTreeNode, nowExpanded: boolean): any;
107
+ notifyWillResolveChildren(target: ICompositeTreeNode, nowExpanded: boolean): any;
108
+ notifyDidResolveChildren(target: ICompositeTreeNode, nowExpanded: boolean): any;
109
+ notifyDidChangePath(target: ITreeNodeOrCompositeTreeNode): any;
110
+ notifyDidChangeMetadata(target: ITreeNodeOrCompositeTreeNode, change: IMetadataChange): any;
111
+ notifyDidUpdateBranch(): any;
112
+ dispose: IDisposable;
113
+ }
114
+ //# sourceMappingURL=watcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../../src/recycle-tree/types/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,oBAAY,aAAa;IACvB,wBAAwB,IAAI;IAC5B,uBAAuB,IAAA;IACvB,gBAAgB,IAAA;IAChB,eAAe,IAAA;IACf,WAAW,IAAA;IACX,UAAU,IAAA;IACV,eAAe,IAAA;IACf,aAAa,IAAA;IACb,oBAAoB,IAAA;IACpB,qBAAqB,KAAA;IACrB,iBAAiB,K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
+ exports.MetadataChangeType = exports.WatchEvent = exports.TreeNodeEvent = void 0;
4
+ var TreeNodeEvent;
5
+ (function (TreeNodeEvent) {
6
+ TreeNodeEvent[TreeNodeEvent["WillChangeExpansionState"] = 1] = "WillChangeExpansionState";
7
+ TreeNodeEvent[TreeNodeEvent["DidChangeExpansionState"] = 2] = "DidChangeExpansionState";
8
+ TreeNodeEvent[TreeNodeEvent["WillChangeParent"] = 3] = "WillChangeParent";
9
+ TreeNodeEvent[TreeNodeEvent["DidChangeParent"] = 4] = "DidChangeParent";
10
+ TreeNodeEvent[TreeNodeEvent["WillDispose"] = 5] = "WillDispose";
11
+ TreeNodeEvent[TreeNodeEvent["DidDispose"] = 6] = "DidDispose";
12
+ TreeNodeEvent[TreeNodeEvent["BranchDidUpdate"] = 7] = "BranchDidUpdate";
13
+ TreeNodeEvent[TreeNodeEvent["DidChangePath"] = 8] = "DidChangePath";
14
+ TreeNodeEvent[TreeNodeEvent["DidProcessWatchEvent"] = 9] = "DidProcessWatchEvent";
15
+ TreeNodeEvent[TreeNodeEvent["WillProcessWatchEvent"] = 10] = "WillProcessWatchEvent";
16
+ TreeNodeEvent[TreeNodeEvent["DidChangeMetadata"] = 11] = "DidChangeMetadata";
17
+ TreeNodeEvent[TreeNodeEvent["DidResolveChildren"] = 12] = "DidResolveChildren";
18
+ TreeNodeEvent[TreeNodeEvent["WillResolveChildren"] = 13] = "WillResolveChildren";
19
+ })(TreeNodeEvent = exports.TreeNodeEvent || (exports.TreeNodeEvent = {}));
20
+ var WatchEvent;
21
+ (function (WatchEvent) {
22
+ /**
23
+ * 节点添加事件
24
+ */
25
+ WatchEvent[WatchEvent["Added"] = 1] = "Added";
26
+ /**
27
+ * 节点移除事件
28
+ */
29
+ WatchEvent[WatchEvent["Removed"] = 2] = "Removed";
30
+ /**
31
+ * 避免过多的调用该事件
32
+ * 该事件会执行较大成本的节点刷新
33
+ */
34
+ WatchEvent[WatchEvent["Changed"] = 3] = "Changed";
35
+ /**
36
+ * 节点移动事件
37
+ */
38
+ WatchEvent[WatchEvent["Moved"] = 4] = "Moved";
39
+ })(WatchEvent = exports.WatchEvent || (exports.WatchEvent = {}));
40
+ var MetadataChangeType;
41
+ (function (MetadataChangeType) {
42
+ MetadataChangeType[MetadataChangeType["Added"] = 1] = "Added";
43
+ MetadataChangeType[MetadataChangeType["Updated"] = 2] = "Updated";
44
+ MetadataChangeType[MetadataChangeType["Removed"] = 3] = "Removed";
45
+ })(MetadataChangeType = exports.MetadataChangeType || (exports.MetadataChangeType = {}));
46
+ //# sourceMappingURL=watcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../../src/recycle-tree/types/watcher.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAcX;AAdD,WAAY,aAAa;IACvB,yFAA4B,CAAA;IAC5B,uFAAuB,CAAA;IACvB,yEAAgB,CAAA;IAChB,uEAAe,CAAA;IACf,+DAAW,CAAA;IACX,6DAAU,CAAA;IACV,uEAAe,CAAA;IACf,mEAAa,CAAA;IACb,iFAAoB,CAAA;IACpB,oFAAqB,CAAA;IACrB,4EAAiB,CAAA;IACjB,8EAAkB,CAAA;IAClB,gFAAmB,CAAA;AACrB,CAAC,EAdW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAcxB;AAED,IAAY,UAkBX;AAlBD,WAAY,UAAU;IACpB;;OAEG;IACH,6CAAS,CAAA;IACT;;OAEG;IACH,iDAAO,CAAA;IACP;;;OAGG;IACH,iDAAO,CAAA;IACP;;OAEG;IACH,6CAAK,CAAA;AACP,CAAC,EAlBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAkBrB;AA0CD,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,6DAAS,CAAA;IACT,iEAAO,CAAA;IACP,iEAAO,CAAA;AACT,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export interface ICustomScrollbarProps {
4
+ forwardedRef?: any;
5
+ onScroll?: any;
6
+ onUpdate?: any;
7
+ style?: React.CSSProperties;
8
+ className?: string;
9
+ children?: React.ReactNode;
10
+ onReachBottom?: any;
11
+ }
12
+ export declare const Scrollbars: ({ onScroll, onUpdate, forwardedRef, style, children, className, onReachBottom }: ICustomScrollbarProps) => JSX.Element;
13
+ export declare const ScrollbarsVirtualList: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scrollbars/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,eAAe,CAAC;AAGvB,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,oFAAqF,qBAAqB,gBAwDhI,CAAC;AAEF,eAAO,MAAM,qBAAqB,+DAEhC,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScrollbarsVirtualList = exports.Scrollbars = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
6
+ const react_custom_scrollbars_1 = require("react-custom-scrollbars");
7
+ const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
8
+ require("./styles.less");
9
+ const throttle_1 = (0, tslib_1.__importDefault)(require("lodash/throttle"));
10
+ const Scrollbars = ({ onScroll, onUpdate, forwardedRef, style, children, className, onReachBottom }) => {
11
+ const refSetter = react_1.default.useCallback((scrollbarsRef) => {
12
+ if (scrollbarsRef) {
13
+ forwardedRef && forwardedRef(scrollbarsRef.view);
14
+ }
15
+ else {
16
+ forwardedRef && forwardedRef(null);
17
+ }
18
+ }, []);
19
+ let shadowTopRef;
20
+ const handleReachBottom = react_1.default.useCallback((0, throttle_1.default)((values) => {
21
+ const { scrollTop, scrollHeight, clientHeight } = values;
22
+ if (scrollHeight === 0 && clientHeight === 0) {
23
+ return;
24
+ }
25
+ const pad = 100;
26
+ const t = ((scrollTop + pad) / (scrollHeight - clientHeight));
27
+ if (t > 1) {
28
+ onReachBottom && onReachBottom();
29
+ }
30
+ }, 100), [onReachBottom]);
31
+ const handleUpdate = (values) => {
32
+ const { scrollTop } = values;
33
+ const shadowTopOpacity = 1 / 20 * Math.min(scrollTop, 20);
34
+ if (shadowTopRef) {
35
+ shadowTopRef.style.opacity = String(shadowTopOpacity);
36
+ }
37
+ handleReachBottom(values);
38
+ onUpdate && onUpdate(values);
39
+ };
40
+ return (react_1.default.createElement(react_custom_scrollbars_1.Scrollbars, { ref: refSetter, style: Object.assign(Object.assign({}, style), { overflow: 'hidden' }), className: (0, classnames_1.default)(className, 'kt-scrollbar'), onUpdate: handleUpdate, onScroll: onScroll, renderThumbVertical: (_a) => {
41
+ var { style } = _a, props = (0, tslib_1.__rest)(_a, ["style"]);
42
+ return react_1.default.createElement("div", Object.assign({}, props, { className: 'scrollbar-thumb-vertical' }));
43
+ }, renderThumbHorizontal: (_a) => {
44
+ var { style } = _a, props = (0, tslib_1.__rest)(_a, ["style"]);
45
+ return react_1.default.createElement("div", Object.assign({}, props, { className: 'scrollbar-thumb-horizontal' }));
46
+ } },
47
+ react_1.default.createElement("div", { ref: (ref) => { shadowTopRef = ref; }, className: 'scrollbar-decoration' }),
48
+ children));
49
+ };
50
+ exports.Scrollbars = Scrollbars;
51
+ exports.ScrollbarsVirtualList = react_1.default.forwardRef((props, ref) => (react_1.default.createElement(exports.Scrollbars, Object.assign({}, props, { forwardedRef: ref }))));
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scrollbars/index.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,qEAAyE;AACzE,yEAA6B;AAC7B,yBAAuB;AACvB,4EAAuC;AAYhC,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAyB,EAAE,EAAE;IACnI,MAAM,SAAS,GAAG,eAAK,CAAC,WAAW,CAAC,CAAC,aAAa,EAAE,EAAE;QACpD,IAAI,aAAa,EAAE;YACjB,YAAY,IAAI,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;SAClD;aAAM;YACL,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;SACpC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,YAAmC,CAAC;IAExC,MAAM,iBAAiB,GAAG,eAAK,CAAC,WAAW,CAAC,IAAA,kBAAQ,EAAC,CAAC,MAAM,EAAE,EAAE;QAC9D,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;QAEzD,IAAI,YAAY,KAAK,CAAC,IAAI,YAAY,KAAK,CAAC,EAAE;YAC5C,OAAO;SACR;QAED,MAAM,GAAG,GAAG,GAAG,CAAC;QAChB,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,GAAG,CAAC,EAAE;YACT,aAAa,IAAI,aAAa,EAAE,CAAC;SAClC;IACH,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAE1B,MAAM,YAAY,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K,EAAE,GAAG,EAAE,EAAE,CAAC,CACpE,8BAAC,kBAAU,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAC7C,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ /* scrollbar 默认高度 */
2
+ @kt-scrollbar-height: 10px;
3
+
4
+ /* scrollbar 默认宽度 */
5
+ @kt-scrollbar-width: 10px;
6
+
7
+ .kt-scrollbar {
8
+
9
+ .scrollbar-thumb-vertical,
10
+ .scrollbar-thumb-horizontal {
11
+ opacity: 0;
12
+ transition: opacity .5s ease;
13
+ background: var(--scrollbarSlider-background);
14
+ width: @kt-scrollbar-width;
15
+ height: @kt-scrollbar-height;
16
+ &:hover {
17
+ background: var(--scrollbarSlider-hoverBackground);
18
+ }
19
+
20
+ &:active {
21
+ background: var(--scrollbarSlider-activeBackground);
22
+ }
23
+ }
24
+
25
+ // 设置滚动条样式
26
+ &:hover {
27
+
28
+ .scrollbar-thumb-vertical,
29
+ .scrollbar-thumb-horizontal {
30
+ opacity: 1;
31
+ }
32
+ }
33
+
34
+ .scrollbar-decoration {
35
+ position: fixed;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 6px;
40
+ z-index: 999;
41
+ box-shadow: var(--scrollbar-shadow)0 6px 6px -6px inset;
42
+ }
43
+ }
44
+
45
+
46
+
@@ -0,0 +1,119 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ export interface IDataOption<T> {
4
+ iconClass?: string;
5
+ label?: string;
6
+ value: T;
7
+ }
8
+ export interface IDataOptionGroup<T> {
9
+ iconClass?: string;
10
+ groupName: string;
11
+ options: IDataOption<T>[];
12
+ }
13
+ export interface ISelectProps<T = string> {
14
+ className?: string;
15
+ size?: 'large' | 'default' | 'small';
16
+ loading?: boolean;
17
+ options?: Array<React.ReactNode> | Array<IDataOption<T>> | IDataOptionGroup<T>[];
18
+ value?: T;
19
+ disabled?: boolean;
20
+ onChange?: (value: T) => void;
21
+ maxHeight?: string;
22
+ [prop: string]: any;
23
+ optionStyle?: any;
24
+ equals?: (v1: T | undefined, v2: T | undefined) => boolean;
25
+ optionRenderer?: React.FC<{
26
+ data: IDataOption<T>;
27
+ isCurrent: boolean;
28
+ }>;
29
+ groupTitleRenderer?: React.FC<{
30
+ group: IDataOptionGroup<T>;
31
+ index: number;
32
+ }>;
33
+ headerComponent?: React.FC<any> | React.ComponentClass;
34
+ footerComponent?: React.FC<any> | React.ComponentClass;
35
+ /**
36
+ * 点击时是否启用搜索
37
+ */
38
+ showSearch?: boolean;
39
+ /**
40
+ * 搜索 placeholder
41
+ */
42
+ searchPlaceholder?: string;
43
+ /**
44
+ * 搜索时,根据输入筛选, 如果showSearch为true,则默认使用 label 判断
45
+ */
46
+ filterOption?: (input: string, options: IDataOption<T>, group?: IDataOptionGroup<T>) => boolean;
47
+ /**
48
+ * 列表为空时的展示组件
49
+ */
50
+ emptyComponent?: React.FC<any>;
51
+ /**
52
+ * 渲染选中项
53
+ */
54
+ selectedRenderer?: React.FC<{
55
+ data: IDataOption<T>;
56
+ }> | React.ComponentClass<{
57
+ data: IDataOption<T>;
58
+ }>;
59
+ /**
60
+ * 在显示可选项之前的操作
61
+ * 返回 true 表示阻止此次显示
62
+ */
63
+ onBeforeShowOptions?: () => boolean;
64
+ /**
65
+ * 允许 select 的选项框宽度比 select宽度大, 默认 false
66
+ */
67
+ allowOptionsOverflow?: boolean;
68
+ /**
69
+ * 定义选择组件下拉选择菜单的渲染方式
70
+ * fixed —— 相对视窗位置
71
+ * absolute —— 相对于组件位置
72
+ * 默认值为 fixed
73
+ */
74
+ dropdownRenderType?: 'fixed' | 'absolute';
75
+ }
76
+ export declare const Option: React.FC<React.PropsWithChildren<{
77
+ value: string | number | string[];
78
+ children?: any;
79
+ className?: string;
80
+ onClick?: (value: string | number | string[]) => void;
81
+ optionLabelProp?: string;
82
+ disabled?: boolean;
83
+ label?: string | undefined;
84
+ style?: any;
85
+ }>>;
86
+ export declare function isDataOptions<T = any>(options: Array<React.ReactNode | {
87
+ label: string;
88
+ value: T;
89
+ }> | undefined): options is Array<{
90
+ label: string;
91
+ value: T;
92
+ iconClass?: string;
93
+ }>;
94
+ export declare function isDataOptionGroups<T = any>(options: Array<React.ReactNode> | Array<IDataOption<T>> | IDataOptionGroup<T>[] | undefined): options is IDataOptionGroup<T>[];
95
+ export declare function Select<T = string>({ disabled, options, size, children, value, onChange, optionLabelProp, style, optionStyle, className, maxHeight, equals, optionRenderer, groupTitleRenderer, footerComponent, headerComponent, setSelectHandle, showSearch, filterOption, searchPlaceholder, emptyComponent, selectedRenderer, onBeforeShowOptions, allowOptionsOverflow, dropdownRenderType, }: ISelectProps<T>): JSX.Element;
96
+ export interface ISelectOptionsListProps<T = string> {
97
+ className?: string;
98
+ size?: 'large' | 'default' | 'small';
99
+ currentValue?: T;
100
+ options: IDataOption<T>[] | IDataOptionGroup<T>[];
101
+ onSelect: (value: T) => void;
102
+ optionStyle?: any;
103
+ equals?: (v1: T | undefined, v2: T | undefined) => boolean;
104
+ optionRenderer?: React.FC<{
105
+ data: IDataOption<T>;
106
+ isCurrent: boolean;
107
+ }>;
108
+ groupTitleRenderer?: React.FC<{
109
+ group: IDataOptionGroup<T>;
110
+ index: number;
111
+ }>;
112
+ style?: any;
113
+ renderCheck?: boolean;
114
+ headerComponent?: React.FC<any> | React.ComponentClass;
115
+ footerComponent?: React.FC<any> | React.ComponentClass;
116
+ emptyComponent?: React.FC<any> | React.ComponentClass;
117
+ }
118
+ export declare const SelectOptionsList: React.ForwardRefExoticComponent<ISelectOptionsListProps<unknown> & React.RefAttributes<unknown>>;
119
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC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