listpage-next 0.0.228 → 0.0.230

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.
@@ -3,4 +3,5 @@ import { MenuProps as AntdMenuProps } from 'antd';
3
3
  export type MenuItem = ItemType;
4
4
  export interface MenuProps extends Omit<AntdMenuProps, 'onSelect'> {
5
5
  onSelect?: (path: string) => void;
6
+ defaultActiveKey?: string;
6
7
  }
@@ -1,5 +1,4 @@
1
1
  function detectActiveMenu(pathname, menus) {
2
- debugger;
3
2
  const activeMenu = menus.filter((item)=>item && pathname.startsWith(item.key)).sort((a, b)=>b.key.length - a.key.length)?.[0];
4
3
  if (!activeMenu) return;
5
4
  if (!activeMenu.children?.length) return activeMenu.key;
@@ -11,5 +11,6 @@ export interface ChatInputProps {
11
11
  placeholder?: string;
12
12
  extra?: ReactNode;
13
13
  actions?: ReactNode;
14
+ disabled?: boolean;
14
15
  }
15
16
  export declare const ChatInput: (props: ChatInputProps) => import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ import { ChatInputBottom, ChatInputContent, ChatInputPanel, ExtraContainer, Send
6
6
  import { useTrigger } from "./hooks/useTrigger.js";
7
7
  import { IconSend } from "../../icons/IconSend.js";
8
8
  const ChatInput = (props)=>{
9
- const { style, className, placeholder, extra, actions, loading, onSubmit, skills = [] } = props;
9
+ const { style, className, placeholder, extra, actions, loading, onSubmit, disabled, skills = [] } = props;
10
10
  const ref = useRef(null);
11
11
  const [inputValue, setInputValue] = useState('');
12
12
  const { interceptKeyDown, ...triggerProps } = useTrigger({
@@ -58,7 +58,7 @@ const ChatInput = (props)=>{
58
58
  variant: "filled",
59
59
  onClick: handleClickSend,
60
60
  onKeyDown: handleKeyDown,
61
- disabled: !inputValue && !loading,
61
+ disabled: disabled || !inputValue && !loading,
62
62
  icon: /*#__PURE__*/ jsx(IconSend, {
63
63
  size: 16
64
64
  }),
@@ -7,15 +7,17 @@ import { useSelectionTools } from "../../hooks/useSelectionTools.js";
7
7
  import { useListPageStore } from "../../context/index.js";
8
8
  import { TableContainer } from "../../styles.js";
9
9
  const DataTable = observer((props)=>{
10
- const { title, extra, columns = [], rowTitleKey, rowSelectionType, tableProps } = props;
10
+ const { title, extra, columns = [], rowTitleKey, rowSelectionType, tableProps, variant, style } = props;
11
11
  const store = useListPageStore();
12
12
  const paginationEle = usePagination(tableProps?.pagination);
13
13
  const newColumns = useColumns(columns);
14
14
  const extraEle = 'function' == typeof extra ? extra(store) : extra;
15
15
  const selectionToolEle = useSelectionTools(rowTitleKey);
16
16
  return /*#__PURE__*/ jsxs(Card, {
17
+ variant: variant,
17
18
  title: selectionToolEle || title,
18
19
  extra: extraEle,
20
+ style: style,
19
21
  styles: {
20
22
  body: {
21
23
  padding: 0
@@ -1,6 +1,6 @@
1
1
  import { TableProps, TagProps, TypographyProps } from 'antd';
2
2
  import { ColumnType } from 'antd/es/table';
3
- import { HTMLAttributeAnchorTarget, ReactNode } from 'react';
3
+ import { CSSProperties, HTMLAttributeAnchorTarget, ReactNode } from 'react';
4
4
  import { ListPageStore } from '../../context';
5
5
  export type ComponentType = 'text' | 'time' | 'tag' | 'link' | 'switch';
6
6
  export type ComponentProps<RecordValue extends Record<string, any> = any> = {
@@ -34,6 +34,8 @@ export interface DataTableProps<FilterValue = any, RecordValue extends Record<st
34
34
  rowSelectionType?: 'checkbox' | 'radio';
35
35
  rowTitleKey?: string;
36
36
  columns?: ListPageTableColumn<FilterValue, RecordValue>[];
37
+ variant?: 'borderless' | 'outlined';
38
+ style?: CSSProperties;
37
39
  tableProps?: Omit<TableProps<RecordValue>, 'dataSource' | 'title' | 'columns'>;
38
40
  }
39
41
  export type ColumnRender<Type extends ComponentType, R extends Record<string, any> = any, K extends string = any> = (value: R[K], record: R, index: number, props: ComponentProps<R>[Type]) => ReactNode;
@@ -4,6 +4,7 @@ import { ListPageContext } from '../..';
4
4
  export interface ListPageProps<FilterValue = any, RecordValue extends Record<string, any> = any> {
5
5
  styles?: {
6
6
  page?: React.CSSProperties;
7
+ table?: React.CSSProperties;
7
8
  };
8
9
  pageRef?: React.RefObject<ListPageContext<FilterValue, RecordValue>>;
9
10
  request: ListPageRequest<FilterValue, RecordValue>;
@@ -41,7 +41,11 @@ const ListPageContainerComponent = observer((props)=>{
41
41
  children: toolbar.render(store)
42
42
  }),
43
43
  /*#__PURE__*/ jsx(DataTable, {
44
- ...table
44
+ ...table,
45
+ style: {
46
+ ...styles?.table,
47
+ ...table.style
48
+ }
45
49
  }),
46
50
  floatEle
47
51
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.228",
3
+ "version": "0.0.230",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",