rj-grid 0.2.2 → 0.2.4

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.
@@ -46,9 +46,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
46
46
  showGroupPanel?: boolean | undefined;
47
47
  chartable?: boolean | undefined;
48
48
  exportable?: boolean | undefined;
49
+ /** 工具栏各导出/打印按钮单独显隐(仅在 exportable 为真时生效);默认全 true,可按需关掉其中任意几个 */
50
+ showPrint?: boolean | undefined;
51
+ showCsv?: boolean | undefined;
52
+ showPdf?: boolean | undefined;
53
+ showExcel?: boolean | undefined;
49
54
  colReorder?: boolean | undefined;
50
55
  resizable?: boolean | undefined;
51
56
  rowSelection?: false | "multiple" | "single" | undefined;
57
+ /** 单击数据行单元格即选中该行(替换式,无需再点复选框);按住 Ctrl/Shift/Alt 仍走区域选择,复选框保留多选,双击仍编辑。默认 true */
58
+ selectOnCellClick?: boolean | undefined;
52
59
  keepSelectionCrossPage?: boolean | undefined;
53
60
  editable?: boolean | undefined;
54
61
  rangeSelection?: boolean | undefined;
@@ -96,6 +103,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
96
103
  */
97
104
  serverExport?: ((params: RjServerExportParams) => void | Promise<void>) | undefined;
98
105
  exportFileName?: string | undefined;
106
+ /**
107
+ * 打印 / PDF 单次最大行数护栏:浏览器打印靠把整表排版进隐藏 iframe,
108
+ * 上万行会生成十几 MB HTML 并让主线程卡死(页面假死)。超过此上限只打印前 N 行并提示,
109
+ * 需全量请先筛选 / 用分页 / 走后端导出,或按宿主机器性能调大本值。置 0 或负数则不限。
110
+ */
111
+ printMaxRows?: number | undefined;
99
112
  /** 导出取值口径:默认导出「所见即所得」的格式化文本(与屏幕一致、单文件内口径统一);
100
113
  * 置 true 则导出原始类型值,让 Excel 里数字仍是数字(对齐 AG Grid useCellValuesForExports) */
101
114
  exportRawValues?: boolean | undefined;
@@ -151,9 +164,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
151
164
  showGroupPanel: boolean;
152
165
  chartable: boolean;
153
166
  exportable: boolean;
167
+ showPrint: boolean;
168
+ showCsv: boolean;
169
+ showPdf: boolean;
170
+ showExcel: boolean;
154
171
  colReorder: boolean;
155
172
  resizable: boolean;
156
173
  rowSelection: boolean;
174
+ selectOnCellClick: boolean;
157
175
  editable: boolean;
158
176
  rangeSelection: boolean;
159
177
  clipboard: boolean;
@@ -182,6 +200,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
182
200
  copyHeadersToClipboard: boolean;
183
201
  markDirtyCells: boolean;
184
202
  rowHover: boolean;
203
+ printMaxRows: number;
185
204
  queryable: boolean;
186
205
  viewable: boolean;
187
206
  queryFields: () => never[];
@@ -253,9 +272,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
253
272
  showGroupPanel?: boolean | undefined;
254
273
  chartable?: boolean | undefined;
255
274
  exportable?: boolean | undefined;
275
+ /** 工具栏各导出/打印按钮单独显隐(仅在 exportable 为真时生效);默认全 true,可按需关掉其中任意几个 */
276
+ showPrint?: boolean | undefined;
277
+ showCsv?: boolean | undefined;
278
+ showPdf?: boolean | undefined;
279
+ showExcel?: boolean | undefined;
256
280
  colReorder?: boolean | undefined;
257
281
  resizable?: boolean | undefined;
258
282
  rowSelection?: false | "multiple" | "single" | undefined;
283
+ /** 单击数据行单元格即选中该行(替换式,无需再点复选框);按住 Ctrl/Shift/Alt 仍走区域选择,复选框保留多选,双击仍编辑。默认 true */
284
+ selectOnCellClick?: boolean | undefined;
259
285
  keepSelectionCrossPage?: boolean | undefined;
260
286
  editable?: boolean | undefined;
261
287
  rangeSelection?: boolean | undefined;
@@ -303,6 +329,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
303
329
  */
304
330
  serverExport?: ((params: RjServerExportParams) => void | Promise<void>) | undefined;
305
331
  exportFileName?: string | undefined;
