@ccs-ui/rc-pro 1.1.1-rc5 → 1.1.1-rc6
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/button.d.ts +2 -1
- package/es/dialog/button.js +14 -11
- package/es/dialog/form.js +2 -1
- package/package.json +1 -1
package/es/dialog/button.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ interface DialogButtonsProps {
|
|
|
5
5
|
okAuth?: string;
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
hideCancel?: boolean;
|
|
8
9
|
onOk?: (values?: any) => void;
|
|
9
10
|
}
|
|
10
|
-
export default function CcsDialogButtons({ okText, okAuth, loading, children, cancelText, onOk, }: DialogButtonsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export default function CcsDialogButtons({ okText, okAuth, loading, children, hideCancel, cancelText, onOk, }: DialogButtonsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
12
|
export {};
|
package/es/dialog/button.js
CHANGED
|
@@ -9,13 +9,14 @@ import { Button, Form } from 'antd';
|
|
|
9
9
|
import { useEffect } from 'react';
|
|
10
10
|
import CcsDialog from '.';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
export default function CcsDialogButtons(_ref) {
|
|
15
15
|
var okText = _ref.okText,
|
|
16
16
|
okAuth = _ref.okAuth,
|
|
17
17
|
loading = _ref.loading,
|
|
18
18
|
children = _ref.children,
|
|
19
|
+
hideCancel = _ref.hideCancel,
|
|
19
20
|
cancelText = _ref.cancelText,
|
|
20
21
|
onOk = _ref.onOk;
|
|
21
22
|
var _CcsDialog$useContext = CcsDialog.useContext(),
|
|
@@ -38,18 +39,20 @@ export default function CcsDialogButtons(_ref) {
|
|
|
38
39
|
}
|
|
39
40
|
onOk();
|
|
40
41
|
};
|
|
41
|
-
return onOk ? /*#__PURE__*/_jsx(_Fragment, {
|
|
42
|
+
return onOk || children ? /*#__PURE__*/_jsx(_Fragment, {
|
|
42
43
|
children: /*#__PURE__*/_jsxs("div", {
|
|
43
44
|
className: "ccs-dialog-buttons",
|
|
44
|
-
children: [children, /*#__PURE__*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
children: [children, onOk && /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: [!hideCancel && /*#__PURE__*/_jsx(Button, {
|
|
47
|
+
onClick: closeDialog,
|
|
48
|
+
children: cancelText || '取消'
|
|
49
|
+
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
50
|
+
auth: okAuth || '',
|
|
51
|
+
type: "primary",
|
|
52
|
+
loading: loading,
|
|
53
|
+
onClick: onOkClick,
|
|
54
|
+
children: okText || '确定'
|
|
55
|
+
})]
|
|
53
56
|
})]
|
|
54
57
|
})
|
|
55
58
|
}) : null;
|
package/es/dialog/form.js
CHANGED