linkmore-design 1.0.49 → 1.0.53

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 (189) hide show
  1. package/dist/Button/style/index.d.ts +1 -1
  2. package/dist/CardTable/fns/index.d.ts +9 -0
  3. package/dist/CardTable/hooks/usePagination.d.ts +19 -0
  4. package/dist/CardTable/toolbar/TablePagination.d.ts +4 -0
  5. package/dist/CardTable/toolbar/ToolBarBottom.d.ts +3 -0
  6. package/dist/List/demos/basic.d.ts +2 -0
  7. package/dist/List/index.d.ts +2 -0
  8. package/dist/List/style/index.d.ts +1 -0
  9. package/dist/LmEditTable/DndContainer.d.ts +5 -0
  10. package/dist/LmEditTable/DragHandle.d.ts +4 -0
  11. package/dist/LmEditTable/EditTable.d.ts +31 -0
  12. package/dist/LmEditTable/demos/Editbasic.d.ts +2 -0
  13. package/dist/LmEditTable/demos/basic.d.ts +2 -0
  14. package/dist/LmEditTable/demos/formEditTable.d.ts +2 -0
  15. package/dist/LmEditTable/demos/hoverEdit.d.ts +2 -0
  16. package/dist/LmEditTable/index.d.ts +2 -0
  17. package/dist/LmEditTable/sortableBox.d.ts +5 -0
  18. package/dist/LmEditTable/sortableItem.d.ts +2 -0
  19. package/dist/LmEditTable/style/index.d.ts +1 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.umd.js +3853 -689
  22. package/dist/index.umd.min.js +6 -6
  23. package/dist/message/hooks/useMessage.d.ts +7 -0
  24. package/dist/message/index.d.ts +63 -4
  25. package/es/Button/style/{style.css → index.css} +0 -0
  26. package/es/Button/style/index.d.ts +1 -1
  27. package/es/Button/style/index.js +1 -1
  28. package/es/ButtonTags/style/{style.css → index.css} +0 -0
  29. package/es/ButtonTags/style/index.js +1 -1
  30. package/es/CardTable/card/PictureTextColumn.js +11 -6
  31. package/es/CardTable/card/PictureTextRow.js +11 -6
  32. package/es/CardTable/fns/index.js +106 -0
  33. package/es/CardTable/hooks/usePagination.js +128 -0
  34. package/es/CardTable/index.js +3 -0
  35. package/{lib/CardTable/style/style.css → es/CardTable/style/index.css} +13 -1
  36. package/es/CardTable/style/index.js +1 -1
  37. package/es/CardTable/table/TableRoot.js +43 -64
  38. package/es/CardTable/table/TableWrapper.js +4 -0
  39. package/es/CardTable/toolbar/TablePagination.js +62 -0
  40. package/es/CardTable/toolbar/ToolBarBottom.js +47 -0
  41. package/es/Checkbox/style/{style.css → index.css} +0 -0
  42. package/es/Checkbox/style/index.js +1 -1
  43. package/es/CkFilter/style/{style.css → index.css} +0 -0
  44. package/es/CkFilter/style/index.js +1 -1
  45. package/es/CustomTableOption/columnsSort.js +5 -5
  46. package/es/CustomTableOption/filterSort.js +3 -3
  47. package/es/CustomTableOption/index.js +1 -2
  48. package/es/CustomerService/style/{style.css → index.css} +0 -0
  49. package/es/CustomerService/style/index.js +1 -1
  50. package/es/EditTable/style/{style.css → index.css} +0 -0
  51. package/es/EditTable/style/index.js +1 -1
  52. package/es/EnlargeImg/style/{style.css → index.css} +0 -0
  53. package/es/EnlargeImg/style/index.js +1 -1
  54. package/es/Filter/style/{style.css → index.css} +0 -0
  55. package/es/Filter/style/index.js +1 -1
  56. package/es/IconSelect/style/{style.css → index.css} +0 -0
  57. package/es/IconSelect/style/index.js +1 -1
  58. package/{lib/Input/style/style.css → es/Input/style/index.css} +21 -1
  59. package/es/Input/style/index.js +1 -1
  60. package/es/LeftTable/style/{style.css → index.css} +0 -0
  61. package/es/LeftTable/style/index.js +1 -1
  62. package/es/List/index.d.ts +2 -0
  63. package/es/List/index.js +3 -0
  64. package/es/List/style/index.css +505 -0
  65. package/es/List/style/index.d.ts +1 -0
  66. package/es/List/style/index.js +1 -0
  67. package/es/LmEditTable/DndContainer.d.ts +5 -0
  68. package/es/LmEditTable/DndContainer.js +35 -0
  69. package/es/LmEditTable/DragHandle.d.ts +4 -0
  70. package/es/LmEditTable/DragHandle.js +22 -0
  71. package/es/LmEditTable/EditTable.d.ts +31 -0
  72. package/es/LmEditTable/EditTable.js +892 -0
  73. package/es/LmEditTable/index.d.ts +2 -0
  74. package/es/LmEditTable/index.js +2 -0
  75. package/es/LmEditTable/sortableBox.d.ts +5 -0
  76. package/es/LmEditTable/sortableBox.js +13 -0
  77. package/es/LmEditTable/sortableItem.d.ts +2 -0
  78. package/es/LmEditTable/sortableItem.js +43 -0
  79. package/es/LmEditTable/style/index.css +574 -0
  80. package/es/LmEditTable/style/index.d.ts +1 -0
  81. package/es/LmEditTable/style/index.js +1 -0
  82. package/es/LmTable/Table.js +16 -6
  83. package/{lib/LmTable/style/style.css → es/LmTable/style/index.css} +6 -0
  84. package/es/LmTable/style/index.js +1 -1
  85. package/es/OldModal/style/{style.css → index.css} +0 -0
  86. package/es/OldModal/style/index.js +1 -1
  87. package/es/PopTable/style/{style.css → index.css} +0 -0
  88. package/es/PopTable/style/index.js +1 -1
  89. package/es/ProTable/style/{style.css → index.css} +0 -0
  90. package/es/ProTable/style/index.js +1 -1
  91. package/es/Radio/style/{style.css → index.css} +0 -0
  92. package/es/Radio/style/index.js +1 -1
  93. package/es/Select/style/index.css +3 -0
  94. package/es/TableRender/style/{style.css → index.css} +0 -0
  95. package/es/TableRender/style/index.js +1 -1
  96. package/es/UploadOss/style/{style.css → index.css} +0 -0
  97. package/es/UploadOss/style/index.js +1 -1
  98. package/es/VirtualList/style/{style.css → index.css} +0 -0
  99. package/es/VirtualList/style/index.js +1 -1
  100. package/es/index.d.ts +2 -0
  101. package/es/index.js +3 -1
  102. package/es/message/hooks/useMessage.d.ts +7 -0
  103. package/es/message/hooks/useMessage.js +83 -0
  104. package/es/message/index.d.ts +63 -4
  105. package/es/message/index.js +241 -12
  106. package/es/message/style/index.css +27 -1
  107. package/lib/Button/style/{style.css → index.css} +0 -0
  108. package/lib/Button/style/index.d.ts +1 -1
  109. package/lib/Button/style/index.js +1 -1
  110. package/lib/ButtonTags/style/{style.css → index.css} +0 -0
  111. package/lib/ButtonTags/style/index.js +1 -1
  112. package/lib/CardTable/card/PictureTextColumn.js +11 -6
  113. package/lib/CardTable/card/PictureTextRow.js +11 -6
  114. package/lib/CardTable/fns/index.js +106 -0
  115. package/lib/CardTable/hooks/usePagination.js +128 -0
  116. package/lib/CardTable/index.js +3 -0
  117. package/{es/CardTable/style/style.css → lib/CardTable/style/index.css} +13 -1
  118. package/lib/CardTable/style/index.js +1 -1
  119. package/lib/CardTable/table/TableRoot.js +43 -64
  120. package/lib/CardTable/table/TableWrapper.js +4 -0
  121. package/lib/CardTable/toolbar/TablePagination.js +62 -0
  122. package/lib/CardTable/toolbar/ToolBarBottom.js +47 -0
  123. package/lib/Checkbox/style/{style.css → index.css} +0 -0
  124. package/lib/Checkbox/style/index.js +1 -1
  125. package/lib/CkFilter/style/{style.css → index.css} +0 -0
  126. package/lib/CkFilter/style/index.js +1 -1
  127. package/lib/CustomTableOption/columnsSort.js +5 -5
  128. package/lib/CustomTableOption/filterSort.js +3 -3
  129. package/lib/CustomTableOption/index.js +1 -2
  130. package/lib/CustomerService/style/{style.css → index.css} +0 -0
  131. package/lib/CustomerService/style/index.js +1 -1
  132. package/lib/EditTable/style/{style.css → index.css} +0 -0
  133. package/lib/EditTable/style/index.js +1 -1
  134. package/lib/EnlargeImg/style/{style.css → index.css} +0 -0
  135. package/lib/EnlargeImg/style/index.js +1 -1
  136. package/lib/Filter/style/{style.css → index.css} +0 -0
  137. package/lib/Filter/style/index.js +1 -1
  138. package/lib/IconSelect/style/{style.css → index.css} +0 -0
  139. package/lib/IconSelect/style/index.js +1 -1
  140. package/{es/Input/style/style.css → lib/Input/style/index.css} +21 -1
  141. package/lib/Input/style/index.js +1 -1
  142. package/lib/LeftTable/style/{style.css → index.css} +0 -0
  143. package/lib/LeftTable/style/index.js +1 -1
  144. package/lib/List/index.d.ts +2 -0
  145. package/lib/List/index.js +15 -0
  146. package/lib/List/style/index.css +505 -0
  147. package/lib/List/style/index.d.ts +1 -0
  148. package/lib/List/style/index.js +3 -0
  149. package/lib/LmEditTable/DndContainer.d.ts +5 -0
  150. package/lib/LmEditTable/DndContainer.js +49 -0
  151. package/lib/LmEditTable/DragHandle.d.ts +4 -0
  152. package/lib/LmEditTable/DragHandle.js +37 -0
  153. package/lib/LmEditTable/EditTable.d.ts +31 -0
  154. package/lib/LmEditTable/EditTable.js +925 -0
  155. package/lib/LmEditTable/index.d.ts +2 -0
  156. package/lib/LmEditTable/index.js +13 -0
  157. package/lib/LmEditTable/sortableBox.d.ts +5 -0
  158. package/lib/LmEditTable/sortableBox.js +24 -0
  159. package/lib/LmEditTable/sortableItem.d.ts +2 -0
  160. package/lib/LmEditTable/sortableItem.js +55 -0
  161. package/lib/LmEditTable/style/index.css +574 -0
  162. package/lib/LmEditTable/style/index.d.ts +1 -0
  163. package/lib/LmEditTable/style/index.js +3 -0
  164. package/lib/LmTable/Table.js +16 -6
  165. package/{es/LmTable/style/style.css → lib/LmTable/style/index.css} +6 -0
  166. package/lib/LmTable/style/index.js +1 -1
  167. package/lib/OldModal/style/{style.css → index.css} +0 -0
  168. package/lib/OldModal/style/index.js +1 -1
  169. package/lib/PopTable/style/{style.css → index.css} +0 -0
  170. package/lib/PopTable/style/index.js +1 -1
  171. package/lib/ProTable/style/{style.css → index.css} +0 -0
  172. package/lib/ProTable/style/index.js +1 -1
  173. package/lib/Radio/style/{style.css → index.css} +0 -0
  174. package/lib/Radio/style/index.js +1 -1
  175. package/lib/Select/style/index.css +3 -0
  176. package/lib/TableRender/style/{style.css → index.css} +0 -0
  177. package/lib/TableRender/style/index.js +1 -1
  178. package/lib/UploadOss/style/{style.css → index.css} +0 -0
  179. package/lib/UploadOss/style/index.js +1 -1
  180. package/lib/VirtualList/style/{style.css → index.css} +0 -0
  181. package/lib/VirtualList/style/index.js +1 -1
  182. package/lib/index.d.ts +2 -0
  183. package/lib/index.js +17 -1
  184. package/lib/message/hooks/useMessage.d.ts +7 -0
  185. package/lib/message/hooks/useMessage.js +101 -0
  186. package/lib/message/index.d.ts +63 -4
  187. package/lib/message/index.js +262 -16
  188. package/lib/message/style/index.css +27 -1
  189. package/package.json +2 -1
