@freegridjs/core 1.7.0 → 1.7.1

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/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { G as GridOptions, a as GridApi, E as ExportOptions, R as Row, D as Datasource, b as RowTransaction, L as LocalePack } from './types-DPOWDM8R.js';
2
- export { A as AdvancedFilter, c as AdvancedFilterCondition, d as Aggregator, e as AssistantAction, f as AssistantColumn, g as AssistantOptions, h as AssistantRequest, i as AssistantResult, C as CellEvent, j as CellParams, k as CellStyle, l as ChartHandle, m as ChartOptions, n as ColumnDef, o as ColumnState, p as ColumnType, q as CombinedFilterModel, r as ConditionalFormat, s as ConditionalFormatType, t as ConditionalOp, u as ContextMenuItem, v as ContextMenuParams, w as CustomEditor, x as DateFilterModel, y as DateOp, z as EditorParams, B as EditorSpec, F as FilterModel, H as FilterOp, I as FilterType, J as GridEvents, K as GridRange, M as InvalidCell, N as JsonExportOptions, O as KeyAction, P as Messages, Q as NumberFilterModel, S as NumberOp, T as PdfOptions, U as PivotConfig, V as PrintOptions, W as Region, X as RowDragOptions, Y as RowDropParams, Z as RowDropPosition, _ as SavedGridState, $ as SavedStatePart, a0 as ScrollPosition, a1 as SelectOption, a2 as ServerParams, a3 as SetFilterModel, a4 as SortDir, a5 as SortItem, a6 as SpanParams, a7 as SummaryCell, a8 as SummaryOptions, a9 as SummaryRowDef, aa as TextFilterModel, ab as TextOp, ac as TransactionResult, ad as XlsxCell, ae as XlsxSheet, af as readXlsx, ag as writeXlsx } from './types-DPOWDM8R.js';
1
+ import { G as GridOptions, a as GridApi, E as ExportOptions, R as Row, D as Datasource, b as RowTransaction, L as LocalePack } from './types-D8F0nn1a.js';
2
+ export { A as AdvancedFilter, c as AdvancedFilterCondition, d as Aggregator, e as AssistantAction, f as AssistantColumn, g as AssistantOptions, h as AssistantRequest, i as AssistantResult, C as CellEvent, j as CellParams, k as CellStyle, l as ChartHandle, m as ChartOptions, n as ColumnDef, o as ColumnState, p as ColumnType, q as CombinedFilterModel, r as ConditionalFormat, s as ConditionalFormatType, t as ConditionalOp, u as ContextMenuItem, v as ContextMenuParams, w as CustomEditor, x as DateFilterModel, y as DateOp, z as EditorParams, B as EditorSpec, F as FilterModel, H as FilterOp, I as FilterType, J as GridEvents, K as GridRange, M as InvalidCell, N as JsonExportOptions, O as KeyAction, P as Messages, Q as NumberFilterModel, S as NumberOp, T as PdfOptions, U as PivotConfig, V as PrintOptions, W as Region, X as RowDragOptions, Y as RowDropParams, Z as RowDropPosition, _ as SavedGridState, $ as SavedStatePart, a0 as ScrollPosition, a1 as SelectOption, a2 as ServerParams, a3 as SetFilterModel, a4 as SortDir, a5 as SortItem, a6 as SpanParams, a7 as SummaryCell, a8 as SummaryOptions, a9 as SummaryRowDef, aa as TextFilterModel, ab as TextOp, ac as TransactionResult, ad as XlsxCell, ae as XlsxSheet, af as readXlsx, ag as writeXlsx } from './types-D8F0nn1a.js';
3
3
  export { default as en } from './locales/en.js';
4
4
 
5
5
  declare function createGrid(host: HTMLElement, options: GridOptions): GridApi;
6
6
 
7
7
  /** FreeGrid version (kept in sync with releases.json by scripts/release.mjs). */
8
- declare const version = "1.7.0";
8
+ declare const version = "1.7.1";
9
9
 
