@ccs-ui/rc-pro 1.1.4 → 1.1.5
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/HookDrawer.js
CHANGED
|
@@ -14,7 +14,7 @@ import { Drawer } from 'antd';
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
16
16
|
import { DialogSelfButton } from "./HookModal";
|
|
17
|
-
import { DialogButtonHolder } from "./button";
|
|
17
|
+
import CcsDialogButtons, { DialogButtonHolder } from "./button";
|
|
18
18
|
import { DialogContentContext } from "./context";
|
|
19
19
|
import DialogForm from "./form";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -116,6 +116,7 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
116
116
|
}),
|
|
117
117
|
children: /*#__PURE__*/_jsx(DialogContentContext.Provider, {
|
|
118
118
|
value: {
|
|
119
|
+
Buttons: CcsDialogButtons,
|
|
119
120
|
buttonRef: buttonRef,
|
|
120
121
|
buttonType: 'drawer',
|
|
121
122
|
closeDialog: close,
|
package/es/dialog/HookModal.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from 'classnames';
|
|
|
15
15
|
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
|
16
16
|
import Draggable from 'react-draggable';
|
|
17
17
|
import { CcsAuth, CcsDialog, CcsUtils } from '..';
|
|
18
|
-
import { DialogButtonHolder } from "./button";
|
|
18
|
+
import CcsDialogButtons, { DialogButtonHolder } from "./button";
|
|
19
19
|
import { DialogContentContext } from "./context";
|
|
20
20
|
import DialogForm from "./form";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -231,8 +231,9 @@ var HookModal = function HookModal(_ref3, ref) {
|
|
|
231
231
|
value: {
|
|
232
232
|
buttonRef: buttonRef,
|
|
233
233
|
buttonType: 'modal',
|
|
234
|
-
|
|
235
|
-
formInitialValues: ((_config$form2 = config.form) === null || _config$form2 === void 0 ? void 0 : _config$form2.initialValues) || {}
|
|
234
|
+
Buttons: CcsDialogButtons,
|
|
235
|
+
formInitialValues: ((_config$form2 = config.form) === null || _config$form2 === void 0 ? void 0 : _config$form2.initialValues) || {},
|
|
236
|
+
closeDialog: close
|
|
236
237
|
},
|
|
237
238
|
children: config.form ? /*#__PURE__*/_jsx(DialogForm, {
|
|
238
239
|
ref: formRef,
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
interface DialogButtonsProps {
|
|
2
|
+
export interface DialogButtonsProps {
|
|
3
3
|
okText?: string;
|
|
4
4
|
cancelText?: string;
|
|
5
5
|
okAuth?: string;
|
|
@@ -12,5 +12,4 @@ export type DialogButtonRef = {
|
|
|
12
12
|
onSetButtons: (e: React.ReactElement) => void;
|
|
13
13
|
};
|
|
14
14
|
export declare const DialogButtonHolder: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<DialogButtonRef>>>;
|
|
15
|
-
export default function CcsDialogButtons({ okText, okAuth, loading, children, hideCancel, cancelText, onOk, }: DialogButtonsProps):
|
|
16
|
-
export {};
|
|
15
|
+
export default function CcsDialogButtons({ okText, okAuth, loading, children, hideCancel, cancelText, onOk, }: DialogButtonsProps): import("react/jsx-runtime").JSX.Element;
|
package/es/dialog/button.js
CHANGED
|
@@ -84,8 +84,8 @@ export default function CcsDialogButtons(_ref) {
|
|
|
84
84
|
children: btns
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
CcsUtils.showWarning(!!buttonRef.current, "\u68C0\u6D4B\u5230".concat(buttonType === 'modal' ? 'openModal' : 'openDrawer', "\u4F20\u5165request\u53C2\u6570\
|
|
87
|
+
CcsUtils.showWarning(!!buttonRef.current, "\u68C0\u6D4B\u5230".concat(buttonType === 'modal' ? 'openModal' : 'openDrawer', "\u4F20\u5165request\u53C2\u6570\uFF0CButtons\u5C06\u4E0D\u80FD\u751F\u6548\u3002"));
|
|
88
88
|
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.onSetButtons(btns);
|
|
89
89
|
});
|
|
90
|
-
return
|
|
90
|
+
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
91
91
|
}
|
package/es/dialog/context.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Store } from 'antd/es/form/interface';
|
|
2
|
-
import React, { RefObject } from 'react';
|
|
3
|
-
import { DialogButtonRef } from './button';
|
|
2
|
+
import React, { ReactElement, RefObject } from 'react';
|
|
3
|
+
import { DialogButtonRef, DialogButtonsProps } from './button';
|
|
4
4
|
export interface DialogContextType<T = Store> {
|
|
5
|
-
/** 按钮类型 */
|
|
6
|
-
buttonType: 'modal' | 'drawer';
|
|
7
5
|
/** 表单初始值 */
|
|
8
6
|
formInitialValues: T;
|
|
7
|
+
/** 按钮组件 */
|
|
8
|
+
Buttons: (e: DialogButtonsProps) => ReactElement;
|
|
9
|
+
/** 按钮类型 */
|
|
10
|
+
buttonType: 'modal' | 'drawer';
|
|
9
11
|
/** 按钮 ref */
|
|
10
12
|
buttonRef: RefObject<DialogButtonRef>;
|
|
11
13
|
/** drawer footer ref */
|