@@ -1,24 +1,270 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+
3
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
6
 
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
8
- exports.default = void 0;
9
-
10
- require("antd/es/message/style");
11
-
12
- var _message2 = _interopRequireDefault(require("antd/es/message"));
13
-
14
- // const prefixCls = 'lm_message'
15
- // const LMMessage: React.FC<IMessageProps> = (props) => {
16
- // const { children, className, ...others } = props
17
- // return (
18
- // <div className={classNames(className, prefixCls)} {...others}>
19
- // {children}
20
- // </div>
21
- // )
22
- // }
23
- var _default = _message2.default;
10
+ exports.attachTypeApi = attachTypeApi;
11
+ exports.getInstance = exports.default = void 0;
12
+ exports.getKeyThenIncreaseKey = getKeyThenIncreaseKey;
13
+ exports.typeList = void 0;
14
+
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
+
17
+ var _icons = require("@ant-design/icons");
18
+
19
+ var _classnames = _interopRequireDefault(require("classnames"));
20
+
21
+ var _rcNotification = _interopRequireDefault(require("rc-notification"));
22
+
23
+ var _react = _interopRequireDefault(require("react"));
24
+
25
+ var _configProvider = _interopRequireWildcard(require("antd/es/config-provider"));
26
+
27
+ var _useMessage = _interopRequireDefault(require("./hooks/useMessage"));
28
+
29
+ var messageInstance;
30
+ var defaultDuration = 3;
31
+ var defaultTop;
32
+ var key = 1;
33
+ var localPrefixCls = '';
34
+ var transitionName = 'move-up';
35
+ var hasTransitionName = false;
36
+ var getContainer;
37
+ var maxCount;
38
+ var rtl = false;
39
+
40
+ function getKeyThenIncreaseKey() {
41
+ return key++;
42
+ }
43
+
44
+ function setMessageConfig(options) {
45
+ if (options.top !== undefined) {
46
+ defaultTop = options.top;
47
+ messageInstance = null; // delete messageInstance for new defaultTop
48
+ }
49
+
50
+ if (options.duration !== undefined) {
51
+ defaultDuration = options.duration;
52
+ }
53
+
54
+ if (options.prefixCls !== undefined) {
55
+ localPrefixCls = options.prefixCls;
56
+ }
57
+
58
+ if (options.getContainer !== undefined) {
59
+ getContainer = options.getContainer;
60
+ messageInstance = null; // delete messageInstance for new getContainer
61
+ }
62
+
63
+ if (options.transitionName !== undefined) {
64
+ transitionName = options.transitionName;
65
+ messageInstance = null; // delete messageInstance for new transitionName
66
+
67
+ hasTransitionName = true;
68
+ }
69
+
70
+ if (options.maxCount !== undefined) {
71
+ maxCount = options.maxCount;
72
+ messageInstance = null;
73
+ }
74
+
75
+ if (options.rtl !== undefined) {
76
+ rtl = options.rtl;
77
+ }
78
+ }
79
+
80
+ function getRCNotificationInstance(args, callback) {
81
+ var customizePrefixCls = args.prefixCls,
82
+ getContextPopupContainer = args.getPopupContainer;
83
+
84
+ var _globalConfig = (0, _configProvider.globalConfig)(),
85
+ getPrefixCls = _globalConfig.getPrefixCls,
86
+ getRootPrefixCls = _globalConfig.getRootPrefixCls,
87
+ getIconPrefixCls = _globalConfig.getIconPrefixCls;
88
+
89
+ var prefixCls = getPrefixCls('message', customizePrefixCls || localPrefixCls);
90
+ var rootPrefixCls = getRootPrefixCls(args.rootPrefixCls, prefixCls);
91
+ var iconPrefixCls = getIconPrefixCls();
92
+
93
+ if (messageInstance) {
94
+ callback({
95
+ prefixCls: prefixCls,
96
+ rootPrefixCls: rootPrefixCls,
97
+ iconPrefixCls: iconPrefixCls,
98
+ instance: messageInstance
99
+ });
100
+ return;
101
+ }
102
+
103
+ var instanceConfig = {
104
+ prefixCls: prefixCls,
105
+ transitionName: hasTransitionName ? transitionName : "".concat(rootPrefixCls, "-").concat(transitionName),
106
+ style: {
107
+ top: defaultTop
108
+ },
109
+ getContainer: getContainer || getContextPopupContainer,
110
+ maxCount: maxCount
111
+ };
112
+
113
+ _rcNotification.default.newInstance(instanceConfig, function (instance) {
114
+ if (messageInstance) {
115
+ callback({
116
+ prefixCls: prefixCls,
117
+ rootPrefixCls: rootPrefixCls,
118
+ iconPrefixCls: iconPrefixCls,
119
+ instance: messageInstance
120
+ });
121
+ return;
122
+ }
123
+
124
+ messageInstance = instance;
125
+
126
+ if (process.env.NODE_ENV === 'test') {
127
+ messageInstance.config = instanceConfig;
128
+ }
129
+
130
+ callback({
131
+ prefixCls: prefixCls,
132
+ rootPrefixCls: rootPrefixCls,
133
+ iconPrefixCls: iconPrefixCls,
134
+ instance: instance
135
+ });
136
+ });
137
+ }
138
+
139
+ var typeToIcon = {
140
+ info: _icons.InfoCircleFilled,
141
+ success: _icons.CheckCircleFilled,
142
+ error: _icons.CloseCircleFilled,
143
+ warning: _icons.ExclamationCircleFilled,
144
+ loading: _icons.LoadingOutlined
145
+ };
146
+ var typeList = Object.keys(typeToIcon);
147
+ exports.typeList = typeList;
148
+
149
+ function getRCNoticeProps(args, prefixCls, iconPrefixCls) {
150
+ var _classNames;
151
+
152
+ var duration = args.duration !== undefined ? args.duration : defaultDuration;
153
+ var progress = args.progress === false ? false : true;
154
+ var IconComponent = typeToIcon[args.type];
155
+ var messageClass = (0, _classnames.default)("".concat(prefixCls, "-custom-content"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-").concat(args.type), args.type), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-rtl"), rtl === true), _classNames));
156
+ return {
157
+ key: args.key,
158
+ duration: duration,
159
+ style: args.style || {},
160
+ className: (0, _classnames.default)(args.className, 'lm_message'),
161
+ content: /*#__PURE__*/_react.default.createElement(_configProvider.default, {
162
+ iconPrefixCls: iconPrefixCls
163
+ }, /*#__PURE__*/_react.default.createElement("div", {
164
+ className: messageClass
165
+ }, args.icon || IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, null), /*#__PURE__*/_react.default.createElement("span", null, args.content), progress && duration > 0 && /*#__PURE__*/_react.default.createElement("div", {
166
+ className: 'message_progress',
167
+ style: {
168
+ animationDuration: "".concat(duration, "s")
169
+ }
170
+ }))),
171
+ onClose: args.onClose,
172
+ onClick: args.onClick
173
+ };
174
+ }
175
+
176
+ function notice(args) {
177
+ var target = args.key || getKeyThenIncreaseKey();
178
+ var closePromise = new Promise(function (resolve) {
179
+ var callback = function callback() {
180
+ if (typeof args.onClose === 'function') {
181
+ args.onClose();
182
+ }
183
+
184
+ return resolve(true);
185
+ };
186
+
187
+ getRCNotificationInstance(args, function (_ref) {
188
+ var prefixCls = _ref.prefixCls,
189
+ iconPrefixCls = _ref.iconPrefixCls,
190
+ instance = _ref.instance;
191
+ instance.notice(getRCNoticeProps(Object.assign(Object.assign({}, args), {
192
+ key: target,
193
+ onClose: callback
194
+ }), prefixCls, iconPrefixCls));
195
+ });
196
+ });
197
+
198
+ var result = function result() {
199
+ if (messageInstance) {
200
+ messageInstance.removeNotice(target);
201
+ }
202
+ };
203
+
204
+ result.then = function (filled, rejected) {
205
+ return closePromise.then(filled, rejected);
206
+ };
207
+
208
+ result.promise = closePromise;
209
+ return result;
210
+ }
211
+
212
+ function isArgsProps(content) {
213
+ return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;
214
+ }
215
+
216
+ var api = {
217
+ open: notice,
218
+ config: setMessageConfig,
219
+ destroy: function destroy(messageKey) {
220
+ if (messageInstance) {
221
+ if (messageKey) {
222
+ var _messageInstance = messageInstance,
223
+ removeNotice = _messageInstance.removeNotice;
224
+ removeNotice(messageKey);
225
+ } else {
226
+ var _messageInstance2 = messageInstance,
227
+ destroy = _messageInstance2.destroy;
228
+ destroy();
229
+ messageInstance = null;
230
+ }
231
+ }
232
+ }
233
+ };
234
+
235
+ function attachTypeApi(originalApi, type) {
236
+ originalApi[type] = function (content, duration, onClose) {
237
+ if (isArgsProps(content)) {
238
+ return originalApi.open(Object.assign(Object.assign({}, content), {
239
+ type: type
240
+ }));
241
+ }
242
+
243
+ if (typeof duration === 'function') {
244
+ onClose = duration;
245
+ duration = undefined;
246
+ }
247
+
248
+ return originalApi.open({
249
+ content: content,
250
+ duration: duration,
251
+ type: type,
252
+ onClose: onClose
253
+ });
254
+ };
255
+ }
256
+
257
+ typeList.forEach(function (type) {
258
+ return attachTypeApi(api, type);
259
+ });
260
+ api.warn = api.warning;
261
+ api.useMessage = (0, _useMessage.default)(getRCNotificationInstance, getRCNoticeProps);
262
+ /** @private test Only function. Not work on production */
263
+
264
+ var getInstance = function getInstance() {
265
+ return process.env.NODE_ENV === 'test' ? messageInstance : null;
266
+ };
267
+
268
+ exports.getInstance = getInstance;
269
+ var _default = api;
24
270
  exports.default = _default;
@@ -503,7 +503,33 @@ 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
+ }
523
+ .lm_message:hover .message_progress {
524
+ width: 100%;
525
+ animation-name: none;
526
+ animation-play-state: paused;
527
+ }
528
+ @keyframes Progress {
529
+ from {
530
+ width: 100%;
531
+ }
532
+ to {
533
+ width: 0;
534
+ }
535
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linkmore-design",
3
- "version": "1.0.49",
3
+ "version": "1.0.53",
4
4
  "author": {
5
5
  "name": "nowthen",
6
6
  "email": "rnlvwyx@gmail.com"
@@ -62,6 +62,7 @@
62
62
  "axios": "^0.21.0",
63
63
  "classnames": "^2.3.1",
64
64
  "dayjs": "^1.9.7",
65
+ "immer": "^9.0.15",
65
66
  "lodash": "^4.17.21",
66
67
  "react-cookies": "^0.1.1",
67
68
  "react-query": "^3.34.15",