10
10
  interface LicenseInfo {
11
11
  /** Licensed domains (plus their www. host); `*.example.com` also covers every subdomain. */
package/dist/index.js CHANGED
@@ -3268,6 +3268,7 @@ var en = {
3268
3268
  exportCsv: "Export CSV",
3269
3269
  exportExcel: "Export Excel",
3270
3270
  print: "Print\u2026",
3271
+ printLimited: "Printed the first {n} of {total} rows. Export to Excel or CSV for all of them.",
3271
3272
  pivot: "Pivot",
3272
3273
  pivotMode: "Pivot mode",
3273
3274
  pivotRows: "Row groups",
@@ -6576,6 +6577,7 @@ tr.title td { border: 0; padding: 0 0 4px; background: none; }
6576
6577
  tr.total td { font-weight: 700; background: #f3f4f6; border-top: 1.5px solid #111827; border-bottom: 0; }
6577
6578
  `;
6578
6579
  var colorOk = (c) => typeof c === "string" && /^(#[0-9a-f]{3,8}|[a-z]+|rgba?\([\d\s.,%]+\)|hsla?\([\d\s.,%deg]+\))$/i.test(c.trim()) ? c.trim() : void 0;
6580
+ var DEFAULT_PRINT_ROWS = 1e3;
6579
6581
  function printModel(grid, opts = {}) {
6580
6582
  const cols = exportColumns(grid, opts.columns);
6581
6583
  const loc = grid.store.state.locale;
@@ -6629,8 +6631,11 @@ function printModel(grid, opts = {}) {
6629
6631
  const groupBy = opts.groups !== false && !grid.rowModel.server && !grid.options.treeData ? grid.getGroupBy() : [];
6630
6632
  const probe = opts.styles !== false && cols.some((c) => c.def.cellClass) ? classStyles(grid) : null;
6631
6633
  const body = [];
6634
+ const maxRows = typeof opts.maxRows === "number" && opts.maxRows >= 1 ? Math.floor(opts.maxRows) : DEFAULT_PRINT_ROWS;
6635
+ let printedRows = 0;
6632
6636
  try {
6633
6637
  for (const line2 of printLines(grid, rows, groupBy)) {
6638
+ if (line2.kind === "row" && printedRows >= maxRows) break;
6634
6639
  if (line2.kind === "group") {
6635
6640
  const def = grid.columns.getNode(line2.colId)?.def;
6636
6641
  const value = isBlank(line2.value) ? loc.blanks : def ? getFormatter(def, code)(line2.value) : String(line2.value);
@@ -6680,6 +6685,7 @@ function printModel(grid, opts = {}) {
6680
6685
  cells.push(cell);
6681
6686
  });
6682
6687
  body.push({ kind: "row", cells });
6688
+ printedRows++;
6683
6689
  }
6684
6690
  } finally {
6685
6691
  probe?.dispose();
@@ -6701,8 +6707,11 @@ function printModel(grid, opts = {}) {
6701
6707
  const orientation = opts.orientation === "portrait" || opts.orientation === "landscape" ? opts.orientation : sum + (numbered ? 40 : 0) > PORTRAIT_WIDTH ? "landscape" : "portrait";
6702
6708
  const printed = opts.printedAt !== false ? new Intl.DateTimeFormat(code, { dateStyle: "medium", timeStyle: "short" }).format(/* @__PURE__ */ new Date()) : "";
6703
6709
  const repeatRows = Number.isInteger(opts.repeatRows) && opts.repeatRows > 0 ? Math.min(opts.repeatRows, body.length) : 0;
6710
+ const limited = rows.length > printedRows ? loc.printLimited.replace("{n}", nf.format(printedRows)).replace("{total}", nf.format(rows.length)) : "";
6711
+ if (limited) foot.push({ kind: "total", cells: [{ text: limited, align: "left", span: cols.length + (numbered ? 1 : 0), italic: true }] });
6704
6712
  return {
6705
6713
  lang: code,
6714
+ limited,
6706
6715
  title: opts.title ?? "",
6707
6716
  subtitle: opts.subtitle ?? "",
6708
6717
  printed,
@@ -7595,7 +7604,7 @@ function buildPivot(source, config, defOf, labels, locale) {
7595
7604
  }
7596
7605
 
7597
7606
  // src/version.ts
7598
- var version = "1.7.0";
7607
+ var version = "1.7.1";
7599
7608
 
7600
7609
  // src/license.ts
7601
7610
  var PUBLIC_KEY = { kty: "EC", crv: "P-256", x: "sUTKkglZmk-HMKPNub8p7AeLBKesHCU8irIkw9rJlbE", y: "j0U_aKRDR7iApY9UpaD3hUemhBLZJwDv9-QiT_hUyw8" };
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const de: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var de = {
73
73
  exportCsv: "Als CSV exportieren",
74
74
  exportExcel: "Nach Excel exportieren",
75
75
  print: "Drucken\u2026",
76
+ printLimited: "Die ersten {n} von {total} Zeilen wurden gedruckt. F\xFCr alle Zeilen nach Excel oder CSV exportieren.",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "Pivot-Modus",
78
79
  pivotRows: "Zeilengruppen",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const en: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var en = {
73
73
  exportCsv: "Export CSV",
74
74
  exportExcel: "Export Excel",
75
75
  print: "Print\u2026",
76
+ printLimited: "Printed the first {n} of {total} rows. Export to Excel or CSV for all of them.",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "Pivot mode",
78
79
  pivotRows: "Row groups",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const es: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var es = {
73
73
  exportCsv: "Exportar CSV",
74
74
  exportExcel: "Exportar a Excel",
75
75
  print: "Imprimir\u2026",
76
+ printLimited: "Se imprimieron las primeras {n} de {total} filas. Exporte a Excel o CSV para obtenerlas todas.",
76
77
  pivot: "Tabla din\xE1mica",
77
78
  pivotMode: "Modo tabla din\xE1mica",
78
79
  pivotRows: "Grupos de filas",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const fr: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var fr = {
73
73
  exportCsv: "Exporter en CSV",
74
74
  exportExcel: "Exporter vers Excel",
75
75
  print: "Imprimer\u2026",
76
+ printLimited: "Les {n} premi\xE8res lignes sur {total} ont \xE9t\xE9 imprim\xE9es. Exportez vers Excel ou CSV pour toutes les avoir.",
76
77
  pivot: "Tableau crois\xE9",
77
78
  pivotMode: "Mode tableau crois\xE9",
78
79
  pivotRows: "Groupes de lignes",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const id: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var id = {
73
73
  exportCsv: "Ekspor CSV",
74
74
  exportExcel: "Ekspor Excel",
75
75
  print: "Cetak\u2026",
76
+ printLimited: "Dicetak {n} baris pertama dari {total}. Ekspor ke Excel atau CSV untuk semua baris.",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "Mode pivot",
78
79
  pivotRows: "Grup baris",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const it: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var it = {
73
73
  exportCsv: "Esporta CSV",
74
74
  exportExcel: "Esporta Excel",
75
75
  print: "Stampa\u2026",
76
+ printLimited: "Stampate le prime {n} di {total} righe. Esporta in Excel o CSV per averle tutte.",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "Modalit\xE0 pivot",
78
79
  pivotRows: "Gruppi di righe",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const ja: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var ja = {
73
73
  exportCsv: "CSV \u306B\u66F8\u304D\u51FA\u3059",
74
74
  exportExcel: "Excel \u306B\u66F8\u304D\u51FA\u3059",
75
75
  print: "\u5370\u5237\u2026",
76
+ printLimited: "\u5168 {total} \u884C\u306E\u3046\u3061\u6700\u521D\u306E {n} \u884C\u306E\u307F\u5370\u5237\u3057\u307E\u3057\u305F\u3002\u3059\u3079\u3066\u306E\u884C\u306F Excel \u307E\u305F\u306F CSV \u306B\u66F8\u304D\u51FA\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
76
77
  pivot: "\u30D4\u30DC\u30C3\u30C8",
77
78
  pivotMode: "\u30D4\u30DC\u30C3\u30C8\u30E2\u30FC\u30C9",
78
79
  pivotRows: "\u884C\u30B0\u30EB\u30FC\u30D7",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const ko: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var ko = {
73
73
  exportCsv: "CSV\uB85C \uB0B4\uBCF4\uB0B4\uAE30",
74
74
  exportExcel: "\uC5D1\uC140\uB85C \uB0B4\uBCF4\uB0B4\uAE30",
75
75
  print: "\uC778\uC1C4\u2026",
76
+ printLimited: "\uC804\uCCB4 {total}\uD589 \uC911 \uCC98\uC74C {n}\uD589\uB9CC \uC778\uC1C4\uD588\uC2B5\uB2C8\uB2E4. \uC804\uCCB4\uB294 \uC5D1\uC140\uC774\uB098 CSV\uB85C \uB0B4\uBCF4\uB0B4\uC138\uC694.",
76
77
  pivot: "\uD53C\uBC97",
77
78
  pivotMode: "\uD53C\uBC97 \uBAA8\uB4DC",
78
79
  pivotRows: "\uD589 \uADF8\uB8F9",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const ptBR: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var ptBR = {
73
73
  exportCsv: "Exportar CSV",
74
74
  exportExcel: "Exportar Excel",
75
75
  print: "Imprimir\u2026",
76
+ printLimited: "Foram impressas as primeiras {n} de {total} linhas. Exporte para Excel ou CSV para obter todas.",
76
77
  pivot: "Piv\xF4",
77
78
  pivotMode: "Modo piv\xF4",
78
79
  pivotRows: "Grupos de linhas",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const ru: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var ru = {
73
73
  exportCsv: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 CSV",
74
74
  exportExcel: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 Excel",
75
75
  print: "\u041F\u0435\u0447\u0430\u0442\u044C\u2026",
76
+ printLimited: "\u041D\u0430\u043F\u0435\u0447\u0430\u0442\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A. \u0427\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0432\u0441\u0435, \u044D\u043A\u0441\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 Excel \u0438\u043B\u0438 CSV.",
76
77
  pivot: "\u0421\u0432\u043E\u0434\u043D\u0430\u044F",
77
78
  pivotMode: "\u0420\u0435\u0436\u0438\u043C \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u044B",
78
79
  pivotRows: "\u0413\u0440\u0443\u043F\u043F\u044B \u0441\u0442\u0440\u043E\u043A",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const th: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var th = {
73
73
  exportCsv: "\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 CSV",
74
74
  exportExcel: "\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 Excel",
75
75
  print: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u2026",
76
+ printLimited: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C {n} \u0E41\u0E16\u0E27\u0E41\u0E23\u0E01\u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 {total} \u0E41\u0E16\u0E27 \u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01\u0E40\u0E1B\u0E47\u0E19 Excel \u0E2B\u0E23\u0E37\u0E2D CSV \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E23\u0E31\u0E1A\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "\u0E42\u0E2B\u0E21\u0E14 Pivot",
78
79
  pivotRows: "\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E16\u0E27",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const vi: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var vi = {
73
73
  exportCsv: "Xu\u1EA5t CSV",
74
74
  exportExcel: "Xu\u1EA5t Excel",
75
75
  print: "In\u2026",
76
+ printLimited: "\u0110\xE3 in {n} h\xE0ng \u0111\u1EA7u ti\xEAn trong t\u1ED5ng s\u1ED1 {total} h\xE0ng. Xu\u1EA5t sang Excel ho\u1EB7c CSV \u0111\u1EC3 c\xF3 t\u1EA5t c\u1EA3.",
76
77
  pivot: "Pivot",
77
78
  pivotMode: "Ch\u1EBF \u0111\u1ED9 pivot",
78
79
  pivotRows: "Nh\xF3m d\xF2ng",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const zhCN: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var zhCN = {
73
73
  exportCsv: "\u5BFC\u51FA CSV",
74
74
  exportExcel: "\u5BFC\u51FA Excel",
75
75
  print: "\u6253\u5370\u2026",
76
+ printLimited: "\u4EC5\u6253\u5370\u4E86 {total} \u884C\u4E2D\u7684\u524D {n} \u884C\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8BF7\u5BFC\u51FA\u4E3A Excel \u6216 CSV\u3002",
76
77
  pivot: "\u6570\u636E\u900F\u89C6",
77
78
  pivotMode: "\u900F\u89C6\u6A21\u5F0F",
78
79
  pivotRows: "\u884C\u5206\u7EC4",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-DPOWDM8R.js';
1
+ import { L as LocalePack } from '../types-D8F0nn1a.js';
2
2
 
3
3
  declare const zhTW: LocalePack;
4
4
 
@@ -73,6 +73,7 @@ var zhTW = {
73
73
  exportCsv: "\u532F\u51FA CSV",
74
74
  exportExcel: "\u532F\u51FA Excel",
75
75
  print: "\u5217\u5370\u2026",
76
+ printLimited: "\u50C5\u5217\u5370\u4E86 {total} \u5217\u4E2D\u7684\u524D {n} \u5217\u3002\u5982\u9700\u5168\u90E8\uFF0C\u8ACB\u532F\u51FA\u70BA Excel \u6216 CSV\u3002",
76
77
  pivot: "\u6A1E\u7D10\u5206\u6790",
77
78
  pivotMode: "\u6A1E\u7D10\u5206\u6790\u6A21\u5F0F",
78
79
  pivotRows: "\u5217\u7FA4\u7D44",
@@ -361,6 +361,8 @@ interface Messages {
361
361
  exportCsv: string;
362
362
  exportExcel: string;
363
363
  print: string;
364
+ /** Printed or PDF page cut at maxRows: {n} rows printed, {total} rows in all. */
365
+ printLimited: string;
364
366
  pivot: string;
365
367
  pivotMode: string;
366
368
  pivotRows: string;
@@ -546,6 +548,11 @@ interface PrintOptions extends ExportOptions {
546
548
  rowNumbers?: boolean;
547
549
  /** Repeat the title block on every page. Default false. */
548
550
  repeatTitle?: boolean;
551
+ /**
552
+ * Most data rows to print (default 1000); a note at the end says how many were left out.
553
+ * Browsers take minutes to lay out a print of many thousands of rows; Excel and CSV have no limit.
554
+ */
555
+ maxRows?: number;
549
556
  }
550
557
  /** Look of a cell set by a conditional format. Colours: #hex, rgb(), hsl(), names or var(--x). */
551
558
  interface CellStyle {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freegridjs/core",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "FreeGrid — a fast data grid for the web (free for personal use): virtual scrolling, grouping, pivot, charts, Excel export, 7 languages.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",