332
+ /**
333
+ * 打印 / PDF 单次最大行数护栏:浏览器打印靠把整表排版进隐藏 iframe,
334
+ * 上万行会生成十几 MB HTML 并让主线程卡死(页面假死)。超过此上限只打印前 N 行并提示,
335
+ * 需全量请先筛选 / 用分页 / 走后端导出,或按宿主机器性能调大本值。置 0 或负数则不限。
336
+ */
337
+ printMaxRows?: number | undefined;
306
338
  /** 导出取值口径:默认导出「所见即所得」的格式化文本(与屏幕一致、单文件内口径统一);
307
339
  * 置 true 则导出原始类型值,让 Excel 里数字仍是数字(对齐 AG Grid useCellValuesForExports) */
308
340
  exportRawValues?: boolean | undefined;
@@ -358,9 +390,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
358
390
  showGroupPanel: boolean;
359
391
  chartable: boolean;
360
392
  exportable: boolean;
393
+ showPrint: boolean;
394
+ showCsv: boolean;
395
+ showPdf: boolean;
396
+ showExcel: boolean;
361
397
  colReorder: boolean;
362
398
  resizable: boolean;
363
399
  rowSelection: boolean;
400
+ selectOnCellClick: boolean;
364
401
  editable: boolean;
365
402
  rangeSelection: boolean;
366
403
  clipboard: boolean;
@@ -389,6 +426,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
389
426
  copyHeadersToClipboard: boolean;
390
427
  markDirtyCells: boolean;
391
428
  rowHover: boolean;
429
+ printMaxRows: number;
392
430
  queryable: boolean;
393
431
  viewable: boolean;
394
432
  queryFields: () => never[];
@@ -451,9 +489,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
451
489
  showGroupPanel: boolean;
452
490
  chartable: boolean;
453
491
  exportable: boolean;
492
+ showPrint: boolean;
493
+ showCsv: boolean;
494
+ showPdf: boolean;
495
+ showExcel: boolean;
454
496
  colReorder: boolean;
455
497
  resizable: boolean;
456
498
  rowSelection: false | "multiple" | "single";
499
+ selectOnCellClick: boolean;
457
500
  rangeSelection: boolean;
458
501
  clipboard: boolean;
459
502
  contextMenu: boolean | ((ctx: any) => RjMenuItem[]);
@@ -472,6 +515,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
472
515
  detailHeight: number;
473
516
  fullWidthHeight: number;
474
517
  exportRange: "auto" | RjExportScopeResolved;
518
+ printMaxRows: number;
475
519
  statusBar: boolean;
476
520
  statusAggregations: ("sum" | "avg" | "min" | "max" | "count")[];
477
521
  undoRedoCellEditing: boolean;
@@ -594,6 +638,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
594
638
  autoSizeColumn: (colId: string) => void;
595
639
  autoSizeAll: () => void;
596
640
  sizeColumnsToFit: () => void;
641
+ /** 清除宽度覆盖:把列宽还原到列定义/内容自适应默认值(配合 autoSizeAll 做「自适应↔还原」切换) */
642
+ resetColumnWidths: () => void;
597
643
  setTheme: (params: RjThemeParams) => void;
