linkmore-design 1.0.51 → 1.0.55

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 (325) hide show
  1. package/dist/{Notification → Affix}/demos/basic.d.ts +0 -0
  2. package/dist/Affix/index.d.ts +54 -0
  3. package/dist/{Notification → Affix}/style/index.d.ts +0 -0
  4. package/dist/Affix/utils.d.ts +15 -0
  5. package/dist/Alert/ErrorBoundary.d.ts +22 -0
  6. package/dist/{Notification/demos/button.d.ts → Alert/demos/basic.d.ts} +0 -0
  7. package/dist/{Notification/demos/icon.d.ts → Alert/demos/visible.d.ts} +0 -0
  8. package/dist/Alert/index.d.ts +41 -0
  9. package/dist/Alert/style/index.d.ts +1 -0
  10. package/dist/Button/style/index.d.ts +1 -1
  11. package/dist/CardTable/fns/index.d.ts +3 -3
  12. package/dist/CardTable/{toolbar → pager}/TablePagination.d.ts +0 -0
  13. package/dist/CardTable/pager/index.d.ts +3 -0
  14. package/dist/IconFont/index.d.ts +1 -1
  15. package/dist/LmEditTable/style/index.d.ts +1 -1
  16. package/dist/LmFilter/LmFilter.d.ts +3 -0
  17. package/dist/LmFilter/baseFilter/fuzzySearch.d.ts +4 -0
  18. package/dist/LmFilter/baseFilter/index.d.ts +3 -0
  19. package/dist/LmFilter/clearFilter/index.d.ts +3 -0
  20. package/dist/LmFilter/complexFilter/index.d.ts +2 -0
  21. package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
  22. package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
  23. package/dist/LmFilter/components/DateFilter.d.ts +5 -0
  24. package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
  25. package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
  26. package/dist/LmFilter/components/InputFilter.d.ts +4 -0
  27. package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
  28. package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
  29. package/dist/LmFilter/components/index.d.ts +3 -0
  30. package/dist/LmFilter/customFilter/index.d.ts +2 -0
  31. package/dist/LmFilter/demos/basic.d.ts +2 -0
  32. package/dist/LmFilter/filterFns/index.d.ts +12 -0
  33. package/dist/LmFilter/hooks/index.d.ts +1 -0
  34. package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
  35. package/dist/LmFilter/index.d.ts +2 -0
  36. package/dist/LmFilter/style/index.d.ts +1 -0
  37. package/dist/LmFilter/utils.d.ts +9 -0
  38. package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
  39. package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
  40. package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
  41. package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
  42. package/dist/QuickMenu/demos/basic.d.ts +2 -0
  43. package/dist/QuickMenu/index.d.ts +14 -0
  44. package/dist/QuickMenu/style/index.d.ts +1 -0
  45. package/dist/Tag/demos/ExigencyTag.d.ts +2 -0
  46. package/dist/Tag/index.d.ts +4 -0
  47. package/dist/Upload/demos/picture-little.d.ts +3 -0
  48. package/dist/Upload/index.d.ts +5 -1
  49. package/dist/_util/domTarget.d.ts +7 -0
  50. package/dist/_util/getDataOrAriaProps.d.ts +1 -0
  51. package/dist/_util/reactNode.d.ts +7 -0
  52. package/dist/_util/throttleByAnimationFrame.d.ts +8 -0
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.umd.js +3453 -317
  55. package/dist/index.umd.min.js +6 -6
  56. package/dist/message/hooks/useMessage.d.ts +7 -0
  57. package/dist/message/index.d.ts +63 -4
  58. package/dist/notification/demos/basic.d.ts +2 -0
  59. package/dist/notification/demos/button.d.ts +2 -0
  60. package/dist/notification/demos/icon.d.ts +2 -0
  61. package/dist/notification/hooks/useNotification.d.ts +7 -0
  62. package/dist/notification/index.d.ts +54 -0
  63. package/dist/notification/style/index.d.ts +1 -0
  64. package/es/Affix/index.d.ts +54 -0
  65. package/es/Affix/index.js +326 -0
  66. package/{lib/Notification → es/Affix}/style/index.css +0 -3
  67. package/es/{Notification → Affix}/style/index.d.ts +0 -0
  68. package/es/{Notification → Affix}/style/index.js +0 -0
  69. package/es/Affix/utils.d.ts +15 -0
  70. package/es/Affix/utils.js +83 -0
  71. package/es/Alert/ErrorBoundary.d.ts +22 -0
  72. package/es/Alert/ErrorBoundary.js +65 -0
  73. package/es/Alert/index.d.ts +41 -0
  74. package/es/Alert/index.js +192 -0
  75. package/es/Alert/style/index.css +531 -0
  76. package/{lib/Notification → es/Alert}/style/index.d.ts +0 -0
  77. package/es/Alert/style/index.js +1 -0
  78. package/es/Button/style/{style.css → index.css} +0 -0
  79. package/es/Button/style/index.d.ts +1 -1
  80. package/es/Button/style/index.js +1 -1
  81. package/es/ButtonTags/style/{style.css → index.css} +0 -0
  82. package/es/ButtonTags/style/index.js +1 -1
  83. package/es/CardTable/card/PictureTextColumn.js +8 -6
  84. package/es/CardTable/card/PictureTextRow.js +1 -1
  85. package/es/CardTable/fns/index.js +38 -8
  86. package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  87. package/es/CardTable/pager/index.js +48 -0
  88. package/{lib/CardTable/style/style.css → es/CardTable/style/index.css} +2 -2
  89. package/es/CardTable/style/index.js +1 -1
  90. package/es/CardTable/table/TableRoot.js +20 -18
  91. package/es/CardTable/table/TableWrapper.js +4 -0
  92. package/es/CardTable/toolbar/ToolBarBottom.js +8 -27
  93. package/es/Checkbox/style/{style.css → index.css} +0 -0
  94. package/es/Checkbox/style/index.js +1 -1
  95. package/es/CkFilter/style/{style.css → index.css} +0 -0
  96. package/es/CkFilter/style/index.js +1 -1
  97. package/es/CustomerService/style/{style.css → index.css} +0 -0
  98. package/es/CustomerService/style/index.js +1 -1
  99. package/es/Descriptions/style/index.css +10 -8
  100. package/es/EditTable/style/{style.css → index.css} +0 -0
  101. package/es/EditTable/style/index.js +1 -1
  102. package/es/EnlargeImg/style/{style.css → index.css} +0 -0
  103. package/es/EnlargeImg/style/index.js +1 -1
  104. package/es/Filter/style/{style.css → index.css} +0 -0
  105. package/es/Filter/style/index.js +1 -1
  106. package/es/IconFont/index.js +3 -2
  107. package/es/IconSelect/style/{style.css → index.css} +0 -0
  108. package/es/IconSelect/style/index.js +1 -1
  109. package/es/Input/style/{style.css → index.css} +0 -0
  110. package/es/Input/style/index.js +1 -1
  111. package/es/LeftTable/style/{style.css → index.css} +0 -0
  112. package/es/LeftTable/style/index.js +1 -1
  113. package/es/LmEditTable/style/{style.css → index.css} +0 -0
  114. package/es/LmEditTable/style/index.d.ts +1 -1
  115. package/es/LmEditTable/style/index.js +1 -1
  116. package/es/LmFilter/LmFilter.js +27 -0
  117. package/es/LmFilter/baseFilter/fuzzySearch.js +53 -0
  118. package/es/LmFilter/baseFilter/index.js +34 -0
  119. package/es/LmFilter/clearFilter/index.js +35 -0
  120. package/es/LmFilter/complexFilter/index.js +17 -0
  121. package/es/LmFilter/components/CascaderFilter.js +159 -0
  122. package/es/LmFilter/components/CheckboxFilter.js +197 -0
  123. package/es/LmFilter/components/DateFilter.js +139 -0
  124. package/es/LmFilter/components/DropdownFIlter.js +230 -0
  125. package/es/LmFilter/components/EmptyFilter.js +27 -0
  126. package/es/LmFilter/components/InputFilter.js +52 -0
  127. package/es/LmFilter/components/InputSearchClose.js +74 -0
  128. package/es/LmFilter/components/SelectFilter.js +113 -0
  129. package/es/LmFilter/components/index.js +140 -0
  130. package/es/LmFilter/customFilter/index.js +17 -0
  131. package/es/LmFilter/filterFns/index.js +54 -0
  132. package/es/LmFilter/hooks/index.js +18 -0
  133. package/es/LmFilter/hooks/useDelayedFn.js +29 -0
  134. package/es/LmFilter/icon_placeholder.png +0 -0
  135. package/es/LmFilter/index.js +16 -0
  136. package/es/LmFilter/style/index.js +3 -0
  137. package/es/LmFilter/style/style.css +205 -0
  138. package/es/LmFilter/utils.js +71 -0
  139. package/es/LmFilter/wrapper/Filter.js +33 -0
  140. package/es/LmFilter/wrapper/FilterContainer.js +29 -0
  141. package/es/LmFilter/wrapper/FilterRoot.js +120 -0
  142. package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
  143. package/es/LmTable/style/{style.css → index.css} +0 -0
  144. package/es/LmTable/style/index.js +1 -1
  145. package/es/OldModal/style/{style.css → index.css} +0 -0
  146. package/es/OldModal/style/index.js +1 -1
  147. package/es/PopTable/style/{style.css → index.css} +0 -0
  148. package/es/PopTable/style/index.js +1 -1
  149. package/es/ProTable/style/{style.css → index.css} +0 -0
  150. package/es/ProTable/style/index.js +1 -1
  151. package/es/QuickMenu/index.d.ts +14 -0
  152. package/es/QuickMenu/index.js +169 -0
  153. package/es/QuickMenu/style/index.css +560 -0
  154. package/es/QuickMenu/style/index.d.ts +1 -0
  155. package/es/QuickMenu/style/index.js +1 -0
  156. package/es/Radio/style/{style.css → index.css} +0 -0
  157. package/es/Radio/style/index.js +1 -1
  158. package/es/TableRender/style/{style.css → index.css} +0 -0
  159. package/es/TableRender/style/index.js +1 -1
  160. package/es/Tag/index.d.ts +4 -0
  161. package/es/Tag/index.js +48 -2
  162. package/es/Tag/style/index.css +4 -1
  163. package/es/Upload/index.d.ts +5 -1
  164. package/es/Upload/index.js +7 -2
  165. package/es/Upload/style/index.css +35 -0
  166. package/es/UploadOss/style/{style.css → index.css} +0 -0
  167. package/es/UploadOss/style/index.js +1 -1
  168. package/es/VirtualList/style/{style.css → index.css} +0 -0
  169. package/es/VirtualList/style/index.js +1 -1
  170. package/es/_util/domTarget.d.ts +7 -0
  171. package/es/_util/domTarget.js +20 -0
  172. package/es/_util/getDataOrAriaProps.d.ts +1 -0
  173. package/es/_util/getDataOrAriaProps.js +9 -0
  174. package/es/_util/reactNode.d.ts +7 -0
  175. package/es/_util/reactNode.js +10 -0
  176. package/es/_util/throttleByAnimationFrame.d.ts +8 -0
  177. package/es/_util/throttleByAnimationFrame.js +58 -0
  178. package/es/index.d.ts +2 -1
  179. package/es/index.js +3 -2
  180. package/es/message/hooks/useMessage.d.ts +7 -0
  181. package/es/message/hooks/useMessage.js +83 -0
  182. package/es/message/index.d.ts +63 -4
  183. package/es/message/index.js +241 -12
  184. package/es/message/style/index.css +28 -1
  185. package/es/notification/hooks/useNotification.d.ts +7 -0
  186. package/es/notification/hooks/useNotification.js +54 -0
  187. package/es/notification/index.d.ts +54 -0
  188. package/es/notification/index.js +342 -0
  189. package/es/notification/style/index.css +546 -0
  190. package/es/notification/style/index.d.ts +1 -0
  191. package/es/notification/style/index.js +1 -0
  192. package/lib/Affix/index.d.ts +54 -0
  193. package/lib/Affix/index.js +349 -0
  194. package/{es/Notification → lib/Affix}/style/index.css +0 -3
  195. package/lib/Affix/style/index.d.ts +1 -0
  196. package/lib/{Notification → Affix}/style/index.js +0 -0
  197. package/lib/Affix/utils.d.ts +15 -0
  198. package/lib/Affix/utils.js +104 -0
  199. package/lib/Alert/ErrorBoundary.d.ts +22 -0
  200. package/lib/Alert/ErrorBoundary.js +79 -0
  201. package/lib/Alert/index.d.ts +41 -0
  202. package/lib/Alert/index.js +215 -0
  203. package/lib/Alert/style/index.css +531 -0
  204. package/lib/Alert/style/index.d.ts +1 -0
  205. package/lib/Alert/style/index.js +3 -0
  206. package/lib/Button/style/{style.css → index.css} +0 -0
  207. package/lib/Button/style/index.d.ts +1 -1
  208. package/lib/Button/style/index.js +1 -1
  209. package/lib/ButtonTags/style/{style.css → index.css} +0 -0
  210. package/lib/ButtonTags/style/index.js +1 -1
  211. package/lib/CardTable/card/PictureTextColumn.js +8 -6
  212. package/lib/CardTable/card/PictureTextRow.js +1 -1
  213. package/lib/CardTable/fns/index.js +38 -8
  214. package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  215. package/lib/CardTable/pager/index.js +48 -0
  216. package/{es/CardTable/style/style.css → lib/CardTable/style/index.css} +2 -2
  217. package/lib/CardTable/style/index.js +1 -1
  218. package/lib/CardTable/table/TableRoot.js +20 -18
  219. package/lib/CardTable/table/TableWrapper.js +4 -0
  220. package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
  221. package/lib/Checkbox/style/{style.css → index.css} +0 -0
  222. package/lib/Checkbox/style/index.js +1 -1
  223. package/lib/CkFilter/style/{style.css → index.css} +0 -0
  224. package/lib/CkFilter/style/index.js +1 -1
  225. package/lib/CustomerService/style/{style.css → index.css} +0 -0
  226. package/lib/CustomerService/style/index.js +1 -1
  227. package/lib/Descriptions/style/index.css +10 -8
  228. package/lib/EditTable/style/{style.css → index.css} +0 -0
  229. package/lib/EditTable/style/index.js +1 -1
  230. package/lib/EnlargeImg/style/{style.css → index.css} +0 -0
  231. package/lib/EnlargeImg/style/index.js +1 -1
  232. package/lib/Filter/style/{style.css → index.css} +0 -0
  233. package/lib/Filter/style/index.js +1 -1
  234. package/lib/IconFont/index.js +3 -2
  235. package/lib/IconSelect/style/{style.css → index.css} +0 -0
  236. package/lib/IconSelect/style/index.js +1 -1
  237. package/lib/Input/style/{style.css → index.css} +0 -0
  238. package/lib/Input/style/index.js +1 -1
  239. package/lib/LeftTable/style/{style.css → index.css} +0 -0
  240. package/lib/LeftTable/style/index.js +1 -1
  241. package/lib/LmEditTable/style/{style.css → index.css} +0 -0
  242. package/lib/LmEditTable/style/index.d.ts +1 -1
  243. package/lib/LmEditTable/style/index.js +1 -1
  244. package/lib/LmFilter/LmFilter.js +27 -0
  245. package/lib/LmFilter/baseFilter/fuzzySearch.js +53 -0
  246. package/lib/LmFilter/baseFilter/index.js +34 -0
  247. package/lib/LmFilter/clearFilter/index.js +35 -0
  248. package/lib/LmFilter/complexFilter/index.js +17 -0
  249. package/lib/LmFilter/components/CascaderFilter.js +159 -0
  250. package/lib/LmFilter/components/CheckboxFilter.js +197 -0
  251. package/lib/LmFilter/components/DateFilter.js +139 -0
  252. package/lib/LmFilter/components/DropdownFIlter.js +230 -0
  253. package/lib/LmFilter/components/EmptyFilter.js +27 -0
  254. package/lib/LmFilter/components/InputFilter.js +52 -0
  255. package/lib/LmFilter/components/InputSearchClose.js +74 -0
  256. package/lib/LmFilter/components/SelectFilter.js +113 -0
  257. package/lib/LmFilter/components/index.js +140 -0
  258. package/lib/LmFilter/customFilter/index.js +17 -0
  259. package/lib/LmFilter/filterFns/index.js +54 -0
  260. package/lib/LmFilter/hooks/index.js +18 -0
  261. package/lib/LmFilter/hooks/useDelayedFn.js +29 -0
  262. package/lib/LmFilter/icon_placeholder.png +0 -0
  263. package/lib/LmFilter/index.js +16 -0
  264. package/lib/LmFilter/style/index.js +3 -0
  265. package/lib/LmFilter/style/style.css +205 -0
  266. package/lib/LmFilter/utils.js +71 -0
  267. package/lib/LmFilter/wrapper/Filter.js +33 -0
  268. package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
  269. package/lib/LmFilter/wrapper/FilterRoot.js +120 -0
  270. package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
  271. package/lib/LmTable/style/{style.css → index.css} +0 -0
  272. package/lib/LmTable/style/index.js +1 -1
  273. package/lib/OldModal/style/{style.css → index.css} +0 -0
  274. package/lib/OldModal/style/index.js +1 -1
  275. package/lib/PopTable/style/{style.css → index.css} +0 -0
  276. package/lib/PopTable/style/index.js +1 -1
  277. package/lib/ProTable/style/{style.css → index.css} +0 -0
  278. package/lib/ProTable/style/index.js +1 -1
  279. package/lib/QuickMenu/index.d.ts +14 -0
  280. package/lib/QuickMenu/index.js +187 -0
  281. package/lib/QuickMenu/style/index.css +560 -0
  282. package/lib/QuickMenu/style/index.d.ts +1 -0
  283. package/lib/QuickMenu/style/index.js +3 -0
  284. package/lib/Radio/style/{style.css → index.css} +0 -0
  285. package/lib/Radio/style/index.js +1 -1
  286. package/lib/TableRender/style/{style.css → index.css} +0 -0
  287. package/lib/TableRender/style/index.js +1 -1
  288. package/lib/Tag/index.d.ts +4 -0
  289. package/lib/Tag/index.js +48 -1
  290. package/lib/Tag/style/index.css +4 -1
  291. package/lib/Upload/index.d.ts +5 -1
  292. package/lib/Upload/index.js +8 -2
  293. package/lib/Upload/style/index.css +35 -0
  294. package/lib/UploadOss/style/{style.css → index.css} +0 -0
  295. package/lib/UploadOss/style/index.js +1 -1
  296. package/lib/VirtualList/style/{style.css → index.css} +0 -0
  297. package/lib/VirtualList/style/index.js +1 -1
  298. package/lib/_util/domTarget.d.ts +7 -0
  299. package/lib/_util/domTarget.js +31 -0
  300. package/lib/_util/getDataOrAriaProps.d.ts +1 -0
  301. package/lib/_util/getDataOrAriaProps.js +16 -0
  302. package/lib/_util/reactNode.d.ts +7 -0
  303. package/lib/_util/reactNode.js +24 -0
  304. package/lib/_util/throttleByAnimationFrame.d.ts +8 -0
  305. package/lib/_util/throttleByAnimationFrame.js +72 -0
  306. package/lib/index.d.ts +2 -1
  307. package/lib/index.js +11 -3
  308. package/lib/message/hooks/useMessage.d.ts +7 -0
  309. package/lib/message/hooks/useMessage.js +101 -0
  310. package/lib/message/index.d.ts +63 -4
  311. package/lib/message/index.js +262 -16
  312. package/lib/message/style/index.css +28 -1
  313. package/lib/notification/hooks/useNotification.d.ts +7 -0
  314. package/lib/notification/hooks/useNotification.js +69 -0
  315. package/lib/notification/index.d.ts +54 -0
  316. package/lib/notification/index.js +365 -0
  317. package/lib/notification/style/index.css +546 -0
  318. package/lib/notification/style/index.d.ts +1 -0
  319. package/lib/notification/style/index.js +3 -0
  320. package/package.json +5 -2
  321. package/dist/Notification/index.d.ts +0 -7
  322. package/es/Notification/index.d.ts +0 -7
  323. package/es/Notification/index.js +0 -10
  324. package/lib/Notification/index.d.ts +0 -7
  325. package/lib/Notification/index.js +0 -23
