@xn-lib/component 0.1.31 → 0.1.34
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/index.cjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.iife.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/form-list/index.vue.d.ts +4 -4
- package/dist/types/index.d.ts +3 -1
- package/dist/types/modal/index.d.ts +5 -0
- package/dist/types/modal/index.vue.d.ts +567 -0
- package/dist/types/modal/props.d.ts +75 -0
- package/dist/types/table/components/TableMain.vue.d.ts +70 -0
- package/dist/types/table/components/TablePagination.vue.d.ts +24 -0
- package/dist/types/table/components/TableToolbar.vue.d.ts +18 -0
- package/dist/types/table/components/ToolbarButtonGroup.vue.d.ts +23 -0
- package/dist/types/table/composables/index.d.ts +2 -0
- package/dist/types/table/composables/store.d.ts +399 -0
- package/dist/types/table/index.d.ts +6 -0
- package/dist/types/table/index.vue.d.ts +262 -0
- package/dist/types/table/props.d.ts +100 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/table.d.ts +322 -0
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import type { ModalFormConfig } from '../types';
|
|
3
|
+
export declare const modalProps: {
|
|
4
|
+
/** 交互类型 */
|
|
5
|
+
readonly type: {
|
|
6
|
+
readonly type: PropType<"dialog" | "drawer">;
|
|
7
|
+
readonly default: "dialog";
|
|
8
|
+
};
|
|
9
|
+
/** 标题,支持字符串或函数返回 */
|
|
10
|
+
readonly title: {
|
|
11
|
+
readonly type: PropType<string | ((data?: any) => string)>;
|
|
12
|
+
readonly default: "";
|
|
13
|
+
};
|
|
14
|
+
/** 宽度 */
|
|
15
|
+
readonly width: {
|
|
16
|
+
readonly type: PropType<string | number>;
|
|
17
|
+
readonly default: "500px";
|
|
18
|
+
};
|
|
19
|
+
/** 是否在关闭时销毁 */
|
|
20
|
+
readonly destroyOnClose: {
|
|
21
|
+
readonly type: BooleanConstructor;
|
|
22
|
+
readonly default: true;
|
|
23
|
+
};
|
|
24
|
+
/** 点击遮罩关闭 */
|
|
25
|
+
readonly closeOnClickModal: {
|
|
26
|
+
readonly type: BooleanConstructor;
|
|
27
|
+
readonly default: true;
|
|
28
|
+
};
|
|
29
|
+
/** ESC 关闭 */
|
|
30
|
+
readonly closeOnPressEscape: {
|
|
31
|
+
readonly type: BooleanConstructor;
|
|
32
|
+
readonly default: true;
|
|
33
|
+
};
|
|
34
|
+
/** 是否追加到 body */
|
|
35
|
+
readonly appendToBody: {
|
|
36
|
+
readonly type: BooleanConstructor;
|
|
37
|
+
readonly default: true;
|
|
38
|
+
};
|
|
39
|
+
/** drawer 方向 */
|
|
40
|
+
readonly placement: {
|
|
41
|
+
readonly type: PropType<"left" | "right" | "top" | "bottom">;
|
|
42
|
+
readonly default: "right";
|
|
43
|
+
};
|
|
44
|
+
/** 是否显示底部按钮 */
|
|
45
|
+
readonly showFooter: {
|
|
46
|
+
readonly type: BooleanConstructor;
|
|
47
|
+
readonly default: true;
|
|
48
|
+
};
|
|
49
|
+
/** 取消按钮文本 */
|
|
50
|
+
readonly cancelText: {
|
|
51
|
+
readonly type: StringConstructor;
|
|
52
|
+
readonly default: "取消";
|
|
53
|
+
};
|
|
54
|
+
/** 确定按钮文本 */
|
|
55
|
+
readonly confirmText: {
|
|
56
|
+
readonly type: StringConstructor;
|
|
57
|
+
readonly default: "确定";
|
|
58
|
+
};
|
|
59
|
+
/** 表单配置,有值时自动包裹 el-form 并校验 */
|
|
60
|
+
readonly form: {
|
|
61
|
+
readonly type: PropType<ModalFormConfig>;
|
|
62
|
+
readonly default: undefined;
|
|
63
|
+
};
|
|
64
|
+
/** 确定回调,返回 false 阻止关闭,支持 Promise */
|
|
65
|
+
readonly onOk: {
|
|
66
|
+
readonly type: PropType<(data?: any) => boolean | Promise<boolean | void> | void>;
|
|
67
|
+
readonly default: undefined;
|
|
68
|
+
};
|
|
69
|
+
/** 取消回调,返回 false 阻止关闭,支持 Promise */
|
|
70
|
+
readonly onCancel: {
|
|
71
|
+
readonly type: PropType<(data?: any) => boolean | Promise<boolean | void> | void>;
|
|
72
|
+
readonly default: undefined;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export type ModalProps = ExtractPropTypes<typeof modalProps>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ColumnStyle, ColumnCls, CheckboxValueType } from 'element-plus';
|
|
2
|
+
import type { TableColumn } from '../../types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
data: any[];
|
|
5
|
+
columns: TableColumn[];
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
virtual?: boolean;
|
|
8
|
+
rowKey?: any;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
maxHeight?: number | string;
|
|
11
|
+
width?: number;
|
|
12
|
+
stripe?: boolean;
|
|
13
|
+
border?: boolean;
|
|
14
|
+
size?: 'large' | 'default' | 'small';
|
|
15
|
+
showHeader?: boolean;
|
|
16
|
+
highlightCurrentRow?: boolean;
|
|
17
|
+
rowClassName?: ColumnCls<any> | undefined;
|
|
18
|
+
rowStyle?: ColumnStyle<any> | undefined;
|
|
19
|
+
emptyText?: string;
|
|
20
|
+
rowHeight?: number;
|
|
21
|
+
cache?: number;
|
|
22
|
+
showSelection?: boolean;
|
|
23
|
+
selectionType?: 'single' | 'multiple';
|
|
24
|
+
reserveSelection?: boolean;
|
|
25
|
+
showIndex?: boolean;
|
|
26
|
+
singleSelectedKey?: any;
|
|
27
|
+
currentPage?: number;
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
visibleColumns?: TableColumn[];
|
|
30
|
+
isSingleSelected?: (row: any) => boolean;
|
|
31
|
+
onSingleSelect?: (row: any, selected: CheckboxValueType) => void;
|
|
32
|
+
selectable?: (row: any, index: number) => boolean;
|
|
33
|
+
};
|
|
34
|
+
declare var __VLS_46: string, __VLS_47: {
|
|
35
|
+
row: any;
|
|
36
|
+
column: TableColumn;
|
|
37
|
+
index: any;
|
|
38
|
+
}, __VLS_77: {};
|
|
39
|
+
type __VLS_Slots = {} & {
|
|
40
|
+
[K in NonNullable<typeof __VLS_46>]?: (props: typeof __VLS_47) => any;
|
|
41
|
+
} & {
|
|
42
|
+
default?: (props: typeof __VLS_77) => any;
|
|
43
|
+
};
|
|
44
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
45
|
+
tableRef: import("vue").Ref<any, any>;
|
|
46
|
+
tableV2Ref: import("vue").Ref<any, any>;
|
|
47
|
+
toggleRowSelection: (row: any, selected?: boolean) => void;
|
|
48
|
+
clearSelection: () => void;
|
|
49
|
+
toggleAllSelection: () => void;
|
|
50
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
51
|
+
select: (selection: any[], row: any) => any;
|
|
52
|
+
"selection-change": (selection: any[]) => any;
|
|
53
|
+
"select-all": (selection: any[]) => any;
|
|
54
|
+
"row-click": (row: any, column: any, event: MouseEvent) => any;
|
|
55
|
+
"action-modal": (key: string, row: any) => any;
|
|
56
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
57
|
+
onSelect?: ((selection: any[], row: any) => any) | undefined;
|
|
58
|
+
"onSelection-change"?: ((selection: any[]) => any) | undefined;
|
|
59
|
+
"onSelect-all"?: ((selection: any[]) => any) | undefined;
|
|
60
|
+
"onRow-click"?: ((row: any, column: any, event: MouseEvent) => any) | undefined;
|
|
61
|
+
"onAction-modal"?: ((key: string, row: any) => any) | undefined;
|
|
62
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
63
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
64
|
+
declare const _default: typeof __VLS_export;
|
|
65
|
+
export default _default;
|
|
66
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
67
|
+
new (): {
|
|
68
|
+
$slots: S;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
currentPage: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
pageSizeOptions: number[];
|
|
6
|
+
total: number;
|
|
7
|
+
layout?: string;
|
|
8
|
+
background?: boolean;
|
|
9
|
+
size?: 'small' | 'default';
|
|
10
|
+
showTotal?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:currentPage": (page: number) => any;
|
|
14
|
+
"update:pageSize": (size: number) => any;
|
|
15
|
+
"page-change": (page: number) => any;
|
|
16
|
+
"size-change": (size: number) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
"onUpdate:currentPage"?: ((page: number) => any) | undefined;
|
|
19
|
+
"onUpdate:pageSize"?: ((size: number) => any) | undefined;
|
|
20
|
+
"onPage-change"?: ((page: number) => any) | undefined;
|
|
21
|
+
"onSize-change"?: ((size: number) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SearchConfig, ToolbarConfig } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
visibleSearchConfig: SearchConfig[];
|
|
4
|
+
searchParams: Record<string, any>;
|
|
5
|
+
updateSearchParam: (key: string, value: any) => void;
|
|
6
|
+
toolbar: ToolbarConfig;
|
|
7
|
+
selection: any[];
|
|
8
|
+
hasSelection: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
search: (params: Record<string, any>) => any;
|
|
12
|
+
reset: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSearch?: ((params: Record<string, any>) => any) | undefined;
|
|
15
|
+
onReset?: (() => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ToolbarButton } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
buttons: ToolbarButton[];
|
|
4
|
+
selection: any[];
|
|
5
|
+
hasSelection: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {
|
|
8
|
+
button: ToolbarButton;
|
|
9
|
+
selection: any[];
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
'toolbar-button'?: (props: typeof __VLS_1) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import type { TableColumn, SelectionConfig, PaginationConfig } from '../../types';
|
|
2
|
+
import type { TableProps } from '../props';
|
|
3
|
+
import { CheckboxValueType } from 'element-plus';
|
|
4
|
+
declare const tableStore: {
|
|
5
|
+
provider: (props: TableProps) => {
|
|
6
|
+
selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
|
|
7
|
+
selectedRows: import("vue").ShallowRef<any[], any[]>;
|
|
8
|
+
currentPage: import("vue").Ref<number, number>;
|
|
9
|
+
pageSize: import("vue").Ref<number, number>;
|
|
10
|
+
searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
|
|
11
|
+
visibleColumns: import("vue").Ref<string[], string[]>;
|
|
12
|
+
rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
|
|
13
|
+
filteredData: import("vue").Ref<any[], any[]>;
|
|
14
|
+
requestData: import("vue").Ref<any[], any[]>;
|
|
15
|
+
requestTotal: import("vue").Ref<number, number>;
|
|
16
|
+
requestLoading: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
modalMap: import("vue").Ref<Map<string, {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
data?: any;
|
|
20
|
+
}> & Omit<Map<string, {
|
|
21
|
+
visible: boolean;
|
|
22
|
+
data?: any;
|
|
23
|
+
}>, keyof Map<any, any>>, Map<string, {
|
|
24
|
+
visible: boolean;
|
|
25
|
+
data?: any;
|
|
26
|
+
}> | (Map<string, {
|
|
27
|
+
visible: boolean;
|
|
28
|
+
data?: any;
|
|
29
|
+
}> & Omit<Map<string, {
|
|
30
|
+
visible: boolean;
|
|
31
|
+
data?: any;
|
|
32
|
+
}>, keyof Map<any, any>>)>;
|
|
33
|
+
hasSelection: import("vue").ComputedRef<boolean>;
|
|
34
|
+
selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
|
|
35
|
+
selectionType: import("vue").ComputedRef<any>;
|
|
36
|
+
selectionConfig: import("vue").ComputedRef<SelectionConfig>;
|
|
37
|
+
singleSelectedKey: import("vue").ComputedRef<any>;
|
|
38
|
+
paginationEnabled: import("vue").ComputedRef<boolean>;
|
|
39
|
+
paginationConfig: import("vue").ComputedRef<PaginationConfig>;
|
|
40
|
+
pageSizeOptions: import("vue").ComputedRef<number[]>;
|
|
41
|
+
visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
|
|
42
|
+
visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
|
|
43
|
+
isRequestMode: import("vue").ComputedRef<boolean>;
|
|
44
|
+
autoLoad: import("vue").ComputedRef<boolean>;
|
|
45
|
+
autoRequest: import("vue").ComputedRef<boolean>;
|
|
46
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
47
|
+
autoTotal: import("vue").ComputedRef<number>;
|
|
48
|
+
displayData: import("vue").ComputedRef<any[]>;
|
|
49
|
+
tableConfig: import("vue").ComputedRef<{
|
|
50
|
+
height?: number | string;
|
|
51
|
+
maxHeight?: number | string;
|
|
52
|
+
stripe: boolean;
|
|
53
|
+
border: boolean;
|
|
54
|
+
size: import("../../types").SizeType;
|
|
55
|
+
showHeader: boolean;
|
|
56
|
+
highlightCurrentRow: boolean;
|
|
57
|
+
rowClassName?: import("element-plus").ColumnCls<any> | undefined;
|
|
58
|
+
rowStyle?: import("element-plus").ColumnStyle<any> | undefined;
|
|
59
|
+
emptyText?: string;
|
|
60
|
+
scroll?: {
|
|
61
|
+
x?: number;
|
|
62
|
+
y?: number;
|
|
63
|
+
};
|
|
64
|
+
}>;
|
|
65
|
+
mergedToolbar: import("vue").ComputedRef<{
|
|
66
|
+
left: import("../../types").ToolbarButton[];
|
|
67
|
+
right: import("../../types").ToolbarButton[];
|
|
68
|
+
}>;
|
|
69
|
+
toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
|
|
70
|
+
setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
|
|
71
|
+
clearSelection: () => void;
|
|
72
|
+
setCurrentPage: (page: number) => void;
|
|
73
|
+
setPageSize: (size: number) => void;
|
|
74
|
+
updateSearchParam: (key: string, value: any) => void;
|
|
75
|
+
setSearchFields: (fields: Record<string, any>) => void;
|
|
76
|
+
resetSearch: () => void;
|
|
77
|
+
getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
|
|
78
|
+
setVisibleColumns: (columns: string[]) => void;
|
|
79
|
+
toggleColumn: (key: string) => void;
|
|
80
|
+
init: (config: {
|
|
81
|
+
columns: TableColumn[];
|
|
82
|
+
selectionConfig?: boolean | SelectionConfig;
|
|
83
|
+
}) => void;
|
|
84
|
+
getRowKey: (row: any) => any;
|
|
85
|
+
getKeyValue: (row: any) => any;
|
|
86
|
+
handleSelectionChange: (selection: any[]) => void;
|
|
87
|
+
handleSelectAll: (selection: any[]) => void;
|
|
88
|
+
getSelectedKeys: () => any[];
|
|
89
|
+
getSelectedRows: () => any[];
|
|
90
|
+
isSingleSelected: (row: any) => boolean;
|
|
91
|
+
handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
|
|
92
|
+
handleFilter: () => void;
|
|
93
|
+
resetFilter: () => void;
|
|
94
|
+
load: (emit?: (name: string, data: any) => void) => Promise<void>;
|
|
95
|
+
openModal: (key: string, data?: any) => void;
|
|
96
|
+
closeModal: (key: string) => void;
|
|
97
|
+
closeAllModals: () => void;
|
|
98
|
+
getModal: (key: string) => {
|
|
99
|
+
visible: boolean;
|
|
100
|
+
data?: any;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
useStore: () => {
|
|
104
|
+
selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
|
|
105
|
+
selectedRows: import("vue").ShallowRef<any[], any[]>;
|
|
106
|
+
currentPage: import("vue").Ref<number, number>;
|
|
107
|
+
pageSize: import("vue").Ref<number, number>;
|
|
108
|
+
searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
|
|
109
|
+
visibleColumns: import("vue").Ref<string[], string[]>;
|
|
110
|
+
rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
|
|
111
|
+
filteredData: import("vue").Ref<any[], any[]>;
|
|
112
|
+
requestData: import("vue").Ref<any[], any[]>;
|
|
113
|
+
requestTotal: import("vue").Ref<number, number>;
|
|
114
|
+
requestLoading: import("vue").Ref<boolean, boolean>;
|
|
115
|
+
modalMap: import("vue").Ref<Map<string, {
|
|
116
|
+
visible: boolean;
|
|
117
|
+
data?: any;
|
|
118
|
+
}> & Omit<Map<string, {
|
|
119
|
+
visible: boolean;
|
|
120
|
+
data?: any;
|
|
121
|
+
}>, keyof Map<any, any>>, Map<string, {
|
|
122
|
+
visible: boolean;
|
|
123
|
+
data?: any;
|
|
124
|
+
}> | (Map<string, {
|
|
125
|
+
visible: boolean;
|
|
126
|
+
data?: any;
|
|
127
|
+
}> & Omit<Map<string, {
|
|
128
|
+
visible: boolean;
|
|
129
|
+
data?: any;
|
|
130
|
+
}>, keyof Map<any, any>>)>;
|
|
131
|
+
hasSelection: import("vue").ComputedRef<boolean>;
|
|
132
|
+
selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
|
|
133
|
+
selectionType: import("vue").ComputedRef<any>;
|
|
134
|
+
selectionConfig: import("vue").ComputedRef<SelectionConfig>;
|
|
135
|
+
singleSelectedKey: import("vue").ComputedRef<any>;
|
|
136
|
+
paginationEnabled: import("vue").ComputedRef<boolean>;
|
|
137
|
+
paginationConfig: import("vue").ComputedRef<PaginationConfig>;
|
|
138
|
+
pageSizeOptions: import("vue").ComputedRef<number[]>;
|
|
139
|
+
visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
|
|
140
|
+
visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
|
|
141
|
+
isRequestMode: import("vue").ComputedRef<boolean>;
|
|
142
|
+
autoLoad: import("vue").ComputedRef<boolean>;
|
|
143
|
+
autoRequest: import("vue").ComputedRef<boolean>;
|
|
144
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
145
|
+
autoTotal: import("vue").ComputedRef<number>;
|
|
146
|
+
displayData: import("vue").ComputedRef<any[]>;
|
|
147
|
+
tableConfig: import("vue").ComputedRef<{
|
|
148
|
+
height?: number | string;
|
|
149
|
+
maxHeight?: number | string;
|
|
150
|
+
stripe: boolean;
|
|
151
|
+
border: boolean;
|
|
152
|
+
size: import("../../types").SizeType;
|
|
153
|
+
showHeader: boolean;
|
|
154
|
+
highlightCurrentRow: boolean;
|
|
155
|
+
rowClassName?: import("element-plus").ColumnCls<any> | undefined;
|
|
156
|
+
rowStyle?: import("element-plus").ColumnStyle<any> | undefined;
|
|
157
|
+
emptyText?: string;
|
|
158
|
+
scroll?: {
|
|
159
|
+
x?: number;
|
|
160
|
+
y?: number;
|
|
161
|
+
};
|
|
162
|
+
}>;
|
|
163
|
+
mergedToolbar: import("vue").ComputedRef<{
|
|
164
|
+
left: import("../../types").ToolbarButton[];
|
|
165
|
+
right: import("../../types").ToolbarButton[];
|
|
166
|
+
}>;
|
|
167
|
+
toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
|
|
168
|
+
setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
|
|
169
|
+
clearSelection: () => void;
|
|
170
|
+
setCurrentPage: (page: number) => void;
|
|
171
|
+
setPageSize: (size: number) => void;
|
|
172
|
+
updateSearchParam: (key: string, value: any) => void;
|
|
173
|
+
setSearchFields: (fields: Record<string, any>) => void;
|
|
174
|
+
resetSearch: () => void;
|
|
175
|
+
getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
|
|
176
|
+
setVisibleColumns: (columns: string[]) => void;
|
|
177
|
+
toggleColumn: (key: string) => void;
|
|
178
|
+
init: (config: {
|
|
179
|
+
columns: TableColumn[];
|
|
180
|
+
selectionConfig?: boolean | SelectionConfig;
|
|
181
|
+
}) => void;
|
|
182
|
+
getRowKey: (row: any) => any;
|
|
183
|
+
getKeyValue: (row: any) => any;
|
|
184
|
+
handleSelectionChange: (selection: any[]) => void;
|
|
185
|
+
handleSelectAll: (selection: any[]) => void;
|
|
186
|
+
getSelectedKeys: () => any[];
|
|
187
|
+
getSelectedRows: () => any[];
|
|
188
|
+
isSingleSelected: (row: any) => boolean;
|
|
189
|
+
handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
|
|
190
|
+
handleFilter: () => void;
|
|
191
|
+
resetFilter: () => void;
|
|
192
|
+
load: (emit?: (name: string, data: any) => void) => Promise<void>;
|
|
193
|
+
openModal: (key: string, data?: any) => void;
|
|
194
|
+
closeModal: (key: string) => void;
|
|
195
|
+
closeAllModals: () => void;
|
|
196
|
+
getModal: (key: string) => {
|
|
197
|
+
visible: boolean;
|
|
198
|
+
data?: any;
|
|
199
|
+
} | undefined;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
export declare const useTableProvider: (props: TableProps) => {
|
|
203
|
+
selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
|
|
204
|
+
selectedRows: import("vue").ShallowRef<any[], any[]>;
|
|
205
|
+
currentPage: import("vue").Ref<number, number>;
|
|
206
|
+
pageSize: import("vue").Ref<number, number>;
|
|
207
|
+
searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
|
|
208
|
+
visibleColumns: import("vue").Ref<string[], string[]>;
|
|
209
|
+
rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
|
|
210
|
+
filteredData: import("vue").Ref<any[], any[]>;
|
|
211
|
+
requestData: import("vue").Ref<any[], any[]>;
|
|
212
|
+
requestTotal: import("vue").Ref<number, number>;
|
|
213
|
+
requestLoading: import("vue").Ref<boolean, boolean>;
|
|
214
|
+
modalMap: import("vue").Ref<Map<string, {
|
|
215
|
+
visible: boolean;
|
|
216
|
+
data?: any;
|
|
217
|
+
}> & Omit<Map<string, {
|
|
218
|
+
visible: boolean;
|
|
219
|
+
data?: any;
|
|
220
|
+
}>, keyof Map<any, any>>, Map<string, {
|
|
221
|
+
visible: boolean;
|
|
222
|
+
data?: any;
|
|
223
|
+
}> | (Map<string, {
|
|
224
|
+
visible: boolean;
|
|
225
|
+
data?: any;
|
|
226
|
+
}> & Omit<Map<string, {
|
|
227
|
+
visible: boolean;
|
|
228
|
+
data?: any;
|
|
229
|
+
}>, keyof Map<any, any>>)>;
|
|
230
|
+
hasSelection: import("vue").ComputedRef<boolean>;
|
|
231
|
+
selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
|
|
232
|
+
selectionType: import("vue").ComputedRef<any>;
|
|
233
|
+
selectionConfig: import("vue").ComputedRef<SelectionConfig>;
|
|
234
|
+
singleSelectedKey: import("vue").ComputedRef<any>;
|
|
235
|
+
paginationEnabled: import("vue").ComputedRef<boolean>;
|
|
236
|
+
paginationConfig: import("vue").ComputedRef<PaginationConfig>;
|
|
237
|
+
pageSizeOptions: import("vue").ComputedRef<number[]>;
|
|
238
|
+
visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
|
|
239
|
+
visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
|
|
240
|
+
isRequestMode: import("vue").ComputedRef<boolean>;
|
|
241
|
+
autoLoad: import("vue").ComputedRef<boolean>;
|
|
242
|
+
autoRequest: import("vue").ComputedRef<boolean>;
|
|
243
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
244
|
+
autoTotal: import("vue").ComputedRef<number>;
|
|
245
|
+
displayData: import("vue").ComputedRef<any[]>;
|
|
246
|
+
tableConfig: import("vue").ComputedRef<{
|
|
247
|
+
height?: number | string;
|
|
248
|
+
maxHeight?: number | string;
|
|
249
|
+
stripe: boolean;
|
|
250
|
+
border: boolean;
|
|
251
|
+
size: import("../../types").SizeType;
|
|
252
|
+
showHeader: boolean;
|
|
253
|
+
highlightCurrentRow: boolean;
|
|
254
|
+
rowClassName?: import("element-plus").ColumnCls<any> | undefined;
|
|
255
|
+
rowStyle?: import("element-plus").ColumnStyle<any> | undefined;
|
|
256
|
+
emptyText?: string;
|
|
257
|
+
scroll?: {
|
|
258
|
+
x?: number;
|
|
259
|
+
y?: number;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
mergedToolbar: import("vue").ComputedRef<{
|
|
263
|
+
left: import("../../types").ToolbarButton[];
|
|
264
|
+
right: import("../../types").ToolbarButton[];
|
|
265
|
+
}>;
|
|
266
|
+
toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
|
|
267
|
+
setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
|
|
268
|
+
clearSelection: () => void;
|
|
269
|
+
setCurrentPage: (page: number) => void;
|
|
270
|
+
setPageSize: (size: number) => void;
|
|
271
|
+
updateSearchParam: (key: string, value: any) => void;
|
|
272
|
+
setSearchFields: (fields: Record<string, any>) => void;
|
|
273
|
+
resetSearch: () => void;
|
|
274
|
+
getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
|
|
275
|
+
setVisibleColumns: (columns: string[]) => void;
|
|
276
|
+
toggleColumn: (key: string) => void;
|
|
277
|
+
init: (config: {
|
|
278
|
+
columns: TableColumn[];
|
|
279
|
+
selectionConfig?: boolean | SelectionConfig;
|
|
280
|
+
}) => void;
|
|
281
|
+
getRowKey: (row: any) => any;
|
|
282
|
+
getKeyValue: (row: any) => any;
|
|
283
|
+
handleSelectionChange: (selection: any[]) => void;
|
|
284
|
+
handleSelectAll: (selection: any[]) => void;
|
|
285
|
+
getSelectedKeys: () => any[];
|
|
286
|
+
getSelectedRows: () => any[];
|
|
287
|
+
isSingleSelected: (row: any) => boolean;
|
|
288
|
+
handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
|
|
289
|
+
handleFilter: () => void;
|
|
290
|
+
resetFilter: () => void;
|
|
291
|
+
load: (emit?: (name: string, data: any) => void) => Promise<void>;
|
|
292
|
+
openModal: (key: string, data?: any) => void;
|
|
293
|
+
closeModal: (key: string) => void;
|
|
294
|
+
closeAllModals: () => void;
|
|
295
|
+
getModal: (key: string) => {
|
|
296
|
+
visible: boolean;
|
|
297
|
+
data?: any;
|
|
298
|
+
} | undefined;
|
|
299
|
+
};
|
|
300
|
+
export declare const useTableStore: () => {
|
|
301
|
+
selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
|
|
302
|
+
selectedRows: import("vue").ShallowRef<any[], any[]>;
|
|
303
|
+
currentPage: import("vue").Ref<number, number>;
|
|
304
|
+
pageSize: import("vue").Ref<number, number>;
|
|
305
|
+
searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
|
|
306
|
+
visibleColumns: import("vue").Ref<string[], string[]>;
|
|
307
|
+
rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
|
|
308
|
+
filteredData: import("vue").Ref<any[], any[]>;
|
|
309
|
+
requestData: import("vue").Ref<any[], any[]>;
|
|
310
|
+
requestTotal: import("vue").Ref<number, number>;
|
|
311
|
+
requestLoading: import("vue").Ref<boolean, boolean>;
|
|
312
|
+
modalMap: import("vue").Ref<Map<string, {
|
|
313
|
+
visible: boolean;
|
|
314
|
+
data?: any;
|
|
315
|
+
}> & Omit<Map<string, {
|
|
316
|
+
visible: boolean;
|
|
317
|
+
data?: any;
|
|
318
|
+
}>, keyof Map<any, any>>, Map<string, {
|
|
319
|
+
visible: boolean;
|
|
320
|
+
data?: any;
|
|
321
|
+
}> | (Map<string, {
|
|
322
|
+
visible: boolean;
|
|
323
|
+
data?: any;
|
|
324
|
+
}> & Omit<Map<string, {
|
|
325
|
+
visible: boolean;
|
|
326
|
+
data?: any;
|
|
327
|
+
}>, keyof Map<any, any>>)>;
|
|
328
|
+
hasSelection: import("vue").ComputedRef<boolean>;
|
|
329
|
+
selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
|
|
330
|
+
selectionType: import("vue").ComputedRef<any>;
|
|
331
|
+
selectionConfig: import("vue").ComputedRef<SelectionConfig>;
|
|
332
|
+
singleSelectedKey: import("vue").ComputedRef<any>;
|
|
333
|
+
paginationEnabled: import("vue").ComputedRef<boolean>;
|
|
334
|
+
paginationConfig: import("vue").ComputedRef<PaginationConfig>;
|
|
335
|
+
pageSizeOptions: import("vue").ComputedRef<number[]>;
|
|
336
|
+
visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
|
|
337
|
+
visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
|
|
338
|
+
isRequestMode: import("vue").ComputedRef<boolean>;
|
|
339
|
+
autoLoad: import("vue").ComputedRef<boolean>;
|
|
340
|
+
autoRequest: import("vue").ComputedRef<boolean>;
|
|
341
|
+
loading: import("vue").ComputedRef<boolean>;
|
|
342
|
+
autoTotal: import("vue").ComputedRef<number>;
|
|
343
|
+
displayData: import("vue").ComputedRef<any[]>;
|
|
344
|
+
tableConfig: import("vue").ComputedRef<{
|
|
345
|
+
height?: number | string;
|
|
346
|
+
maxHeight?: number | string;
|
|
347
|
+
stripe: boolean;
|
|
348
|
+
border: boolean;
|
|
349
|
+
size: import("../../types").SizeType;
|
|
350
|
+
showHeader: boolean;
|
|
351
|
+
highlightCurrentRow: boolean;
|
|
352
|
+
rowClassName?: import("element-plus").ColumnCls<any> | undefined;
|
|
353
|
+
rowStyle?: import("element-plus").ColumnStyle<any> | undefined;
|
|
354
|
+
emptyText?: string;
|
|
355
|
+
scroll?: {
|
|
356
|
+
x?: number;
|
|
357
|
+
y?: number;
|
|
358
|
+
};
|
|
359
|
+
}>;
|
|
360
|
+
mergedToolbar: import("vue").ComputedRef<{
|
|
361
|
+
left: import("../../types").ToolbarButton[];
|
|
362
|
+
right: import("../../types").ToolbarButton[];
|
|
363
|
+
}>;
|
|
364
|
+
toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
|
|
365
|
+
setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
|
|
366
|
+
clearSelection: () => void;
|
|
367
|
+
setCurrentPage: (page: number) => void;
|
|
368
|
+
setPageSize: (size: number) => void;
|
|
369
|
+
updateSearchParam: (key: string, value: any) => void;
|
|
370
|
+
setSearchFields: (fields: Record<string, any>) => void;
|
|
371
|
+
resetSearch: () => void;
|
|
372
|
+
getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
|
|
373
|
+
setVisibleColumns: (columns: string[]) => void;
|
|
374
|
+
toggleColumn: (key: string) => void;
|
|
375
|
+
init: (config: {
|
|
376
|
+
columns: TableColumn[];
|
|
377
|
+
selectionConfig?: boolean | SelectionConfig;
|
|
378
|
+
}) => void;
|
|
379
|
+
getRowKey: (row: any) => any;
|
|
380
|
+
getKeyValue: (row: any) => any;
|
|
381
|
+
handleSelectionChange: (selection: any[]) => void;
|
|
382
|
+
handleSelectAll: (selection: any[]) => void;
|
|
383
|
+
getSelectedKeys: () => any[];
|
|
384
|
+
getSelectedRows: () => any[];
|
|
385
|
+
isSingleSelected: (row: any) => boolean;
|
|
386
|
+
handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
|
|
387
|
+
handleFilter: () => void;
|
|
388
|
+
resetFilter: () => void;
|
|
389
|
+
load: (emit?: (name: string, data: any) => void) => Promise<void>;
|
|
390
|
+
openModal: (key: string, data?: any) => void;
|
|
391
|
+
closeModal: (key: string) => void;
|
|
392
|
+
closeAllModals: () => void;
|
|
393
|
+
getModal: (key: string) => {
|
|
394
|
+
visible: boolean;
|
|
395
|
+
data?: any;
|
|
396
|
+
} | undefined;
|
|
397
|
+
};
|
|
398
|
+
export type TableStore = ReturnType<typeof tableStore.useStore>;
|
|
399
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Plugin } from 'vue';
|
|
2
|
+
import TableComponent from './index.vue';
|
|
3
|
+
declare const Table: typeof TableComponent & Plugin;
|
|
4
|
+
export default Table;
|
|
5
|
+
export type { TableProps } from './props';
|
|
6
|
+
export type { TableInst, TableColumn, PaginationConfig, SelectionConfig, SearchConfig, ToolbarConfig, ToolbarButton } from '../types';
|