@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,52 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { RowIdMapper } from './index';
|
|
3
|
+
import { ActualRow } from './model/row/ActualRow';
|
|
4
|
+
import { GridRow } from './model/row/GridRow';
|
|
5
|
+
import { EditableRow } from './model/row/EditableRow';
|
|
6
|
+
/**
|
|
7
|
+
* 表格数据源
|
|
8
|
+
*/
|
|
9
|
+
export declare class GridDataCache<T> {
|
|
10
|
+
/**
|
|
11
|
+
* 原始数据行
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
private rows;
|
|
15
|
+
/**
|
|
16
|
+
* 第几页
|
|
17
|
+
*/
|
|
18
|
+
pageNum: number;
|
|
19
|
+
/**
|
|
20
|
+
* 每页数量
|
|
21
|
+
*/
|
|
22
|
+
pageSize: number;
|
|
23
|
+
/**
|
|
24
|
+
* 数据是否已经全部加载完毕
|
|
25
|
+
*/
|
|
26
|
+
isFinished: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 草稿数据 用于存储进入编辑模式时尚未提交的数据
|
|
29
|
+
* 比如编辑中的变更数据和新插入的临时数据
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
private readonly idMapper;
|
|
33
|
+
gridApi: GridApi<GridRow<T>>;
|
|
34
|
+
constructor(idMapper: RowIdMapper<T>);
|
|
35
|
+
createRow(data: T): ActualRow<T>;
|
|
36
|
+
setRows(rows: (ActualRow<T> | EditableRow<T>)[]): this;
|
|
37
|
+
replace(row: ActualRow<T> | EditableRow<T>): void;
|
|
38
|
+
remove(row: (ActualRow<T> | EditableRow<T>)[]): void;
|
|
39
|
+
getRows(): (ActualRow<T> | EditableRow<T>)[];
|
|
40
|
+
appendRows(rows: ActualRow<T>[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* 插入数据
|
|
43
|
+
* @param rows
|
|
44
|
+
* @param index
|
|
45
|
+
*/
|
|
46
|
+
insertRows(rows: (ActualRow<T> | EditableRow<T>)[], index?: number): void;
|
|
47
|
+
/**
|
|
48
|
+
* 删除数据
|
|
49
|
+
* @param rows
|
|
50
|
+
*/
|
|
51
|
+
deleteRows(rows: GridRow<T>[] | string[]): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GridApi, IDatasource, IGetRowsParams, SortDirection, SortModelItem } from 'ag-grid-community';
|
|
2
|
+
import type { GridDataCache } from './GridDataCache';
|
|
3
|
+
import { ProjectionRow } from './model/row/ProjectionRow';
|
|
4
|
+
export type DataGetter<T> = T[] | ((params: PageFetchParams) => Promise<T[]>) | ((params: PageFetchParams) => T[]);
|
|
5
|
+
export type PageFetchParams = {
|
|
6
|
+
pageNum: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
} & FetchParams;
|
|
9
|
+
export type FetchParams = {
|
|
10
|
+
startRow: number;
|
|
11
|
+
endRow: number;
|
|
12
|
+
sorts: SortModelItem[];
|
|
13
|
+
params: any;
|
|
14
|
+
};
|
|
15
|
+
export type SortModel = {
|
|
16
|
+
field: string;
|
|
17
|
+
direction: SortDirection;
|
|
18
|
+
};
|
|
19
|
+
export declare class GridDataSource<T> implements IDatasource {
|
|
20
|
+
/**
|
|
21
|
+
* 是否正在加载中
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
private loading;
|
|
25
|
+
private readonly dataGetter;
|
|
26
|
+
private cache;
|
|
27
|
+
private _api?;
|
|
28
|
+
private loadingDelay;
|
|
29
|
+
constructor(dataGetter: DataGetter<T>, cache: GridDataCache<T>);
|
|
30
|
+
set api(value: GridApi<ProjectionRow<T>>);
|
|
31
|
+
get api(): GridApi<ProjectionRow<T>>;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
loadData(): void;
|
|
34
|
+
private getSorts;
|
|
35
|
+
getRows(params: IGetRowsParams & {
|
|
36
|
+
pageNum: number;
|
|
37
|
+
pageSize: number;
|
|
38
|
+
}): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { GridDataCache } from './GridDataCache';
|
|
2
|
+
import type { IGetRowsParams, SortModelItem } from 'ag-grid-community';
|
|
3
|
+
export declare class ServerGetRowsParamsRequest<T> implements IGetRowsParams {
|
|
4
|
+
context: any;
|
|
5
|
+
/**
|
|
6
|
+
* 结束行
|
|
7
|
+
*/
|
|
8
|
+
endRow: number;
|
|
9
|
+
/**
|
|
10
|
+
* 过滤条件
|
|
11
|
+
*/
|
|
12
|
+
filterModel: any;
|
|
13
|
+
/**
|
|
14
|
+
* 排序条件
|
|
15
|
+
*/
|
|
16
|
+
sortModel: SortModelItem[];
|
|
17
|
+
/**
|
|
18
|
+
* 起始行
|
|
19
|
+
*/
|
|
20
|
+
startRow: number;
|
|
21
|
+
/**
|
|
22
|
+
* 数据源
|
|
23
|
+
*/
|
|
24
|
+
dataCache: GridDataCache<T>;
|
|
25
|
+
pageNum: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
constructor(pageNum: number, pageSize: number, dataCache: GridDataCache<T>, sortModel?: SortModelItem[]);
|
|
28
|
+
static from<T>(pageNum: number, pageSize: number | undefined, dataCache: GridDataCache<T>): ServerGetRowsParamsRequest<T>;
|
|
29
|
+
static nextPage<T>(dataCache: GridDataCache<T>): ServerGetRowsParamsRequest<T>;
|
|
30
|
+
failCallback(): void;
|
|
31
|
+
successCallback(rowsThisBlock: T[]): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GridOptions } from 'ag-grid-community';
|
|
2
|
+
import { RestrictedAgGridOptions } from './ag-grid-options';
|
|
3
|
+
export type AgGridMenuOptions = Pick<GridOptions, 'onCellContextMenu' | 'suppressContextMenu' | 'getContextMenuItems' | 'onColumnHeaderContextMenu' | 'onContextMenuVisibleChanged' | 'preventDefaultOnContextMenu' | 'allowContextMenuWithControlKey'>;
|
|
4
|
+
/**
|
|
5
|
+
* 适配器函数,用于将GridOptions转换为AgGridMenuOptions
|
|
6
|
+
* @param options 原始网格选项配置
|
|
7
|
+
* @returns 返回适配后的AgGrid菜单选项配置
|
|
8
|
+
*/
|
|
9
|
+
export declare const adapterGridMenuOptions: <T>(options: RestrictedAgGridOptions<T>) => AgGridMenuOptions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GridOptions, GetContextMenuItemsParams } from 'ag-grid-community';
|
|
2
|
+
import { ContextMenuItem } from '../../index';
|
|
3
|
+
import { RowSelectionOptions } from 'ag-grid-community/dist/types/src/entities/gridOptions';
|
|
4
|
+
/**
|
|
5
|
+
* 受限的ag-grid-options 用于暴露对外的ag-grid 选项 因为使用的社区版 需要把部分企业版的选项去掉
|
|
6
|
+
* 同时对于部分自定义模块替换商业模块的功能支持不是很足和实现不一致也需要覆盖和修改其类型
|
|
7
|
+
*/
|
|
8
|
+
export type RestrictedAgGridOptions<TData> = Pick<GridOptions, 'onSelectionChanged' | 'getRowStyle' | 'getRowClass' | 'rowClass' | 'rowStyle' | 'rowClassRules' | 'onCellMouseOver' | 'onRowSelected' | 'onCellMouseOut'> & {
|
|
9
|
+
getContextMenuItems?: (e: GetContextMenuItemsParams) => ContextMenuItem<TData>[];
|
|
10
|
+
rowSelection?: RowSelectionOptions<TData>;
|
|
11
|
+
};
|