@ccs-ui/rc-pro 1.1.25-beta-27 → 1.2.0-beta-2
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/ccs.d.ts +2 -0
- package/es/context/index.d.ts +3 -3
- package/es/context/index.js +1 -1
- package/es/dialog/DialogRequestButton.d.ts +1 -1
- package/es/dialog/DialogRequestButton.js +2 -1
- package/es/dialog/DialogSelfOkButton.d.ts +1 -1
- package/es/dialog/DialogSelfOkButton.js +2 -1
- package/es/dialog/HookDrawer.js +7 -19
- package/es/dialog/HookModal.js +23 -24
- package/es/dialog/button.d.ts +3 -5
- package/es/dialog/button.js +26 -15
- package/es/dialog/drawer-footer.js +1 -4
- package/es/dialog/form.d.ts +1 -2
- package/es/dialog/form.js +2 -3
- package/es/dialog/hook.d.ts +6 -2
- package/es/dialog/hook.js +42 -4
- package/es/dialog/index.less +0 -14
- package/es/hooks/use-page.d.ts +1 -1
- package/es/layout-keep-alive/page.d.ts +1 -1
- package/es/pro-table/index.less +6 -4
- package/package.json +4 -2
package/es/ccs.d.ts
CHANGED
package/es/context/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TabPaneProps } from 'antd';
|
|
2
2
|
import { Store } from 'antd/es/form/interface';
|
|
3
|
-
import { Location } from 'history';
|
|
4
3
|
import React from 'react';
|
|
4
|
+
import { Location } from 'react-router';
|
|
5
5
|
import CCS from '..';
|
|
6
6
|
type CcsTabsChangeProps = {
|
|
7
7
|
/** 当前激活tab面板的key */
|
|
@@ -55,5 +55,5 @@ declare const GlobalContext: React.Context<GlobalContextType>;
|
|
|
55
55
|
declare const DrawerAndModalContext: React.Context<FnContextType<any>>;
|
|
56
56
|
declare const PageContext: React.Context<PageContextType>;
|
|
57
57
|
declare const TabsContext: React.Context<CcsTabsContextType>;
|
|
58
|
-
export
|
|
59
|
-
export {
|
|
58
|
+
export { DrawerAndModalContext, GlobalContext, PageContext, TabsContext };
|
|
59
|
+
export type { CcsTabsChangeProps, CcsTabsContextType, FnContextType, GlobalContextPropsType, };
|
package/es/context/index.js
CHANGED
|
@@ -3,4 +3,4 @@ var GlobalContext = /*#__PURE__*/createContext({});
|
|
|
3
3
|
var DrawerAndModalContext = /*#__PURE__*/createContext({});
|
|
4
4
|
var PageContext = /*#__PURE__*/createContext({});
|
|
5
5
|
var TabsContext = /*#__PURE__*/React.createContext({});
|
|
6
|
-
export {
|
|
6
|
+
export { DrawerAndModalContext, GlobalContext, PageContext, TabsContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
2
|
import { DialogFormRef } from './form';
|
|
3
3
|
import { CcsDialogModalProps } from './hook';
|
|
4
|
-
declare const DialogRequestButton: ({ auth, formRef, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onRequestBefore" | "onCancel"> & {
|
|
4
|
+
declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onRequestBefore" | "onCancel" | "extraBtn"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,6 +19,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
var DialogRequestButton = function DialogRequestButton(_ref) {
|
|
20
20
|
var auth = _ref.auth,
|
|
21
21
|
formRef = _ref.formRef,
|
|
22
|
+
extraBtn = _ref.extraBtn,
|
|
22
23
|
_ref$formInitialValue = _ref.formInitialValues,
|
|
23
24
|
formInitialValues = _ref$formInitialValue === void 0 ? {} : _ref$formInitialValue,
|
|
24
25
|
request = _ref.request,
|
|
@@ -50,7 +51,7 @@ var DialogRequestButton = function DialogRequestButton(_ref) {
|
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
53
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
53
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
54
|
+
children: [extraBtn, /*#__PURE__*/_jsx(Button, {
|
|
54
55
|
onClick: onCancel,
|
|
55
56
|
children: "\u53D6\u6D88"
|
|
56
57
|
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormProps } from 'antd';
|
|
2
2
|
import { DialogFormRef } from './form';
|
|
3
3
|
import { CcsDialogModalProps } from './hook';
|
|
4
|
-
declare const DialogSelfOkButton: ({ auth, formRef, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "
|
|
4
|
+
declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onCancel" | "extraBtn" | "onOk"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,6 +12,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
var DialogSelfOkButton = function DialogSelfOkButton(_ref) {
|
|
13
13
|
var auth = _ref.auth,
|
|
14
14
|
formRef = _ref.formRef,
|
|
15
|
+
extraBtn = _ref.extraBtn,
|
|
15
16
|
_ref$formInitialValue = _ref.formInitialValues,
|
|
16
17
|
formInitialValues = _ref$formInitialValue === void 0 ? {} : _ref$formInitialValue,
|
|
17
18
|
onCancel = _ref.onCancel,
|
|
@@ -29,7 +30,7 @@ var DialogSelfOkButton = function DialogSelfOkButton(_ref) {
|
|
|
29
30
|
});
|
|
30
31
|
};
|
|
31
32
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
32
|
-
children: [/*#__PURE__*/_jsx(Button, {
|
|
33
|
+
children: [extraBtn, /*#__PURE__*/_jsx(Button, {
|
|
33
34
|
onClick: onCancel,
|
|
34
35
|
children: "\u53D6\u6D88"
|
|
35
36
|
}), /*#__PURE__*/_jsx(CcsAuth.Button, {
|
package/es/dialog/HookDrawer.js
CHANGED
|
@@ -19,7 +19,6 @@ 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) {
|
|
22
|
-
var _innerConfig$styles;
|
|
23
22
|
var hookAfterClose = _ref.afterClose,
|
|
24
23
|
config = _ref.config;
|
|
25
24
|
var _useState = useState(function () {
|
|
@@ -92,26 +91,18 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
92
91
|
};
|
|
93
92
|
var isCrInProp = ('getContainer' in innerConfig);
|
|
94
93
|
var styles = innerConfig.styles || {};
|
|
95
|
-
if (form) {
|
|
96
|
-
styles.body = {
|
|
97
|
-
padding: 0
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
94
|
styles.mask = _objectSpread({
|
|
101
95
|
background: 'rgba(0, 0, 0, 0.1)'
|
|
102
96
|
}, styles.mask);
|
|
103
97
|
var renderExtra = function renderExtra() {
|
|
104
98
|
if (request) {
|
|
105
|
-
return /*#__PURE__*/_jsx(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
onRequestBefore: onRequestBefore,
|
|
113
|
-
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
114
|
-
})
|
|
99
|
+
return /*#__PURE__*/_jsx(DialogRequestButton, {
|
|
100
|
+
auth: auth,
|
|
101
|
+
request: request,
|
|
102
|
+
onCancel: close,
|
|
103
|
+
formRef: formRef,
|
|
104
|
+
onRequestBefore: onRequestBefore,
|
|
105
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
115
106
|
});
|
|
116
107
|
}
|
|
117
108
|
return /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
@@ -146,9 +137,6 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
146
137
|
children: form ? /*#__PURE__*/_jsx(DialogForm, {
|
|
147
138
|
ref: formRef,
|
|
148
139
|
formProps: form,
|
|
149
|
-
styles: _objectSpread({
|
|
150
|
-
padding: 24
|
|
151
|
-
}, (_innerConfig$styles = innerConfig.styles) === null || _innerConfig$styles === void 0 ? void 0 : _innerConfig$styles.body),
|
|
152
140
|
children: content
|
|
153
141
|
}) : content
|
|
154
142
|
})
|
package/es/dialog/HookModal.js
CHANGED
|
@@ -96,6 +96,7 @@ var HookModal = function HookModal(_ref2, ref) {
|
|
|
96
96
|
_innerConfig$styles = innerConfig.styles,
|
|
97
97
|
styles = _innerConfig$styles === void 0 ? {} : _innerConfig$styles,
|
|
98
98
|
className = innerConfig.className,
|
|
99
|
+
extraBtn = innerConfig.extraBtn,
|
|
99
100
|
request = innerConfig.request,
|
|
100
101
|
onCancel = innerConfig.onCancel,
|
|
101
102
|
onRequestBefore = innerConfig.onRequestBefore,
|
|
@@ -135,32 +136,34 @@ var HookModal = function HookModal(_ref2, ref) {
|
|
|
135
136
|
};
|
|
136
137
|
});
|
|
137
138
|
var renderFooter = function renderFooter() {
|
|
139
|
+
// 传入接口请求参数
|
|
138
140
|
if (request) {
|
|
139
|
-
return /*#__PURE__*/_jsx(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
148
|
-
})
|
|
141
|
+
return /*#__PURE__*/_jsx(DialogRequestButton, {
|
|
142
|
+
auth: auth,
|
|
143
|
+
request: request,
|
|
144
|
+
onCancel: close,
|
|
145
|
+
formRef: formRef,
|
|
146
|
+
extraBtn: extraBtn,
|
|
147
|
+
onRequestBefore: onRequestBefore,
|
|
148
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
+
|
|
152
|
+
// 传入onOk参数
|
|
151
153
|
if (innerConfig.onOk) {
|
|
152
|
-
return /*#__PURE__*/_jsx(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
160
|
-
})
|
|
154
|
+
return /*#__PURE__*/_jsx(DialogSelfOkButton, {
|
|
155
|
+
auth: auth,
|
|
156
|
+
onCancel: close,
|
|
157
|
+
formRef: formRef,
|
|
158
|
+
extraBtn: extraBtn,
|
|
159
|
+
onOk: innerConfig.onOk,
|
|
160
|
+
formInitialValues: form === null || form === void 0 ? void 0 : form.initialValues
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
+
|
|
164
|
+
// 对话框中使用buttons生成按钮
|
|
163
165
|
return /*#__PURE__*/_jsx(DialogButtonHolder, {
|
|
166
|
+
extraBtn: extraBtn,
|
|
164
167
|
ref: buttonRef
|
|
165
168
|
});
|
|
166
169
|
};
|
|
@@ -168,11 +171,7 @@ var HookModal = function HookModal(_ref2, ref) {
|
|
|
168
171
|
onCancel: close,
|
|
169
172
|
afterClose: afterClose
|
|
170
173
|
}, innerConfig), {}, {
|
|
171
|
-
styles:
|
|
172
|
-
footer: !request ? {
|
|
173
|
-
padding: 0
|
|
174
|
-
} : undefined
|
|
175
|
-
}, styles),
|
|
174
|
+
styles: styles,
|
|
176
175
|
className: classNames('ccs-dialog-modal', className),
|
|
177
176
|
footer: renderFooter(),
|
|
178
177
|
title: /*#__PURE__*/_jsx("div", {
|
package/es/dialog/button.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
cancelText?: string;
|
|
2
|
+
import { CcsDialogModalProps } from './hook';
|
|
3
|
+
export type DialogButtonsProps = Pick<CcsDialogModalProps, 'okText' | 'cancelText' | 'onOk'> & {
|
|
5
4
|
okAuth?: string;
|
|
6
5
|
loading?: boolean;
|
|
7
6
|
children?: ReactNode;
|
|
8
7
|
hideCancel?: boolean;
|
|
9
|
-
onOk?: (values?: any) => void;
|
|
10
8
|
};
|
|
11
9
|
export type DialogButtonRef = {
|
|
12
10
|
onSetButtons: (e: React.ReactElement) => void;
|
|
13
11
|
};
|
|
14
|
-
export declare const DialogButtonHolder: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<DialogButtonRef>>>;
|
|
12
|
+
export declare const DialogButtonHolder: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CcsDialogModalProps, "extraBtn"> & React.RefAttributes<DialogButtonRef>>>;
|
|
15
13
|
export default function CcsDialogButtons({ okText, okAuth, loading, children, hideCancel, cancelText, onOk, }: DialogButtonsProps): import("react/jsx-runtime").JSX.Element;
|
package/es/dialog/button.js
CHANGED
|
@@ -12,16 +12,18 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import { CcsAuth, CcsUtils } from "./..";
|
|
14
14
|
import { Button, Form } from 'antd';
|
|
15
|
-
import React, { useEffect, useImperativeHandle, useState } from 'react';
|
|
15
|
+
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
16
16
|
import CcsDialog from '.';
|
|
17
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
export var DialogButtonHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (
|
|
20
|
+
export var DialogButtonHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
|
+
var extraBtn = _ref.extraBtn;
|
|
21
22
|
var _useState = useState(),
|
|
22
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
24
|
buttons = _useState2[0],
|
|
24
25
|
setButtons = _useState2[1];
|
|
26
|
+
var noBtnRef = useRef(null);
|
|
25
27
|
useImperativeHandle(ref, function () {
|
|
26
28
|
return {
|
|
27
29
|
onSetButtons: function onSetButtons(e) {
|
|
@@ -29,18 +31,28 @@ export var DialogButtonHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forw
|
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
33
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
if (buttons) {
|
|
36
|
+
noBtnRef.current.parentElement.removeAttribute('style');
|
|
37
|
+
} else {
|
|
38
|
+
// 没有按钮时,ant-modal-footer padding置0。
|
|
39
|
+
noBtnRef.current.parentElement.style.padding = '0px';
|
|
40
|
+
}
|
|
41
|
+
}, [buttons]);
|
|
42
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
43
|
+
children: [extraBtn, buttons, /*#__PURE__*/_jsx("div", {
|
|
44
|
+
ref: noBtnRef
|
|
45
|
+
})]
|
|
34
46
|
});
|
|
35
47
|
}));
|
|
36
|
-
export default function CcsDialogButtons(
|
|
37
|
-
var okText =
|
|
38
|
-
okAuth =
|
|
39
|
-
loading =
|
|
40
|
-
children =
|
|
41
|
-
hideCancel =
|
|
42
|
-
cancelText =
|
|
43
|
-
onOk =
|
|
48
|
+
export default function CcsDialogButtons(_ref2) {
|
|
49
|
+
var okText = _ref2.okText,
|
|
50
|
+
okAuth = _ref2.okAuth,
|
|
51
|
+
loading = _ref2.loading,
|
|
52
|
+
children = _ref2.children,
|
|
53
|
+
hideCancel = _ref2.hideCancel,
|
|
54
|
+
cancelText = _ref2.cancelText,
|
|
55
|
+
onOk = _ref2.onOk;
|
|
44
56
|
var _CcsDialog$useInstanc = CcsDialog.useInstance(),
|
|
45
57
|
closeDialog = _CcsDialog$useInstanc.closeDialog,
|
|
46
58
|
buttonRef = _CcsDialog$useInstanc.buttonRef,
|
|
@@ -77,8 +89,7 @@ export default function CcsDialogButtons(_ref) {
|
|
|
77
89
|
})]
|
|
78
90
|
});
|
|
79
91
|
if (buttonType === 'modal') {
|
|
80
|
-
btns = /*#__PURE__*/_jsx(
|
|
81
|
-
className: "ccs-dialog-footer",
|
|
92
|
+
btns = /*#__PURE__*/_jsx(_Fragment, {
|
|
82
93
|
children: btns
|
|
83
94
|
});
|
|
84
95
|
}
|
|
@@ -39,10 +39,7 @@ export default function CcsDrawerFooter(_ref) {
|
|
|
39
39
|
useEffect(function () {
|
|
40
40
|
var _drawerFooterRef$curr;
|
|
41
41
|
if (!onOk && !children) return;
|
|
42
|
-
var btns = /*#__PURE__*/_jsxs(
|
|
43
|
-
style: {
|
|
44
|
-
padding: '8px 16px'
|
|
45
|
-
},
|
|
42
|
+
var btns = /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
43
|
children: [children, onOk && /*#__PURE__*/_jsxs(_Fragment, {
|
|
47
44
|
children: [!hideCancel && /*#__PURE__*/_jsx(Button, {
|
|
48
45
|
onClick: closeDialog,
|
package/es/dialog/form.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { FormInstance, FormProps } from 'antd';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
type PropsType = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
formProps: FormProps;
|
|
6
|
-
styles?: CSSProperties;
|
|
7
6
|
};
|
|
8
7
|
export type DialogFormRef = {
|
|
9
8
|
formInstance: FormInstance;
|
package/es/dialog/form.js
CHANGED
|
@@ -22,7 +22,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
22
22
|
*/
|
|
23
23
|
var DialogForm = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
24
24
|
var children = _ref.children,
|
|
25
|
-
styles = _ref.styles,
|
|
26
25
|
_ref$formProps = _ref.formProps,
|
|
27
26
|
labelCol = _ref$formProps.labelCol,
|
|
28
27
|
wrapperCol = _ref$formProps.wrapperCol,
|
|
@@ -45,10 +44,10 @@ var DialogForm = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
45
44
|
},
|
|
46
45
|
preserve: false
|
|
47
46
|
}, restProps), {}, {
|
|
48
|
-
style: _objectSpread(
|
|
47
|
+
style: _objectSpread({
|
|
49
48
|
height: '100%',
|
|
50
49
|
overflow: 'auto'
|
|
51
|
-
},
|
|
50
|
+
}, restProps.style),
|
|
52
51
|
children: children
|
|
53
52
|
}));
|
|
54
53
|
});
|
package/es/dialog/hook.d.ts
CHANGED
|
@@ -22,12 +22,14 @@ export type CcsDialogModalProps = ModalFuncProps & {
|
|
|
22
22
|
form?: FormProps;
|
|
23
23
|
/** 表单接口请求权限 */
|
|
24
24
|
auth?: string;
|
|
25
|
+
/** 关闭后销毁组件,默认true */
|
|
26
|
+
destroyOnClose?: boolean;
|
|
27
|
+
/** 通过参数传递的扩展按钮 */
|
|
28
|
+
extraBtn?: ReactNode;
|
|
25
29
|
/** 表单接口请求 */
|
|
26
30
|
request?: (values: any) => Promise<CCS.HttpResult>;
|
|
27
31
|
/** request执行前参数处理 */
|
|
28
32
|
onRequestBefore?: (values: any) => any;
|
|
29
|
-
/** 关闭后销毁组件,默认true */
|
|
30
|
-
destroyOnClose?: boolean;
|
|
31
33
|
/** 通过closeDialog方法关闭dialog */
|
|
32
34
|
onAfterOk?: (e: any) => void;
|
|
33
35
|
/** 通过点击关闭按钮或取消按钮关闭 */
|
|
@@ -40,6 +42,8 @@ export type CcsDialogDrawerProps = Omit<DrawerProps, 'extra'> & {
|
|
|
40
42
|
auth?: string;
|
|
41
43
|
/** 抽屉内容 */
|
|
42
44
|
content?: ReactNode;
|
|
45
|
+
/** 通过参数传递的扩展按钮 */
|
|
46
|
+
extraBtn?: ReactNode;
|
|
43
47
|
/** 表单接口请求 */
|
|
44
48
|
request?: (values: any) => Promise<CCS.HttpResult>;
|
|
45
49
|
/** request执行前参数处理 */
|
package/es/dialog/hook.js
CHANGED
|
@@ -12,6 +12,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
12
|
|
|
13
13
|
import _debounce from 'lodash/debounce';
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import { createRoot } from 'react-dom/client';
|
|
16
|
+
import { CcsUtils } from '..';
|
|
15
17
|
import HookDrawer from "./HookDrawer";
|
|
16
18
|
import HookModal from "./HookModal";
|
|
17
19
|
import usePatchElement from "./usePatchElement";
|
|
@@ -53,10 +55,12 @@ export default function useCcsDialog() {
|
|
|
53
55
|
}
|
|
54
56
|
}, [actionQueue]);
|
|
55
57
|
var getModalFunc = React.useCallback(function (config) {
|
|
56
|
-
var _holderRef$current;
|
|
57
58
|
modalUuid += 1;
|
|
58
59
|
var modalRef = /*#__PURE__*/React.createRef();
|
|
60
|
+
|
|
61
|
+
// 关闭事件
|
|
59
62
|
var closeFunc;
|
|
63
|
+
// modal
|
|
60
64
|
var modal = /*#__PURE__*/_jsx(HookModal, {
|
|
61
65
|
config: config,
|
|
62
66
|
afterClose: function afterClose() {
|
|
@@ -65,7 +69,24 @@ export default function useCcsDialog() {
|
|
|
65
69
|
},
|
|
66
70
|
ref: modalRef
|
|
67
71
|
}, "modal-".concat(modalUuid));
|
|
68
|
-
|
|
72
|
+
if (holderRef.current) {
|
|
73
|
+
// 加载了contextHolder
|
|
74
|
+
closeFunc = holderRef.current.patchElement(modal);
|
|
75
|
+
} else {
|
|
76
|
+
CcsUtils.showWarning(true, "\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
|
|
77
|
+
// 未加载contextHolder,创建dom
|
|
78
|
+
var dialogEle = document.createElement('div');
|
|
79
|
+
document.body.append(dialogEle);
|
|
80
|
+
var root = createRoot(dialogEle);
|
|
81
|
+
root.render( /*#__PURE__*/_jsx(_Fragment, {
|
|
82
|
+
children: modal
|
|
83
|
+
}));
|
|
84
|
+
closeFunc = function closeFunc() {
|
|
85
|
+
setTimeout(function () {
|
|
86
|
+
root.unmount();
|
|
87
|
+
}, 500);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
69
90
|
if (closeFunc) {
|
|
70
91
|
destroyFns.push(closeFunc);
|
|
71
92
|
}
|
|
@@ -100,7 +121,6 @@ export default function useCcsDialog() {
|
|
|
100
121
|
return instance;
|
|
101
122
|
}, []);
|
|
102
123
|
var getDrawerFunc = React.useCallback(function (config) {
|
|
103
|
-
var _holderRef$current2;
|
|
104
124
|
drawerUuid += 1;
|
|
105
125
|
var modalRef = /*#__PURE__*/React.createRef();
|
|
106
126
|
var closeFunc;
|
|
@@ -112,7 +132,25 @@ export default function useCcsDialog() {
|
|
|
112
132
|
},
|
|
113
133
|
ref: modalRef
|
|
114
134
|
}, "drawer-".concat(drawerUuid));
|
|
115
|
-
|
|
135
|
+
if (holderRef.current) {
|
|
136
|
+
var _holderRef$current;
|
|
137
|
+
// 加载了contextHolder
|
|
138
|
+
closeFunc = (_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.patchElement(modal);
|
|
139
|
+
} else {
|
|
140
|
+
CcsUtils.showWarning(true, "\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
|
|
141
|
+
// 未加载contextHolder,创建dom
|
|
142
|
+
var dialogEle = document.createElement('div');
|
|
143
|
+
document.body.append(dialogEle);
|
|
144
|
+
var root = createRoot(dialogEle);
|
|
145
|
+
root.render( /*#__PURE__*/_jsx(_Fragment, {
|
|
146
|
+
children: modal
|
|
147
|
+
}));
|
|
148
|
+
closeFunc = function closeFunc() {
|
|
149
|
+
setTimeout(function () {
|
|
150
|
+
root.unmount();
|
|
151
|
+
}, 500);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
116
154
|
if (closeFunc) {
|
|
117
155
|
destroyFns.push(closeFunc);
|
|
118
156
|
}
|
package/es/dialog/index.less
CHANGED
package/es/hooks/use-page.d.ts
CHANGED
package/es/pro-table/index.less
CHANGED
|
@@ -190,28 +190,30 @@
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
.ant-table-wrapper .ant-table > .ant-table-container {
|
|
193
|
+
border-inline-start: 0;
|
|
194
|
+
border-top: 0;
|
|
195
|
+
|
|
193
196
|
& > .ant-table-header > table > thead > tr {
|
|
194
197
|
& > th:last-child {
|
|
195
198
|
border-inline-end: 0;
|
|
196
199
|
border-start-start-radius: 0;
|
|
197
200
|
border-start-end-radius: 0;
|
|
198
201
|
}
|
|
202
|
+
|
|
199
203
|
& > th:first-child {
|
|
200
204
|
border-start-start-radius: 0;
|
|
201
205
|
}
|
|
202
206
|
}
|
|
207
|
+
|
|
203
208
|
& > .ant-table-body > table > tbody > tr > td:last-child {
|
|
204
209
|
border-inline-end: 0;
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
212
|
|
|
208
|
-
.ant-table-wrapper .ant-table > .ant-table-container {
|
|
209
|
-
border-inline-start: 0;
|
|
210
|
-
border-top: 0;
|
|
211
|
-
}
|
|
212
213
|
.ant-table-wrapper table {
|
|
213
214
|
border-radius: 0;
|
|
214
215
|
}
|
|
216
|
+
|
|
215
217
|
.ant-table-wrapper .ant-table .ant-table-header {
|
|
216
218
|
border-radius: 0;
|
|
217
219
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ccs-ui/rc-pro",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "验证码组件兼容暗黑模式;proTable封装rowselection代码;proTable添加自适应布局模式;",
|
|
3
|
+
"version": "1.2.0-beta-2",
|
|
4
|
+
"description": "验证码组件兼容暗黑模式;proTable封装rowselection代码;proTable添加自适应布局模式;CcsDialog不适应contextHolder也能打开。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hong",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"js-base64": "^3.7.5",
|
|
69
69
|
"localforage": "^1.10.0",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
71
|
+
"rc-menu": "^9.15.1",
|
|
71
72
|
"rc-trigger": "^5.3.4",
|
|
72
73
|
"rc-util": "^5.32.4",
|
|
73
74
|
"react-color": "^2.19.3",
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
"prettier": "^2.7.1",
|
|
103
104
|
"prettier-plugin-organize-imports": "^3.0.0",
|
|
104
105
|
"prettier-plugin-packagejson": "^2.2.18",
|
|
106
|
+
"rc-table": "^7.47.5",
|
|
105
107
|
"react": "^18.0.0",
|
|
106
108
|
"react-dom": "^18.0.0",
|
|
107
109
|
"stylelint": "^14.9.1"
|