@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,8 @@
1
+ import React from 'react';
2
+ import './notification.less';
3
+ import { MessageType } from '../common';
4
+ export declare const notification: import("./notification").NotificationApi;
5
+ export declare function open<T = string>(message: string | React.ReactNode, type: MessageType, closable: boolean | undefined, key: string, buttons?: string[], description?: string | React.ReactNode, duration?: number, onClose?: () => void): Promise<T | undefined> | undefined;
6
+ export declare function close(key: string): void;
7
+ export declare function update(key: string, message: string): void;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notification/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAYxC,eAAO,MAAM,YAAY,0CAAmB,CAAC;AAI7C,wBAAgB,IAAI,CAAC,CAAC,GAAG,MAAM,EAC7B,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EACjC,IAAI,EAAE,WAAW,EACjB,QAAQ,qBAAgB,EACxB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EACtC,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,IAAI,GACnB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,CAyCpC;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,QAEhC;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAOlD"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = exports.close = exports.open = exports.notification = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const classnames_1 = (0, tslib_1.__importDefault)(require("classnames"));
6
+ const react_1 = (0, tslib_1.__importDefault)(require("react"));
7
+ const notification_1 = (0, tslib_1.__importDefault)(require("./notification"));
8
+ const button_1 = require("../button");
9
+ require("./notification.less");
10
+ const common_1 = require("../common");
11
+ const DURATION = {
12
+ [common_1.MessageType.Info]: 15000,
13
+ [common_1.MessageType.Warning]: 18000,
14
+ [common_1.MessageType.Error]: 20000,
15
+ };
16
+ notification_1.default.config({
17
+ placement: 'bottomRight',
18
+ });
19
+ exports.notification = notification_1.default;
20
+ const cachedArgs = new Map();
21
+ function open(message, type, closable = true, key, buttons, description, duration, onClose) {
22
+ return new Promise((resolve) => {
23
+ const args = {
24
+ key,
25
+ className: (0, classnames_1.default)('kt-notification-wrapper', {
26
+ ['kt-notification-info']: type === common_1.MessageType.Info,
27
+ ['kt-notification-error']: type === common_1.MessageType.Error,
28
+ ['kt-notification-warn']: type === common_1.MessageType.Warning,
29
+ }),
30
+ duration: duration !== undefined ? null : (DURATION[type] / 1000),
31
+ onClose: () => {
32
+ onClose && onClose();
33
+ cachedArgs.delete(key);
34
+ resolve(undefined);
35
+ },
36
+ btn: buttons
37
+ ? buttons.map((button, index) => (react_1.default.createElement(button_1.Button, { className: (0, classnames_1.default)('kt-notification-button'), size: 'small', ghost: index === 0, onClick: () => {
38
+ resolve(button);
39
+ notification_1.default.close(key);
40
+ }, key: button }, button)))
41
+ : null,
42
+ message,
43
+ description,
44
+ };
45
+ cachedArgs.set(key, [type, args]);
46
+ // closable 为 false 时,不展示 closeIcon
47
+ if (!closable) {
48
+ args.closeIcon = react_1.default.createElement("span", null);
49
+ }
50
+ doOpenNotification(type, args);
51
+ });
52
+ }
53
+ exports.open = open;
54
+ function close(key) {
55
+ exports.notification.close(key);
56
+ }
57
+ exports.close = close;
58
+ function update(key, message) {
59
+ const args = cachedArgs.get(key);
60
+ doOpenNotification(args[0], Object.assign(Object.assign({}, args[1]), { key,
61
+ message }));
62
+ }
63
+ exports.update = update;
64
+ function doOpenNotification(type, args) {
65
+ switch (type) {
66
+ case common_1.MessageType.Info:
67
+ exports.notification.info(args);
68
+ break;
69
+ case common_1.MessageType.Warning:
70
+ exports.notification.warning(args);
71
+ break;
72
+ case common_1.MessageType.Error:
73
+ exports.notification.error(args);
74
+ break;
75
+ default:
76
+ exports.notification.open(args);
77
+ break;
78
+ }
79
+ }
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notification/index.tsx"],"names":[],"mappings":";;;;AAAA,yEAA6B;AAC7B,+DAA0B;AAE1B,+EAA6D;AAE7D,sCAAmC;AACnC,+BAA6B;AAC7B,sCAAwC;AAExC,MAAM,QAAQ,GAA+B;IAC3C,CAAC,oBAAW,CAAC,IAAI,CAAC,EAAE,KAAK;IACzB,CAAC,oBAAW,CAAC,OAAO,CAAC,EA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M;QACR;YACE,oBAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,MAAM;KACT;AACH,CAAC"}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
3
+ export declare type IconType = 'success' | 'info' | 'error' | 'warning';
4
+ export interface ConfigProps {
5
+ top?: number;
6
+ bottom?: number;
7
+ duration?: number;
8
+ placement?: NotificationPlacement;
9
+ getContainer?: () => HTMLElement;
10
+ closeIcon?: React.ReactNode;
11
+ }
12
+ export interface ArgsProps {
13
+ message: React.ReactNode;
14
+ description?: React.ReactNode;
15
+ btn?: React.ReactNode;
16
+ key?: string;
17
+ onClose?: () => void;
18
+ duration?: number | null;
19
+ icon?: React.ReactNode;
20
+ placement?: NotificationPlacement;
21
+ style?: React.CSSProperties;
22
+ prefixCls?: string;
23
+ className?: string;
24
+ readonly type?: IconType;
25
+ onClick?: () => void;
26
+ top?: number;
27
+ bottom?: number;
28
+ getContainer?: () => HTMLElement;
29
+ closeIcon?: React.ReactNode;
30
+ }
31
+ export interface NotificationApi {
32
+ success(args: ArgsProps): void;
33
+ error(args: ArgsProps): void;
34
+ info(args: ArgsProps): void;
35
+ warn(args: ArgsProps): void;
36
+ warning(args: ArgsProps): void;
37
+ open(args: ArgsProps): void;
38
+ close(key: string): void;
39
+ config(options: ConfigProps): void;
40
+ destroy(): void;
41
+ }
42
+ declare const _default: NotificationApi;
43
+ export default _default;
44
+ //# sourceMappingURL=notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/notification/notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,qBAAqB,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAE1F,oBAAY,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,C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B,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,OAAO,IAAI,IAAI,CAAC;CACjB;;AAED,wBAAsC"}
@@ -0,0 +1,156 @@
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_notification_1 = (0, tslib_1.__importDefault)(require("rc-notification"));
6
+ const CloseOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/CloseOutlined"));
7
+ const CheckCircleOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/CheckCircleOutlined"));
8
+ const CloseCircleOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/CloseCircleOutlined"));
9
+ const ExclamationCircleOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/ExclamationCircleOutlined"));
10
+ const InfoCircleOutlined_1 = (0, tslib_1.__importDefault)(require("@ant-design/icons/InfoCircleOutlined"));
11
+ const notificationInstance = {};
12
+ let defaultDuration = 4.5;
13
+ let defaultTop = 24;
14
+ let defaultBottom = 24;
15
+ let defaultPlacement = 'topRight';
16
+ let defaultGetContainer;
17
+ let defaultCloseIcon;
18
+ function setNotificationConfig(options) {
19
+ const { duration, placement, bottom, top, getContainer, closeIcon } = options;
20
+ if (duration !== undefined) {
21
+ defaultDuration = duration;
22
+ }
23
+ if (placement !== undefined) {
24
+ defaultPlacement = placement;
25
+ }
26
+ if (bottom !== undefined) {
27
+ defaultBottom = bottom;
28
+ }
29
+ if (top !== undefined) {
30
+ defaultTop = top;
31
+ }
32
+ if (getContainer !== undefined) {
33
+ defaultGetContainer = getContainer;
34
+ }
35
+ if (closeIcon !== undefined) {
36
+ defaultCloseIcon = closeIcon;
37
+ }
38
+ }
39
+ function getPlacementStyle(placement, top = defaultTop, bottom = defaultBottom) {
40
+ let style;
41
+ switch (placement) {
42
+ case 'topLeft':
43
+ style = {
44
+ left: 0,
45
+ top,
46
+ bottom: 'auto',
47
+ };
48
+ break;
49
+ case 'topRight':
50
+ style = {
51
+ right: 0,
52
+ top,
53
+ bottom: 'auto',
54
+ };
55
+ break;
56
+ case 'bottomLeft':
57
+ style = {
58
+ left: 0,
59
+ top: 'auto',
60
+ bottom,
61
+ };
62
+ break;
63
+ default:
64
+ style = {
65
+ right: 0,
66
+ top: 'auto',
67
+ bottom,
68
+ };
69
+ break;
70
+ }
71
+ return style;
72
+ }
73
+ function getNotificationInstance({ prefixCls, placement = defaultPlacement, getContainer = defaultGetContainer, top, bottom, closeIcon = defaultCloseIcon, }, callback) {
74
+ const cacheKey = `${prefixCls}-${placement}`;
75
+ if (notificationInstance[cacheKey]) {
76
+ callback(notificationInstance[cacheKey]);
77
+ return;
78
+ }
79
+ const closeIconToRender = (react_1.default.createElement("span", { className: `${prefixCls}-close-x` }, closeIcon || react_1.default.createElement(CloseOutlined_1.default, { className: `${prefixCls}-close-icon` })));
80
+ rc_notification_1.default.newInstance({
81
+ prefixCls,
82
+ className: `${prefixCls}-${placement}`,
83
+ style: getPlacementStyle(placement, top, bottom),
84
+ getContainer,
85
+ closeIcon: closeIconToRender,
86
+ }, (notification) => {
87
+ notificationInstance[cacheKey] = notification;
88
+ callback(notification);
89
+ });
90
+ }
91
+ const typeToIcon = {
92
+ success: CheckCircleOutlined_1.default,
93
+ info: InfoCircleOutlined_1.default,
94
+ error: CloseCircleOutlined_1.default,
95
+ warning: ExclamationCircleOutlined_1.default,
96
+ };
97
+ function notice(args) {
98
+ const outerPrefixCls = args.prefixCls || 'kt-notification';
99
+ const prefixCls = `${outerPrefixCls}-notice`;
100
+ const duration = args.duration === undefined ? defaultDuration : args.duration;
101
+ let iconNode = null;
102
+ if (args.icon) {
103
+ iconNode = react_1.default.createElement("span", { className: `${prefixCls}-icon` }, args.icon);
104
+ }
105
+ else if (args.type) {
106
+ iconNode = react_1.default.createElement(typeToIcon[args.type] || null, {
107
+ className: `${prefixCls}-icon ${prefixCls}-icon-${args.type}`,
108
+ });
109
+ }
110
+ const autoMarginTag = !args.description && iconNode ? (react_1.default.createElement("span", { className: `${prefixCls}-message-single-line-auto-margin` })) : null;
111
+ const { placement, top, bottom, getContainer, closeIcon } = args;
112
+ getNotificationInstance({
113
+ prefixCls: outerPrefixCls,
114
+ placement,
115
+ top,
116
+ bottom,
117
+ getContainer,
118
+ closeIcon,
119
+ }, (notification) => {
120
+ notification.notice({
121
+ content: (react_1.default.createElement("div", { className: iconNode ? `${prefixCls}-with-icon` : '' },
122
+ iconNode,
123
+ react_1.default.createElement("div", { className: `${prefixCls}-message` },
124
+ autoMarginTag,
125
+ args.message),
126
+ react_1.default.createElement("div", { className: `${prefixCls}-description` }, args.description),
127
+ args.btn ? react_1.default.createElement("span", { className: `${prefixCls}-btn` }, args.btn) : null)),
128
+ duration,
129
+ closable: true,
130
+ onClose: args.onClose,
131
+ onClick: args.onClick,
132
+ key: args.key,
133
+ style: args.style || {},
134
+ className: args.className,
135
+ });
136
+ });
137
+ }
138
+ const api = {
139
+ open: notice,
140
+ close(key) {
141
+ Object.keys(notificationInstance).forEach((cacheKey) => notificationInstance[cacheKey].removeNotice(key));
142
+ },
143
+ config: setNotificationConfig,
144
+ destroy() {
145
+ Object.keys(notificationInstance).forEach((cacheKey) => {
146
+ notificationInstance[cacheKey].destroy();
147
+ delete notificationInstance[cacheKey];
148
+ });
149
+ },
150
+ };
151
+ ['success', 'info', 'warning', 'error'].forEach((type) => {
152
+ api[type] = (args) => api.open(Object.assign(Object.assign({}, args), { type }));
153
+ });
154
+ api.warn = api.warning;
155
+ exports.default = api;
156
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/notification/notification.tsx"],"names":[],"mappings":";;;AAAA,+DAA0B;AAC1B,mFAA2C;AAC3C,iGAA4D;AAC5D,6GAAwE;AACxE,6GAAwE;AACxE,yHAAoF;AACpF,2GAAsE;AAMtE,MAAM,oBAAoB,GAA2B,EAAE,CAAC;AACxD,IAAI,eAAe,GAAG,GAAG,CAAC;AAC1B,IAAI,UAAU,GAAG,EAAE,CAAC;AACpB,IAAI,aAAa,GAAG,EAAE,CAAC;AACvB,IAAI,gBAAgB,GAA0B,UAAU,CAAC;AACzD,IAAI,mBAAsC,CAAC;AAC3C,IAAI,gBAAiC,CAAC;AAWtC,SAAS,qBAAqB,CAAC,OAAoB;IACjD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC9E,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,eAAe,GAAG,QAAQ,CAAC;KAC5B;IACD,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,gBAAgB,GAAG,SAAS,CAAC;KAC9B;IACD,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,aAAa,GAAG,MAAM,CAAC;KACxB;IACD,IAAI,GAAG,KAAK,SAAS,EAAE;QACrB,UAAU,GAAG,GAAG,CAAC;KAClB;IACD,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,mBAAmB,GAAG,YAAY,CAAC;KACpC;IACD,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,gBAAgB,GAAG,SAAS,CAAC;KAC9B;AACH,CAAC;AAED,SAAS,iBAAiB,CACxB,SAAgC,EAChC,MAAc,UAAU,EACxB,SAAiB,aAAa;IAE9B,IAAI,KAAK,CAAC;IACV,QAAQ,SAAS,EAAE;QACjB,KAAK,SAAS;YACZ,KAAK,GAAG;gBACN,IAAI,EAAE,CAAC;gBACP,GAAG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QAAQ,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC;AAEF,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;IACvD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAe,EAAE,EAAE,CAC9B,GAAG,CAAC,IAAI,iCACH,IAAI,KACP,IAAI,IACJ,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;AAcvB,kBAAe,GAAsB,CAAC"}
@@ -0,0 +1,231 @@
1
+ @import '../style/variable.less';
2
+ @import '../style/mixins.less';
3
+
4
+ @notification-prefix-cls: ~'@{kt-prefix}-notification';
5
+ @notification-width: 384px;
6
+ @notification-padding-vertical: 16px;
7
+ @notification-padding-horizontal: 24px;
8
+ @notification-padding: @notification-padding-vertical @notification-padding-horizontal;
9
+ @notification-margin-bottom: 16px;
10
+
11
+ .@{notification-prefix-cls} {
12
+ .reset-component;
13
+
14
+ position: fixed;
15
+ z-index: @zindex-notification;
16
+ width: @notification-width;
17
+ max-width: ~'calc(100vw - 32px)';
18
+ margin-right: 24px;
19
+
20
+ &-topLeft,
21
+ &-bottomLeft {
22
+ margin-right: 0;
23
+ margin-left: 24px;
24
+
25
+ .@{notification-prefix-cls}-fade-enter.@{notification-prefix-cls}-fade-enter-active,
26
+ .@{notification-prefix-cls}-fade-appear.@{notification-prefix-cls}-fade-appear-active {
27
+ animation-name: NotificationLeftFadeIn;
28
+ }
29
+ }
30
+
31
+ &-close-icon {
32
+ font-size: @font-size-base;
33
+ cursor: pointer;
34
+ }
35
+
36
+ &-notice {
37
+ position: relative;
38
+ margin-bottom: @notification-margin-bottom;
39
+ padding: @notification-padding;
40
+ overflow: hidden;
41
+ line-height: 1.5;
42
+ background: @component-background;
43
+ border-radius: @border-radius-base;
44
+ box-shadow: @shadow-2;
45
+
46
+ &-message {
47
+ display: inline-block;
48
+ margin-bottom: 8px;
49
+ color: @heading-color;
50
+ font-size: @font-size-lg;
51
+ line-height: 24px;
52
+
53
+ // https://github.com/ant-design/ant-design/issues/5846#issuecomment-296244140
54
+ &-single-line-auto-margin {
55
+ display: block;
56
+ width: ~'calc(@{notification-width} - @{notification-padding-horizontal} * 2 - 24px - 48px - 100%)';
57
+ max-width: 4px;
58
+ background-color: transparent;
59
+ pointer-events: none;
60
+ &::before {
61
+ display: block;
62
+ content: '';
63
+ }
64
+ }
65
+ }
66
+
67
+ &-description {
68
+ font-size: @font-size-base;
69
+ }
70
+
71
+ &-closable &-message {
72
+ padding-right: 24px;
73
+ }
74
+
75
+ &-with-icon &-message {
76
+ margin-bottom: 4px;
77
+ margin-left: 48px;
78
+ font-size: @font-size-lg;
79
+ }
80
+
81
+ &-with-icon &-description {
82
+ margin-left: 48px;
83
+ font-size: @font-size-base;
84
+ }
85
+
86
+ // Icon & color style in different selector level
87
+ // https://github.com/ant-design/ant-design/issues/16503
88
+ // https://github.com/ant-design/ant-design/issues/15512
89
+ &-icon {
90
+ position: absolute;
91
+ margin-left: 4px;
92
+ font-size: 24px;
93
+ line-height: 24px;
94
+ }
95
+
96
+ .@{iconfont-css-prefix}&-icon {
97
+ &-success {
98
+ color: @success-color;
99
+ }
100
+ &-info {
101
+ color: var(--notificationsInfoIcon-foreground);
102
+ }
103
+ &-warning {
104
+ color: var(--notificationsWarningIcon-foreground);
105
+ }
106
+ &-error {
107
+ color: var(--notificationsErrorIcon-foreground);
108
+ }
109
+ }
110
+
111
+ &-close {
112
+ position: absolute;
113
+ top: 16px;
114
+ right: 22px;
115
+ color: @text-color-secondary;
116
+ outline: none;
117
+
118
+ &:hover {
119
+ color: shade(@text-color-secondary, 40%);
120
+ }
121
+ }
122
+
123
+ &-btn {
124
+ float: right;
125
+ margin-top: 16px;
126
+ }
127
+ }
128
+
129
+ .notification-fade-effect {
130
+ animation-duration: 0.24s;
131
+ animation-timing-function: @ease-in-out;
132
+ animation-fill-mode: both;
133
+ }
134
+
135
+ &-fade-enter,
136
+ &-fade-appear {
137
+ opacity: 0;
138
+ .notification-fade-effect();
139
+
140
+ animation-play-state: paused;
141
+ }
142
+
143
+ &-fade-leave {
144
+ .notification-fade-effect();
145
+
146
+ animation-duration: 0.2s;
147
+ animation-play-state: paused;
148
+ }
149
+
150
+ &-fade-enter&-fade-enter-active,
151
+ &-fade-appear&-fade-appear-active {
152
+ animation-name: NotificationFadeIn;
153
+ animation-play-state: running;
154
+ }
155
+
156
+ &-fade-leave&-fade-leave-active {
157
+ animation-name: NotificationFadeOut;
158
+ animation-play-state: running;
159
+ }
160
+ }
161
+
162
+ @keyframes NotificationFadeIn {
163
+ 0% {
164
+ left: @notification-width;
165
+ opacity: 0;
166
+ }
167
+ 100% {
168
+ left: 0;
169
+ opacity: 1;
170
+ }
171
+ }
172
+
173
+ @keyframes NotificationLeftFadeIn {
174
+ 0% {
175
+ right: @notification-width;
176
+ opacity: 0;
177
+ }
178
+ 100% {
179
+ right: 0;
180
+ opacity: 1;
181
+ }
182
+ }
183
+
184
+ @keyframes NotificationFadeOut {
185
+ 0% {
186
+ max-height: 150px;
187
+ margin-bottom: @notification-margin-bottom;
188
+ padding-top: @notification-padding;
189
+ padding-bottom: @notification-padding;
190
+ opacity: 1;
191
+ }
192
+ 100% {
193
+ max-height: 0;
194
+ margin-bottom: 0;
195
+ padding-top: 0;
196
+ padding-bottom: 0;
197
+ opacity: 0;
198
+ }
199
+ }
200
+
201
+
202
+ .@{notification-prefix-cls}-wrapper {
203
+ background: var(--notifications-background) !important;
204
+ border-color: var(--notifications-border) !important;
205
+ word-break: break-word;
206
+ padding: 12px !important;
207
+ position: relative;
208
+
209
+ .@{iconfont-css-prefix} {
210
+ font-size: 12px;
211
+ margin-top: 5px;
212
+ }
213
+
214
+ .@{notification-prefix-cls}-notice {
215
+ &-close, &-message, &-description {
216
+ color: var(--notifications-foreground) !important;
217
+ font-size: 12px !important;
218
+ margin-left: 22px !important;
219
+ line-height: 20px !important;
220
+ }
221
+
222
+ &-close {
223
+ right: 14px;
224
+ top: 12px;
225
+ }
226
+
227
+ &-btn button {
228
+ margin: 0 0 0 10px;
229
+ }
230
+ }
231
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ModalProps } from '../modal';
3
+ import './styles.less';
4
+ declare type getContainerFunc = () => HTMLElement;
5
+ export interface IOverlayProps {
6
+ className?: string;
7
+ width?: number;
8
+ maskClosable?: boolean;
9
+ visible: boolean;
10
+ afterClose: ModalProps['afterClose'];
11
+ onClose: ModalProps['onCancel'];
12
+ closable?: ModalProps['closable'];
13
+ title?: ModalProps['title'];
14
+ footer?: JSX.Element[] | JSX.Element;
15
+ getContainer?: string | HTMLElement | getContainerFunc | false | null;
16
+ }
17
+ export declare const Overlay: React.FC<IOverlayProps>;
18
+ export {};
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/overlay/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAS,UAAU,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,eAAe,CAAC;AAEvB,OAAO,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,gBAAgB,GAAG,KAAK,GAAG,IAAI,CAAC;CACvE;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAe1C,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Overlay = 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 modal_1 = require("../modal");
8
+ require("./styles.less");
9
+ exports.Overlay = ((_a) => {
10
+ var { maskClosable = false, closable = true, className, onClose, children, footer, title, getContainer } = _a, restProps = (0, tslib_1.__rest)(_a, ["maskClosable", "closable", "className", "onClose", "children", "footer", "title", "getContainer"]);
11
+ return (react_1.default.createElement(modal_1.Modal, Object.assign({ footer: footer ? footer : null, maskClosable: maskClosable, closable: closable, onCancel: onClose, title: title, getContainer: getContainer, className: (0, classnames_1.default)('kt-overlay', className) }, restProps), children));
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.tsx"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,yEAA8B;AAC9B,oCAA6C;AAE7C,yBAAuB;AAiBV,QAAA,OAAO,GAA4B,CAAC,CAAC,EAAkH,EAAE,EAAE;QAAtH,EAAE,YAAY,GAAG,KAAK,EAAE,QAAQ,GAAG,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,OAAgB,EAAX,SAAS,2BAAhH,mGAAkH,CAAF;IAChK,OAAO,CACL,8BAAC,aAAK,kBACJ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAC9B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,IAAA,oBAAI,EAAC,YAAY,EAAE,SAAS,CAAC,IACpC,SAAS,GAEZ,QAAQ,CACH,CACT,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ @import '../style/variable.less';
2
+
3
+ @dialog-prefix-cls: ~'@{kt-prefix}-modal';
4
+
5
+ .kt-overlay {
6
+ &.@{dialog-prefix-cls} {
7
+ padding: 24px 24px;
8
+ color: var(--kt-modal-foreground);
9
+ }
10
+
11
+ .@{dialog-prefix-cls} {
12
+ &-body {
13
+ background: var(--kt-modal-background);
14
+ border-color: var(--notifications-border);
15
+ }
16
+
17
+ &-header {
18
+ background-color: var(--kt-modal-background);
19
+ border-bottom-color: var(--kt-modal-separatorBackground);
20
+ height: 56px;
21
+ border-radius: 2px 2px 0 0;
22
+ }
23
+
24
+ &-title {
25
+ color: var(--kt-modal-foreground);
26
+ }
27
+
28
+ &-footer {
29
+ background-color: var(--kt-modal-background);
30
+ border-top-color: var(--kt-modal-separatorBackground);
31
+ height: 52px;
32
+ border-radius: 0 0 2px 2px;
33
+ }
34
+
35
+ &-close-x {
36
+ margin: 18px 24px 0 0;
37
+ width: 20px;
38
+ height: 20px;
39
+ line-height: 20px;
40
+ color: var(--kt-notificationsCloseIcon-foreground);
41
+ }
42
+ }
43
+
44
+ }
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare enum PopoverTriggerType {
4
+ hover = 0,
5
+ program = 1
6
+ }
7
+ export declare enum PopoverPosition {
8
+ top = "top",
9
+ bottom = "bottom",
10
+ left = "left",
11
+ right = "right"
12
+ }
13
+ export declare const Popover: React.FC<{
14
+ id: string;
15
+ insertClass?: string;
16
+ content?: React.ReactElement;
17
+ trigger?: PopoverTriggerType;
18
+ display?: boolean;
19
+ [key: string]: any;
20
+ popoverClass?: string;
21
+ position?: PopoverPosition;
22
+ delay?: number;
23
+ title?: string;
24
+ titleClassName?: string;
25
+ action?: string;
26
+ onClickAction?: (args: any) => void;
27
+ }>;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,eAAe,CAAC;AAIvB,oBAAY,kBAAkB;IAC5B,KAAK,IAAA;IACL,OAAO,IAAA;CACR;AAED,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAID,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC,CA0HA,CAAC"}