linkmore-design 1.0.53 → 1.0.56

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 (257) 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/CardTable/card/PictureTextRowOperate.d.ts +7 -0
  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/LmFilter/Controls/CheckboxTags.d.ts +6 -0
  16. package/dist/LmFilter/Controls/index.d.ts +2 -0
  17. package/dist/LmFilter/LmFilter.d.ts +6 -0
  18. package/dist/LmFilter/baseFilter/fuzzySearch.d.ts +4 -0
  19. package/dist/LmFilter/baseFilter/index.d.ts +3 -0
  20. package/dist/LmFilter/clearFilter/index.d.ts +3 -0
  21. package/dist/LmFilter/complexFilter/drawer.d.ts +4 -0
  22. package/dist/LmFilter/complexFilter/index.d.ts +4 -0
  23. package/dist/LmFilter/complexFilter/valueDrawer.d.ts +4 -0
  24. package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
  25. package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
  26. package/dist/LmFilter/components/DateFilter.d.ts +5 -0
  27. package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
  28. package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
  29. package/dist/LmFilter/components/InputFilter.d.ts +4 -0
  30. package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
  31. package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
  32. package/dist/LmFilter/components/index.d.ts +3 -0
  33. package/dist/LmFilter/customFilter/index.d.ts +2 -0
  34. package/dist/LmFilter/demos/basic.d.ts +2 -0
  35. package/dist/LmFilter/filterFns/index.d.ts +12 -0
  36. package/dist/LmFilter/hooks/index.d.ts +1 -0
  37. package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
  38. package/dist/LmFilter/index.d.ts +2 -0
  39. package/dist/LmFilter/localization.d.ts +8 -0
  40. package/dist/LmFilter/style/index.d.ts +1 -0
  41. package/dist/LmFilter/utils.d.ts +9 -0
  42. package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
  43. package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
  44. package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
  45. package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
  46. package/dist/QuickMenu/demos/basic.d.ts +2 -0
  47. package/dist/QuickMenu/index.d.ts +14 -0
  48. package/dist/QuickMenu/style/index.d.ts +1 -0
  49. package/dist/Switch/demos/table.d.ts +2 -0
  50. package/dist/Switch/index.d.ts +2 -1
  51. package/dist/Tag/demos/ExigencyTag.d.ts +2 -0
  52. package/dist/Tag/index.d.ts +4 -0
  53. package/dist/Upload/demos/picture-little.d.ts +3 -0
  54. package/dist/Upload/index.d.ts +5 -1
  55. package/dist/_util/domTarget.d.ts +7 -0
  56. package/dist/_util/getDataOrAriaProps.d.ts +1 -0
  57. package/dist/_util/reactNode.d.ts +7 -0
  58. package/dist/_util/throttleByAnimationFrame.d.ts +8 -0
  59. package/dist/index.d.ts +2 -1
  60. package/dist/index.umd.js +4245 -3326
  61. package/dist/index.umd.min.js +5 -5
  62. package/dist/notification/demos/basic.d.ts +2 -0
  63. package/dist/notification/demos/button.d.ts +2 -0
  64. package/dist/notification/demos/icon.d.ts +2 -0
  65. package/dist/notification/hooks/useNotification.d.ts +7 -0
  66. package/dist/notification/index.d.ts +54 -0
  67. package/dist/notification/style/index.d.ts +1 -0
  68. package/es/Affix/index.d.ts +54 -0
  69. package/es/Affix/index.js +326 -0
  70. package/es/{Notification → Affix}/style/index.css +0 -3
  71. package/es/{Notification → Affix}/style/index.d.ts +0 -0
  72. package/es/{Notification → Affix}/style/index.js +0 -0
  73. package/es/Affix/utils.d.ts +15 -0
  74. package/es/Affix/utils.js +83 -0
  75. package/es/Alert/ErrorBoundary.d.ts +22 -0
  76. package/es/Alert/ErrorBoundary.js +65 -0
  77. package/es/Alert/index.d.ts +41 -0
  78. package/es/Alert/index.js +192 -0
  79. package/es/Alert/style/index.css +531 -0
  80. package/{lib/Notification → es/Alert}/style/index.d.ts +0 -0
  81. package/es/Alert/style/index.js +1 -0
  82. package/es/CardTable/body/TableBodyCell.js +3 -0
  83. package/es/CardTable/card/PictureTextColumn.js +8 -6
  84. package/es/CardTable/card/PictureTextRow.js +14 -51
  85. package/es/CardTable/card/PictureTextRowOperate.js +130 -0
  86. package/es/CardTable/fns/index.js +38 -8
  87. package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  88. package/es/CardTable/pager/index.js +48 -0
  89. package/es/CardTable/style/index.css +160 -12
  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/Descriptions/style/index.css +10 -8
  94. package/es/IconFont/index.js +3 -2
  95. package/es/LmFilter/Controls/CheckboxTags.js +53 -0
  96. package/es/LmFilter/Controls/index.js +47 -0
  97. package/es/LmFilter/LmFilter.js +39 -0
  98. package/es/LmFilter/baseFilter/fuzzySearch.js +53 -0
  99. package/es/LmFilter/baseFilter/index.js +34 -0
  100. package/es/LmFilter/clearFilter/index.js +35 -0
  101. package/es/LmFilter/complexFilter/drawer.js +376 -0
  102. package/es/LmFilter/complexFilter/index.js +64 -0
  103. package/es/LmFilter/complexFilter/valueDrawer.js +238 -0
  104. package/es/LmFilter/components/CascaderFilter.js +159 -0
  105. package/es/LmFilter/components/CheckboxFilter.js +197 -0
  106. package/es/LmFilter/components/DateFilter.js +139 -0
  107. package/es/LmFilter/components/DropdownFIlter.js +229 -0
  108. package/es/LmFilter/components/EmptyFilter.js +27 -0
  109. package/es/LmFilter/components/InputFilter.js +52 -0
  110. package/es/LmFilter/components/InputSearchClose.js +74 -0
  111. package/es/LmFilter/components/SelectFilter.js +113 -0
  112. package/es/LmFilter/components/index.js +140 -0
  113. package/es/LmFilter/customFilter/index.js +17 -0
  114. package/es/LmFilter/filterFns/index.js +73 -0
  115. package/es/LmFilter/hooks/index.js +18 -0
  116. package/es/LmFilter/hooks/useDelayedFn.js +29 -0
  117. package/es/LmFilter/icon_placeholder.png +0 -0
  118. package/es/LmFilter/index.js +16 -0
  119. package/es/LmFilter/localization.d.ts +8 -0
  120. package/es/LmFilter/localization.js +12 -0
  121. package/es/LmFilter/style/index.js +3 -0
  122. package/es/LmFilter/style/style.css +212 -0
  123. package/es/LmFilter/utils.js +71 -0
  124. package/es/LmFilter/wrapper/Filter.js +33 -0
  125. package/es/LmFilter/wrapper/FilterContainer.js +29 -0
  126. package/es/LmFilter/wrapper/FilterRoot.js +170 -0
  127. package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
  128. package/es/QuickMenu/index.d.ts +14 -0
  129. package/es/QuickMenu/index.js +169 -0
  130. package/es/QuickMenu/style/index.css +560 -0
  131. package/es/QuickMenu/style/index.d.ts +1 -0
  132. package/es/QuickMenu/style/index.js +1 -0
  133. package/es/Switch/index.d.ts +2 -1
  134. package/es/Switch/index.js +33 -1
  135. package/es/Switch/style/index.css +41 -0
  136. package/es/Tag/index.d.ts +4 -0
  137. package/es/Tag/index.js +48 -2
  138. package/es/Tag/style/index.css +4 -1
  139. package/es/Upload/index.d.ts +5 -1
  140. package/es/Upload/index.js +7 -2
  141. package/es/Upload/style/index.css +35 -0
  142. package/es/_util/domTarget.d.ts +7 -0
  143. package/es/_util/domTarget.js +20 -0
  144. package/es/_util/getDataOrAriaProps.d.ts +1 -0
  145. package/es/_util/getDataOrAriaProps.js +9 -0
  146. package/es/_util/reactNode.d.ts +7 -0
  147. package/es/_util/reactNode.js +10 -0
  148. package/es/_util/throttleByAnimationFrame.d.ts +8 -0
  149. package/es/_util/throttleByAnimationFrame.js +58 -0
  150. package/es/index.d.ts +2 -1
  151. package/es/index.js +3 -2
  152. package/es/message/style/index.css +1 -0
  153. package/es/notification/hooks/useNotification.d.ts +7 -0
  154. package/es/notification/hooks/useNotification.js +54 -0
  155. package/es/notification/index.d.ts +54 -0
  156. package/es/notification/index.js +342 -0
  157. package/es/notification/style/index.css +546 -0
  158. package/es/notification/style/index.d.ts +1 -0
  159. package/es/notification/style/index.js +1 -0
  160. package/lib/Affix/index.d.ts +54 -0
  161. package/lib/Affix/index.js +349 -0
  162. package/lib/{Notification → Affix}/style/index.css +0 -3
  163. package/lib/Affix/style/index.d.ts +1 -0
  164. package/lib/{Notification → Affix}/style/index.js +0 -0
  165. package/lib/Affix/utils.d.ts +15 -0
  166. package/lib/Affix/utils.js +104 -0
  167. package/lib/Alert/ErrorBoundary.d.ts +22 -0
  168. package/lib/Alert/ErrorBoundary.js +79 -0
  169. package/lib/Alert/index.d.ts +41 -0
  170. package/lib/Alert/index.js +215 -0
  171. package/lib/Alert/style/index.css +531 -0
  172. package/lib/Alert/style/index.d.ts +1 -0
  173. package/lib/Alert/style/index.js +3 -0
  174. package/lib/CardTable/body/TableBodyCell.js +3 -0
  175. package/lib/CardTable/card/PictureTextColumn.js +8 -6
  176. package/lib/CardTable/card/PictureTextRow.js +14 -51
  177. package/lib/CardTable/card/PictureTextRowOperate.js +130 -0
  178. package/lib/CardTable/fns/index.js +38 -8
  179. package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
  180. package/lib/CardTable/pager/index.js +48 -0
  181. package/lib/CardTable/style/index.css +160 -12
  182. package/lib/CardTable/table/TableRoot.js +20 -18
  183. package/lib/CardTable/table/TableWrapper.js +4 -0
  184. package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
  185. package/lib/Descriptions/style/index.css +10 -8
  186. package/lib/IconFont/index.js +3 -2
  187. package/lib/LmFilter/Controls/CheckboxTags.js +53 -0
  188. package/lib/LmFilter/Controls/index.js +47 -0
  189. package/lib/LmFilter/LmFilter.js +39 -0
  190. package/lib/LmFilter/baseFilter/fuzzySearch.js +53 -0
  191. package/lib/LmFilter/baseFilter/index.js +34 -0
  192. package/lib/LmFilter/clearFilter/index.js +35 -0
  193. package/lib/LmFilter/complexFilter/drawer.js +376 -0
  194. package/lib/LmFilter/complexFilter/index.js +64 -0
  195. package/lib/LmFilter/complexFilter/valueDrawer.js +238 -0
  196. package/lib/LmFilter/components/CascaderFilter.js +159 -0
  197. package/lib/LmFilter/components/CheckboxFilter.js +197 -0
  198. package/lib/LmFilter/components/DateFilter.js +139 -0
  199. package/lib/LmFilter/components/DropdownFIlter.js +229 -0
  200. package/lib/LmFilter/components/EmptyFilter.js +27 -0
  201. package/lib/LmFilter/components/InputFilter.js +52 -0
  202. package/lib/LmFilter/components/InputSearchClose.js +74 -0
  203. package/lib/LmFilter/components/SelectFilter.js +113 -0
  204. package/lib/LmFilter/components/index.js +140 -0
  205. package/lib/LmFilter/customFilter/index.js +17 -0
  206. package/lib/LmFilter/filterFns/index.js +73 -0
  207. package/lib/LmFilter/hooks/index.js +18 -0
  208. package/lib/LmFilter/hooks/useDelayedFn.js +29 -0
  209. package/lib/LmFilter/icon_placeholder.png +0 -0
  210. package/lib/LmFilter/index.js +16 -0
  211. package/lib/LmFilter/localization.d.ts +8 -0
  212. package/lib/LmFilter/localization.js +19 -0
  213. package/lib/LmFilter/style/index.js +3 -0
  214. package/lib/LmFilter/style/style.css +212 -0
  215. package/lib/LmFilter/utils.js +71 -0
  216. package/lib/LmFilter/wrapper/Filter.js +33 -0
  217. package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
  218. package/lib/LmFilter/wrapper/FilterRoot.js +170 -0
  219. package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
  220. package/lib/QuickMenu/index.d.ts +14 -0
  221. package/lib/QuickMenu/index.js +187 -0
  222. package/lib/QuickMenu/style/index.css +560 -0
  223. package/lib/QuickMenu/style/index.d.ts +1 -0
  224. package/lib/QuickMenu/style/index.js +3 -0
  225. package/lib/Switch/index.d.ts +2 -1
  226. package/lib/Switch/index.js +34 -1
  227. package/lib/Switch/style/index.css +41 -0
  228. package/lib/Tag/index.d.ts +4 -0
  229. package/lib/Tag/index.js +48 -1
  230. package/lib/Tag/style/index.css +4 -1
  231. package/lib/Upload/index.d.ts +5 -1
  232. package/lib/Upload/index.js +8 -2
  233. package/lib/Upload/style/index.css +35 -0
  234. package/lib/_util/domTarget.d.ts +7 -0
  235. package/lib/_util/domTarget.js +31 -0
  236. package/lib/_util/getDataOrAriaProps.d.ts +1 -0
  237. package/lib/_util/getDataOrAriaProps.js +16 -0
  238. package/lib/_util/reactNode.d.ts +7 -0
  239. package/lib/_util/reactNode.js +24 -0
  240. package/lib/_util/throttleByAnimationFrame.d.ts +8 -0
  241. package/lib/_util/throttleByAnimationFrame.js +72 -0
  242. package/lib/index.d.ts +2 -1
  243. package/lib/index.js +11 -3
  244. package/lib/message/style/index.css +1 -0
  245. package/lib/notification/hooks/useNotification.d.ts +7 -0
  246. package/lib/notification/hooks/useNotification.js +69 -0
  247. package/lib/notification/index.d.ts +54 -0
  248. package/lib/notification/index.js +365 -0
  249. package/lib/notification/style/index.css +546 -0
  250. package/lib/notification/style/index.d.ts +1 -0
  251. package/lib/notification/style/index.js +3 -0
  252. package/package.json +5 -2
  253. package/dist/Notification/index.d.ts +0 -7
  254. package/es/Notification/index.d.ts +0 -7
  255. package/es/Notification/index.js +0 -10
  256. package/lib/Notification/index.d.ts +0 -7
  257. package/lib/Notification/index.js +0 -23
