@ccs-ui/rc-pro 1.1.25-beta-13 → 1.1.25-beta-17
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/dialog/DialogRequestButton.d.ts +8 -0
- package/es/dialog/DialogRequestButton.js +65 -0
- package/es/dialog/DialogSelfOkButton.d.ts +8 -0
- package/es/dialog/DialogSelfOkButton.js +43 -0
- package/es/dialog/HookDrawer.js +20 -11
- package/es/dialog/HookModal.d.ts +0 -6
- package/es/dialog/HookModal.js +45 -74
- package/es/pro-table/head.js +0 -3
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormProps } from 'antd';
|
|
2
|
+
import { DialogFormRef } from './form';
|
|
3
|
+
import { CcsDialogModalProps } from './hook';
|
|
4
|
+
declare const DialogRequestButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onCancel" | "onRequestBefore"> & {
|
|
5
|
+
formRef: React.RefObject<DialogFormRef>;
|
|
6
|
+
formInitialValues: FormProps['initialValues'];
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DialogRequestButton;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { Button } from 'antd';
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { CcsAuth, CcsDialog, CcsUtils } from '..';
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
var DialogRequestButton = function DialogRequestButton(_ref) {
|
|
20
|
+
var auth = _ref.auth,
|
|
21
|
+
formRef = _ref.formRef,
|
|
22
|
+
_ref$formInitialValue = _ref.formInitialValues,
|
|
23
|
+
formInitialValues = _ref$formInitialValue === void 0 ? {} : _ref$formInitialValue,
|
|
24
|
+
request = _ref.request,
|
|
25
|
+
onCancel = _ref.onCancel,
|
|
26
|
+
onRequestBefore = _ref.onRequestBefore;
|
|
27
|
+
var _useState = useState(false),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
loading = _useState2[0],
|
|
30
|
+
setLoading = _useState2[1];
|
|
31
|
+
var onOk = function onOk() {
|
|
32
|
+
var _formRef$current;
|
|
33
|
+
if (!((_formRef$current = formRef.current) !== null && _formRef$current !== void 0 && _formRef$current.formInstance)) {
|
|
34
|
+
CcsUtils.showWarning(false, "\u672A\u5B9A\u4E49form");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
formRef.current.formInstance.validateFields().then(function (values) {
|
|
38
|
+
setLoading(true);
|
|
39
|
+
var params = _objectSpread(_objectSpread({}, formInitialValues), onRequestBefore ? onRequestBefore(values) : values);
|
|
40
|
+
request(params).then(function (d) {
|
|
41
|
+
setLoading(false);
|
|
42
|
+
if (d !== null && d !== void 0 && d.success && onCancel) {
|
|
43
|
+
onCancel(params);
|
|
44
|
+
}
|
|
45
|
+
CcsDialog.easyMessage(d);
|
|
46
|
+
}).catch(function (err) {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
console.log('e', err);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
54
|
+
onClick: onCancel,
|
|
55
|
+
children: "\u53D6\u6D88"
|
|
56
|
+
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
57
|
+
auth: auth || '',
|
|
58
|
+
type: "primary",
|
|
59
|
+
onClick: onOk,
|
|
60
|
+
loading: loading,
|
|
61
|
+
children: "\u786E\u5B9A"
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export default DialogRequestButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormProps } from 'antd';
|
|
2
|
+
import { DialogFormRef } from './form';
|
|
3
|
+
import { CcsDialogModalProps } from './hook';
|
|
4
|
+
declare const DialogSelfOkButton: ({ auth, formRef, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onCancel" | "onOk"> & {
|
|
5
|
+
formRef: React.RefObject<DialogFormRef>;
|
|
6
|
+
formInitialValues: FormProps['initialValues'];
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default DialogSelfOkButton;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { Button } from 'antd';
|
|
8
|
+
import { CcsAuth, CcsUtils } from '..';
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var DialogSelfOkButton = function DialogSelfOkButton(_ref) {
|
|
13
|
+
var auth = _ref.auth,
|
|
14
|
+
formRef = _ref.formRef,
|
|
15
|
+
_ref$formInitialValue = _ref.formInitialValues,
|
|
16
|
+
formInitialValues = _ref$formInitialValue === void 0 ? {} : _ref$formInitialValue,
|
|
17
|
+
onCancel = _ref.onCancel,
|
|
18
|
+
onOk = _ref.onOk;
|
|
19
|
+
var onHandleOk = function onHandleOk() {
|
|
20
|
+
var _formRef$current;
|
|
21
|
+
if (!((_formRef$current = formRef.current) !== null && _formRef$current !== void 0 && _formRef$current.formInstance)) {
|
|
22
|
+
CcsUtils.showWarning(false, "\u672A\u5B9A\u4E49form");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
formRef.current.formInstance.validateFields().then(function (values) {
|
|
26
|
+
var params = _objectSpread(_objectSpread({}, formInitialValues), values);
|
|
27
|
+
if (onOk) onOk(params);
|
|
28
|
+
if (onCancel) onCancel(params);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
33
|
+
onClick: onCancel,
|
|
34
|
+
children: "\u53D6\u6D88"
|
|
35
|
+
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
36
|
+
auth: auth || '',
|
|
37
|
+
type: "primary",
|
|
38
|
+
onClick: onHandleOk,
|
|
39
|
+
children: "\u786E\u5B9A"
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export default DialogSelfOkButton;
|
package/es/dialog/HookDrawer.js
CHANGED
|
@@ -13,9 +13,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import { Drawer } from 'antd';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
16
|
-
import { DialogSelfButton } from "./HookModal";
|
|
17
16
|
import CcsDialogButtons, { DialogButtonHolder } from "./button";
|
|
18
17
|
import { DialogContentContext } from "./context";
|
|
18
|
+
import DialogRequestButton from "./DialogRequestButton";
|
|
19
19
|
import DialogForm from "./form";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
var HookDrawer = function HookDrawer(_ref, ref) {
|
|
@@ -100,6 +100,24 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
100
100
|
styles.mask = _objectSpread({
|
|
101
101
|
background: 'rgba(0, 0, 0, 0.1)'
|
|
102
102
|
}, styles.mask);
|
|
103
|
+
var renderExtra = function renderExtra() {
|
|
104
|
+
if (request) {
|
|
105
|
+
return /*#__PURE__*/_jsx("div", {
|
|
106
|
+
className: "ccs-dialog-footer",
|
|
107
|
+
children: /*#__PURE__*/_jsx(DialogRequestButton, {
|
|
108
|
+
auth: auth,
|
|
109
|
+
request: request,
|
|
110
|
+
onCancel: close,
|
|
111
|
+
formRef: formRef,
|
|
112
|
+
onRequestBefore: onRequestBefore,
|
|
113
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
118
|
+
ref: buttonRef
|
|
119
|
+
});
|
|
120
|
+
};
|
|
103
121
|
return /*#__PURE__*/_jsx(Drawer, _objectSpread(_objectSpread({
|
|
104
122
|
afterOpenChange: function afterOpenChange(open) {
|
|
105
123
|
if (!open) afterClose();
|
|
@@ -112,16 +130,7 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
112
130
|
position: 'absolute'
|
|
113
131
|
} : {}), rootStyle),
|
|
114
132
|
getContainer: isCrInProp ? getContainer : onGetContainer,
|
|
115
|
-
extra:
|
|
116
|
-
request: request,
|
|
117
|
-
onCancel: close,
|
|
118
|
-
formRef: formRef,
|
|
119
|
-
onRequestBefore: onRequestBefore,
|
|
120
|
-
auth: auth,
|
|
121
|
-
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
122
|
-
}) : /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
123
|
-
ref: buttonRef
|
|
124
|
-
}),
|
|
133
|
+
extra: renderExtra(),
|
|
125
134
|
footer: /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
126
135
|
ref: footerRef
|
|
127
136
|
}),
|
package/es/dialog/HookModal.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FormProps } from 'antd';
|
|
3
|
-
import { DialogFormRef } from './form';
|
|
4
2
|
import { CcsDialogModal, CcsDialogModalProps } from './hook';
|
|
5
|
-
export declare const DialogSelfButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onRequestBefore" | "onCancel"> & {
|
|
6
|
-
formRef: React.RefObject<DialogFormRef>;
|
|
7
|
-
formInitialValues: FormProps['initialValues'];
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
3
|
export type HookModalProps = {
|
|
10
4
|
afterClose: () => void;
|
|
11
5
|
config: CcsDialogModalProps;
|
package/es/dialog/HookModal.js
CHANGED
|
@@ -10,17 +10,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
12
|
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); }
|
|
13
|
-
import {
|
|
13
|
+
import { Modal } from 'antd';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
16
16
|
import Draggable from 'react-draggable';
|
|
17
|
-
import { CcsAuth, CcsDialog, CcsUtils } from '..';
|
|
18
17
|
import CcsDialogButtons, { DialogButtonHolder } from "./button";
|
|
19
18
|
import { DialogContentContext } from "./context";
|
|
19
|
+
import DialogRequestButton from "./DialogRequestButton";
|
|
20
|
+
import DialogSelfOkButton from "./DialogSelfOkButton";
|
|
20
21
|
import DialogForm from "./form";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
var DragModal = function DragModal(_ref) {
|
|
25
24
|
var modal = _ref.modal,
|
|
26
25
|
dragState = _ref.dragState,
|
|
@@ -57,56 +56,10 @@ var DragModal = function DragModal(_ref) {
|
|
|
57
56
|
})
|
|
58
57
|
});
|
|
59
58
|
};
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
formInitialValues = _ref2$formInitialValu === void 0 ? {} : _ref2$formInitialValu,
|
|
65
|
-
request = _ref2.request,
|
|
66
|
-
onCancel = _ref2.onCancel,
|
|
67
|
-
onRequestBefore = _ref2.onRequestBefore;
|
|
68
|
-
var _useState = useState(false),
|
|
69
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
-
loading = _useState2[0],
|
|
71
|
-
setLoading = _useState2[1];
|
|
72
|
-
var onOk = function onOk() {
|
|
73
|
-
var _formRef$current;
|
|
74
|
-
if (!((_formRef$current = formRef.current) !== null && _formRef$current !== void 0 && _formRef$current.formInstance)) {
|
|
75
|
-
CcsUtils.showWarning(false, "\u672A\u5B9A\u4E49form");
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
formRef.current.formInstance.validateFields().then(function (values) {
|
|
79
|
-
setLoading(true);
|
|
80
|
-
var params = _objectSpread(_objectSpread({}, formInitialValues), onRequestBefore ? onRequestBefore(values) : values);
|
|
81
|
-
request(params).then(function (d) {
|
|
82
|
-
setLoading(false);
|
|
83
|
-
if (d !== null && d !== void 0 && d.success && onCancel) {
|
|
84
|
-
onCancel(params);
|
|
85
|
-
}
|
|
86
|
-
CcsDialog.easyMessage(d);
|
|
87
|
-
}).catch(function (err) {
|
|
88
|
-
setLoading(false);
|
|
89
|
-
console.log('e', err);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
94
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
95
|
-
onClick: onCancel,
|
|
96
|
-
children: "\u53D6\u6D88"
|
|
97
|
-
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
98
|
-
auth: auth || '',
|
|
99
|
-
type: "primary",
|
|
100
|
-
onClick: onOk,
|
|
101
|
-
loading: loading,
|
|
102
|
-
children: "\u786E\u5B9A"
|
|
103
|
-
})]
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
var HookModal = function HookModal(_ref3, ref) {
|
|
107
|
-
var hookAfterClose = _ref3.afterClose,
|
|
108
|
-
config = _ref3.config;
|
|
109
|
-
var _useState3 = useState(function () {
|
|
59
|
+
var HookModal = function HookModal(_ref2, ref) {
|
|
60
|
+
var hookAfterClose = _ref2.afterClose,
|
|
61
|
+
config = _ref2.config;
|
|
62
|
+
var _useState = useState(function () {
|
|
110
63
|
if (config.open === undefined) {
|
|
111
64
|
return _objectSpread(_objectSpread({}, config), {}, {
|
|
112
65
|
open: true
|
|
@@ -114,10 +67,10 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
114
67
|
}
|
|
115
68
|
return config;
|
|
116
69
|
}),
|
|
117
|
-
|
|
118
|
-
innerConfig =
|
|
119
|
-
setInnerConfig =
|
|
120
|
-
var
|
|
70
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
71
|
+
innerConfig = _useState2[0],
|
|
72
|
+
setInnerConfig = _useState2[1];
|
|
73
|
+
var _useState3 = useState({
|
|
121
74
|
disabled: true,
|
|
122
75
|
bounds: {
|
|
123
76
|
left: 0,
|
|
@@ -126,9 +79,9 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
126
79
|
right: 0
|
|
127
80
|
}
|
|
128
81
|
}),
|
|
129
|
-
|
|
130
|
-
dragState =
|
|
131
|
-
setDragState =
|
|
82
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
83
|
+
dragState = _useState4[0],
|
|
84
|
+
setDragState = _useState4[1];
|
|
132
85
|
var buttonRef = useRef(null);
|
|
133
86
|
var formRef = useRef(null);
|
|
134
87
|
var afterClose = function afterClose() {
|
|
@@ -181,6 +134,36 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
181
134
|
}
|
|
182
135
|
};
|
|
183
136
|
});
|
|
137
|
+
var renderFooter = function renderFooter() {
|
|
138
|
+
if (request) {
|
|
139
|
+
return /*#__PURE__*/_jsx("div", {
|
|
140
|
+
className: "ccs-dialog-footer",
|
|
141
|
+
children: /*#__PURE__*/_jsx(DialogRequestButton, {
|
|
142
|
+
auth: auth,
|
|
143
|
+
request: request,
|
|
144
|
+
onCancel: close,
|
|
145
|
+
formRef: formRef,
|
|
146
|
+
onRequestBefore: onRequestBefore,
|
|
147
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (innerConfig.onOk) {
|
|
152
|
+
return /*#__PURE__*/_jsx("div", {
|
|
153
|
+
className: "ccs-dialog-footer",
|
|
154
|
+
children: /*#__PURE__*/_jsx(DialogSelfOkButton, {
|
|
155
|
+
auth: auth,
|
|
156
|
+
onOk: innerConfig.onOk,
|
|
157
|
+
onCancel: close,
|
|
158
|
+
formRef: formRef,
|
|
159
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
164
|
+
ref: buttonRef
|
|
165
|
+
});
|
|
166
|
+
};
|
|
184
167
|
return /*#__PURE__*/_jsx(Modal, _objectSpread(_objectSpread({
|
|
185
168
|
onCancel: close,
|
|
186
169
|
afterClose: afterClose
|
|
@@ -191,19 +174,7 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
191
174
|
} : undefined
|
|
192
175
|
}, styles),
|
|
193
176
|
className: classNames('ccs-dialog-modal', className),
|
|
194
|
-
footer:
|
|
195
|
-
className: "ccs-dialog-footer",
|
|
196
|
-
children: /*#__PURE__*/_jsx(DialogSelfButton, {
|
|
197
|
-
auth: auth,
|
|
198
|
-
request: request,
|
|
199
|
-
onCancel: close,
|
|
200
|
-
formRef: formRef,
|
|
201
|
-
onRequestBefore: onRequestBefore,
|
|
202
|
-
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
203
|
-
})
|
|
204
|
-
}) : /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
205
|
-
ref: buttonRef
|
|
206
|
-
}),
|
|
177
|
+
footer: renderFooter(),
|
|
207
178
|
title: /*#__PURE__*/_jsx("div", {
|
|
208
179
|
style: {
|
|
209
180
|
width: '100%',
|
package/es/pro-table/head.js
CHANGED
|
@@ -116,9 +116,6 @@ function HeadComponent(_ref) {
|
|
|
116
116
|
children: isExpand ? '收起' : '展开'
|
|
117
117
|
}), /*#__PURE__*/_jsx(Button, {
|
|
118
118
|
type: "primary",
|
|
119
|
-
onClick: function onClick() {
|
|
120
|
-
return form.submit();
|
|
121
|
-
},
|
|
122
119
|
htmlType: "submit",
|
|
123
120
|
children: "\u67E5\u8BE2"
|
|
124
121
|
})]
|