listpage-next 0.0.207 → 0.0.209
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/dist/components/Menu/index.js +7 -3
- package/dist/components/Menu/types.d.ts +5 -2
- package/dist/features/ChatClient/ui/Bubble/Reasoning.d.ts +2 -2
- package/dist/features/ChatClient/ui/Bubble/Reasoning.js +3 -3
- package/dist/features/ListPage/hooks/useColumns.js +10 -2
- package/package.json +1 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo
|
|
2
|
+
import { useMemo } from "react";
|
|
3
3
|
import { Menu } from "antd";
|
|
4
4
|
import { styled } from "styled-components";
|
|
5
|
+
import { useControllableValue } from "ahooks";
|
|
5
6
|
const Menu_Menu = (props)=>{
|
|
6
|
-
const { menus, theme, style,
|
|
7
|
-
const [activeKey, setActiveKey] =
|
|
7
|
+
const { menus, theme, style, onSelect } = props;
|
|
8
|
+
const [activeKey, setActiveKey] = useControllableValue(props, {
|
|
9
|
+
defaultValuePropName: 'defaultActiveKey'
|
|
10
|
+
});
|
|
8
11
|
const menuItems = useMemo(()=>menus.map((item)=>({
|
|
9
12
|
key: item.key,
|
|
10
13
|
label: item.label,
|
|
@@ -27,6 +30,7 @@ const Menu_Menu = (props)=>{
|
|
|
27
30
|
] : [],
|
|
28
31
|
onSelect: (info)=>{
|
|
29
32
|
setActiveKey(info.key);
|
|
33
|
+
onSelect?.(info);
|
|
30
34
|
}
|
|
31
35
|
});
|
|
32
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
2
|
export interface MenuItem {
|
|
3
3
|
key: string;
|
|
4
4
|
label: React.ReactNode;
|
|
@@ -11,5 +11,8 @@ export interface MenuProps {
|
|
|
11
11
|
menus: MenuItem[];
|
|
12
12
|
theme?: 'light' | 'dark';
|
|
13
13
|
style?: CSSProperties;
|
|
14
|
-
|
|
14
|
+
onSelect?: (info: {
|
|
15
|
+
key: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
defaultActiveKey?: string;
|
|
15
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export declare const Reasoning: ({ thinking, children
|
|
2
|
+
export declare const Reasoning: import("react").MemoExoticComponent<({ thinking, children }: {
|
|
3
3
|
thinking?: boolean;
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowsAltOutlined, ShrinkOutlined } from "@ant-design/icons";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
3
|
+
import { memo, useEffect, useState } from "react";
|
|
4
4
|
import { styled } from "styled-components";
|
|
5
|
-
const Reasoning = ({ thinking, children })=>{
|
|
5
|
+
const Reasoning = /*#__PURE__*/ memo(({ thinking, children })=>{
|
|
6
6
|
const [collapsed, setCollapsed] = useState(false);
|
|
7
7
|
useEffect(()=>{
|
|
8
8
|
if (!thinking) setCollapsed(true);
|
|
@@ -40,7 +40,7 @@ const Reasoning = ({ thinking, children })=>{
|
|
|
40
40
|
})
|
|
41
41
|
]
|
|
42
42
|
});
|
|
43
|
-
};
|
|
43
|
+
});
|
|
44
44
|
const ReasoningContainer = styled.div`
|
|
45
45
|
background-color: #fff;
|
|
46
46
|
cursor: pointer;
|
|
@@ -3,8 +3,16 @@ import { renders } from "../components/DataTable/renders/index.js";
|
|
|
3
3
|
function useColumns(columns) {
|
|
4
4
|
const ctx = useListPageStore();
|
|
5
5
|
return columns.map((column)=>{
|
|
6
|
-
if (
|
|
7
|
-
|
|
6
|
+
if (column.component) {
|
|
7
|
+
const render = createColumnRender(column.component, column.props, ctx);
|
|
8
|
+
return {
|
|
9
|
+
...column,
|
|
10
|
+
render
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
...column
|
|
15
|
+
};
|
|
8
16
|
});
|
|
9
17
|
}
|
|
10
18
|
function createColumnRender(component, props, ctx) {
|