@amaoaaaaa/search-table 0.3.0 → 0.5.0
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/CHANGELOG.md +114 -0
- package/README.md +199 -50
- package/dist/SearchTable/ConfigProvider.vue.d.ts +2 -0
- package/dist/SearchTable/config.d.ts +42 -9
- package/dist/SearchTable/index.d.ts +32 -2
- package/dist/SearchTable/index.vue.d.ts +103 -3962
- package/dist/SearchTable/types.d.ts +37 -2
- package/dist/index.d.ts +1 -1
- package/dist/search-table.js +434 -384
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { ProTableProps, TableRow } from '../ProTable/types';
|
|
2
2
|
import { PaginationProps } from 'element-plus';
|
|
3
3
|
import { SortState } from './useTableSort';
|
|
4
|
+
/**
|
|
5
|
+
* 分页组件的视觉配置
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* 直接从 element-plus 的 `PaginationProps` 中 Pick,
|
|
9
|
+
* 保证这里的类型与 `el-pagination` 的 props 始终一致。
|
|
10
|
+
*/
|
|
11
|
+
export type SearchTablePaginationProps = Partial<Pick<PaginationProps, 'size' | 'background' | 'pagerCount' | 'layout' | 'popperClass' | 'popperStyle' | 'prevText' | 'prevIcon' | 'nextText' | 'nextIcon'>>;
|
|
12
|
+
/**
|
|
13
|
+
* 搜索区域的配置
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* 用对象承载搜索区的可配置项,后续新增配置直接往里加字段,
|
|
17
|
+
* 避免在全局配置上不断堆叠扁平的单项属性。
|
|
18
|
+
*/
|
|
19
|
+
export interface SearchTableSearchProps {
|
|
20
|
+
/**
|
|
21
|
+
* 搜索按钮的文字
|
|
22
|
+
*
|
|
23
|
+
* @default '搜索'
|
|
24
|
+
*/
|
|
25
|
+
buttonText?: string;
|
|
26
|
+
}
|
|
4
27
|
export type SearchTableProps<T extends TableRow = any> = Omit<ProTableProps<T>, 'data' | 'defaultSort'> & {
|
|
5
28
|
/**
|
|
6
29
|
* 是否显示搜索区域
|
|
@@ -9,8 +32,18 @@ export type SearchTableProps<T extends TableRow = any> = Omit<ProTableProps<T>,
|
|
|
9
32
|
showSearch?: boolean;
|
|
10
33
|
/**
|
|
11
34
|
* 搜索输入框的提示语
|
|
35
|
+
*
|
|
36
|
+
* @default '输入搜索关键词'
|
|
12
37
|
*/
|
|
13
38
|
searchInputPlaceholder?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 搜索按钮的文字
|
|
41
|
+
*
|
|
42
|
+
* 优先级高于 `SearchTableConfigProvider` 中的 `searchProps.buttonText`
|
|
43
|
+
*
|
|
44
|
+
* @default '搜索'
|
|
45
|
+
*/
|
|
46
|
+
searchButtonText?: string;
|
|
14
47
|
/**
|
|
15
48
|
* 搜索框绑定到查询参数的字段名
|
|
16
49
|
*
|
|
@@ -34,9 +67,11 @@ export type SearchTableProps<T extends TableRow = any> = Omit<ProTableProps<T>,
|
|
|
34
67
|
*/
|
|
35
68
|
pageSize?: number;
|
|
36
69
|
/**
|
|
37
|
-
* element-plus
|
|
70
|
+
* element-plus 分页组件的视觉配置
|
|
71
|
+
*
|
|
72
|
+
* 优先级高于 `SearchTableConfigProvider` 中的 `paginationProps`
|
|
38
73
|
*/
|
|
39
|
-
elPaginationProps?:
|
|
74
|
+
elPaginationProps?: SearchTablePaginationProps;
|
|
40
75
|
/**
|
|
41
76
|
* 默认排序
|
|
42
77
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { default as SearchTable } from './SearchTable/index.vue';
|
|
|
2
2
|
export { default as SearchTableConfigProvider } from './SearchTable/ConfigProvider.vue';
|
|
3
3
|
export { default as ProTable } from './ProTable/index.vue';
|
|
4
4
|
export type { ProTableInstance } from './ProTable';
|
|
5
|
-
export type { SearchTableProps, SearchTableFetchFn, PageParams, PageResp, } from './SearchTable/types';
|
|
5
|
+
export type { SearchTableProps, SearchTablePaginationProps, SearchTableSearchProps, SearchTableFetchFn, PageParams, PageResp, } from './SearchTable/types';
|
|
6
6
|
export type { SearchTableInstance } from './SearchTable';
|
|
7
7
|
export type { SearchTableConfigProviderProps } from './SearchTable/config';
|
|
8
8
|
export type { ProTableProps, ProTableColumn, ProTableAction, TableRow, FilterOption, FilterType, ActionButtonVisibility, ApplyFilterPayload, CellEditPayload, ProTableColumn as SearchTableColumn, ProTableAction as SearchTableAction, } from './ProTable/types';
|