@lemon-fe/kits 1.1.6 → 1.1.8
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.
- package/es/hooks/use-batch-operator/index.d.ts +1 -1
- package/es/hooks/use-batch-operator/index.js +10 -9
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/init.js +1 -26
- package/package.json +3 -3
|
@@ -45,7 +45,7 @@ interface Props<RecordType extends Record<string, any> = Record<string, any>, Re
|
|
|
45
45
|
/**
|
|
46
46
|
* @description 弹窗关闭前的检验,返回true校验通过关闭弹窗,false校验不通过
|
|
47
47
|
*/
|
|
48
|
-
onBeforeClose?: (results: Map<Key, Result<ResultType
|
|
48
|
+
onBeforeClose?: (results: Map<Key, Result<ResultType>>, datas: RecordType[]) => Promise<boolean>;
|
|
49
49
|
/**
|
|
50
50
|
* @description 自定义渲染结果,不要依赖上下文
|
|
51
51
|
* @param params
|
|
@@ -53,11 +53,12 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
53
53
|
return String(result !== null && result !== void 0 ? result : '').toString();
|
|
54
54
|
});
|
|
55
55
|
_defineProperty(_assertThisInitialized(_this), "handleClose", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
56
|
-
var _this$props, onBeforeClose, onClose, results, value;
|
|
56
|
+
var _this$props, onBeforeClose, onClose, data, results, value;
|
|
57
57
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58
58
|
while (1) switch (_context.prev = _context.next) {
|
|
59
59
|
case 0:
|
|
60
60
|
_this$props = _this.props, onBeforeClose = _this$props.onBeforeClose, onClose = _this$props.onClose;
|
|
61
|
+
data = _this.state.data;
|
|
61
62
|
results = new Map();
|
|
62
63
|
_toConsumableArray(_this.state.results).forEach(function (_ref2) {
|
|
63
64
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
@@ -70,20 +71,20 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
70
71
|
});
|
|
71
72
|
_context.t0 = onBeforeClose;
|
|
72
73
|
if (!_context.t0) {
|
|
73
|
-
_context.next =
|
|
74
|
+
_context.next = 9;
|
|
74
75
|
break;
|
|
75
76
|
}
|
|
76
|
-
_context.next =
|
|
77
|
-
return onBeforeClose(results);
|
|
78
|
-
case 7:
|
|
79
|
-
_context.t0 = !_context.sent;
|
|
77
|
+
_context.next = 8;
|
|
78
|
+
return onBeforeClose(results, data);
|
|
80
79
|
case 8:
|
|
80
|
+
_context.t0 = !_context.sent;
|
|
81
|
+
case 9:
|
|
81
82
|
if (!_context.t0) {
|
|
82
|
-
_context.next =
|
|
83
|
+
_context.next = 11;
|
|
83
84
|
break;
|
|
84
85
|
}
|
|
85
86
|
return _context.abrupt("return");
|
|
86
|
-
case
|
|
87
|
+
case 11:
|
|
87
88
|
_this.setState({
|
|
88
89
|
open: false
|
|
89
90
|
});
|
|
@@ -97,7 +98,7 @@ var BatchOperate = /*#__PURE__*/function (_Component) {
|
|
|
97
98
|
results: results
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
|
-
case
|
|
101
|
+
case 13:
|
|
101
102
|
case "end":
|
|
102
103
|
return _context.stop();
|
|
103
104
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from 'antd';
|
|
2
2
|
export { default as zhCN } from 'antd/es/locale/zh_CN';
|
|
3
|
-
export { Alert, Dropdown, InputNumber, Layout, Table } from '@lemon-fe/components';
|
|
3
|
+
export { Alert, Dropdown, InputNumber, Layout, Table, Modal, type ModalProps, } from '@lemon-fe/components';
|
|
4
4
|
export * from '@lemon-fe/components';
|
|
5
5
|
export * from '@lemon-fe/hooks';
|
|
6
6
|
export * from '@lemon-fe/utils';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from 'antd';
|
|
2
2
|
export { default as zhCN } from 'antd/es/locale/zh_CN';
|
|
3
|
-
export { Alert, Dropdown, InputNumber, Layout, Table } from '@lemon-fe/components';
|
|
3
|
+
export { Alert, Dropdown, InputNumber, Layout, Table, Modal } from '@lemon-fe/components';
|
|
4
4
|
//@ts-ignore
|
|
5
5
|
export * from '@lemon-fe/components';
|
|
6
6
|
export * from '@lemon-fe/hooks';
|
package/es/init.js
CHANGED
|
@@ -4,14 +4,13 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
5
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
6
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
|
-
import { message,
|
|
7
|
+
import { message, Select, ConfigProvider, Result, Button, DatePicker, Cascader, TreeSelect, Empty, Menu, TimePicker, Tree } from 'antd';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Icons, PageLoading, PREFIX_CLS, EmptyImage } from '@lemon-fe/components';
|
|
10
10
|
import { config } from '@lemon-fe/hooks';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
var Tip = Icons.Tip,
|
|
13
13
|
Down = Icons.Down,
|
|
14
|
-
CloseLight = Icons.CloseLight,
|
|
15
14
|
Clear = Icons.Clear;
|
|
16
15
|
export default function init() {
|
|
17
16
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -31,7 +30,6 @@ export default function init() {
|
|
|
31
30
|
var types = ['success', 'error', 'warning', 'info'];
|
|
32
31
|
types.forEach(function (item) {
|
|
33
32
|
var msgAPI = message[item].bind(message);
|
|
34
|
-
var modalAPI = Modal[item].bind(Modal);
|
|
35
33
|
message[item] = function () {
|
|
36
34
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
35
|
args[_key] = arguments[_key];
|
|
@@ -55,29 +53,6 @@ export default function init() {
|
|
|
55
53
|
})
|
|
56
54
|
});
|
|
57
55
|
};
|
|
58
|
-
Modal[item] = function (args) {
|
|
59
|
-
return modalAPI(_objectSpread({
|
|
60
|
-
title: '提示',
|
|
61
|
-
width: 400,
|
|
62
|
-
icon: /*#__PURE__*/_jsx(Tip, {
|
|
63
|
-
type: item
|
|
64
|
-
})
|
|
65
|
-
}, args));
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
var modalConfirm = Modal.confirm.bind(Modal);
|
|
69
|
-
Modal.confirm = function (args) {
|
|
70
|
-
return modalConfirm(_objectSpread({
|
|
71
|
-
icon: /*#__PURE__*/_jsx(Tip, {
|
|
72
|
-
type: "info"
|
|
73
|
-
}),
|
|
74
|
-
width: 400,
|
|
75
|
-
title: '提示'
|
|
76
|
-
}, args));
|
|
77
|
-
};
|
|
78
|
-
Modal.defaultProps = _objectSpread(_objectSpread({}, Modal.defaultProps), {}, {
|
|
79
|
-
maskClosable: false,
|
|
80
|
-
closeIcon: /*#__PURE__*/_jsx(CloseLight, {})
|
|
81
56
|
});
|
|
82
57
|
var node = /*#__PURE__*/_jsx(Down, {
|
|
83
58
|
style: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/kits",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ant-design/icons": "^4.7.0",
|
|
26
|
-
"@lemon-fe/components": "^1.1.
|
|
26
|
+
"@lemon-fe/components": "^1.1.8",
|
|
27
27
|
"@lemon-fe/hooks": "^1.1.0",
|
|
28
28
|
"@lemon-fe/utils": "^1.1.0",
|
|
29
29
|
"antd": "4.24.8",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"registry": "https://registry.npmjs.org"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c1976880d7e69d49e8b2416734ca3a4a137f535d"
|
|
48
48
|
}
|