@@ -1,12 +1,241 @@
1
- import "antd/es/message/style";
2
- import _message from "antd/es/message";
3
- // const prefixCls = 'lm_message'
4
- // const LMMessage: React.FC<IMessageProps> = (props) => {
5
- // const { children, className, ...others } = props
6
- // return (
7
- // <div className={classNames(className, prefixCls)} {...others}>
8
- // {children}
9
- // </div>
10
- // )
11
- // }
12
- export default _message;
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import { CheckCircleFilled, CloseCircleFilled, ExclamationCircleFilled, InfoCircleFilled, LoadingOutlined } from '@ant-design/icons';
3
+ import classNames from 'classnames';
4
+ import RCNotification from 'rc-notification';
5
+ import React from 'react';
6
+ import ConfigProvider, { globalConfig } from 'antd/es/config-provider';
7
+ import createUseMessage from './hooks/useMessage';
8
+ var messageInstance;
9
+ var defaultDuration = 3;
10
+ var defaultTop;
11
+ var key = 1;
12
+ var localPrefixCls = '';
13
+ var transitionName = 'move-up';
14
+ var hasTransitionName = false;
15
+ var getContainer;
16
+ var maxCount;
17
+ var rtl = false;
18
+ export function getKeyThenIncreaseKey() {
19
+ return key++;
20
+ }
21
+
22
+ function setMessageConfig(options) {
23
+ if (options.top !== undefined) {
24
+ defaultTop = options.top;
25
+ messageInstance = null; // delete messageInstance for new defaultTop
26
+ }
27
+
28
+ if (options.duration !== undefined) {
29
+ defaultDuration = options.duration;
30
+ }
31
+
32
+ if (options.prefixCls !== undefined) {
33
+ localPrefixCls = options.prefixCls;
34
+ }
35
+
36
+ if (options.getContainer !== undefined) {
37
+ getContainer = options.getContainer;
38
+ messageInstance = null; // delete messageInstance for new getContainer
39
+ }
40
+
41
+ if (options.transitionName !== undefined) {
42
+ transitionName = options.transitionName;
43
+ messageInstance = null; // delete messageInstance for new transitionName
44
+
45
+ hasTransitionName = true;
46
+ }
47
+
48
+ if (options.maxCount !== undefined) {
49
+ maxCount = options.maxCount;
50
+ messageInstance = null;
51
+ }
52
+
53
+ if (options.rtl !== undefined) {
54
+ rtl = options.rtl;
55
+ }
56
+ }
57
+
58
+ function getRCNotificationInstance(args, callback) {
59
+ var customizePrefixCls = args.prefixCls,
60
+ getContextPopupContainer = args.getPopupContainer;
61
+
62
+ var _globalConfig = globalConfig(),
63
+ getPrefixCls = _globalConfig.getPrefixCls,
64
+ getRootPrefixCls = _globalConfig.getRootPrefixCls,
65
+ getIconPrefixCls = _globalConfig.getIconPrefixCls;
66
+
67
+ var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);
68
+ var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);
69
+ var iconPrefixCls = getIconPrefixCls();
70
+
71
+ if (messageInstance) {
72
+ callback({
73
+ prefixCls: prefixCls,
74
+ rootPrefixCls: rootPrefixCls,
75
+ iconPrefixCls: iconPrefixCls,
76
+ instance: messageInstance
77
+ });
78
+ return;
79
+ }
80
+
81
+ var instanceConfig = {
82
+ prefixCls: prefixCls,
83
+ transitionName: hasTransitionName ? transitionName : "".concat(rootPrefixCls, "-").concat(transitionName),
84
+ style: {
85
+ top: defaultTop
86
+ },
87
+ getContainer: getContainer || getContextPopupContainer,
88
+ maxCount: maxCount
89
+ };
90
+ RCNotification.newInstance(instanceConfig, function (instance) {
91
+ if (messageInstance) {
92
+ callback({
93
+ prefixCls: prefixCls,
94
+ rootPrefixCls: rootPrefixCls,
95
+ iconPrefixCls: iconPrefixCls,
96
+ instance: messageInstance
97
+ });
98
+ return;
99
+ }
100
+
101
+ messageInstance = instance;
102
+
103
+ if (process.env.NODE_ENV === 'test') {
104
+ messageInstance.config = instanceConfig;
105
+ }
106
+
107
+ callback({
108
+ prefixCls: prefixCls,
109
+ rootPrefixCls: rootPrefixCls,
110
+ iconPrefixCls: iconPrefixCls,
111
+ instance: instance
112
+ });
113
+ });
114
+ }
115
+
116
+ var typeToIcon = {
117
+ info: InfoCircleFilled,
118
+ success: CheckCircleFilled,
119
+ error: CloseCircleFilled,
120
+ warning: ExclamationCircleFilled,
121
+ loading: LoadingOutlined
122
+ };
123
+ export var typeList = Object.keys(typeToIcon);
124
+
125
+ function getRCNoticeProps(args, prefixCls, iconPrefixCls) {
126
+ var _classNames;
127
+
128
+ var duration = args.duration !== undefined ? args.duration : defaultDuration;
129
+ var progress = args.progress === false ? false : true;
130
+ var IconComponent = typeToIcon[args.type];
131
+ var messageClass = classNames("".concat(prefixCls, "-custom-content"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-").concat(args.type), args.type), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), rtl === true), _classNames));
132
+ return {
133
+ key: args.key,
134
+ duration: duration,
135
+ style: args.style || {},
136
+ className: classNames(args.className, 'lm_message'),
137
+ content: /*#__PURE__*/React.createElement(ConfigProvider, {
138
+ iconPrefixCls: iconPrefixCls
139
+ }, /*#__PURE__*/React.createElement("div", {
140
+ className: messageClass
141
+ }, args.icon || IconComponent && /*#__PURE__*/React.createElement(IconComponent, null), /*#__PURE__*/React.createElement("span", null, args.content), progress && duration > 0 && /*#__PURE__*/React.createElement("div", {
142
+ className: 'message_progress',
143
+ style: {
144
+ animationDuration: "".concat(duration, "s")
145
+ }
146
+ }))),
147
+ onClose: args.onClose,
148
+ onClick: args.onClick
149
+ };
150
+ }
151
+
152
+ function notice(args) {
153
+ var target = args.key || getKeyThenIncreaseKey();
154
+ var closePromise = new Promise(function (resolve) {
155
+ var callback = function callback() {
156
+ if (typeof args.onClose === 'function') {
157
+ args.onClose();
158
+ }
159
+
160
+ return resolve(true);
161
+ };
162
+
163
+ getRCNotificationInstance(args, function (_ref) {
164
+ var prefixCls = _ref.prefixCls,
165
+ iconPrefixCls = _ref.iconPrefixCls,
166
+ instance = _ref.instance;
167
+ instance.notice(getRCNoticeProps(Object.assign(Object.assign({}, args), {
168
+ key: target,
169
+ onClose: callback
170
+ }), prefixCls, iconPrefixCls));
171
+ });
172
+ });
173
+
174
+ var result = function result() {
175
+ if (messageInstance) {
176
+ messageInstance.removeNotice(target);
177
+ }
178
+ };
179
+
180
+ result.then = function (filled, rejected) {
181
+ return closePromise.then(filled, rejected);
182
+ };
183
+
184
+ result.promise = closePromise;
185
+ return result;
186
+ }
187
+
188
+ function isArgsProps(content) {
189
+ return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;
190
+ }
191
+
192
+ var api = {
193
+ open: notice,
194
+ config: setMessageConfig,
195
+ destroy: function destroy(messageKey) {
196
+ if (messageInstance) {
197
+ if (messageKey) {
198
+ var _messageInstance = messageInstance,
199
+ removeNotice = _messageInstance.removeNotice;
200
+ removeNotice(messageKey);
201
+ } else {
202
+ var _messageInstance2 = messageInstance,
203
+ destroy = _messageInstance2.destroy;
204
+ destroy();
205
+ messageInstance = null;
206
+ }
207
+ }
208
+ }
209
+ };
210
+ export function attachTypeApi(originalApi, type) {
211
+ originalApi[type] = function (content, duration, onClose) {
212
+ if (isArgsProps(content)) {
213
+ return originalApi.open(Object.assign(Object.assign({}, content), {
214
+ type: type
215
+ }));
216
+ }
217
+
218
+ if (typeof duration === 'function') {
219
+ onClose = duration;
220
+ duration = undefined;
221
+ }
222
+
223
+ return originalApi.open({
224
+ content: content,
225
+ duration: duration,
226
+ type: type,
227
+ onClose: onClose
228
+ });
229
+ };
230
+ }
231
+ typeList.forEach(function (type) {
232
+ return attachTypeApi(api, type);
233
+ });
234
+ api.warn = api.warning;
235
+ api.useMessage = createUseMessage(getRCNotificationInstance, getRCNoticeProps);
236
+ /** @private test Only function. Not work on production */
237
+
238
+ export var getInstance = function getInstance() {
239
+ return process.env.NODE_ENV === 'test' ? messageInstance : null;
240
+ };
241
+ export default api;
@@ -503,7 +503,34 @@ html {
503
503
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
504
  opacity: 1;
505
505
  }
506
- .ant-message .ant-message-notice-content {
506
+ .lm_message .ant-message-notice-content {
507
+ position: relative;
507
508
  padding: 8px 16px;
508
509
  font-size: 12px;
509
510
  }
511
+ .lm_message .message_progress {
512
+ position: absolute;
513
+ width: 100%;
514
+ height: 2px;
515
+ background-color: #52C41A;
516
+ left: 0;
517
+ bottom: 0;
518
+ animation-name: Progress;
519
+ animation-iteration-count: 1;
520
+ animation-fill-mode: forwards;
521
+ transition: width 0.2s;
522
+ animation-timing-function: linear;
523
+ }
524
+ .lm_message:hover .message_progress {
525
+ width: 100%;
526
+ animation-name: none;
527
+ animation-play-state: paused;
528
+ }
529
+ @keyframes Progress {
530
+ from {
531
+ width: 100%;
532
+ }
533
+ to {
534
+ width: 0;
535
+ }
536
+ }
@@ -0,0 +1,7 @@
1
+ import type { NoticeContent as RCNoticeContent, NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification';
2
+ import * as React from 'react';
3
+ import type { ArgsProps, NotificationInstance } from '..';
4
+ export default function createUseNotification(getNotificationInstance: (args: ArgsProps, callback: (info: {
5
+ prefixCls: string;
6
+ instance: RCNotificationInstance;
7
+ }) => void) => void, getRCNoticeProps: (args: ArgsProps, prefixCls: string) => RCNoticeContent): () => [NotificationInstance, React.ReactElement];
@@ -0,0 +1,54 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import useRCNotification from 'rc-notification/lib/useNotification';
3
+ import * as React from 'react';
4
+ import { ConfigConsumer } from 'antd/es/config-provider';
5
+ export default function createUseNotification(getNotificationInstance, getRCNoticeProps) {
6
+ var useNotification = function useNotification() {
7
+ // We can only get content by render
8
+ var getPrefixCls; // We create a proxy to handle delay created instance
9
+
10
+ var innerInstance = null;
11
+ var proxy = {
12
+ add: function add(noticeProps, holderCallback) {
13
+ innerInstance === null || innerInstance === void 0 ? void 0 : innerInstance.component.add(noticeProps, holderCallback);
14
+ }
15
+ };
16
+
17
+ var _useRCNotification = useRCNotification(proxy),
18
+ _useRCNotification2 = _slicedToArray(_useRCNotification, 2),
19
+ hookNotify = _useRCNotification2[0],
20
+ holder = _useRCNotification2[1];
21
+
22
+ function notify(args) {
23
+ var customizePrefixCls = args.prefixCls;
24
+ var mergedPrefixCls = getPrefixCls('notification', customizePrefixCls);
25
+ getNotificationInstance(Object.assign(Object.assign({}, args), {
26
+ prefixCls: mergedPrefixCls
27
+ }), function (_ref) {
28
+ var prefixCls = _ref.prefixCls,
29
+ instance = _ref.instance;
30
+ innerInstance = instance;
31
+ hookNotify(getRCNoticeProps(args, prefixCls));
32
+ });
33
+ } // Fill functions
34
+
35
+
36
+ var hookApiRef = React.useRef({});
37
+ hookApiRef.current.open = notify;
38
+ ['success', 'info', 'warning', 'error'].forEach(function (type) {
39
+ hookApiRef.current[type] = function (args) {
40
+ return hookApiRef.current.open(Object.assign(Object.assign({}, args), {
41
+ type: type
42
+ }));
43
+ };
44
+ });
45
+ return [hookApiRef.current, /*#__PURE__*/React.createElement(ConfigConsumer, {
46
+ key: "holder"
47
+ }, function (context) {
48
+ getPrefixCls = context.getPrefixCls;
49
+ return holder;
50
+ })];
51
+ };
52
+
53
+ return useNotification;
54
+ }
@@ -0,0 +1,54 @@
1
+ import type { NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification';
2
+ import * as React from 'react';
3
+ export declare type NotificationPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
4
+ export declare type IconType = 'success' | 'info' | 'error' | 'warning';
5
+ export interface ConfigProps {
6
+ top?: number;
7
+ bottom?: number;
8
+ duration?: number;
9
+ prefixCls?: string;
10
+ placement?: NotificationPlacement;
11
+ getContainer?: () => HTMLElement;
12
+ closeIcon?: React.ReactNode;
13
+ rtl?: boolean;
14
+ maxCount?: number;
15
+ }
16
+ export interface ArgsProps {
17
+ message: React.ReactNode;
18
+ description?: React.ReactNode;
19
+ btn?: React.ReactNode;
20
+ key?: string;
21
+ onClose?: () => void;
22
+ duration?: number | null;
23
+ icon?: React.ReactNode;
24
+ placement?: NotificationPlacement;
25
+ maxCount?: number;
26
+ style?: React.CSSProperties;
27
+ prefixCls?: string;
28
+ className?: string;
29
+ readonly type?: IconType;
30
+ onClick?: () => void;
31
+ top?: number;
32
+ bottom?: number;
33
+ getContainer?: () => HTMLElement;
34
+ closeIcon?: React.ReactNode;
35
+ progress?: boolean;
36
+ }
37
+ export interface NotificationInstance {
38
+ success(args: ArgsProps): void;
39
+ error(args: ArgsProps): void;
40
+ info(args: ArgsProps): void;
41
+ warning(args: ArgsProps): void;
42
+ open(args: ArgsProps): void;
43
+ }
44
+ export interface NotificationApi extends NotificationInstance {
45
+ warn(args: ArgsProps): void;
46
+ close(key: string): void;
47
+ config(options: ConfigProps): void;
48
+ destroy(): void;
49
+ useNotification: () => [NotificationInstance, React.ReactElement];
50
+ }
51
+ /** @private test Only function. Not work on production */
52
+ export declare const getInstance: (cacheKey: string) => Promise<RCNotificationInstance>;
53
+ declare const _default: NotificationApi;
54
+ export default _default;