598
644
  getTheme: () => {
599
645
  preset?: "legacy" | "alpine" | "quartz" | "material" | undefined;
@@ -728,6 +774,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
728
774
  autoSizeColumn: (colId: string) => void;
729
775
  autoSizeAll: () => void;
730
776
  sizeColumnsToFit: () => void;
777
+ /** 清除宽度覆盖:把列宽还原到列定义/内容自适应默认值(配合 autoSizeAll 做「自适应↔还原」切换) */
778
+ resetColumnWidths: () => void;
731
779
  setTheme: (params: RjThemeParams) => void;
732
780
  getTheme: () => {
733
781
  preset?: "legacy" | "alpine" | "quartz" | "material" | undefined;
@@ -866,6 +914,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
866
914
  autoSizeColumn: (colId: string) => void;
867
915
  autoSizeAll: () => void;
868
916
  sizeColumnsToFit: () => void;
917
+ /** 清除宽度覆盖:把列宽还原到列定义/内容自适应默认值(配合 autoSizeAll 做「自适应↔还原」切换) */
918
+ resetColumnWidths: () => void;
869
919
  setTheme: (params: RjThemeParams) => void;
870
920
  getTheme: () => {
871
921
  preset?: "legacy" | "alpine" | "quartz" | "material" | undefined;
@@ -1001,6 +1051,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
1001
1051
  autoSizeColumn: (colId: string) => void;
1002
1052
  autoSizeAll: () => void;
1003
1053
  sizeColumnsToFit: () => void;
1054
+ /** 清除宽度覆盖:把列宽还原到列定义/内容自适应默认值(配合 autoSizeAll 做「自适应↔还原」切换) */
1055
+ resetColumnWidths: () => void;
1004
1056
  setTheme: (params: RjThemeParams) => void;
1005
1057
  getTheme: () => {
1006
1058
  preset?: "legacy" | "alpine" | "quartz" | "material" | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { RjFilterModel, RjSortState } from './types';
2
+ import type { RjLang } from './locale';
2
3
  export type RjNlqFilterType = 'text' | 'number' | 'date' | 'select';
3
4
  /** 参与解析的列描述(由网格从列定义构建) */
4
5
  export interface RjNlqColumn {
@@ -39,13 +40,20 @@ export interface RjNlqResult {
39
40
  model: RjFilterModel;
40
41
  }[];
41
42
  sort?: RjSortState;
43
+ /** 排序列展示名(title,供 explainNLQ 本地化回显) */
44
+ sortTitle?: string;
42
45
  groupBy?: string;
43
46
  groupColId?: string;
47
+ /** 分组列展示名(title,供 explainNLQ 本地化回显) */
48
+ groupTitle?: string;
44
49
  limit?: number;
45
50
  search?: string;
46
51
  clauses: RjNlqClause[];
47
52
  }
48
53
  /** 解析自然语言查询 */
49
54
  export declare function parseNLQ(text: string, columns: RjNlqColumn[]): RjNlqResult;
50
- /** 生成人类可读的解析摘要(供 UI 回显,key 交由上层 i18n;此处给结构串) */
51
- export declare function explainNLQ(r: RjNlqResult): string;
55
+ /**
56
+ * 生成人类可读的解析摘要(供 UI 回显)。传 lang 则随语言本地化:
57
+ * 中文如「数量 > 100 · 按金额 降序 · 前5 · 搜索“轴承”」,英文如「qty > 100 · sort by amount desc · top 5 · search "bolt"」。
58
+ */
59
+ export declare function explainNLQ(r: RjNlqResult, lang?: RjLang): string;
@@ -630,6 +630,8 @@ export interface RjGridApi extends ComponentPublicInstance {
630
630
  autoSizeAll: () => void;
631
631
  /** 列宽:按视口宽度等比缩放普通区列(对标 sizeColumnsToFit) */
632
632
  sizeColumnsToFit: () => void;
633
+ /** 清除全部列宽覆盖,还原到列定义/内容自适应默认宽(与 autoSizeAll 配合做自适应↔还原切换) */
634
+ resetColumnWidths: () => void;
633
635
  /** 主题引擎(对标 AG Grid Theming):运行时替换预设/明暗/强调色等 */
634
636
  setTheme: (params: RjThemeParams) => void;
635
637
  /** 读取当前生效的主题参数 */
@@ -60,6 +60,7 @@ export declare function useColumnState(sourceColumns: () => RjColumn[]): {
60
60
  setAutoWidth: (colId: string, width: number) => void;
61
61
  hasSizedWidth: (colId: string) => boolean;
62
62
  sizeToFit: () => void;
63
+ clearWidths: () => void;
63
64
  moveColumn: (dragId: string, targetId: string) => void;
64
65
  togglePin: (colId: string, pin: 'left' | 'right' | null) => void;
65
66
  toggleHide: (colId: string, hide?: boolean) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rj-grid",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "零第三方依赖的自研 Vue3 虚拟表格:虚拟滚动 / 冻结列 / 行拖拽 / 分组透视 / 公式 / SSRM / 主题 i18n / 自然语言查询",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,6 +46,7 @@
46
46
  }
47
47
  },
48
48
  "scripts": {
49
+ "start": "vite --config vite.playground.config.ts",
49
50
  "dev": "vite --config vite.playground.config.ts",
50
51
  "build:play": "vite build --config vite.playground.config.ts",
51
52
  "preview:play": "vite preview --config vite.playground.config.ts",
@@ -55,6 +56,8 @@
55
56
  "lint": "eslint --fix --ext .ts,.vue index.ts src __tests__ playground && stylelint \"src/styles/*.scss\"",
56
57
  "ts": "node --max_old_space_size=8192 ./node_modules/vue-tsc/bin/vue-tsc.js --noEmit -p tsconfig.json",
57
58
  "size": "node ./node_modules/vite/bin/vite.js build --config vite.size.config.ts && node build/rjSizeReport.mjs",
59
+ "publish:github": "node scripts/publish-github.mjs",
60
+ "publish:github:push": "node scripts/publish-github.mjs --push",
58
61
  "prepublishOnly": "pnpm build && pnpm test"
59
62
  },
60
63
  "keywords": [