@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 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
- export type { PageType, RecordType, MenuTreeNode, PageQuery, ListQuery, HttpResult, GlobalConfig, HttpListResult, HttpPageResult, AuthButtonItem, MenuTreeNodeData, UserDetail, RouteHistory, TableData, TableFormItems, TableColumns, TableInstance, TableInstanceRef, TriggerChildrenProps, };
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, };
@@ -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) || {}
@@ -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
  },
@@ -29,7 +29,7 @@ export var DialogButtonHolder = /*#__PURE__*/React.memo( /*#__PURE__*/React.forw
29
29
  }
30
30
  };
31
31
  });
32
- return buttons && /*#__PURE__*/_jsx(_Fragment, {
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;
@@ -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, {
@@ -12,6 +12,11 @@
12
12
  .ccs-dialog-drawer {
13
13
  .ant-drawer-footer {
14
14
  padding: 0;
15
- border-top: 0;
15
+ }
16
+ }
17
+
18
+ .ccs-dialog-modal {
19
+ .ant-modal-footer {
20
+ padding: 0;
16
21
  }
17
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccs-ui/rc-pro",
3
- "version": "1.1.1-rc30",
3
+ "version": "1.1.1-rc32",
4
4
  "description": "A react pro components",
5
5
  "license": "MIT",
6
6
  "module": "es/index.js",