@scvzerng/element-ui-ag-grid-vue2 0.0.8
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/README.md +5 -0
- package/dist/ElementPlusAgGrid.es.js +34344 -0
- package/dist/ElementPlusAgGrid.umd.js +58 -0
- package/dist/favicon.ico +0 -0
- package/dist/style.css +1 -0
- package/dist/types/Grid.vue.d.ts +14849 -0
- package/dist/types/GridDataCache.d.ts +52 -0
- package/dist/types/GridDataSource.d.ts +39 -0
- package/dist/types/GridEmptyDataOverlay.vue.d.ts +2 -0
- package/dist/types/GridLoadingOverlay.vue.d.ts +2 -0
- package/dist/types/PageGetRowsParams.d.ts +32 -0
- package/dist/types/ag-grid/options/ag-grid-menu-options.d.ts +9 -0
- package/dist/types/ag-grid/options/ag-grid-options-clean.d.ts +2 -0
- package/dist/types/ag-grid/options/ag-grid-options.d.ts +11 -0
- package/dist/types/ag-grid-vue/components/AgGridVue.vue.d.ts +1333 -0
- package/dist/types/ag-grid-vue/components/VueComponentFactory.d.ts +16 -0
- package/dist/types/ag-grid-vue/components/VueFrameworkComponentWrapper.d.ts +15 -0
- package/dist/types/ag-grid-vue/components/VueFrameworkOverrides.d.ts +7 -0
- package/dist/types/ag-grid-vue/components/utils.d.ts +2105 -0
- package/dist/types/ag-grid-vue/main.d.ts +2 -0
- package/dist/types/clientSideRowModel/abstractClientSideNodeManager.d.ts +50 -0
- package/dist/types/clientSideRowModel/changedRowNodes.d.ts +12 -0
- package/dist/types/clientSideRowModel/clientSideNodeManager.d.ts +5 -0
- package/dist/types/clientSideRowModel/clientSideRowModel.d.ts +129 -0
- package/dist/types/clientSideRowModel/clientSideRowModelApi.d.ts +12 -0
- package/dist/types/clientSideRowModel/clientSideRowModelModule.d.ts +9 -0
- package/dist/types/clientSideRowModel/filterStage.d.ts +14 -0
- package/dist/types/clientSideRowModel/sortStage.d.ts +10 -0
- package/dist/types/context-menu/index.d.ts +8 -0
- package/dist/types/helper/vModel.d.ts +12 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/model/row/ActualRow.d.ts +77 -0
- package/dist/types/model/row/CellValue.d.ts +37 -0
- package/dist/types/model/row/EditableRow.d.ts +52 -0
- package/dist/types/model/row/GridRow.d.ts +30 -0
- package/dist/types/model/row/ProjectionRow.d.ts +43 -0
- package/dist/types/model/row/SpanInfo.d.ts +25 -0
- package/dist/types/render/CellHolder.d.ts +15 -0
- package/dist/types/render/CellRenderer.vue.d.ts +16 -0
- package/dist/types/render/FooterCellRender.vue.d.ts +15 -0
- package/dist/types/render/HeaderRenderer.vue.d.ts +15 -0
- package/dist/types/render/VNodeRender.d.ts +11 -0
- package/dist/types/render/types/ICellRendererParamsExt.d.ts +13 -0
- package/dist/types/renders.d.ts +35 -0
- package/dist/types/search/DrawerSearch.vue.d.ts +45 -0
- package/dist/types/search/PopoverSearch.vue.d.ts +45 -0
- package/dist/types/search/Search.vue.d.ts +85 -0
- package/dist/types/search/SearchItem.vue.d.ts +22 -0
- package/dist/types/search/Searchable.d.ts +38 -0
- package/dist/types/search/index.d.ts +4 -0
- package/dist/types/search/use-search.d.ts +26 -0
- package/dist/types/selection/baseSelectionService.d.ts +45 -0
- package/dist/types/selection/checkboxSelectionComponent.d.ts +24 -0
- package/dist/types/selection/rowRangeSelectionContext.d.ts +54 -0
- package/dist/types/selection/rowSelectionApi.d.ts +18 -0
- package/dist/types/selection/rowSelectionModule.d.ts +9 -0
- package/dist/types/selection/selectAllFeature.d.ts +28 -0
- package/dist/types/selection/selectionColService.d.ts +38 -0
- package/dist/types/selection/selectionService.d.ts +73 -0
- package/dist/types/selection/utils.d.ts +12 -0
- package/dist/types/tokens.d.ts +22 -0
- package/dist/types/toolbar/GridToolbar.vue.d.ts +18 -0
- package/dist/types/toolbar/features/RefreshButton.vue.d.ts +2 -0
- package/dist/types/toolbar/features/SearchButton.vue.d.ts +15 -0
- package/dist/types/toolbar/features/SettingButton.vue.d.ts +2 -0
- package/dist/types/toolbar/features/use-columns-setting.d.ts +14 -0
- package/dist/types/use-footer.d.ts +14 -0
- package/dist/types/use-grid-scroll.d.ts +10 -0
- package/dist/types/use-grid-state.d.ts +9 -0
- package/dist/types/use-grid.d.ts +672 -0
- package/dist/types/use-proxy.d.ts +8 -0
- package/dist/types/use-sort.d.ts +4 -0
- package/dist/types/use-theme.d.ts +3 -0
- package/dist/types/utils/GridUtils.d.ts +4 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ICellRendererParams } from 'ag-grid-community';
|
|
2
|
+
import type { VNode } from 'vue';
|
|
3
|
+
interface EditCellRendererParams<T, V> extends ICellRendererParams<T, V> {
|
|
4
|
+
hostObject: T;
|
|
5
|
+
hostArrayHook: (hook: (array: T[]) => void) => void;
|
|
6
|
+
}
|
|
7
|
+
export type EditCellRender<T, V> = (params: EditCellRendererParams<T, V>) => VNode | VNode[] | undefined | null;
|
|
8
|
+
export type ICustomCellRendererParams<T, V> = ICellRendererParams<T, V> & {
|
|
9
|
+
render?: (params: ICellRendererParams<T>) => VNode | VNode[] | undefined | null;
|
|
10
|
+
footerRender?: (params: ICellRendererParams<T>) => VNode | VNode[] | undefined | null;
|
|
11
|
+
editeRender?: EditCellRender<T, V>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ColDef, ColGroupDef, type ICellRendererParams } from 'ag-grid-community';
|
|
2
|
+
import type { VNode } from 'vue';
|
|
3
|
+
import { GridRow } from './model/row/GridRow';
|
|
4
|
+
export declare const withRender: (column: ColDef) => CellRenderAdapter;
|
|
5
|
+
type CellRender<ROW = any, VALUE = any> = (params: ICellRendererParams<ROW, VALUE>) => VNode | VNode[] | undefined | string;
|
|
6
|
+
type EditCellRender<HOST_OBJECT = any> = (params: ICellRendererParams<HOST_OBJECT> & {
|
|
7
|
+
hostObject: HOST_OBJECT;
|
|
8
|
+
hostArrayHook: (hook: (array: HOST_OBJECT[]) => void) => void;
|
|
9
|
+
}) => VNode | VNode[] | undefined | string;
|
|
10
|
+
/**
|
|
11
|
+
* 简化自定义渲染列的构建
|
|
12
|
+
*/
|
|
13
|
+
export declare class CellRenderAdapter {
|
|
14
|
+
private readonly colDef;
|
|
15
|
+
private readonly agGridCellRenderParams;
|
|
16
|
+
constructor(colDef: ColDef);
|
|
17
|
+
cellRender<ROW, VALUE>(render: CellRender<ROW, VALUE>): this;
|
|
18
|
+
footerRender<FOOT_ROW = any, VALUE = any>(render: CellRender<FOOT_ROW, VALUE>): this;
|
|
19
|
+
editeRender<HOST_OBJECT>(render: EditCellRender<HOST_OBJECT>): this;
|
|
20
|
+
build(): ColDef<any, any>;
|
|
21
|
+
}
|
|
22
|
+
export declare const withColumnRenderBuilder: (colDefs: (ColDef | ColGroupDef)[]) => ColumnRendersBuilder;
|
|
23
|
+
export declare class ColumnRendersBuilder {
|
|
24
|
+
private readonly colDefs;
|
|
25
|
+
private readonly rendersMap;
|
|
26
|
+
constructor(colDefs: (ColDef | ColGroupDef)[]);
|
|
27
|
+
private eachColDef;
|
|
28
|
+
private getRenderParams;
|
|
29
|
+
render<ROW, VALUE>(colId: string, render: CellRender<GridRow<ROW>, VALUE>): this;
|
|
30
|
+
footerRender<ROW = any, VALUE = any>(colId: string, render: CellRender<ROW, VALUE>): this;
|
|
31
|
+
editRender<HOST_OBJECT>(colId: string, render: EditCellRender<HOST_OBJECT>): this;
|
|
32
|
+
alwaysRender(colId: string): void;
|
|
33
|
+
build(): (ColDef<any, any> | ColGroupDef<any>)[];
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SearchCallback } from './use-search';
|
|
2
|
+
import type { Searchable } from './Searchable';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/**
|
|
5
|
+
* 搜索项
|
|
6
|
+
*/
|
|
7
|
+
search?: Searchable[];
|
|
8
|
+
/**
|
|
9
|
+
* element-plus 各组件的teleported属性
|
|
10
|
+
*/
|
|
11
|
+
teleported?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 外部搜索回调
|
|
14
|
+
*/
|
|
15
|
+
searchRemote: SearchCallback;
|
|
16
|
+
attached?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function __VLS_template(): {
|
|
19
|
+
attrs: Partial<{}>;
|
|
20
|
+
slots: {
|
|
21
|
+
default?(_: {
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$scopedSlots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SearchCallback } from './use-search';
|
|
2
|
+
import type { Searchable } from './Searchable';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/**
|
|
5
|
+
* 搜索项
|
|
6
|
+
*/
|
|
7
|
+
search?: Searchable[];
|
|
8
|
+
/**
|
|
9
|
+
* element-plus 各组件的teleported属性
|
|
10
|
+
*/
|
|
11
|
+
teleported?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 外部搜索回调
|
|
14
|
+
*/
|
|
15
|
+
searchRemote: SearchCallback;
|
|
16
|
+
field: string;
|
|
17
|
+
};
|
|
18
|
+
declare function __VLS_template(): {
|
|
19
|
+
attrs: Partial<{}>;
|
|
20
|
+
slots: {
|
|
21
|
+
default?(_: {
|
|
22
|
+
loading: boolean;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: any;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$scopedSlots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { SearchCallback } from './use-search';
|
|
2
|
+
import type { Searchable } from './Searchable';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/**
|
|
5
|
+
* 搜索项
|
|
6
|
+
*/
|
|
7
|
+
search?: Searchable[];
|
|
8
|
+
/**
|
|
9
|
+
* element-plus 各组件的teleported属性
|
|
10
|
+
*/
|
|
11
|
+
teleported?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 外部搜索回调
|
|
14
|
+
*/
|
|
15
|
+
searchRemote: SearchCallback;
|
|
16
|
+
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 确认按钮文案
|
|
19
|
+
*/
|
|
20
|
+
confirmButtonText?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 重置按钮文案
|
|
23
|
+
*/
|
|
24
|
+
resetButtonText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 是否开启重置条件自动搜索
|
|
27
|
+
* 某些计费服务需要主动关闭否则会浪费付费服务次数
|
|
28
|
+
*/
|
|
29
|
+
autoResetSearch?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否开启
|
|
32
|
+
*/
|
|
33
|
+
enable?: boolean;
|
|
34
|
+
};
|
|
35
|
+
declare function __VLS_template(): {
|
|
36
|
+
attrs: Partial<{}>;
|
|
37
|
+
slots: {
|
|
38
|
+
default?(_: {}): any;
|
|
39
|
+
};
|
|
40
|
+
refs: {
|
|
41
|
+
searchForm: unknown;
|
|
42
|
+
};
|
|
43
|
+
rootEl: any;
|
|
44
|
+
};
|
|
45
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
46
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
47
|
+
confirmButtonText: string;
|
|
48
|
+
resetButtonText: string;
|
|
49
|
+
enable: boolean;
|
|
50
|
+
autoResetSearch: boolean;
|
|
51
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
52
|
+
confirmButtonText: string;
|
|
53
|
+
resetButtonText: string;
|
|
54
|
+
enable: boolean;
|
|
55
|
+
autoResetSearch: boolean;
|
|
56
|
+
}>>>, {
|
|
57
|
+
confirmButtonText: string;
|
|
58
|
+
resetButtonText: string;
|
|
59
|
+
autoResetSearch: boolean;
|
|
60
|
+
enable: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
63
|
+
export default _default;
|
|
64
|
+
type __VLS_WithDefaults<P, D> = {
|
|
65
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
66
|
+
default: D[K];
|
|
67
|
+
}> : P[K];
|
|
68
|
+
};
|
|
69
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
70
|
+
type __VLS_TypePropsToOption<T> = {
|
|
71
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
72
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
73
|
+
} : {
|
|
74
|
+
type: import('vue').PropType<T[K]>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$scopedSlots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
type __VLS_PrettifyLocal<T> = {
|
|
84
|
+
[K in keyof T]: T[K];
|
|
85
|
+
} & {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { Searchable } from './Searchable';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
search: {
|
|
5
|
+
type: PropType<Searchable>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
teleported: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
};
|
|
11
|
+
}, () => import("vue").VNode | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
search: {
|
|
13
|
+
type: PropType<Searchable>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
teleported: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
teleported: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
export type TransformCallback<T> = (value: T) => Record<string, any>;
|
|
3
|
+
export declare class Searches {
|
|
4
|
+
record: Record<string, any>;
|
|
5
|
+
constructor(record: Record<string, any>);
|
|
6
|
+
static from(searches: Searchable[]): Searches;
|
|
7
|
+
transform<T>(field: string, transformCallback: TransformCallback<T>): Searches;
|
|
8
|
+
toCondition<T>(record?: Record<string, any>): T;
|
|
9
|
+
}
|
|
10
|
+
export interface Searchable {
|
|
11
|
+
/**
|
|
12
|
+
* 属性名
|
|
13
|
+
*/
|
|
14
|
+
field: string;
|
|
15
|
+
/**
|
|
16
|
+
* 描述
|
|
17
|
+
*/
|
|
18
|
+
label: string;
|
|
19
|
+
/**
|
|
20
|
+
* 绑定数据
|
|
21
|
+
*/
|
|
22
|
+
value?: any;
|
|
23
|
+
/**
|
|
24
|
+
* 初始化数据
|
|
25
|
+
*/
|
|
26
|
+
initValue?: any;
|
|
27
|
+
visible?: boolean;
|
|
28
|
+
width?: number;
|
|
29
|
+
/**
|
|
30
|
+
* 是否支持搜索条件持久化
|
|
31
|
+
*/
|
|
32
|
+
transient?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 渲染器
|
|
35
|
+
* @param row
|
|
36
|
+
*/
|
|
37
|
+
render: (value: Searchable) => VNode | undefined;
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Searchable } from './Searchable';
|
|
2
|
+
export type SearchCallback = () => Promise<void>;
|
|
3
|
+
export type SearchProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 搜索项
|
|
6
|
+
*/
|
|
7
|
+
search?: Searchable[];
|
|
8
|
+
/**
|
|
9
|
+
* element-plus 各组件的teleported属性
|
|
10
|
+
*/
|
|
11
|
+
teleported?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 外部搜索回调
|
|
14
|
+
*/
|
|
15
|
+
searchRemote: SearchCallback;
|
|
16
|
+
};
|
|
17
|
+
export declare const useSearch: (searchRemote: SearchCallback, props: SearchProps, search?: Searchable | Searchable[]) => {
|
|
18
|
+
visible: import("vue").Ref<any>;
|
|
19
|
+
loading: import("vue").Ref<boolean>;
|
|
20
|
+
width: import("vue").ComputedRef<number | undefined>;
|
|
21
|
+
loadingClass: import("vue").ComputedRef<string[]>;
|
|
22
|
+
hasCondition: import("vue").ComputedRef<boolean>;
|
|
23
|
+
hasConditionColor: import("vue").ComputedRef<"var(--el-color-primary)" | undefined>;
|
|
24
|
+
doSearch: () => Promise<void>;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BeanStub, IRowComp, RowContainerType } from 'ag-grid-community';
|
|
2
|
+
import type { AgColumn, IsRowSelectable, RowNode, SelectionEventSourceType, IRowNode, ISetNodesSelectedParams, RowCtrl, ChangedPath } from 'ag-grid-community';
|
|
3
|
+
import { CheckboxSelectionComponent } from './checkboxSelectionComponent';
|
|
4
|
+
import { RowRangeSelectionContext } from './rowRangeSelectionContext';
|
|
5
|
+
import { SelectAllFeature } from './selectAllFeature';
|
|
6
|
+
type RowGui = {
|
|
7
|
+
rowComp: IRowComp;
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
containerType: RowContainerType;
|
|
10
|
+
compBean: BeanStub;
|
|
11
|
+
};
|
|
12
|
+
export declare abstract class BaseSelectionService extends BeanStub {
|
|
13
|
+
protected isRowSelectable?: IsRowSelectable;
|
|
14
|
+
protected selectionCtx: RowRangeSelectionContext;
|
|
15
|
+
postConstruct(): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
createCheckboxSelectionComponent(): CheckboxSelectionComponent;
|
|
18
|
+
createSelectAllFeature(column: AgColumn): SelectAllFeature | undefined;
|
|
19
|
+
protected isMultiSelect(): boolean;
|
|
20
|
+
onRowCtrlSelected(rowCtrl: RowCtrl, hasFocusFunc: (gui: RowGui) => void, gui?: RowGui): void;
|
|
21
|
+
announceAriaRowSelection(rowNode: RowNode): void;
|
|
22
|
+
updateGroupsFromChildrenSelections?(source: SelectionEventSourceType, changedPath?: ChangedPath): boolean;
|
|
23
|
+
abstract setNodesSelected(params: ISetNodesSelectedParams): number;
|
|
24
|
+
protected abstract updateSelectable(changedPath?: ChangedPath): void;
|
|
25
|
+
protected isRowSelectionBlocked(rowNode: RowNode): boolean;
|
|
26
|
+
updateRowSelectable(rowNode: RowNode, suppressSelectionUpdate?: boolean): boolean;
|
|
27
|
+
protected setRowSelectable(rowNode: RowNode, newVal: boolean, suppressSelectionUpdate?: boolean): void;
|
|
28
|
+
protected calculateSelectedFromChildren(rowNode: RowNode): boolean | undefined | null;
|
|
29
|
+
selectRowNode(rowNode: RowNode, newValue?: boolean, e?: Event, source?: SelectionEventSourceType): boolean;
|
|
30
|
+
isCellCheckboxSelection(column: AgColumn, rowNode: IRowNode): boolean;
|
|
31
|
+
protected inferNodeSelections(node: RowNode, shiftKey: boolean, metaKey: boolean, source: SelectionEventSourceType): null | NodeSelection;
|
|
32
|
+
}
|
|
33
|
+
interface SingleNodeSelection {
|
|
34
|
+
node: RowNode;
|
|
35
|
+
newValue: boolean;
|
|
36
|
+
clearSelection: boolean;
|
|
37
|
+
keepDescendants?: boolean;
|
|
38
|
+
}
|
|
39
|
+
interface MultiNodeSelection {
|
|
40
|
+
select: readonly RowNode[];
|
|
41
|
+
deselect: readonly RowNode[];
|
|
42
|
+
reset: boolean;
|
|
43
|
+
}
|
|
44
|
+
type NodeSelection = SingleNodeSelection | MultiNodeSelection;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component } from 'ag-grid-community';
|
|
2
|
+
import type { AgColumn, CheckboxSelectionCallback, RowNode, GroupCheckboxSelectionCallback } from 'ag-grid-community';
|
|
3
|
+
export declare class CheckboxSelectionComponent extends Component {
|
|
4
|
+
private readonly eCheckbox;
|
|
5
|
+
private rowNode;
|
|
6
|
+
private column;
|
|
7
|
+
private overrides?;
|
|
8
|
+
constructor();
|
|
9
|
+
postConstruct(): void;
|
|
10
|
+
private onDataChanged;
|
|
11
|
+
private onSelectableChanged;
|
|
12
|
+
private onSelectionChanged;
|
|
13
|
+
init(params: {
|
|
14
|
+
rowNode: RowNode;
|
|
15
|
+
column?: AgColumn;
|
|
16
|
+
overrides?: {
|
|
17
|
+
isVisible: boolean | CheckboxSelectionCallback | GroupCheckboxSelectionCallback | undefined;
|
|
18
|
+
callbackParams: any;
|
|
19
|
+
removeHidden: boolean;
|
|
20
|
+
};
|
|
21
|
+
}): void;
|
|
22
|
+
private showOrHideSelect;
|
|
23
|
+
private getIsVisible;
|
|
24
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { RowNode, IRowModel, IPinnedRowModel } from 'ag-grid-community';
|
|
2
|
+
interface RangePartition {
|
|
3
|
+
keep: readonly RowNode[];
|
|
4
|
+
discard: readonly RowNode[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The context of a row range selection operation.
|
|
8
|
+
*
|
|
9
|
+
* Used to model the stateful range selection behaviour found in things like Excel and
|
|
10
|
+
* various file explorers, in particular Windows File Explorer, where a given cell/row
|
|
11
|
+
* represents the "root" of a selection range, and subsequent selections are based off that root.
|
|
12
|
+
*
|
|
13
|
+
* See AG-9620 for more
|
|
14
|
+
*/
|
|
15
|
+
export declare class RowRangeSelectionContext {
|
|
16
|
+
private readonly rowModel;
|
|
17
|
+
private readonly pinnedRowModel?;
|
|
18
|
+
/** Whether the user is currently selecting all nodes either via the header checkbox or API */
|
|
19
|
+
selectAll: boolean;
|
|
20
|
+
private rootId;
|
|
21
|
+
/**
|
|
22
|
+
* Note that the "end" `RowNode` may come before or after the "root" `RowNode` in the
|
|
23
|
+
* actual grid.
|
|
24
|
+
*/
|
|
25
|
+
private endId;
|
|
26
|
+
private cachedRange;
|
|
27
|
+
constructor(rowModel: IRowModel, pinnedRowModel?: IPinnedRowModel | undefined);
|
|
28
|
+
reset(): void;
|
|
29
|
+
setRoot(node: RowNode): void;
|
|
30
|
+
setEndRange(end: RowNode): void;
|
|
31
|
+
getRange(): readonly RowNode[];
|
|
32
|
+
isInRange(node: RowNode): boolean;
|
|
33
|
+
getRoot(fallback?: RowNode): RowNode | undefined;
|
|
34
|
+
private getEnd;
|
|
35
|
+
private getRowNode;
|
|
36
|
+
/**
|
|
37
|
+
* Truncates the range to the given node (assumed to be within the current range).
|
|
38
|
+
* Returns nodes that remain in the current range and those that should be removed
|
|
39
|
+
*
|
|
40
|
+
* @param node - Node at which to truncate the range
|
|
41
|
+
* @returns Object of nodes to either keep or discard (i.e. deselect) from the range
|
|
42
|
+
*/
|
|
43
|
+
truncate(node: RowNode): RangePartition;
|
|
44
|
+
/**
|
|
45
|
+
* Extends the range to the given node. Returns nodes that remain in the current range
|
|
46
|
+
* and those that should be removed.
|
|
47
|
+
*
|
|
48
|
+
* @param node - Node marking the new end of the range
|
|
49
|
+
* @returns Object of nodes to either keep or discard (i.e. deselect) from the range
|
|
50
|
+
*/
|
|
51
|
+
extend(node: RowNode, groupSelectsChildren?: boolean): RangePartition;
|
|
52
|
+
private getNodesInRange;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BeanCollection, SelectAllMode, SelectionEventSourceType, IRowNode } from 'ag-grid-community';
|
|
2
|
+
export declare function setNodesSelected(beans: BeanCollection, params: {
|
|
3
|
+
nodes: IRowNode[];
|
|
4
|
+
newValue: boolean;
|
|
5
|
+
source?: SelectionEventSourceType;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare function selectAll(beans: BeanCollection, selectAll?: SelectAllMode, source?: SelectionEventSourceType): void;
|
|
8
|
+
export declare function deselectAll(beans: BeanCollection, selectAll?: SelectAllMode, source?: SelectionEventSourceType): void;
|
|
9
|
+
/** @deprecated v33 */
|
|
10
|
+
export declare function selectAllFiltered(beans: BeanCollection, source?: SelectionEventSourceType): void;
|
|
11
|
+
/** @deprecated v33 */
|
|
12
|
+
export declare function deselectAllFiltered(beans: BeanCollection, source?: SelectionEventSourceType): void;
|
|
13
|
+
/** @deprecated v33 */
|
|
14
|
+
export declare function selectAllOnCurrentPage(beans: BeanCollection, source?: SelectionEventSourceType): void;
|
|
15
|
+
/** @deprecated v33 */
|
|
16
|
+
export declare function deselectAllOnCurrentPage(beans: BeanCollection, source?: SelectionEventSourceType): void;
|
|
17
|
+
export declare function getSelectedNodes<TData = any>(beans: BeanCollection): IRowNode<TData>[];
|
|
18
|
+
export declare function getSelectedRows<TData = any>(beans: BeanCollection): TData[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { _ModuleWithApi, _ModuleWithoutApi } from 'ag-grid-community';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare const SharedRowSelectionModule: _ModuleWithApi<any>;
|
|
6
|
+
/**
|
|
7
|
+
* @feature Selection -> Row Selection
|
|
8
|
+
*/
|
|
9
|
+
export declare const RowSelectionModule: _ModuleWithoutApi;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BeanCollection, HeaderCellCtrl, AgColumn } from 'ag-grid-community';
|
|
2
|
+
import { BeanStub } from 'ag-grid-community';
|
|
3
|
+
export declare class SelectAllFeature extends BeanStub {
|
|
4
|
+
private readonly column;
|
|
5
|
+
private cbSelectAllVisible;
|
|
6
|
+
private processingEventFromCheckbox;
|
|
7
|
+
private headerCellCtrl?;
|
|
8
|
+
private cbSelectAll?;
|
|
9
|
+
constructor(column: AgColumn);
|
|
10
|
+
onSpaceKeyDown(e: KeyboardEvent): void;
|
|
11
|
+
getCheckboxGui(): HTMLElement;
|
|
12
|
+
setComp(ctrl: HeaderCellCtrl): void;
|
|
13
|
+
private onDisplayedColumnsChanged;
|
|
14
|
+
private showOrHideSelectAll;
|
|
15
|
+
private updateStateOfCheckbox;
|
|
16
|
+
private refreshSelectAllLabel;
|
|
17
|
+
private checkSelectionType;
|
|
18
|
+
private checkRightRowModelType;
|
|
19
|
+
private onCbSelectAll;
|
|
20
|
+
/**
|
|
21
|
+
* Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API
|
|
22
|
+
* or `headerCheckboxSelection` is enabled in the legacy API.
|
|
23
|
+
*/
|
|
24
|
+
private isCheckboxSelection;
|
|
25
|
+
private getSelectAllMode;
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function isCheckboxSelection({ gos, selectionColSvc }: BeanCollection, column: AgColumn): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgProvidedColumnGroup, PropertyValueChangedEvent, IColumnCollectionService, ColKey, NamedBean } from 'ag-grid-community';
|
|
2
|
+
import { BeanStub, AgColumn } from 'ag-grid-community';
|
|
3
|
+
export interface ColumnCollections {
|
|
4
|
+
tree: (AgColumn | AgProvidedColumnGroup)[];
|
|
5
|
+
treeDepth: number;
|
|
6
|
+
list: AgColumn[];
|
|
7
|
+
map: {
|
|
8
|
+
[id: string]: AgColumn;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare class SelectionColService extends BeanStub implements NamedBean, IColumnCollectionService {
|
|
12
|
+
beanName: "selectionColSvc";
|
|
13
|
+
columns: ColumnCollections | null;
|
|
14
|
+
postConstruct(): void;
|
|
15
|
+
addColumns(cols: ColumnCollections): void;
|
|
16
|
+
createColumns(cols: ColumnCollections, updateOrders: (callback: (cols: AgColumn[] | null) => AgColumn[] | null) => void): void;
|
|
17
|
+
updateColumns(event: PropertyValueChangedEvent<'selectionColumnDef'>): void;
|
|
18
|
+
getColumn(key: ColKey): AgColumn | null;
|
|
19
|
+
getColumns(): AgColumn[] | null;
|
|
20
|
+
isSelectionColumnEnabled(): boolean;
|
|
21
|
+
private createSelectionColDef;
|
|
22
|
+
private generateSelectionCols;
|
|
23
|
+
private onSelectionOptionsChanged;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Refreshes visibility of the selection column based on which columns are currently visible.
|
|
27
|
+
* Called by the VisibleColsService with the columns that are currently visible in left/center/right
|
|
28
|
+
* containers. This method *MUTATES* those arrays directly.
|
|
29
|
+
*
|
|
30
|
+
* The selection column should be visible if all of the following are true
|
|
31
|
+
* - The selection column is not disabled
|
|
32
|
+
* - The number of visible columns excluding the selection column and row numbers column is greater than 0
|
|
33
|
+
* @param leftCols Visible columns in the left-pinned container
|
|
34
|
+
* @param centerCols Visible columns in the center viewport
|
|
35
|
+
* @param rightCols Visible columns in the right-pinned container
|
|
36
|
+
*/
|
|
37
|
+
refreshVisibility(leftCols: AgColumn[], centerCols: AgColumn[], rightCols: AgColumn[]): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { NamedBean, ServerSideRowGroupSelectionState, ServerSideRowSelectionState, ISelectionService, ISetNodesSelectedParams, GridApi, GridOptions, SelectionEventSourceType, SelectAllMode } from 'ag-grid-community';
|
|
2
|
+
import { ChangedPath, RowNode } from 'ag-grid-community';
|
|
3
|
+
import { BaseSelectionService } from './baseSelectionService';
|
|
4
|
+
export declare class SelectionService extends BaseSelectionService implements NamedBean, ISelectionService {
|
|
5
|
+
beanName: "selectionSvc";
|
|
6
|
+
private selectedNodes;
|
|
7
|
+
/** Only used to track detail grid selection state when master/detail is enabled */
|
|
8
|
+
private detailSelection;
|
|
9
|
+
private groupSelectsDescendants;
|
|
10
|
+
private groupSelectsFiltered;
|
|
11
|
+
private mode?;
|
|
12
|
+
private masterSelectsDetail;
|
|
13
|
+
postConstruct(): void;
|
|
14
|
+
destroy(): void;
|
|
15
|
+
handleSelectionEvent(event: MouseEvent | KeyboardEvent, rowNode: RowNode, source: SelectionEventSourceType): number;
|
|
16
|
+
setNodesSelected({ newValue, clearSelection, suppressFinishActions, nodes, event, source, keepDescendants, }: ISetNodesSelectedParams & {
|
|
17
|
+
keepDescendants?: boolean;
|
|
18
|
+
}): number;
|
|
19
|
+
private selectRange;
|
|
20
|
+
private selectChildren;
|
|
21
|
+
getSelectedNodes(): RowNode[];
|
|
22
|
+
getSelectedRows(): any[];
|
|
23
|
+
getSelectionCount(): number;
|
|
24
|
+
/**
|
|
25
|
+
* This method is used by the CSRM to remove groups which are being disposed of,
|
|
26
|
+
* events do not need fired in this case
|
|
27
|
+
*/
|
|
28
|
+
filterFromSelection(predicate: (node: RowNode) => boolean): void;
|
|
29
|
+
updateGroupsFromChildrenSelections(source: SelectionEventSourceType, changedPath?: ChangedPath): boolean;
|
|
30
|
+
private clearOtherNodes;
|
|
31
|
+
private onRowSelected;
|
|
32
|
+
syncInRowNode(rowNode: RowNode, oldNode?: RowNode): void;
|
|
33
|
+
createDaemonNode(rowNode: RowNode): RowNode | undefined;
|
|
34
|
+
private syncInOldRowNode;
|
|
35
|
+
private syncInNewRowNode;
|
|
36
|
+
reset(source: SelectionEventSourceType): void;
|
|
37
|
+
private resetNodes;
|
|
38
|
+
getBestCostNodeSelection(): RowNode[] | undefined;
|
|
39
|
+
isEmpty(): boolean;
|
|
40
|
+
deselectAllRowNodes({ source, selectAll, }: {
|
|
41
|
+
source: SelectionEventSourceType;
|
|
42
|
+
selectAll?: SelectAllMode;
|
|
43
|
+
}): void;
|
|
44
|
+
private getSelectedCounts;
|
|
45
|
+
getSelectAllState(selectAll?: SelectAllMode): boolean | null;
|
|
46
|
+
hasNodesToSelect(selectAll: SelectAllMode): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* @param selectAll See `MultiRowSelectionOptions.selectAll`
|
|
49
|
+
* @returns all nodes including unselectable nodes which are the target of this selection attempt
|
|
50
|
+
*/
|
|
51
|
+
private getNodesToSelect;
|
|
52
|
+
private forEachNodeOnPage;
|
|
53
|
+
selectAllRowNodes(params: {
|
|
54
|
+
source: SelectionEventSourceType;
|
|
55
|
+
selectAll?: SelectAllMode;
|
|
56
|
+
}): void;
|
|
57
|
+
getSelectionState(): string[] | null;
|
|
58
|
+
setSelectionState(state: string[] | ServerSideRowSelectionState | ServerSideRowGroupSelectionState | undefined, source: SelectionEventSourceType, clearSelection?: boolean): void;
|
|
59
|
+
private canSelectAll;
|
|
60
|
+
/**
|
|
61
|
+
* Updates the selectable state for a node by invoking isRowSelectable callback.
|
|
62
|
+
* If the node is not selectable, it will be deselected.
|
|
63
|
+
*
|
|
64
|
+
* Callers:
|
|
65
|
+
* - property isRowSelectable changed
|
|
66
|
+
* - after grouping / treeData via `updateSelectableAfterGrouping`
|
|
67
|
+
*/
|
|
68
|
+
protected updateSelectable(changedPath?: ChangedPath): void;
|
|
69
|
+
updateSelectableAfterGrouping(changedPath: ChangedPath | undefined): void;
|
|
70
|
+
refreshMasterNodeState(node: RowNode, e?: Event): void;
|
|
71
|
+
setDetailSelectionState(masterNode: RowNode, detailGridOptions: GridOptions, detailApi: GridApi): void;
|
|
72
|
+
private dispatchSelectionChanged;
|
|
73
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GridOptionsService, IPinnedRowModel, LocaleTextFunc, RowNode, RowPinnedType, RowSelectionOptions, SelectAllMode } from 'ag-grid-community';
|
|
2
|
+
export declare function _getMasterSelects(gos: GridOptionsService): NonNullable<RowSelectionOptions['masterSelects']>;
|
|
3
|
+
/** Whether the given node is pinned manually to the top or bottom container */
|
|
4
|
+
export declare function _isManualPinnedRow(rowNode: RowNode): boolean;
|
|
5
|
+
export declare function _getSelectAll(gos: GridOptionsService, defaultValue?: boolean): SelectAllMode | undefined;
|
|
6
|
+
export declare function _getAriaCheckboxStateName(translate: LocaleTextFunc, state?: boolean): string;
|
|
7
|
+
export declare function _getNodesInRangeForSelection(rowModel: IPinnedRowModel, float: NonNullable<RowPinnedType>, start: RowNode | undefined, end: RowNode | undefined): RowNode[];
|
|
8
|
+
/** Get the display configuration for disabled checkboxes. Defaults to displaying disabled checkboxes. */
|
|
9
|
+
export declare function _getHideDisabledCheckboxes(selection: RowSelectionOptions): boolean;
|
|
10
|
+
export declare function _getEnableDeselection(gos: GridOptionsService): boolean;
|
|
11
|
+
export declare function _getEnableSelection(gos: GridOptionsService): boolean;
|
|
12
|
+
export declare function _getEnableSelectionWithoutKeys(gos: GridOptionsService): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { GridApi, GridOptions } from 'ag-grid-community';
|
|
2
|
+
import type { RefreshCallback } from './use-grid';
|
|
3
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
4
|
+
import { GridRow } from './model/row/GridRow';
|
|
5
|
+
export declare const GRID_CONTEXT: InjectionKey<GridContext>;
|
|
6
|
+
export type GridContext = {
|
|
7
|
+
refresh: RefreshCallback;
|
|
8
|
+
api: Ref<GridApi | undefined>;
|
|
9
|
+
resetGridState: () => void;
|
|
10
|
+
};
|
|
11
|
+
export type GridInstance<T> = {
|
|
12
|
+
setFooterData<T>(data: T[]): void;
|
|
13
|
+
updateGridOptions(gridOptions: GridOptions): void;
|
|
14
|
+
reload(): void;
|
|
15
|
+
refresh(): void;
|
|
16
|
+
getRows(): GridRow<T>[];
|
|
17
|
+
createRow(data: T, transient: boolean): GridRow<T>;
|
|
18
|
+
existRow(row: GridRow<T>): void;
|
|
19
|
+
insertRows(rows: GridRow<T>[], index?: number): void;
|
|
20
|
+
startEditing(): void;
|
|
21
|
+
stopEditing(): void;
|
|
22
|
+
};
|