rj-grid 0.1.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/LICENSE +201 -0
- package/README.md +92 -0
- package/dist/rj-grid.js +14074 -0
- package/dist/style.css +2050 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/src/RjAdvGroup.vue.d.ts +32 -0
- package/dist/types/src/RjAdvancedFilterDialog.vue.d.ts +38 -0
- package/dist/types/src/RjCell.vue.d.ts +82 -0
- package/dist/types/src/RjChartDialog.vue.d.ts +22 -0
- package/dist/types/src/RjColumnMenu.vue.d.ts +109 -0
- package/dist/types/src/RjConfirmDialog.vue.d.ts +23 -0
- package/dist/types/src/RjContextMenu.vue.d.ts +26 -0
- package/dist/types/src/RjEditor.vue.d.ts +28 -0
- package/dist/types/src/RjFilterMenu.vue.d.ts +58 -0
- package/dist/types/src/RjGrid.vue.d.ts +1046 -0
- package/dist/types/src/RjHeader.vue.d.ts +80 -0
- package/dist/types/src/RjImgList.vue.d.ts +29 -0
- package/dist/types/src/RjPager.vue.d.ts +41 -0
- package/dist/types/src/RjQueryBar.vue.d.ts +47 -0
- package/dist/types/src/RjRowFormDialog.vue.d.ts +50 -0
- package/dist/types/src/RjSlotRender.d.ts +56 -0
- package/dist/types/src/RjSparkline.vue.d.ts +43 -0
- package/dist/types/src/RjToolPanel.vue.d.ts +103 -0
- package/dist/types/src/RjViewManager.vue.d.ts +28 -0
- package/dist/types/src/editHistory.d.ts +27 -0
- package/dist/types/src/export.d.ts +24 -0
- package/dist/types/src/expression.d.ts +19 -0
- package/dist/types/src/filtering.d.ts +29 -0
- package/dist/types/src/formula.d.ts +88 -0
- package/dist/types/src/icons.d.ts +35 -0
- package/dist/types/src/locale.d.ts +21 -0
- package/dist/types/src/nlq.d.ts +51 -0
- package/dist/types/src/print.d.ts +37 -0
- package/dist/types/src/query.d.ts +28 -0
- package/dist/types/src/rowForm.d.ts +41 -0
- package/dist/types/src/serverGroups.d.ts +52 -0
- package/dist/types/src/ssrm.d.ts +102 -0
- package/dist/types/src/theme.d.ts +33 -0
- package/dist/types/src/types.d.ts +624 -0
- package/dist/types/src/useColumnState.d.ts +70 -0
- package/dist/types/src/useInteraction.d.ts +150 -0
- package/dist/types/src/useQueryViews.d.ts +16 -0
- package/dist/types/src/useRowModel.d.ts +225 -0
- package/dist/types/src/utils.d.ts +130 -0
- package/package.json +90 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { RjColumn } from './types';
|
|
2
|
+
import type { RjLeafCol } from './useColumnState';
|
|
3
|
+
export interface HeaderLevelCell {
|
|
4
|
+
col: RjColumn;
|
|
5
|
+
colId: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
x: number;
|
|
8
|
+
width: number;
|
|
9
|
+
isGroup: boolean;
|
|
10
|
+
leafCol?: RjLeafCol;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
levelCells: HeaderLevelCell[][];
|
|
14
|
+
totalWidth: number;
|
|
15
|
+
scrollLeft: number;
|
|
16
|
+
headerRowHeight: number;
|
|
17
|
+
sortStates: {
|
|
18
|
+
field: string;
|
|
19
|
+
dir: string;
|
|
20
|
+
}[];
|
|
21
|
+
activeFilters: string[];
|
|
22
|
+
reorderable?: boolean | undefined;
|
|
23
|
+
gridSlots?: Record<string, any> | undefined;
|
|
24
|
+
allLeaves: RjLeafCol[];
|
|
25
|
+
headerChecked?: boolean | undefined;
|
|
26
|
+
headerIndeterminate?: boolean | undefined;
|
|
27
|
+
/** 浮动筛选行 */
|
|
28
|
+
floating?: boolean | undefined;
|
|
29
|
+
floatValues?: Record<string, string> | undefined;
|
|
30
|
+
filterRowHeight?: number | undefined;
|
|
31
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
sort: (colId: string, field: string | undefined, additive: boolean) => void;
|
|
33
|
+
"open-filter": (cell: HeaderLevelCell, el: MouseEvent) => void;
|
|
34
|
+
"header-menu": (cell: HeaderLevelCell, ev: MouseEvent) => void;
|
|
35
|
+
resize: (colId: string, width: number, done: boolean) => void;
|
|
36
|
+
"col-drop": (dragId: string, targetId: string) => void;
|
|
37
|
+
"col-draggroup": (dragId: string, ev: DragEvent) => void;
|
|
38
|
+
"auto-width": (colId: string) => void;
|
|
39
|
+
"toggle-check-all": () => void;
|
|
40
|
+
"float-filter": (colId: string, value: string) => void;
|
|
41
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
42
|
+
levelCells: HeaderLevelCell[][];
|
|
43
|
+
totalWidth: number;
|
|
44
|
+
scrollLeft: number;
|
|
45
|
+
headerRowHeight: number;
|
|
46
|
+
sortStates: {
|
|
47
|
+
field: string;
|
|
48
|
+
dir: string;
|
|
49
|
+
}[];
|
|
50
|
+
activeFilters: string[];
|
|
51
|
+
reorderable?: boolean | undefined;
|
|
52
|
+
gridSlots?: Record<string, any> | undefined;
|
|
53
|
+
allLeaves: RjLeafCol[];
|
|
54
|
+
headerChecked?: boolean | undefined;
|
|
55
|
+
headerIndeterminate?: boolean | undefined;
|
|
56
|
+
/** 浮动筛选行 */
|
|
57
|
+
floating?: boolean | undefined;
|
|
58
|
+
floatValues?: Record<string, string> | undefined;
|
|
59
|
+
filterRowHeight?: number | undefined;
|
|
60
|
+
}>>> & Readonly<{
|
|
61
|
+
onSort?: ((colId: string, field: string | undefined, additive: boolean) => any) | undefined;
|
|
62
|
+
onResize?: ((colId: string, width: number, done: boolean) => any) | undefined;
|
|
63
|
+
"onCol-drop"?: ((dragId: string, targetId: string) => any) | undefined;
|
|
64
|
+
"onOpen-filter"?: ((cell: HeaderLevelCell, el: MouseEvent) => any) | undefined;
|
|
65
|
+
"onHeader-menu"?: ((cell: HeaderLevelCell, ev: MouseEvent) => any) | undefined;
|
|
66
|
+
"onCol-draggroup"?: ((dragId: string, ev: DragEvent) => any) | undefined;
|
|
67
|
+
"onAuto-width"?: ((colId: string) => any) | undefined;
|
|
68
|
+
"onToggle-check-all"?: (() => any) | undefined;
|
|
69
|
+
"onFloat-filter"?: ((colId: string, value: string) => any) | undefined;
|
|
70
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
71
|
+
export default _default;
|
|
72
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
73
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
74
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
75
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
76
|
+
} : {
|
|
77
|
+
type: import('vue').PropType<T[K]>;
|
|
78
|
+
required: true;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
urls: string[];
|
|
3
|
+
style: Record<string, string>;
|
|
4
|
+
shape: 'square' | 'rounded' | 'circle';
|
|
5
|
+
lazy: boolean;
|
|
6
|
+
alt: string;
|
|
7
|
+
fallback: string;
|
|
8
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
preview: (url: string) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
urls: string[];
|
|
12
|
+
style: Record<string, string>;
|
|
13
|
+
shape: 'square' | 'rounded' | 'circle';
|
|
14
|
+
lazy: boolean;
|
|
15
|
+
alt: string;
|
|
16
|
+
fallback: string;
|
|
17
|
+
}>>> & Readonly<{
|
|
18
|
+
onPreview?: ((url: string) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
total: number;
|
|
5
|
+
variant?: "top" | "bottom" | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
variant: string;
|
|
8
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:page": (v: number) => void;
|
|
10
|
+
"update:pageSize": (v: number) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
total: number;
|
|
15
|
+
variant?: "top" | "bottom" | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
variant: string;
|
|
18
|
+
}>>> & Readonly<{
|
|
19
|
+
"onUpdate:page"?: ((v: number) => any) | undefined;
|
|
20
|
+
"onUpdate:pageSize"?: ((v: number) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
variant: 'top' | 'bottom';
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
26
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
27
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
28
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
29
|
+
} : {
|
|
30
|
+
type: import('vue').PropType<T[K]>;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type __VLS_WithDefaults<P, D> = {
|
|
35
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
36
|
+
default: D[K];
|
|
37
|
+
}> : P[K];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_Prettify<T> = {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} & {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { RjQueryAction, RjQueryCondition, RjQueryFieldDef, RjRowData } from './types';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
fields: RjQueryFieldDef[];
|
|
4
|
+
modelValue: RjQueryCondition[];
|
|
5
|
+
/** 重置旁的自定义操作按钮(queryActions prop) */
|
|
6
|
+
actions?: RjQueryAction[] | undefined;
|
|
7
|
+
/** 当前选中行:供按钮禁用态实时求值 */
|
|
8
|
+
selectedRows?: RjRowData[] | undefined;
|
|
9
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:modelValue": (v: RjQueryCondition[]) => void;
|
|
11
|
+
search: () => void;
|
|
12
|
+
"action-click": (a: RjQueryAction) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
14
|
+
fields: RjQueryFieldDef[];
|
|
15
|
+
modelValue: RjQueryCondition[];
|
|
16
|
+
/** 重置旁的自定义操作按钮(queryActions prop) */
|
|
17
|
+
actions?: RjQueryAction[] | undefined;
|
|
18
|
+
/** 当前选中行:供按钮禁用态实时求值 */
|
|
19
|
+
selectedRows?: RjRowData[] | undefined;
|
|
20
|
+
}>>> & Readonly<{
|
|
21
|
+
onSearch?: (() => any) | undefined;
|
|
22
|
+
"onUpdate:modelValue"?: ((v: RjQueryCondition[]) => any) | undefined;
|
|
23
|
+
"onAction-click"?: ((a: RjQueryAction) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, Readonly<{
|
|
25
|
+
actions?: ((props: {
|
|
26
|
+
rows: RjRowData[];
|
|
27
|
+
}) => unknown) | undefined;
|
|
28
|
+
}> & {
|
|
29
|
+
actions?: ((props: {
|
|
30
|
+
rows: RjRowData[];
|
|
31
|
+
}) => unknown) | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
44
|
+
new (): {
|
|
45
|
+
$slots: S;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { RjFormField } from './rowForm';
|
|
2
|
+
import type { RjRowData } from './types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
fields: RjFormField[];
|
|
5
|
+
rows: RjRowData[];
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
width?: number | undefined;
|
|
8
|
+
/** add=新增模式(空白表单);缺省 edit=编辑模式(预填选中行) */
|
|
9
|
+
mode?: "edit" | "add" | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
width: number;
|
|
12
|
+
mode: string;
|
|
13
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
submit: (changes: Record<string, any>) => void;
|
|
15
|
+
close: () => void;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
17
|
+
fields: RjFormField[];
|
|
18
|
+
rows: RjRowData[];
|
|
19
|
+
title?: string | undefined;
|
|
20
|
+
width?: number | undefined;
|
|
21
|
+
/** add=新增模式(空白表单);缺省 edit=编辑模式(预填选中行) */
|
|
22
|
+
mode?: "edit" | "add" | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
width: number;
|
|
25
|
+
mode: string;
|
|
26
|
+
}>>> & Readonly<{
|
|
27
|
+
onClose?: (() => any) | undefined;
|
|
28
|
+
onSubmit?: ((changes: Record<string, any>) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
mode: 'edit' | 'add';
|
|
31
|
+
width: number;
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
48
|
+
type __VLS_Prettify<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
slots: {
|
|
4
|
+
type: PropType<Readonly<{
|
|
5
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
6
|
+
}>>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
name: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
params: {
|
|
14
|
+
type: PropType<any>;
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>[] | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
slots: {
|
|
21
|
+
type: PropType<Readonly<{
|
|
22
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
name: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
params: {
|
|
31
|
+
type: PropType<any>;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{}>, {
|
|
35
|
+
params: any;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
37
|
+
export default _default;
|
|
38
|
+
export declare const RjFnRender: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
39
|
+
render: {
|
|
40
|
+
type: PropType<(p: any) => any>;
|
|
41
|
+
required: true;
|
|
42
|
+
};
|
|
43
|
+
params: {
|
|
44
|
+
type: PropType<any>;
|
|
45
|
+
required: true;
|
|
46
|
+
};
|
|
47
|
+
}>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
|
+
render: {
|
|
49
|
+
type: PropType<(p: any) => any>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
params: {
|
|
53
|
+
type: PropType<any>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
data: number[];
|
|
3
|
+
style?: "bar" | "line" | "spider" | undefined;
|
|
4
|
+
color?: string | undefined;
|
|
5
|
+
w?: number | undefined;
|
|
6
|
+
h?: number | undefined;
|
|
7
|
+
}>, {
|
|
8
|
+
color: string;
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
data: number[];
|
|
13
|
+
style?: "bar" | "line" | "spider" | undefined;
|
|
14
|
+
color?: string | undefined;
|
|
15
|
+
w?: number | undefined;
|
|
16
|
+
h?: number | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
color: string;
|
|
19
|
+
w: number;
|
|
20
|
+
h: number;
|
|
21
|
+
}>>> & Readonly<{}>, {
|
|
22
|
+
color: string;
|
|
23
|
+
w: number;
|
|
24
|
+
h: number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
29
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
30
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
31
|
+
} : {
|
|
32
|
+
type: import('vue').PropType<T[K]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
type __VLS_WithDefaults<P, D> = {
|
|
37
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
38
|
+
default: D[K];
|
|
39
|
+
}> : P[K];
|
|
40
|
+
};
|
|
41
|
+
type __VLS_Prettify<T> = {
|
|
42
|
+
[K in keyof T]: T[K];
|
|
43
|
+
} & {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { RjColumn } from './types';
|
|
2
|
+
export interface PanelLeaf {
|
|
3
|
+
col: RjColumn;
|
|
4
|
+
colId: string;
|
|
5
|
+
field?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
hidden: boolean;
|
|
8
|
+
pinned: 'left' | 'right' | null;
|
|
9
|
+
aggFunc?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
leafList: PanelLeaf[];
|
|
13
|
+
/**
|
|
14
|
+
* 候选列(分组维 / 透视维 / 透视值)专用列源:应始终为用户真正声明的列。
|
|
15
|
+
* 透视态下 leafList 会被引擎生成的 __pv* 列顶替,直接拿它做候选,
|
|
16
|
+
* 用户可以把 `__pvrow0:kind` 再勾一次当透视维,把透视结果直接做塌。
|
|
17
|
+
*/
|
|
18
|
+
pivotLeafList?: PanelLeaf[] | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* 默认「全部指标」隐式态下引擎真正生效的度量 colId 集。
|
|
21
|
+
* 面板候选按类型列出所有数值列,隐式态却只聚合已声明 aggFunc 的那几项,
|
|
22
|
+
* 不拿这份基线画勾选态,会把未生效项也显示成已勾选。
|
|
23
|
+
*/
|
|
24
|
+
pivotValueDefault?: string[] | undefined;
|
|
25
|
+
groupedFields: string[];
|
|
26
|
+
pivot: {
|
|
27
|
+
cols: string[];
|
|
28
|
+
values: string[];
|
|
29
|
+
active: boolean;
|
|
30
|
+
};
|
|
31
|
+
filters?: {
|
|
32
|
+
colId: string;
|
|
33
|
+
kind: 'column' | 'float' | 'advanced';
|
|
34
|
+
title: string;
|
|
35
|
+
text: string;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
quickFilter?: string | undefined;
|
|
38
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"toggle-hide": (colId: string) => void;
|
|
40
|
+
"toggle-pin": (colId: string, pin: "left" | "right" | null) => void;
|
|
41
|
+
"col-drop": (from: string, to: string) => void;
|
|
42
|
+
"group-add": (field: string) => void;
|
|
43
|
+
"group-remove": (field: string) => void;
|
|
44
|
+
"group-drop": (colId: string) => void;
|
|
45
|
+
"pivot-enable": (v: boolean) => void;
|
|
46
|
+
"pivot-toggle": (which: "values" | "cols", key: string) => void;
|
|
47
|
+
"pivot-drop": (colId: string) => void;
|
|
48
|
+
"set-agg": (field: string, agg: string | undefined) => void;
|
|
49
|
+
"filter-remove": (colId: string, kind: "column" | "advanced" | "float") => void;
|
|
50
|
+
"filters-clear-all": () => void;
|
|
51
|
+
"quick-clear": () => void;
|
|
52
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
53
|
+
leafList: PanelLeaf[];
|
|
54
|
+
/**
|
|
55
|
+
* 候选列(分组维 / 透视维 / 透视值)专用列源:应始终为用户真正声明的列。
|
|
56
|
+
* 透视态下 leafList 会被引擎生成的 __pv* 列顶替,直接拿它做候选,
|
|
57
|
+
* 用户可以把 `__pvrow0:kind` 再勾一次当透视维,把透视结果直接做塌。
|
|
58
|
+
*/
|
|
59
|
+
pivotLeafList?: PanelLeaf[] | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* 默认「全部指标」隐式态下引擎真正生效的度量 colId 集。
|
|
62
|
+
* 面板候选按类型列出所有数值列,隐式态却只聚合已声明 aggFunc 的那几项,
|
|
63
|
+
* 不拿这份基线画勾选态,会把未生效项也显示成已勾选。
|
|
64
|
+
*/
|
|
65
|
+
pivotValueDefault?: string[] | undefined;
|
|
66
|
+
groupedFields: string[];
|
|
67
|
+
pivot: {
|
|
68
|
+
cols: string[];
|
|
69
|
+
values: string[];
|
|
70
|
+
active: boolean;
|
|
71
|
+
};
|
|
72
|
+
filters?: {
|
|
73
|
+
colId: string;
|
|
74
|
+
kind: 'column' | 'float' | 'advanced';
|
|
75
|
+
title: string;
|
|
76
|
+
text: string;
|
|
77
|
+
}[] | undefined;
|
|
78
|
+
quickFilter?: string | undefined;
|
|
79
|
+
}>>> & Readonly<{
|
|
80
|
+
"onCol-drop"?: ((from: string, to: string) => any) | undefined;
|
|
81
|
+
"onToggle-hide"?: ((colId: string) => any) | undefined;
|
|
82
|
+
"onToggle-pin"?: ((colId: string, pin: "left" | "right" | null) => any) | undefined;
|
|
83
|
+
"onGroup-add"?: ((field: string) => any) | undefined;
|
|
84
|
+
"onGroup-remove"?: ((field: string) => any) | undefined;
|
|
85
|
+
"onGroup-drop"?: ((colId: string) => any) | undefined;
|
|
86
|
+
"onPivot-enable"?: ((v: boolean) => any) | undefined;
|
|
87
|
+
"onPivot-toggle"?: ((which: "values" | "cols", key: string) => any) | undefined;
|
|
88
|
+
"onPivot-drop"?: ((colId: string) => any) | undefined;
|
|
89
|
+
"onSet-agg"?: ((field: string, agg: string | undefined) => any) | undefined;
|
|
90
|
+
"onFilter-remove"?: ((colId: string, kind: "column" | "advanced" | "float") => any) | undefined;
|
|
91
|
+
"onFilters-clear-all"?: (() => any) | undefined;
|
|
92
|
+
"onQuick-clear"?: (() => any) | undefined;
|
|
93
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
94
|
+
export default _default;
|
|
95
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
96
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
97
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
98
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
99
|
+
} : {
|
|
100
|
+
type: import('vue').PropType<T[K]>;
|
|
101
|
+
required: true;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare function open(): void;
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
condCount: number;
|
|
4
|
+
colCount: number;
|
|
5
|
+
}>>, {
|
|
6
|
+
openNew: typeof open;
|
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
save: (payload: {
|
|
9
|
+
name: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
|
+
condCount: number;
|
|
13
|
+
colCount: number;
|
|
14
|
+
}>>> & Readonly<{
|
|
15
|
+
onSave?: ((payload: {
|
|
16
|
+
name: string;
|
|
17
|
+
}) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface EditChange<T = any> {
|
|
2
|
+
/** 变更目标(此处为行数据对象引用) */
|
|
3
|
+
target: T;
|
|
4
|
+
/** 列 id(colId / field) */
|
|
5
|
+
field: string;
|
|
6
|
+
oldValue: any;
|
|
7
|
+
newValue: any;
|
|
8
|
+
}
|
|
9
|
+
export declare class EditHistory<T = any> {
|
|
10
|
+
private undoStack;
|
|
11
|
+
private redoStack;
|
|
12
|
+
private limit;
|
|
13
|
+
constructor(limit?: number);
|
|
14
|
+
setLimit(n: number): void;
|
|
15
|
+
/** 记录一次动作(一组变更);清空重做栈 */
|
|
16
|
+
push(group: EditChange<T>[]): void;
|
|
17
|
+
private trim;
|
|
18
|
+
canUndo(): boolean;
|
|
19
|
+
canRedo(): boolean;
|
|
20
|
+
get undoDepth(): number;
|
|
21
|
+
get redoDepth(): number;
|
|
22
|
+
/** 弹出一组待反向应用(写回 oldValue)的变更 */
|
|
23
|
+
undo(): EditChange<T>[] | null;
|
|
24
|
+
/** 弹出一组待正向应用(写回 newValue)的变更 */
|
|
25
|
+
redo(): EditChange<T>[] | null;
|
|
26
|
+
clear(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function toCsvText(matrix: any[][]): string;
|
|
2
|
+
export declare function downloadCsv(matrix: any[][], fileName: string): void;
|
|
3
|
+
export interface XlsxSheet {
|
|
4
|
+
name: string;
|
|
5
|
+
matrix: any[][];
|
|
6
|
+
colWidths?: number[];
|
|
7
|
+
/** 每个样式 id:0 常规 1 表头 2 分组/汇总 3 数字 */
|
|
8
|
+
rowStyles?: number[];
|
|
9
|
+
/** 前多少行为表头(默认 1),用于冻结窗格 */
|
|
10
|
+
headerRows?: number;
|
|
11
|
+
}
|
|
12
|
+
/** 多 sheet xlsx 工作簿 → Blob */
|
|
13
|
+
export declare function buildXlsxWorkbook(sheets: XlsxSheet[]): Blob;
|
|
14
|
+
/**
|
|
15
|
+
* 单矩阵 → xlsx Blob(向后兼容)
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildXlsxBlob(matrix: any[][], colWidths?: number[]): Blob;
|
|
18
|
+
export declare function downloadXlsx(matrix: any[][], fileName: string, colWidths?: number[]): void;
|
|
19
|
+
export declare function downloadXlsxWorkbook(sheets: XlsxSheet[], fileName: string): void;
|
|
20
|
+
export declare function toTsv(matrix: any[][]): string;
|
|
21
|
+
/** 解析剪贴板文本(TSV,兼容引号包裹单元格) */
|
|
22
|
+
export declare function parseTsv(text: string): string[][];
|
|
23
|
+
export declare function writeClipboard(text: string): Promise<boolean>;
|
|
24
|
+
export declare function readClipboard(): Promise<string>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ExprScope {
|
|
2
|
+
value?: any;
|
|
3
|
+
data?: any;
|
|
4
|
+
row?: any;
|
|
5
|
+
node?: any;
|
|
6
|
+
colId?: string;
|
|
7
|
+
column?: any;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export type ExprFn = (scope: ExprScope) => any;
|
|
11
|
+
/** 是否为字符串表达式(非空字符串) */
|
|
12
|
+
export declare function isExpression(v: any): v is string;
|
|
13
|
+
/**
|
|
14
|
+
* 编译字符串表达式为取值函数。编译失败返回 null(调用方回退原值)。
|
|
15
|
+
* 注入别名:value/data/row/node/colId/column/params,表达式内可用 `data.price * 100` 或 `params.value`。
|
|
16
|
+
*/
|
|
17
|
+
export declare function compileExpression(expr: string): ExprFn | null;
|
|
18
|
+
/** 清空编译缓存(测试 / 热更新用) */
|
|
19
|
+
export declare function clearExpressionCache(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RjFilterCondition } from './types';
|
|
2
|
+
/** 条件是否为"空条件"(未选择操作符)——空条件不参与判定 */
|
|
3
|
+
export declare function isEmptyCondition(c: RjFilterCondition | undefined | null): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 多条件组合判定(对标 AG Grid 单列 andOrConditions)。
|
|
6
|
+
* - 修正旧实现"命中任一即通过"的错误:operator==='and' 需全部非空条件通过;'or' 任一通过即可。
|
|
7
|
+
* - 全部为空条件时返回 true(视为不过滤)。
|
|
8
|
+
* test 由调用方提供(含类型转换 / 值解析)。
|
|
9
|
+
*/
|
|
10
|
+
export declare function evalConditions(conditions: RjFilterCondition[] | undefined, operator: 'and' | 'or', test: (c: RjFilterCondition) => boolean): boolean;
|
|
11
|
+
/** 高级过滤:单个条件(绑定到某列) */
|
|
12
|
+
export interface AdvColumnCondition {
|
|
13
|
+
colId: string;
|
|
14
|
+
condition: RjFilterCondition;
|
|
15
|
+
filterType?: string;
|
|
16
|
+
}
|
|
17
|
+
/** 高级过滤节点:可嵌套 and/or 组(表达式树,对标 AG Grid Advanced Filter) */
|
|
18
|
+
export interface AdvFilterGroup {
|
|
19
|
+
operator: 'and' | 'or';
|
|
20
|
+
items: Array<AdvFilterGroup | AdvColumnCondition>;
|
|
21
|
+
}
|
|
22
|
+
export declare function isAdvGroup(node: AdvFilterGroup | AdvColumnCondition): node is AdvFilterGroup;
|
|
23
|
+
/**
|
|
24
|
+
* 求值高级过滤表达式树。testCond 由调用方提供(解析列值 + matchCondition)。
|
|
25
|
+
* 空组 / 无条件视为通过。
|
|
26
|
+
*/
|
|
27
|
+
export declare function evalAdvancedFilter(node: AdvFilterGroup | null | undefined, testCond: (c: AdvColumnCondition) => boolean): boolean;
|
|
28
|
+
/** 统计表达式树里的列条件总数(供状态栏/校验) */
|
|
29
|
+
export declare function countAdvConditions(node: AdvFilterGroup | null | undefined): number;
|