zs_library 0.6.19 → 0.6.20
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.
|
@@ -37,16 +37,20 @@ export interface SortableConfig<D, C> {
|
|
|
37
37
|
/**
|
|
38
38
|
* 自定义 item 渲染
|
|
39
39
|
*/
|
|
40
|
-
itemBuilder?: (item: SortItem<D, C
|
|
40
|
+
itemBuilder?: (item: SortItem<D, C>, index: number) => React.ReactNode;
|
|
41
41
|
/**
|
|
42
42
|
* 自定义 item 渲染(允许返回 null 以回退到默认渲染)
|
|
43
43
|
* 当返回值为 null 或 undefined 时,将继续执行下方的默认 switch 渲染逻辑
|
|
44
44
|
*/
|
|
45
|
-
itemBuilderAllowNull?: (item: SortItem<D, C
|
|
45
|
+
itemBuilderAllowNull?: (item: SortItem<D, C>, index: number) => React.ReactNode;
|
|
46
46
|
/**
|
|
47
47
|
* 自定义 item 图标渲染
|
|
48
48
|
*/
|
|
49
49
|
itemIconBuilder?: (item: SortItem<D, C>) => React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* 自定义 item 图标渲染(允许返回 null 以回退到默认渲染)
|
|
52
|
+
*/
|
|
53
|
+
itemIconBuilderAllowNull?: (item: SortItem<D, C>) => React.ReactNode;
|
|
50
54
|
/**
|
|
51
55
|
* 自定义右键菜单
|
|
52
56
|
*/
|
|
@@ -7,8 +7,9 @@ export declare const useSortableConfig: () => {
|
|
|
7
7
|
contextMenu?: false | import('../../context-menu').ContextMenuProps<any, any> | ((data: import('../..').SortItem<any, any>) => false | import('../../context-menu').ContextMenuProps<any, any>) | undefined;
|
|
8
8
|
pagingDotsBuilder?: (dots: React.ReactNode) => React.JSX.Element;
|
|
9
9
|
pagingDotBuilder?: ((item: import('../..').ListItem<any, any>, index: number, isActive: boolean) => React.JSX.Element) | undefined;
|
|
10
|
-
itemBuilder?: ((item: import('../..').SortItem<any, any
|
|
11
|
-
itemBuilderAllowNull?: ((item: import('../..').SortItem<any, any
|
|
10
|
+
itemBuilder?: ((item: import('../..').SortItem<any, any>, index: number) => React.ReactNode) | undefined;
|
|
11
|
+
itemBuilderAllowNull?: ((item: import('../..').SortItem<any, any>, index: number) => React.ReactNode) | undefined;
|
|
12
12
|
itemIconBuilder?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
|
|
13
|
+
itemIconBuilderAllowNull?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
|
|
13
14
|
contextMenuBuilder?: ((data: import('../..').SortItem<any, any>) => import('../../context-menu').ContextMenuProps<any, any>) | undefined;
|
|
14
15
|
};
|
|
@@ -7,4 +7,4 @@ import { SortItem } from '../types';
|
|
|
7
7
|
* @param configItemIconBuilder 配置中的图标构建器
|
|
8
8
|
* @returns 渲染的图标元素
|
|
9
9
|
*/
|
|
10
|
-
export declare const renderIcon: <D, C>(item: SortItem<D, C>, icon?: React.ReactNode, configItemIconBuilder?: ((item: SortItem<D, C>) => React.ReactNode) | React.ReactNode) => React.ReactNode;
|
|
10
|
+
export declare const renderIcon: <D, C>(item: SortItem<D, C>, icon?: React.ReactNode, configItemIconBuilderAllowNull?: (item: SortItem<D, C>) => React.ReactNode, configItemIconBuilder?: ((item: SortItem<D, C>) => React.ReactNode) | React.ReactNode) => React.ReactNode;
|