listpage-next 0.0.159 → 0.0.160

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.
@@ -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,25 +2,20 @@ 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, {
11
10
  children: [
12
11
  /*#__PURE__*/ jsx(Splitter.Panel, {
13
12
  size: defaultSize,
14
13
  min: minSize,
15
14
  max: maxSize,
15
+ resizable: !pure,
16
16
  style: panelStyle,
17
- children: /*#__PURE__*/ jsx(Card, {
18
- styles: {
19
- body: cardBodyStyle,
20
- header: cardHeaderStyle
21
- },
22
- style: cardStyle,
23
- size: "small",
17
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
18
+ pure: !pure,
24
19
  title: left.title,
25
20
  extra: left.extra,
26
21
  children: left.body
@@ -28,13 +23,7 @@ const ChatSplitter = (props)=>{
28
23
  }),
29
24
  /*#__PURE__*/ jsx(Splitter.Panel, {
30
25
  style: panelStyle,
31
- children: /*#__PURE__*/ jsx(Card, {
32
- styles: {
33
- body: cardBodyStyle,
34
- header: cardHeaderStyle
35
- },
36
- style: cardStyle,
37
- size: "small",
26
+ children: /*#__PURE__*/ jsx(SplitterPanelCard, {
38
27
  title: right.title,
39
28
  extra: right.extra,
40
29
  children: right.body
@@ -51,17 +40,42 @@ const StyledSplitter = styled_components(Splitter)`
51
40
  background: transparent !important;
52
41
  }
53
42
  `;
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
43
  const panelStyle = {
65
44
  padding: 4
66
45
  };
67
- export { ChatSplitter };
46
+ const SplitterPanelCard = ({ pure, ...props })=>{
47
+ const pureCardProps = pure ? {
48
+ ...props,
49
+ styles: {
50
+ body: {
51
+ padding: 0
52
+ }
53
+ },
54
+ title: void 0,
55
+ extra: void 0,
56
+ style: {
57
+ border: 'none',
58
+ background: 'transparent'
59
+ }
60
+ } : void 0;
61
+ return /*#__PURE__*/ jsx(Card, {
62
+ styles: {
63
+ body: {
64
+ height: 'calc(100% - 38px)',
65
+ overflow: 'auto'
66
+ },
67
+ header: {
68
+ background: 'rgba(0, 0, 0, 0.02)'
69
+ }
70
+ },
71
+ style: {
72
+ height: '100%'
73
+ },
74
+ size: "small",
75
+ title: props.title,
76
+ extra: props.extra,
77
+ ...pureCardProps,
78
+ children: props.children
79
+ });
80
+ };
81
+ 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.160",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",