@ccs-ui/rc-pro 1.1.1-rc30 → 1.1.1-rc32
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 +6 -1
- package/es/dialog/HookDrawer.js +1 -0
- package/es/dialog/HookModal.js +1 -0
- package/es/dialog/button.js +11 -2
- package/es/dialog/context.d.ts +2 -0
- package/es/dialog/drawer-footer.js +1 -2
- package/es/dialog/index.less +6 -1
- package/package.json +1 -1
package/es/ccs.d.ts
CHANGED
|
@@ -204,4 +204,9 @@ type GlobalConfig = {
|
|
|
204
204
|
type TableFormItems = TableFormItem[];
|
|
205
205
|
type TableInstanceRef<T = any> = MutableRefObject<TableInstance<T> | undefined> | React.RefObject<TableInstance<T>>;
|
|
206
206
|
type TableColumns<T = any> = ColumnsType<T>;
|
|
207
|
-
|
|
207
|
+
type PageQueryType<T = Record<string, any>> = {
|
|
208
|
+
pageNo: number;
|
|
209
|
+
pageSize: number;
|
|
210
|
+
query: T;
|
|
211
|
+
};
|
|
212
|
+
export type { PageType, RecordType, MenuTreeNode, PageQuery, ListQuery, HttpResult, GlobalConfig, HttpListResult, HttpPageResult, AuthButtonItem, MenuTreeNodeData, UserDetail, RouteHistory, TableData, PageQueryType, TableFormItems, TableColumns, TableInstance, TableInstanceRef, TriggerChildrenProps, };
|
package/es/dialog/HookDrawer.js
CHANGED
|
@@ -108,6 +108,7 @@ var HookDrawer = function HookDrawer(_ref, ref) {
|
|
|
108
108
|
children: /*#__PURE__*/_jsx(DialogContentContext.Provider, {
|
|
109
109
|
value: {
|
|
110
110
|
buttonRef: buttonRef,
|
|
111
|
+
buttonType: 'drawer',
|
|
111
112
|
closeDialog: close,
|
|
112
113
|
drawerFooterRef: footerRef,
|
|
113
114
|
formInitialValues: ((_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.initialValues) || {}
|
package/es/dialog/HookModal.js
CHANGED
|
@@ -164,6 +164,7 @@ var HookModal = function HookModal(_ref2, ref) {
|
|
|
164
164
|
children: /*#__PURE__*/_jsx(DialogContentContext.Provider, {
|
|
165
165
|
value: {
|
|
166
166
|
buttonRef: buttonRef,
|
|
167
|
+
buttonType: 'modal',
|
|
167
168
|
closeDialog: close,
|
|
168
169
|
formInitialValues: ((_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.initialValues) || {}
|
|
169
170
|
},
|
package/es/dialog/button.js
CHANGED
|
@@ -29,7 +29,7 @@ export var DialogButtonHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forw
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
|
-
return
|
|
32
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
33
33
|
children: buttons
|
|
34
34
|
});
|
|
35
35
|
}));
|
|
@@ -44,7 +44,8 @@ export default function CcsDialogButtons(_ref) {
|
|
|
44
44
|
var _CcsDialog$useInstanc = CcsDialog.useInstance(),
|
|
45
45
|
closeDialog = _CcsDialog$useInstanc.closeDialog,
|
|
46
46
|
buttonRef = _CcsDialog$useInstanc.buttonRef,
|
|
47
|
-
formInitialValues = _CcsDialog$useInstanc.formInitialValues
|
|
47
|
+
formInitialValues = _CcsDialog$useInstanc.formInitialValues,
|
|
48
|
+
buttonType = _CcsDialog$useInstanc.buttonType;
|
|
48
49
|
var form = Form.useFormInstance();
|
|
49
50
|
var onOkClick = function onOkClick() {
|
|
50
51
|
if (!onOk) return;
|
|
@@ -75,6 +76,14 @@ export default function CcsDialogButtons(_ref) {
|
|
|
75
76
|
})]
|
|
76
77
|
})]
|
|
77
78
|
});
|
|
79
|
+
if (buttonType === 'modal') {
|
|
80
|
+
btns = /*#__PURE__*/_jsx("div", {
|
|
81
|
+
style: {
|
|
82
|
+
padding: '8px 16px'
|
|
83
|
+
},
|
|
84
|
+
children: btns
|
|
85
|
+
});
|
|
86
|
+
}
|
|
78
87
|
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.onSetButtons(btns);
|
|
79
88
|
});
|
|
80
89
|
return null;
|
package/es/dialog/context.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { Store } from 'antd/es/form/interface';
|
|
|
2
2
|
import React, { RefObject } from 'react';
|
|
3
3
|
import { DialogButtonRef } from './button';
|
|
4
4
|
export interface DialogContextType<T = Store> {
|
|
5
|
+
/** 按钮类型 */
|
|
6
|
+
buttonType: 'modal' | 'drawer';
|
|
5
7
|
/** 表单初始值 */
|
|
6
8
|
formInitialValues: T;
|
|
7
9
|
/** 按钮 ref */
|
|
@@ -41,8 +41,7 @@ export default function CcsDrawerFooter(_ref) {
|
|
|
41
41
|
if (!onOk && !children) return;
|
|
42
42
|
var btns = /*#__PURE__*/_jsxs("div", {
|
|
43
43
|
style: {
|
|
44
|
-
padding: '8px 16px'
|
|
45
|
-
borderTop: '1px solid rgba(5, 5, 5, 0.06)'
|
|
44
|
+
padding: '8px 16px'
|
|
46
45
|
},
|
|
47
46
|
children: [children, onOk && /*#__PURE__*/_jsxs(_Fragment, {
|
|
48
47
|
children: [!hideCancel && /*#__PURE__*/_jsx(Button, {
|
package/es/dialog/index.less
CHANGED