package/es/Tag/index.js CHANGED
@@ -14,7 +14,9 @@ var __rest = this && this.__rest || function (s, e) {
14
14
  return t;
15
15
  };
16
16
 
17
- import React, { forwardRef } from 'react';
17
+ import React, { forwardRef, useMemo, useRef } from 'react';
18
+ import hexToRgba from 'hex-to-rgba';
19
+ var CheckableTag = _Tag.CheckableTag;
18
20
  import classNames from 'classnames';
19
21
  export var PresetColorTypes = ['pink', 'red', 'yellow', 'orange', 'cyan', 'green', 'blue', 'purple', 'geekblue', 'magenta', 'volcano', 'gold', 'lime', 'theme'];
20
22
  var prefixCls = 'lm_tag';
@@ -32,5 +34,49 @@ var LmTag = /*#__PURE__*/forwardRef(function (props, ref) {
32
34
  }, className, PresetColorTypes.includes(color) && "lm_tag_main_color lm_tag_main_".concat(color))
33
35
  }));
34
36
  });
35
- LmTag.CheckableTag = _Tag.CheckableTag;
37
+ var checkPreFixCls = 'lm_check_tag';
38
+
39
+ LmTag.CheckableTag = function (props) {
40
+ var className = props.className,
41
+ color = props.color,
42
+ checked = props.checked,
43
+ rest = __rest(props, ["className", "color", "checked"]);
44
+
45
+ var checkTagRef = useRef(null);
46
+ var colorProps = useMemo(function () {
47
+ if (color) {
48
+ try {
49
+ return {
50
+ style: {
51
+ color: checked ? '#fff' : hexToRgba(color),
52
+ background: checked ? color : hexToRgba(color, 0.15)
53
+ },
54
+ onMouseEnter: function onMouseEnter() {
55
+ checkTagRef.current.firstChild.style.background = checked ? color : hexToRgba(color, 0.25);
56
+ },
57
+ onMouseLeave: function onMouseLeave() {
58
+ checkTagRef.current.firstChild.style.background = checked ? color : hexToRgba(color, 0.15);
59
+ }
60
+ };
61
+ } catch (_a) {
62
+ return {
63
+ style: {
64
+ color: hexToRgba(color),
65
+ background: hexToRgba(color, 0.15)
66
+ }
67
+ };
68
+ }
69
+ } else {
70
+ return {};
71
+ }
72
+ }, [color, checked]);
73
+ return /*#__PURE__*/React.createElement("span", {
74
+ ref: checkTagRef
75
+ }, /*#__PURE__*/React.createElement(CheckableTag, Object.assign({}, rest, {
76
+ checked: checked
77
+ }, colorProps, {
78
+ className: classNames(checkPreFixCls, className, color && 'lm_custom_color_tag')
79
+ })));
80
+ };
81
+
36
82
  export default LmTag;
