@scvzerng/element-ui-ag-grid-vue2 0.0.35 → 0.0.37

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.
@@ -11,6 +11,16 @@ type __VLS_Props = {
11
11
  columns: Column[];
12
12
  rowData: RowData<any>;
13
13
  pageSize?: number;
14
+ /**
15
+ * 是否开启游标分页 (cursor / keyset)
16
+ *
17
+ * 开启后每次取数都是"第 1 页"语义, 请求带上当前已加载数组最后一行的 id 作为 cursorId,
18
+ * 后端按 id 倒序查 id < cursorId (或 id <= cursorId) 的下一批;
19
+ * 加载完毕判定: 这一页没有带来任何新 id.
20
+ *
21
+ * 依赖 id 排序, 开启后列排序图标消失 (排序条件不参与取数), 默认关闭
22
+ */
23
+ enableCursorPage?: boolean;
14
24
  footerHeight?: number;
15
25
  tools?: ('search' | 'refresh' | 'setting')[];
16
26
  searches?: Searchable[];
@@ -14807,6 +14817,7 @@ declare function __VLS_template(): {
14807
14817
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14808
14818
  declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
14809
14819
  pageSize: number;
14820
+ enableCursorPage: boolean;
14810
14821
  tools: () => string[];
14811
14822
  gridOptions: () => Options;
14812
14823
  }>, {
@@ -14823,11 +14834,13 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
14823
14834
  deselectAll: (mode?: SelectAllMode, source?: SelectionEventSourceType) => void;
14824
14835
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
14825
14836
  pageSize: number;
14837
+ enableCursorPage: boolean;
14826
14838
  tools: () => string[];
14827
14839
  gridOptions: () => Options;
14828
14840
  }>>>, {
14829
14841
  gridOptions: Options;
14830
14842
  pageSize: number;
14843
+ enableCursorPage: boolean;
14831
14844
  tools: ("search" | "refresh" | "setting")[];
14832
14845
  }>;
14833
14846
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -16,6 +16,16 @@ export type GridProps = {
16
16
  columns: Column[];
17
17
  rowData: RowData<any>;
18
18
  pageSize: number;
19
+ /**
20
+ * 是否开启游标分页 (cursor / keyset)
21
+ *
22
+ * 开启后每次取数都是"第 1 页"语义, 请求带上当前已加载数组最后一行的 id 作为 cursorId,
23
+ * 后端按 id 倒序查 id < cursorId (或 id <= cursorId) 的下一批;
24
+ * 加载完毕判定: 这一页没有带来任何新 id.
25
+ *
26
+ * 依赖 id 排序, 开启后列排序图标消失 (排序条件不参与取数), 默认关闭
27
+ */
28
+ enableCursorPage?: boolean;
19
29
  tools: ('search' | 'refresh' | 'setting')[];
20
30
  searches: Searchable[];
21
31
  /**
@@ -342,6 +352,7 @@ export declare const useGrid: <T = any>(props: GridProps) => {
342
352
  getRows: (params: import("ag-grid-community").IGetRowsParams & {
343
353
  pageNum: number;
344
354
  pageSize: number;
355
+ cursorId?: string;
345
356
  }) => void;
346
357
  }, import("@scvzerng/ag-grid-core").GridDataSource<any> | {
347
358
  api: {
@@ -656,6 +667,7 @@ export declare const useGrid: <T = any>(props: GridProps) => {
656
667
  getRows: (params: import("ag-grid-community").IGetRowsParams & {
657
668
  pageNum: number;
658
669
  pageSize: number;
670
+ cursorId?: string;
659
671
  }) => void;
660
672
  }>;
661
673
  gridStyles: import("vue").Ref<{
@@ -672,6 +684,7 @@ export declare const useGrid: <T = any>(props: GridProps) => {
672
684
  pageNum: number;
673
685
  pageSize: number;
674
686
  isFinished: boolean;
687
+ enableCursorPage: boolean;
675
688
  bridge?: {
676
689
  reload: () => void;
677
690
  redraw: (row: GridRow<any>) => void;
@@ -694,6 +707,7 @@ export declare const useGrid: <T = any>(props: GridProps) => {
694
707
  pageNum: number;
695
708
  pageSize: number;
696
709
  isFinished: boolean;
710
+ enableCursorPage: boolean;
697
711
  bridge?: {
698
712
  reload: () => void;
699
713
  redraw: (row: GridRow<any>) => void;
@@ -723,4 +737,5 @@ export declare const useGrid: <T = any>(props: GridProps) => {
723
737
  refresh: () => Promise<void>;
724
738
  selectByIds: (ids: string[], source?: import("ag-grid-community").SelectionEventSourceType) => void;
725
739
  deselectByIds: (ids: string[], source?: import("ag-grid-community").SelectionEventSourceType) => void;
740
+ getSelectedRows: () => GridRow<T>[];
726
741
  };
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "@scvzerng/element-ui-ag-grid-vue2",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "type": "module",
5
5
  "private": false,
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
9
+ "typecheck": "vue-tsc --noEmit --declaration",
10
+ "lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
11
+ "lint": "run-s lint:*",
12
+ "format": "prettier --write src/"
13
+ },
6
14
  "exports": {
7
15
  ".": {
8
16
  "types": "./dist/types/index.d.ts",
@@ -30,6 +38,7 @@
30
38
  "devDependencies": {
31
39
  "unplugin-vue-macros": "2.14.5",
32
40
  "@prettier/plugin-oxc": "0.0.4",
41
+ "@scvzerng/ag-grid-core": "workspace:*",
33
42
  "@types/md5": "2.3.5",
34
43
  "@types/node": "22.16.5",
35
44
  "@vitejs/plugin-vue2": "2.3.3",
@@ -47,18 +56,9 @@
47
56
  "sass-embedded": "1.90.0",
48
57
  "typescript": "5.9.2",
49
58
  "vite": "5.4.19",
50
- "vue-tsc": "2.1.10",
51
- "@scvzerng/ag-grid-core": "0.1.0"
59
+ "vue-tsc": "2.1.10"
52
60
  },
53
61
  "publishConfig": {
54
62
  "access": "public"
55
- },
56
- "scripts": {
57
- "dev": "vite",
58
- "build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
59
- "typecheck": "vue-tsc --noEmit --declaration",
60
- "lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
61
- "lint": "run-s lint:*",
62
- "format": "prettier --write src/"
63
63
  }
64
- }
64
+ }