@ccs-ui/rc-pro 2.0.1 → 2.0.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.
|
@@ -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, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "
|
|
4
|
+
declare const DialogRequestButton: ({ auth, formRef, extraBtn, formInitialValues, request, onCancel, onRequestBefore, }: Pick<CcsDialogModalProps, "auth" | "request" | "onCancel" | "extraBtn" | "onRequestBefore"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "
|
|
4
|
+
declare const DialogSelfOkButton: ({ auth, formRef, extraBtn, formInitialValues, onCancel, onOk, }: Pick<CcsDialogModalProps, "auth" | "onCancel" | "onOk" | "extraBtn"> & {
|
|
5
5
|
formRef: React.RefObject<DialogFormRef>;
|
|
6
6
|
formInitialValues: FormProps['initialValues'];
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/es/dialog/hook.js
CHANGED
|
@@ -46,6 +46,7 @@ export default function useCcsDialog() {
|
|
|
46
46
|
actionQueue = _React$useState2[0],
|
|
47
47
|
setActionQueue = _React$useState2[1];
|
|
48
48
|
var appConfig = useAppConfig() || {};
|
|
49
|
+
var $holderRef = appConfig.holderRef || holderRef;
|
|
49
50
|
React.useEffect(function () {
|
|
50
51
|
if (actionQueue.length) {
|
|
51
52
|
var cloneQueue = _toConsumableArray(actionQueue);
|
|
@@ -70,14 +71,11 @@ export default function useCcsDialog() {
|
|
|
70
71
|
},
|
|
71
72
|
ref: modalRef
|
|
72
73
|
}, "modal-".concat(modalUuid));
|
|
73
|
-
|
|
74
|
-
// 优先使用自定义contextHolder、其次使用全局contextHolder
|
|
75
|
-
var $holderRef = holderRef.current ? holderRef : appConfig.holderRef;
|
|
76
|
-
if ($holderRef !== null && $holderRef !== void 0 && $holderRef.current) {
|
|
74
|
+
if ($holderRef.current) {
|
|
77
75
|
// 加载了contextHolder
|
|
78
76
|
closeFunc = $holderRef.current.patchElement(modal);
|
|
79
77
|
} else {
|
|
80
|
-
CcsUtils.showWarning(false, "\u672A\
|
|
78
|
+
CcsUtils.showWarning(false, "\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
|
|
81
79
|
// 未加载contextHolder,创建dom
|
|
82
80
|
var dialogEle = document.createElement('div');
|
|
83
81
|
document.body.append(dialogEle);
|
|
@@ -136,13 +134,12 @@ export default function useCcsDialog() {
|
|
|
136
134
|
},
|
|
137
135
|
ref: modalRef
|
|
138
136
|
}, "drawer-".concat(drawerUuid));
|
|
139
|
-
|
|
140
|
-
if ($holderRef !== null && $holderRef !== void 0 && $holderRef.current) {
|
|
137
|
+
if ($holderRef.current) {
|
|
141
138
|
var _$holderRef$current;
|
|
142
139
|
// 加载了contextHolder
|
|
143
140
|
closeFunc = (_$holderRef$current = $holderRef.current) === null || _$holderRef$current === void 0 ? void 0 : _$holderRef$current.patchElement(modal);
|
|
144
141
|
} else {
|
|
145
|
-
CcsUtils.showWarning(
|
|
142
|
+
CcsUtils.showWarning(true, "\u672A\u4F7F\u7528CssAppConfig\u5168\u5C40\u914D\u7F6E\u3001\u4E5F\u672A\u5C06contextHolder\u63D2\u5165\u7EC4\u4EF6\u4E2D\uFF0C\u5C06\u65E0\u6CD5\u9002\u914Dantd\u4E3B\u9898\u914D\u7F6E\u548C\u83B7\u53D6context\u3002");
|
|
146
143
|
// 未加载contextHolder,创建dom
|
|
147
144
|
var dialogEle = document.createElement('div');
|
|
148
145
|
document.body.append(dialogEle);
|