@@ -513,8 +513,8 @@ html {
513
513
  margin-left: 6px;
514
514
  }
515
515
  .lm_tag.ant-tag.lm_tag_main_theme {
516
- background: var(--tree-select-bg);
517
516
  color: var(--primary-color);
517
+ background: var(--tree-select-bg);
518
518
  }
519
519
  .lm_tag.lm_tag_noborder {
520
520
  border-color: transparent;
@@ -564,3 +564,6 @@ html {
564
564
  .ant-tag-checkable.ant-tag-checkable-checked {
565
565
  background-color: var(--primary-color);
566
566
  }
567
+ .lm_check_tag.lm_custom_color_tag.ant-tag-checkable-checked {
568
+ color: #fff !important;
569
+ }
@@ -5,5 +5,9 @@ import type { RcFile as AntdRcFile } from 'antd/es/upload';
5
5
  export declare type UploadProps = AntdUploadProps;
6
6
  export declare type UploadFile = AntdUploadFile;
7
7
  export declare type RcFile = AntdRcFile;
8
- declare const LMUpload: React.FC<UploadProps>;
8
+ export interface LMUploadProps extends UploadProps {
9
+ className?: string;
10
+ sizeType?: string;
11
+ }
12
+ declare const LMUpload: React.FC<LMUploadProps>;
9
13
  export default LMUpload;
@@ -3,19 +3,24 @@ import _Upload from "antd/es/upload";
3
3
  import "antd/es/tooltip/style";
4
4
  import _Tooltip from "antd/es/tooltip";
5
5
  import React from 'react';
6
+ import classNames from 'classnames';
6
7
 
7
8
  var LMUpload = function LMUpload(props) {
8
- var listType = props.listType;
9
+ var className = props.className,
10
+ sizeType = props.sizeType,
11
+ listType = props.listType;
9
12
 
10
13
  var renderUploadItem = function renderUploadItem(originNode, file) {
11
14
  return !listType ? /*#__PURE__*/React.createElement(_Tooltip, {
12
- placement: 'bottom',
15
+ placement: "bottom",
13
16
  title: file.name
14
17
  }, originNode.props.children) : originNode;
15
18
  };
16
19
 
17
20
  return /*#__PURE__*/React.createElement(_Upload, Object.assign({
21
+ className: classNames(className, sizeType == 'small' && 'little-upload'),
18
22
  itemRender: renderUploadItem,
23
+ sizeType: sizeType,
19
24
  listType: listType
20
25
  }, props));
21
26
  };
@@ -503,3 +503,38 @@ html {
503
503
  .card_cell_content:hover .card_cell_body .card_cell_checkbox {
504
504
  opacity: 1;
505
505
  }
506
+ .ant-upload-select-picture-card div {
507
+ margin-top: 8px;
508
+ }
509
+ .little-upload .ant-upload-list-picture-card-container {
510
+ width: 64px;
511
+ height: 64px;
512
+ }
513
+ .little-upload .ant-upload-list-picture-card-container .ant-upload-list-item {
514
+ padding: 0 !important;
515
+ }
516
+ .little-upload .ant-upload-list-picture-card-container .ant-upload-list-item .ant-upload-list-item-thumbnail {
517
+ font-size: 12px;
518
+ }
519
+ .little-upload .ant-upload-list-picture-card-container .ant-upload-list-item .ant-upload-list-item-progress {
520
+ bottom: 5px;
521
+ left: 7px;
522
+ }
523
+ .little-upload .ant-upload-list-picture-card-container .ant-upload-list-item .ant-upload-list-item-name {
524
+ bottom: 5px;
525
+ font-size: 12px;
526
+ }
527
+ .little-upload .ant-upload.ant-upload-select-picture-card {
528
+ width: 64px;
529
+ height: 64px;
530
+ font-size: 12px;
531
+ }
532
+ .little-upload .ant-upload.ant-upload-select-picture-card .anticon svg {
533
+ width: 24px;
534
+ height: 24px;
535
+ margin-top: 8px;
536
+ }
537
+ .little-upload .ant-upload.ant-upload-select-picture-card div {
538
+ margin-top: 0;
539
+ font-size: 12px;
540
+ }
@@ -0,0 +1,7 @@
1
+ import type { MutableRefObject } from 'react';
2
+ export declare const isFunction: (value: unknown) => value is Function;
3
+ declare type TargetValue<T> = T | undefined | null;
4
+ declare type TargetType = HTMLElement | Element | Window | Document;
5
+ export declare type BasicTarget<T extends TargetType = Element> = (() => TargetValue<T>) | TargetValue<T> | MutableRefObject<TargetValue<T>>;
6
+ export declare function getTargetElement<T extends TargetType>(target: BasicTarget<T>, defaultElement?: T): T;
7
+ export {};
@@ -0,0 +1,20 @@
1
+ export var isFunction = function isFunction(value) {
2
+ return typeof value === 'function';
3
+ };
4
+ export function getTargetElement(target, defaultElement) {
5
+ if (!target) {
6
+ return defaultElement;
7
+ }
8
+
9
+ var targetElement;
10
+
11
+ if (isFunction(target)) {
12
+ targetElement = target();
13
+ } else if ('current' in target) {
14
+ targetElement = target.current;
15
+ } else {
16
+ targetElement = target;
17
+ }
18
+
19
+ return targetElement;
20
+ }
@@ -0,0 +1 @@
1
+ export default function getDataOrAriaProps(props: any): any;
@@ -0,0 +1,9 @@
1
+ export default function getDataOrAriaProps(props) {
2
+ return Object.keys(props).reduce(function (prev, key) {
3
+ if ((key.startsWith('data-') || key.startsWith('aria-') || key === 'role') && !key.startsWith('data-__')) {
4
+ prev[key] = props[key];
5
+ }
6
+
7
+ return prev;
8
+ }, {});
9
+ }
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export declare const isValidElement: typeof React.isValidElement;
3
+ declare type AnyObject = Record<any, any>;
4
+ declare type RenderProps = undefined | AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
5
+ export declare function replaceElement(element: React.ReactNode, replacement: React.ReactNode, props: RenderProps): React.ReactNode;
6
+ export declare function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ var isValidElement = React.isValidElement;
3
+ export { isValidElement };
4
+ export function replaceElement(element, replacement, props) {
5
+ if (!isValidElement(element)) return replacement;
6
+ return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
7
+ }
8
+ export function cloneElement(element, props) {
9
+ return replaceElement(element, element, props);
10
+ }
@@ -0,0 +1,8 @@
1
+ export declare function throttleByAnimationFrame<T extends unknown[]>(fn: (...args: T) => void): {
2
+ (...args: T): void;
3
+ cancel: () => void;
4
+ };
5
+ export declare function throttleByAnimationFrameDecorator(): (target: any, key: string, descriptor: any) => {
6
+ configurable: boolean;
7
+ get(): any;
8
+ };
@@ -0,0 +1,58 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import raf from 'rc-util/lib/raf';
3
+ export function throttleByAnimationFrame(fn) {
4
+ var requestId;
5
+
6
+ var later = function later(args) {
7
+ return function () {
8
+ requestId = null;
9
+ fn.apply(void 0, _toConsumableArray(args));
10
+ };
11
+ };
12
+
13
+ var throttled = function throttled() {
14
+ if (requestId == null) {
15
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
16
+ args[_key] = arguments[_key];
17
+ }
18
+
19
+ requestId = raf(later(args));
20
+ }
21
+ };
22
+
23
+ throttled.cancel = function () {
24
+ raf.cancel(requestId);
25
+ requestId = null;
26
+ };
27
+
28
+ return throttled;
29
+ }
30
+ export function throttleByAnimationFrameDecorator() {
31
+ return function throttle(target, key, descriptor) {
32
+ var fn = descriptor.value;
33
+ var definingProperty = false;
34
+ return {
35
+ configurable: true,
36
+ get: function get() {
37
+ // In IE11 calling Object.defineProperty has a side-effect of evaluating the
38
+ // getter for the property which is being replaced. This causes infinite
39
+ // recursion and an "Out of stack space" error.
40
+ // eslint-disable-next-line no-prototype-builtins
41
+ if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
42
+ /* istanbul ignore next */
43
+ return fn;
44
+ }
45
+
46
+ var boundFn = throttleByAnimationFrame(fn.bind(this));
47
+ definingProperty = true;
48
+ Object.defineProperty(this, key, {
49
+ value: boundFn,
50
+ configurable: true,
51
+ writable: true
52
+ });
53
+ definingProperty = false;
54
+ return boundFn;
55
+ }
56
+ };
57
+ };
58
+ }
package/es/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export { default as LmSelect } from './LmSelect';
22
22
  export { default as LoadingPage } from './LoadingPage';
23
23
  export { default as Menu } from './Menu';
24
24
  export { default as Modal } from './Modal';
25
- export { default as notification } from './Notification';
25
+ export { default as notification } from './notification';
26
26
  export { default as OldModal } from './OldModal';
27
27
  export { default as Pagination } from './Pagination';
28
28
  export { default as PopTable } from './PopTable';
@@ -48,3 +48,4 @@ export { default as Form } from './Form';
48
48
  export { default as Spin } from './Spin';
49
49
  export { default as LmEditTable } from './LmEditTable';
50
50
  export { default as List } from './List';
51
+ export { default as LMQuickMenu } from './QuickMenu';
package/es/index.js CHANGED
@@ -22,7 +22,7 @@ export { default as LmSelect } from './LmSelect';
22
22
  export { default as LoadingPage } from './LoadingPage';
23
23
  export { default as Menu } from './Menu';
24
24
  export { default as Modal } from './Modal';
25
- export { default as notification } from './Notification';
25
+ export { default as notification } from './notification';
26
26
  export { default as OldModal } from './OldModal';
27
27
  export { default as Pagination } from './Pagination';
28
28
  export { default as PopTable } from './PopTable';
@@ -46,4 +46,5 @@ export { default as Tooltip } from './Tooltip';
46
46
  export { default as Form } from './Form';
47
47
  export { default as Spin } from './Spin';
48
48
  export { default as LmEditTable } from './LmEditTable';
49
- export { default as List } from './List';
49
+ export { default as List } from './List';
50
+ export { default as LMQuickMenu } from './QuickMenu';
@@ -519,6 +519,7 @@ html {
519
519
  animation-iteration-count: 1;
520
520
  animation-fill-mode: forwards;
521
521
  transition: width 0.2s;
522
+ animation-timing-function: linear;
522
523
  }
523
524
  .lm_message:hover .message_progress {
524
525
  width: 100%;
@@ -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;