listpage-next 0.0.159 → 0.0.161

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.
@@ -0,0 +1 @@
1
+ export declare const Demo12: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import { Fragment, jsx } from "react/jsx-runtime";
2
+ import { Button } from "antd";
3
+ import { ChatSplitter } from "../features/ChatClient/index.js";
4
+ import { CloseOutlined } from "@ant-design/icons";
5
+ import { useState } from "react";
6
+ const Demo12 = ()=>{
7
+ const [pure, setPure] = useState(false);
8
+ return /*#__PURE__*/ jsx("div", {
9
+ style: {
10
+ width: 500,
11
+ background: 'lightblue'
12
+ },
13
+ children: /*#__PURE__*/ jsx(ChatSplitter, {
14
+ pure: pure,
15
+ left: {
16
+ title: '详情',
17
+ body: /*#__PURE__*/ jsx(Fragment, {
18
+ children: "详情"
19
+ })
20
+ },
21
+ right: {
22
+ title: '对话',
23
+ body: /*#__PURE__*/ jsx(Fragment, {
24
+ children: "对话"
25
+ }),
26
+ extra: /*#__PURE__*/ jsx(Button, {
27
+ onClick: ()=>setPure(true),
28
+ icon: /*#__PURE__*/ jsx(CloseOutlined, {})
29
+ })
30
+ },
31
+ size: {
32
+ default: '50%',
33
+ min: '20%',
34
+ max: '80%'
35
+ }
36
+ })
37
+ });
38
+ };
39
+ export { Demo12 };
@@ -1,16 +1,16 @@
1
+ import { CardProps } from 'antd';
1
2
  import type { ReactNode } from 'react';
2
3
  export interface ChatSplitterProps {
4
+ pure?: boolean;
3
5
  left: {
4
6
  title?: string;
5
7
  extra?: ReactNode;
6
8
  body: ReactNode;
7
- visible: boolean;
8
9
  };
9
10
  right: {
10
11
  title?: string;
11
12
  extra?: ReactNode;
12
13
  body: ReactNode;
13
- visible: boolean;
14
14
  };
15
15
  size?: {
16
16
  default?: string;
@@ -18,4 +18,7 @@ export interface ChatSplitterProps {
18
18
  max?: string;
19
19
  };
20
20
  }
21
- export declare const ChatSplitter: (props: ChatSplitterProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
21
+ export declare const ChatSplitter: (props: ChatSplitterProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const SplitterPanelCard: ({ pure, ...props }: CardProps & {
23
+ pure?: boolean;
24
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -2,39 +2,29 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Card, Splitter } from "antd";
3
3
  import styled_components from "styled-components";
4
4
  const ChatSplitter = (props)=>{
5
- const { left, right, size } = props;
5
+ const { pure, left, right, size } = props;
6
6
  const defaultSize = size?.default || '70%';
7
7
  const maxSize = size?.max || '80%';
8
8
  const minSize = size?.min || '60%';
9
- if (!right.visible) return left.body;
10
9
  return /*#__PURE__*/ jsxs(StyledSplitter, {
10
+ lazy: true,
11
11
  children: [
12
12
  /*#__PURE__*/ jsx(Splitter.Panel, {
13
- size: defaultSize,
13
+ defaultSize: defaultSize,
14
14
  min: minSize,
15
15
  max: maxSize,
16
+ resizable: !pure,
16
17
  style: panelStyle,
17
- children: /*#__PURE__*/ jsx(Card, {
18
- styles: {
19
- body: cardBodyStyle,
20
- header: cardHeaderStyle
21
- },
22
- style: cardStyle,
23
- size: "small",
18
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
19
+ pure: pure,
24
20
  title: left.title,
25
21
  extra: left.extra,
26
22
  children: left.body
27
23
  })
28
24
  }),
29
- /*#__PURE__*/ jsx(Splitter.Panel, {
25
+ pure ? false : /*#__PURE__*/ jsx(Splitter.Panel, {
30
26
  style: panelStyle,
31
- children: /*#__PURE__*/ jsx(Card, {
32
- styles: {
33
- body: cardBodyStyle,
34
- header: cardHeaderStyle
35
- },
36
- style: cardStyle,
37
- size: "small",
27
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
38
28
  title: right.title,
39
29
  extra: right.extra,
40
30
  children: right.body
@@ -51,17 +41,42 @@ const StyledSplitter = styled_components(Splitter)`
51
41
  background: transparent !important;
52
42
  }
53
43
  `;
54
- const cardStyle = {
55
- height: '100%'
56
- };
57
- const cardBodyStyle = {
58
- height: 'calc(100% - 38px)',
59
- overflow: 'auto'
60
- };
61
- const cardHeaderStyle = {
62
- background: 'rgba(0, 0, 0, 0.02)'
63
- };
64
44
  const panelStyle = {
65
45
  padding: 4
66
46
  };
67
- export { ChatSplitter };
47
+ const SplitterPanelCard = ({ pure, ...props })=>{
48
+ const pureCardProps = pure ? {
49
+ ...props,
50
+ styles: {
51
+ body: {
52
+ padding: 0
53
+ }
54
+ },
55
+ title: void 0,
56
+ extra: void 0,
57
+ style: {
58
+ border: 'none',
59
+ background: 'transparent'
60
+ }
61
+ } : void 0;
62
+ return /*#__PURE__*/ jsx(Card, {
63
+ styles: {
64
+ body: {
65
+ height: 'calc(100% - 38px)',
66
+ overflow: 'auto'
67
+ },
68
+ header: {
69
+ background: 'rgba(0, 0, 0, 0.02)'
70
+ }
71
+ },
72
+ style: {
73
+ height: '100%'
74
+ },
75
+ size: "small",
76
+ title: props.title,
77
+ extra: props.extra,
78
+ ...pureCardProps,
79
+ children: props.children
80
+ });
81
+ };
82
+ export { ChatSplitter, SplitterPanelCard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.159",
3
+ "version": "0.0.161",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",