listpage-next 0.0.210 → 0.0.212

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.
@@ -30,7 +30,8 @@ const Menu_Menu = (props)=>{
30
30
  ] : [],
31
31
  onSelect: (info)=>{
32
32
  setActiveKey(info.key);
33
- onSelect?.(info);
33
+ const path = info.keyPath.reverse().join('/');
34
+ onSelect?.(path);
34
35
  }
35
36
  });
36
37
  };
@@ -11,8 +11,6 @@ export interface MenuProps {
11
11
  menus: MenuItem[];
12
12
  theme?: 'light' | 'dark';
13
13
  style?: CSSProperties;
14
- onSelect?: (info: {
15
- key: string;
16
- }) => void;
14
+ onSelect?: (path: string) => void;
17
15
  defaultActiveKey?: string;
18
16
  }
@@ -0,0 +1,13 @@
1
+ import { ModalProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
+ export interface PageModalProps extends Omit<ModalProps, 'visible' | 'open' | 'onOk' | 'onCancel' | 'footer' | 'title' | 'children' | 'okText' | 'cancelText' | 'closeIcon' | 'closeable'> {
4
+ visible: boolean;
5
+ onOk?: () => void;
6
+ onCancel?: () => void;
7
+ okText?: string;
8
+ cancelText?: string;
9
+ title: string;
10
+ children?: ReactNode;
11
+ footerExtra?: ReactNode;
12
+ }
13
+ export declare const PageModal: (props: PageModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,78 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Button, Modal } from "antd";
3
+ import styled_components from "styled-components";
4
+ import { AsyncButton } from "../../../AsyncButton/index.js";
5
+ const PageModal = (props)=>{
6
+ const { visible, onCancel, onOk, okText, cancelText, title, children, footerExtra, ...modalProps } = props;
7
+ const footer = /*#__PURE__*/ jsxs(Fragment, {
8
+ children: [
9
+ /*#__PURE__*/ jsx(FooterExtraContainer, {
10
+ children: footerExtra
11
+ }),
12
+ /*#__PURE__*/ jsxs("div", {
13
+ children: [
14
+ /*#__PURE__*/ jsx(Button, {
15
+ type: "text",
16
+ onClick: onCancel,
17
+ children: cancelText || '取消'
18
+ }),
19
+ /*#__PURE__*/ jsx(AsyncButton, {
20
+ style: {
21
+ marginLeft: '0.65rem'
22
+ },
23
+ type: "primary",
24
+ onClick: onOk,
25
+ children: okText || '确定'
26
+ })
27
+ ]
28
+ })
29
+ ]
30
+ });
31
+ return /*#__PURE__*/ jsx(ModalStyled, {
32
+ ...modalProps,
33
+ open: visible,
34
+ title: title,
35
+ closeIcon: null,
36
+ closable: true,
37
+ footer: footer,
38
+ onCancel: onCancel,
39
+ onOk: onOk,
40
+ children: children
41
+ });
42
+ };
43
+ const ModalStyled = styled_components(Modal)`
44
+ .ant-modal-content {
45
+ padding: 0;
46
+ }
47
+ .ant-modal-close {
48
+ top: 10px;
49
+ }
50
+ .ant-modal-footer {
51
+ padding: 14px 21px;
52
+
53
+ background-color: rgb(249 250 251 / 1);
54
+ border-top: 1px solid rgb(243 244 246 / 1);
55
+ justify-content: space-between;
56
+ align-items: center;
57
+ display: flex;
58
+ margin-top: 0;
59
+
60
+ border-radius: 0 0 0.5rem 0.5rem;
61
+ }
62
+
63
+ .ant-modal-header {
64
+ margin: 0;
65
+ padding: 14px 21px;
66
+ background-color: rgb(249 250 251 / 1);
67
+ border-bottom: 1px solid rgb(243 244 246 / 1);
68
+ }
69
+ .ant-modal-body {
70
+ padding: 21px;
71
+ }
72
+ `;
73
+ const FooterExtraContainer = styled_components.div`
74
+ flex-grow: 1;
75
+ display: flex;
76
+ align-items: center;
77
+ `;
78
+ export { PageModal };
@@ -1,3 +1,4 @@
1
+ export { PageModal } from './components/PageModal';
1
2
  export { PageLoading } from './components/PageLoading';
2
3
  export { PageLayout } from './components/PageLayout';
3
4
  export { LayoutContent, type LayoutContentProps, } from './components/LayoutContent';
@@ -1,5 +1,6 @@
1
+ import { PageModal } from "./components/PageModal/index.js";
1
2
  import { PageLoading } from "./components/PageLoading/index.js";
2
3
  import { PageLayout } from "./components/PageLayout/index.js";
3
4
  import { LayoutContent } from "./components/LayoutContent/index.js";
4
5
  import { PageContext, usePageContext } from "./components/PageProvider/index.js";
5
- export { LayoutContent, PageContext, PageLayout, PageLoading, usePageContext };
6
+ export { LayoutContent, PageContext, PageLayout, PageLoading, PageModal, usePageContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.210",
3
+ "version": "0.0.212",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",