listpage-next 0.0.212 → 0.0.213

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.
@@ -6,8 +6,10 @@ export interface PageModalProps extends Omit<ModalProps, 'visible' | 'open' | 'o
6
6
  onCancel?: () => void;
7
7
  okText?: string;
8
8
  cancelText?: string;
9
+ icon?: ReactNode;
9
10
  title: string;
10
11
  children?: ReactNode;
12
+ actionPosition?: 'top' | 'bottom';
11
13
  footerExtra?: ReactNode;
12
14
  }
13
15
  export declare const PageModal: (props: PageModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,10 +3,10 @@ import { Button, Modal } from "antd";
3
3
  import styled_components from "styled-components";
4
4
  import { AsyncButton } from "../../../AsyncButton/index.js";
5
5
  const PageModal = (props)=>{
6
- const { visible, onCancel, onOk, okText, cancelText, title, children, footerExtra, ...modalProps } = props;
6
+ const { icon, visible, onCancel, onOk, okText, cancelText, title, children, footerExtra, actionPosition = 'bottom', ...modalProps } = props;
7
7
  const footer = /*#__PURE__*/ jsxs(Fragment, {
8
8
  children: [
9
- /*#__PURE__*/ jsx(FooterExtraContainer, {
9
+ /*#__PURE__*/ jsx(FlexContainer, {
10
10
  children: footerExtra
11
11
  }),
12
12
  /*#__PURE__*/ jsxs("div", {
@@ -28,13 +28,46 @@ const PageModal = (props)=>{
28
28
  })
29
29
  ]
30
30
  });
31
+ const header = /*#__PURE__*/ jsxs(HeaderContainer, {
32
+ children: [
33
+ /*#__PURE__*/ jsxs(FlexContainer, {
34
+ children: [
35
+ icon,
36
+ title
37
+ ]
38
+ }),
39
+ /*#__PURE__*/ jsxs("div", {
40
+ children: [
41
+ footerExtra,
42
+ /*#__PURE__*/ jsx(Button, {
43
+ type: "text",
44
+ onClick: onCancel,
45
+ children: cancelText || '取消'
46
+ }),
47
+ /*#__PURE__*/ jsx(AsyncButton, {
48
+ style: {
49
+ marginLeft: '0.65rem'
50
+ },
51
+ type: "primary",
52
+ onClick: onOk,
53
+ children: okText || '确定'
54
+ })
55
+ ]
56
+ })
57
+ ]
58
+ });
31
59
  return /*#__PURE__*/ jsx(ModalStyled, {
32
60
  ...modalProps,
33
61
  open: visible,
34
- title: title,
62
+ title: 'top' === actionPosition ? header : /*#__PURE__*/ jsxs(FlexContainer, {
63
+ children: [
64
+ icon,
65
+ title
66
+ ]
67
+ }),
35
68
  closeIcon: null,
36
- closable: true,
37
- footer: footer,
69
+ closable: 'bottom' === actionPosition,
70
+ footer: 'top' === actionPosition ? null : footer,
38
71
  onCancel: onCancel,
39
72
  onOk: onOk,
40
73
  children: children
@@ -70,9 +103,14 @@ const ModalStyled = styled_components(Modal)`
70
103
  padding: 21px;
71
104
  }
72
105
  `;
73
- const FooterExtraContainer = styled_components.div`
106
+ const FlexContainer = styled_components.div`
74
107
  flex-grow: 1;
75
108
  display: flex;
76
109
  align-items: center;
110
+ gap: 4px;
111
+ `;
112
+ const HeaderContainer = styled_components.div`
113
+ display: flex;
114
+ align-items: center;
77
115
  `;
78
116
  export { PageModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.212",
3
+ "version": "0.0.213",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",