@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,85 @@
1
+ .wrapper {
2
+ .kt-modal-body {
3
+ background: var(--kt-modal-background);
4
+ border-color: var(--notifications-border);
5
+ }
6
+
7
+ .kt-modal-footer {
8
+ align-items: center;
9
+ justify-content: flex-end;
10
+ display: flex;
11
+ }
12
+
13
+ .kticon-info-circle {
14
+ color: var(--kt-modalInfoIcon-foreground);
15
+ }
16
+
17
+ .kt-modal-close-x {
18
+ margin: 50% 50% 0 0;
19
+ width: 20px;
20
+ height: 20px;
21
+ line-height: 20px;
22
+ color: var(--kt-notificationsCloseIcon-foreground);
23
+ }
24
+ }
25
+
26
+ .kt-dialog-content {
27
+ display: flex;
28
+
29
+ .kt-dialog-content_area {
30
+ display: flex;
31
+ flex-direction: column;
32
+ flex: 1;
33
+ overflow: hidden;
34
+
35
+ .kt-dialog-content_title {
36
+ line-height: 22px;
37
+ font-size: 14px;
38
+ margin: 0px 0px 8px 0px;
39
+ }
40
+ }
41
+ }
42
+
43
+ .footer {
44
+ border-top: 1px solid var(--notifications-border);
45
+ }
46
+
47
+ .kt-dialog-icon {
48
+ margin-right: 12px;
49
+
50
+ &:before {
51
+ font-size: 20px;
52
+ }
53
+ }
54
+
55
+ .kt-dialog-closex {
56
+ background-color: transparent;
57
+ border: none;
58
+ outline: none;
59
+ display: flex;
60
+ flex-direction: column;
61
+ padding: 0px;
62
+ cursor: pointer;
63
+ }
64
+
65
+ .kt-dialog-buttonWrap {
66
+ display: flex;
67
+ flex-wrap: wrap;
68
+ margin-top: 14px;
69
+ justify-content: flex-end;
70
+
71
+ button {
72
+ margin: 10px 0 0 8px;
73
+ }
74
+ }
75
+
76
+ .kt-dialog-message {
77
+ color: var(--kt-modal-foreground);
78
+ line-height: 22px;
79
+ font-size: 14px;
80
+ word-break: break-all;
81
+ overflow: hidden;
82
+ flex: 1;
83
+ align-items: center;
84
+ display: inline-flex;
85
+ }
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ declare const Placements: ["topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight"];
3
+ declare type Placement = (typeof Placements)[number];
4
+ declare type OverlayFunc = () => React.ReactNode;
5
+ interface Align {
6
+ points?: [string, string];
7
+ offset?: [number, number];
8
+ targetOffset?: [number, number];
9
+ overflow?: {
10
+ adjustX?: boolean;
11
+ adjustY?: boolean;
12
+ };
13
+ useCssRight?: boolean;
14
+ useCssBottom?: boolean;
15
+ useCssTransform?: boolean;
16
+ }
17
+ export interface DropDownProps {
18
+ trigger?: ('click' | 'hover' | 'contextMenu')[];
19
+ overlay: React.ReactNode | OverlayFunc;
20
+ onVisibleChange?: (visible: boolean) => void;
21
+ visible?: boolean;
22
+ disabled?: boolean;
23
+ align?: Align;
24
+ getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
25
+ prefixCls?: string;
26
+ className?: string;
27
+ transitionName?: string;
28
+ placement?: Placement;
29
+ overlayClassName?: string;
30
+ overlayStyle?: React.CSSProperties;
31
+ forceRender?: boolean;
32
+ mouseEnterDelay?: number;
33
+ mouseLeaveDelay?: number;
34
+ openClassName?: string;
35
+ }
36
+ export default class Dropdown extends React.Component<DropDownProps, any> {
37
+ static defaultProps: {
38
+ mouseEnterDelay: number;
39
+ mouseLeaveDelay: number;
40
+ placement: "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
41
+ };
42
+ getTransitionName(): string;
43
+ renderOverlay: (prefixCls: string) => React.ReactNode;
44
+ renderDropDown: () => JSX.Element;
45
+ render(): JSX.Element;
46
+ }
47
+ export {};
48
+ //# sourceMappingURL=dropdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/dropdown/dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,UAAU,mFAOf,CAAC;AACF,aAAK,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7C,aAAK,WAAW,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC;AAEzC,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC;IAChD,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC;IACvC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,WAAW,CAAC;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,EAAE,GAAG,CAAC;IACvE,MAAM,CAAC,YAAY;;;;MAIjB;IAEF,iBAAiB;IAWjB,aAAa,cAAe,MAAM,qBA0CjC;IAED,cAAc,oBAoCb;IAED,MAAM;CAGP"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
5
+ const rc_dropdown_1 = (0, tslib_1.__importDefault)(require("rc-dropdown"));
6
+ const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
7
+ const RightOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/RightOutlined"));
8
+ const type_1 = require("../utils/type");
9
+ const warning_1 = require("../utils/warning");
10
+ const Placements = (0, type_1.tuple)('topLeft', 'topCenter', 'topRight', 'bottomLeft', 'bottomCenter', 'bottomRight');
11
+ class Dropdown extends react_1.default.Component {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.renderOverlay = (prefixCls) => {
15
+ // rc-dropdown already can process the function of overlay, but we have check logic here.
16
+ // So we need render the element to check and pass back to rc-dropdown.
17
+ const { overlay } = this.props;
18
+ let overlayNode;
19
+ if (typeof overlay === 'function') {
20
+ overlayNode = overlay();
21
+ }
22
+ else {
23
+ overlayNode = overlay;
24
+ }
25
+ overlayNode = react_1.default.Children.only(overlayNode);
26
+ const overlayProps = overlayNode.props;
27
+ // Warning if use other mode
28
+ (0, warning_1.warning)(!overlayProps.mode || overlayProps.mode === 'vertical', `[Dropdown] mode="${overlayProps.mode}" is not supported for Dropdown's Menu.`);
29
+ // menu cannot be selectable in dropdown defaultly
30
+ // menu should be focusable in dropdown defaultly
31
+ const { selectable = false, focusable = true } = overlayProps;
32
+ const expandIcon = (react_1.default.createElement("span", { className: `${prefixCls}-menu-submenu-arrow` },
33
+ react_1.default.createElement(RightOutlined_1.default, { className: `${prefixCls}-menu-submenu-arrow-icon` })));
34
+ const fixedModeOverlay = typeof overlayNode.type === 'string'
35
+ ? overlay
36
+ : react_1.default.cloneElement(overlayNode, {
37
+ mode: 'vertical',
38
+ selectable,
39
+ focusable,
40
+ expandIcon,
41
+ });
42
+ return fixedModeOverlay;
43
+ };
44
+ this.renderDropDown = () => {
45
+ const { prefixCls: customizePrefixCls, children, trigger, disabled, getPopupContainer, } = this.props;
46
+ const prefixCls = customizePrefixCls || 'kt-dropdown';
47
+ const child = react_1.default.Children.only(children);
48
+ const dropdownTrigger = react_1.default.cloneElement(child, {
49
+ className: (0, classnames_1.default)(child.props.className, `${prefixCls}-trigger`),
50
+ disabled,
51
+ });
52
+ const triggerActions = disabled ? [] : trigger;
53
+ let alignPoint;
54
+ if (triggerActions && triggerActions.indexOf('contextMenu') !== -1) {
55
+ alignPoint = true;
56
+ }
57
+ return (react_1.default.createElement(rc_dropdown_1.default, Object.assign({ alignPoint: alignPoint }, this.props, { prefixCls: prefixCls, getPopupContainer: getPopupContainer, transitionName: this.getTransitionName(), trigger: triggerActions, overlay: () => this.renderOverlay(prefixCls) }), dropdownTrigger));
58
+ };
59
+ }
60
+ getTransitionName() {
61
+ const { placement = '', transitionName } = this.props;
62
+ if (transitionName !== undefined) {
63
+ return transitionName;
64
+ }
65
+ if (placement.indexOf('top') >= 0) {
66
+ return 'slide-down';
67
+ }
68
+ return 'slide-up';
69
+ }
70
+ render() {
71
+ return this.renderDropDown();
72
+ }
73
+ }
74
+ exports.default = Dropdown;
75
+ Dropdown.defaultProps = {
76
+ mouseEnterDelay: 0.15,
77
+ mouseLeaveDelay: 0.1,
78
+ placement: 'bottomLeft',
79
+ };
80
+ //# sourceMappingURL=dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../src/dropdown/dropdown.tsx"],"names":[],"mappings":";;;AAAA,+DAA0B;AAC1B,2EAAqC;AACrC,yEAAoC;AACpC,iGAA4D;AAC5D,wCAAsC;AACtC,8CAA2C;AAE3C,MAAM,UAAU,GAAG,IAAA,YAAK,EACtB,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,aAAa,CACd,CAAC;AAsCF,MAAqB,QAAS,SAAQ,eAAK,CAAC,SAA6B;IAAzE;;QAkBE,kBAAa,GAAG,CAAC,SAAiB,EAAE,EAAE;YACpC,yFAAyF;YACzF,uEAAuE;YACvE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;YAE/B,IAAI,WAAW,CAAC;YAChB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBACjC,WAAW,GAAI,OAAuB,EAAE,CAAC;aAC1C;iBAAM;gBACL,WAAW,GA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+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dropdown = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const dropdown_1 = (0, tslib_1.__importDefault)(require("./dropdown"));
6
+ exports.Dropdown = dropdown_1.default;
7
+ require("./style.less");
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dropdown/index.tsx"],"names":[],"mappings":";;;;AAAA,uEAAkC;AAKzB,mBALF,kBAAQ,CAKE;AAJjB,wBAAsB"}
@@ -0,0 +1,254 @@
1
+ @import '../style/variable.less';
2
+ @import '../style/mixins.less';
3
+
4
+ @dropdown-prefix-cls: ~'@{kt-prefix}-dropdown';
5
+
6
+ .@{dropdown-prefix-cls} {
7
+ .reset-component;
8
+
9
+ position: absolute;
10
+ top: -9999px;
11
+ left: -9999px;
12
+ z-index: @zindex-dropdown;
13
+ display: block;
14
+
15
+ &::before {
16
+ position: absolute;
17
+ top: -7px;
18
+ right: 0;
19
+ bottom: -7px;
20
+ left: -7px;
21
+ z-index: -9999;
22
+ opacity: 0.0001;
23
+ content: ' ';
24
+ }
25
+
26
+ &-wrap {
27
+ position: relative;
28
+
29
+ .@{kt-prefix}-btn > .@{iconfont-css-prefix}-down {
30
+ .iconfont-size-under-12px(10px);
31
+ }
32
+
33
+ .@{iconfont-css-prefix}-down::before {
34
+ transition: transform 0.2s;
35
+ }
36
+ }
37
+
38
+ &-wrap-open {
39
+ .@{iconfont-css-prefix}-down::before {
40
+ transform: rotate(180deg);
41
+ }
42
+ }
43
+
44
+ &-hidden,
45
+ &-menu-hidden {
46
+ display: none;
47
+ }
48
+
49
+ &-menu {
50
+ position: relative;
51
+ margin: 0;
52
+ padding: @dropdown-edge-child-vertical-padding 0;
53
+ text-align: left;
54
+ list-style-type: none;
55
+ background-color: @component-background;
56
+ background-clip: padding-box;
57
+ border-radius: @border-radius-base;
58
+ outline: none;
59
+ box-shadow: @box-shadow-base;
60
+ -webkit-transform: translate3d(0, 0, 0);
61
+
62
+ &-item-group-title {
63
+ padding: 5px @control-padding-horizontal;
64
+ color: @text-color-secondary;
65
+ transition: all 0.3s;
66
+ }
67
+
68
+ &-submenu-popup {
69
+ position: absolute;
70
+ z-index: @zindex-dropdown;
71
+
72
+ > .@{dropdown-prefix-cls}-menu {
73
+ transform-origin: 0 0;
74
+ }
75
+
76
+ ul,
77
+ li {
78
+ list-style: none;
79
+ }
80
+
81
+ ul {
82
+ margin-right: 0.3em;
83
+ margin-left: 0.3em;
84
+ padding: 0;
85
+ }
86
+ }
87
+
88
+ &-item,
89
+ &-submenu-title {
90
+ clear: both;
91
+ margin: 0;
92
+ padding: @dropdown-vertical-padding @control-padding-horizontal;
93
+ color: @text-color;
94
+ font-weight: normal;
95
+ font-size: @dropdown-font-size;
96
+ line-height: @dropdown-line-height;
97
+ white-space: nowrap;
98
+ cursor: pointer;
99
+ transition: all 0.3s;
100
+
101
+ > .anticon:first-child,
102
+ > span > .anticon:first-child {
103
+ min-width: 12px;
104
+ margin-right: 8px;
105
+ font-size: @font-size-sm;
106
+ }
107
+
108
+ > a {
109
+ display: block;
110
+ margin: -5px -@control-padding-horizontal;
111
+ padding: 5px @control-padding-horizontal;
112
+ color: @text-color;
113
+ transition: all 0.3s;
114
+ }
115
+
116
+ &:first-child {
117
+ & when (@dropdown-edge-child-vertical-padding = 0) {
118
+ border-radius: @border-radius-base @border-radius-base 0 0;
119
+ }
120
+ }
121
+
122
+ &:last-child {
123
+ & when (@dropdown-edge-child-vertical-padding = 0) {
124
+ border-radius: 0 0 @border-radius-base @border-radius-base;
125
+ }
126
+ }
127
+
128
+ &-selected,
129
+ &-selected > a {
130
+ color: @dropdown-selected-color;
131
+ background-color: @item-active-bg;
132
+ }
133
+
134
+ &:hover {
135
+ background-color: @item-hover-bg;
136
+ }
137
+
138
+ &-disabled {
139
+ color: @disabled-color;
140
+ cursor: not-allowed;
141
+
142
+ &:hover {
143
+ color: @disabled-color;
144
+ background-color: @component-background;
145
+ cursor: not-allowed;
146
+ }
147
+ }
148
+
149
+ &-divider {
150
+ height: 1px;
151
+ margin: 4px 0;
152
+ overflow: hidden;
153
+ line-height: 0;
154
+ background-color: @border-color-split;
155
+ }
156
+
157
+ .@{dropdown-prefix-cls}-menu-submenu-arrow {
158
+ position: absolute;
159
+ right: @padding-xs;
160
+ &-icon {
161
+ color: @text-color-secondary;
162
+ font-style: normal;
163
+ .iconfont-size-under-12px(10px);
164
+ }
165
+ }
166
+ }
167
+
168
+ &-item-group-list {
169
+ margin: 0 8px;
170
+ padding: 0;
171
+ list-style: none;
172
+ }
173
+
174
+ &-submenu-title {
175
+ padding-right: 26px;
176
+ }
177
+
178
+ &-submenu-vertical {
179
+ position: relative;
180
+ }
181
+
182
+ &-submenu-vertical > & {
183
+ position: absolute;
184
+ top: 0;
185
+ left: 100%;
186
+ min-width: 100%;
187
+ margin-left: 4px;
188
+ transform-origin: 0 0;
189
+ }
190
+
191
+ &-submenu&-submenu-disabled .@{dropdown-prefix-cls}-menu-submenu-title {
192
+ &,
193
+ .@{dropdown-prefix-cls}-menu-submenu-arrow-icon {
194
+ color: @disabled-color;
195
+ background-color: @component-background;
196
+ cursor: not-allowed;
197
+ }
198
+ }
199
+
200
+ // https://github.com/ant-design/ant-design/issues/19264
201
+ &-submenu-selected &-submenu-title {
202
+ color: @primary-color;
203
+ }
204
+ }
205
+
206
+ &.slide-down-enter.slide-down-enter-active&-placement-bottomLeft,
207
+ &.slide-down-appear.slide-down-appear-active&-placement-bottomLeft,
208
+ &.slide-down-enter.slide-down-enter-active&-placement-bottomCenter,
209
+ &.slide-down-appear.slide-down-appear-active&-placement-bottomCenter,
210
+ &.slide-down-enter.slide-down-enter-active&-placement-bottomRight,
211
+ &.slide-down-appear.slide-down-appear-active&-placement-bottomRight {
212
+ animation-name: antSlideUpIn;
213
+ }
214
+
215
+ &.slide-up-enter.slide-up-enter-active&-placement-topLeft,
216
+ &.slide-up-appear.slide-up-appear-active&-placement-topLeft,
217
+ &.slide-up-enter.slide-up-enter-active&-placement-topCenter,
218
+ &.slide-up-appear.slide-up-appear-active&-placement-topCenter,
219
+ &.slide-up-enter.slide-up-enter-active&-placement-topRight,
220
+ &.slide-up-appear.slide-up-appear-active&-placement-topRight {
221
+ animation-name: antSlideDownIn;
222
+ }
223
+
224
+ &.slide-down-leave.slide-down-leave-active&-placement-bottomLeft,
225
+ &.slide-down-leave.slide-down-leave-active&-placement-bottomCenter,
226
+ &.slide-down-leave.slide-down-leave-active&-placement-bottomRight {
227
+ animation-name: antSlideUpOut;
228
+ }
229
+
230
+ &.slide-up-leave.slide-up-leave-active&-placement-topLeft,
231
+ &.slide-up-leave.slide-up-leave-active&-placement-topCenter,
232
+ &.slide-up-leave.slide-up-leave-active&-placement-topRight {
233
+ animation-name: antSlideDownOut;
234
+ }
235
+ }
236
+
237
+ .@{dropdown-prefix-cls}-trigger,
238
+ .@{dropdown-prefix-cls}-link {
239
+ > .@{iconfont-css-prefix}.@{iconfont-css-prefix}-down {
240
+ .iconfont-size-under-12px(10px);
241
+ }
242
+ }
243
+
244
+ .@{dropdown-prefix-cls}-button {
245
+ white-space: nowrap;
246
+
247
+ &.@{kt-prefix}-btn-group > .@{kt-prefix}-btn:last-child:not(:first-child) {
248
+ padding-right: @padding-xs;
249
+ padding-left: @padding-xs;
250
+ }
251
+ .@{iconfont-css-prefix}.@{iconfont-css-prefix}-down {
252
+ .iconfont-size-under-12px(10px);
253
+ }
254
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { defaultIconfont } from './iconfont/iconManager';
3
+ import { IIconShapeOptions } from './util';
4
+ import './styles.less';
5
+ export declare type DefaultIconKeys = keyof typeof defaultIconfont;
6
+ export interface IIconResourceOptions {
7
+ isDirectory?: boolean;
8
+ isOpenedDirectory?: boolean;
9
+ isSymbolicLink?: boolean;
10
+ }
11
+ export interface IiconContext<T extends string> {
12
+ getIcon: (iconKey: DefaultIconKeys | T, options?: IIconShapeOptions) => string;
13
+ getResourceIcon?: (url: string, options?: IIconResourceOptions) => string;
14
+ }
15
+ export declare const IconContext: React.Context<IiconContext<any>>;
16
+ export declare function IconContextProvider(props: React.PropsWithChildren<{
17
+ value: IiconContext<any>;
18
+ }>): JSX.Element;
19
+ export interface IconBaseProps<T> extends IIconShapeOptions {
20
+ title?: string;
21
+ icon?: DefaultIconKeys | T;
22
+ iconClass?: string;
23
+ tooltip?: string;
24
+ size?: 'small' | 'large';
25
+ loading?: boolean;
26
+ disabled?: boolean;
27
+ onClick?: React.MouseEventHandler<HTMLSpanElement>;
28
+ resourceOptions?: IIconResourceOptions;
29
+ }
30
+ export declare type IconProps<T = any> = IconBaseProps<T> & React.HTMLAttributes<HTMLSpanElement>;
31
+ export declare const _InternalIcon: React.ForwardRefExoticComponent<IconBaseProps<any> & React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
32
+ export declare const Icon: <T = any>(props: IconProps<T>, ref: React.Ref<HTMLSpanElement>) => React.ReactElement;
33
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAkB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAkB,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3D,OAAO,eAAe,CAAC;AAEvB,oBAAY,eAAe,GAA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AAM,IAAI,sCAEV,MAAM,GAAG,CAAC,eAAe,CAAC,KAC5B,MAAM,YAAY,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Icon = exports._InternalIcon = exports.IconContextProvider = exports.IconContext = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
6
+ const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
7
+ const iconManager_1 = require("./iconfont/iconManager");
8
+ const util_1 = require("./util");
9
+ require("./styles.less");
10
+ exports.IconContext = react_1.default.createContext({
11
+ getIcon: (iconKey, options) => iconKey,
12
+ });
13
+ function IconContextProvider(props) {
14
+ return (react_1.default.createElement(exports.IconContext.Provider, { value: props.value },
15
+ react_1.default.createElement(exports.IconContext.Consumer, null, (value) => props.value === value ? props.children : null)));
16
+ }
17
+ exports.IconContextProvider = IconContextProvider;
18
+ /**
19
+ * 在 IDE 集成环境下使用自定义图标时,建议提供自定义 IconKeys 类型
20
+ * @example
21
+ * ```ts
22
+ * const demo = () => (
23
+ * <Icon<'foo' | 'bar'> icon='bar' />
24
+ * );
25
+ * //自定义前缀
26
+ * const demo = () => (
27
+ * <Icon<'foo' | 'bar'> iconClass=`${customPrefix} bar` />
28
+ * );
29
+ * ```
30
+ */
31
+ // tslint:disable-next-line:only-arrow-functions
32
+ const IconBase = function (props, ref) {
33
+ const { size = 'small', loading, icon, iconClass, className, tooltip, rotate, anim, fill, disabled, onClick, children, resourceOptions } = props, restProps = (0, tslib_1.__rest)(props, ["size", "loading", "icon", "iconClass", "className", "tooltip", "rotate", "anim", "fill", "disabled", "onClick", "children", "resourceOptions"]);
34
+ const iconShapeOptions = { rotate, anim, fill };
35
+ let iconClx;
36
+ if (icon) {
37
+ // 因为 getIcon 默认是倒序查找优先级
38
+ // 这里的逻辑会导致是优先用 defaultIconFont 里面去查找
39
+ // 所以这里应该是跟 getIcon 逻辑表现不太一样
40
+ // 此外这里的 useContext 的话,作用看起来意义不大了,因为 getIcon 是个函数,本质上无法做到通知
41
+ // 这里为了兼容被废弃的 icon 使用了 `defaultIconMap` 去取值
42
+ // 但是上方的类型 DefaultIconKeys 里面已经不包含被废弃的 icon 了,避免继续使用废弃的图标
43
+ if (iconManager_1.defaultIconMap[icon]) {
44
+ iconClx = (0, util_1.getKaitianIcon)(icon, iconShapeOptions);
45
+ }
46
+ else {
47
+ const { getIcon, getResourceIcon } = react_1.default.useContext(exports.IconContext);
48
+ if (resourceOptions && getResourceIcon) {
49
+ iconClx = getResourceIcon(icon, resourceOptions);
50
+ }
51
+ else {
52
+ iconClx = getIcon(icon, iconShapeOptions);
53
+ }
54
+ }
55
+ }
56
+ else {
57
+ iconClx = iconClass;
58
+ }
59
+ return (react_1.default.createElement("span", Object.assign({}, restProps, { title: tooltip, onClick: onClick, ref: ref, className: (0, classnames_1.default)('kt-icon', iconClx, className, {
60
+ 'kt-icon-loading': loading,
61
+ 'kt-icon-disabled': !!disabled,
62
+ [`kt-icon-${size}`]: !!size,
63
+ 'kt-icon-clickable': !!onClick,
64
+ 'kt-icon-resource': !!resourceOptions,
65
+ 'expanded': !!resourceOptions && resourceOptions.isOpenedDirectory,
66
+ }) }), children));
67
+ };
68
+ // for ts type usage for iconfont-cn.tsx
69
+ exports._InternalIcon = react_1.default.forwardRef(IconBase);
70
+ exports.Icon = react_1.default.forwardRef(IconBase);
71
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/icon/icon.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA6B;AAE7B,wDAAyE;AACzE,iCAA2D;AAE3D,yBAAuB;AAeV,QAAA,WAAW,GAAG,eAAK,CAAC,aAAa,CAAoB;IAChE,OAAO,EAAE,CAAC,OAAO,EAAE,OAA2B,EAAE,EAAE,CAAC,OAAO;CAC3D,CAAC,CAAC;AAEH,SAAgB,mBAAmB,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