@freegridjs/core 1.10.0 → 1.11.0

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.
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const de: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var de = {
94
94
  freeBadge: "Kostenlose Version",
95
95
  exportPdf: "Als PDF exportieren",
96
96
  exportJson: "Als JSON exportieren",
97
- ai: { title: "KI-Assistent", placeholder: "Fragen Sie zu den Daten oder sagen Sie der Tabelle, was sie tun soll", send: "Senden", thinking: "Wird bearbeitet\u2026", undo: "R\xFCckg\xE4ngig", undone: "R\xFCckg\xE4ngig gemacht", failed: "Der Assistent hat nicht geantwortet", skipped: "\xDCbersprungen", done: "Fertig" },
98
97
  cf: {
99
98
  title: "Bedingte Formatierung",
100
99
  add: "Regel hinzuf\xFCgen",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const en: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var en = {
94
94
  freeBadge: "Free version",
95
95
  exportPdf: "Export PDF",
96
96
  exportJson: "Export JSON",
97
- ai: { title: "AI assistant", placeholder: "Ask about the data or tell the grid what to do", send: "Send", thinking: "Working\u2026", undo: "Undo", undone: "Undone", failed: "The assistant did not answer", skipped: "Skipped", done: "Done" },
98
97
  cf: {
99
98
  title: "Conditional formatting",
100
99
  add: "Add rule",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const es: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var es = {
94
94
  freeBadge: "Versi\xF3n gratuita",
95
95
  exportPdf: "Exportar PDF",
96
96
  exportJson: "Exportar JSON",
97
- ai: { title: "Asistente de IA", placeholder: "Pregunte por los datos o diga a la tabla qu\xE9 hacer", send: "Enviar", thinking: "Procesando\u2026", undo: "Deshacer", undone: "Deshecho", failed: "El asistente no respondi\xF3", skipped: "Omitido", done: "Hecho" },
98
97
  cf: {
99
98
  title: "Formato condicional",
100
99
  add: "A\xF1adir regla",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const fr: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var fr = {
94
94
  freeBadge: "Version gratuite",
95
95
  exportPdf: "Exporter en PDF",
96
96
  exportJson: "Exporter en JSON",
97
- ai: { title: "Assistant IA", placeholder: "Posez une question sur les donn\xE9es ou dites \xE0 la grille quoi faire", send: "Envoyer", thinking: "En cours\u2026", undo: "Annuler", undone: "Annul\xE9", failed: "L'assistant n'a pas r\xE9pondu", skipped: "Ignor\xE9", done: "Termin\xE9" },
98
97
  cf: {
99
98
  title: "Mise en forme conditionnelle",
100
99
  add: "Ajouter une r\xE8gle",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const id: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var id = {
94
94
  freeBadge: "Versi gratis",
95
95
  exportPdf: "Ekspor PDF",
96
96
  exportJson: "Ekspor JSON",
97
- ai: { title: "Asisten AI", placeholder: "Tanyakan tentang data atau beri tahu grid apa yang harus dilakukan", send: "Kirim", thinking: "Memproses\u2026", undo: "Urungkan", undone: "Diurungkan", failed: "Asisten tidak menjawab", skipped: "Dilewati", done: "Selesai" },
98
97
  cf: {
99
98
  title: "Pemformatan bersyarat",
100
99
  add: "Tambah aturan",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const it: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var it = {
94
94
  freeBadge: "Versione gratuita",
95
95
  exportPdf: "Esporta PDF",
96
96
  exportJson: "Esporta JSON",
97
- ai: { title: "Assistente IA", placeholder: "Chiedi qualcosa sui dati o di\u2019 alla griglia cosa fare", send: "Invia", thinking: "In corso\u2026", undo: "Annulla", undone: "Annullato", failed: "L'assistente non ha risposto", skipped: "Saltato", done: "Fatto" },
98
97
  cf: {
99
98
  title: "Formattazione condizionale",
100
99
  add: "Aggiungi regola",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const ja: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var ja = {
94
94
  freeBadge: "\u7121\u6599\u7248\u3092\u4F7F\u7528\u4E2D",
95
95
  exportPdf: "PDF \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",
96
96
  exportJson: "JSON \u306B\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",
97
- ai: { title: "AI \u30A2\u30B7\u30B9\u30BF\u30F3\u30C8", placeholder: "\u30C7\u30FC\u30BF\u306B\u3064\u3044\u3066\u8CEA\u554F\u3059\u308B\u304B\u3001\u30B0\u30EA\u30C3\u30C9\u3078\u306E\u6307\u793A\u3092\u5165\u529B", send: "\u9001\u4FE1", thinking: "\u51E6\u7406\u4E2D\u2026", undo: "\u5143\u306B\u623B\u3059", undone: "\u5143\u306B\u623B\u3057\u307E\u3057\u305F", failed: "\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8\u304B\u3089\u5FDC\u7B54\u304C\u3042\u308A\u307E\u305B\u3093", skipped: "\u30B9\u30AD\u30C3\u30D7", done: "\u5B8C\u4E86" },
98
97
  cf: {
99
98
  title: "\u6761\u4EF6\u4ED8\u304D\u66F8\u5F0F",
100
99
  add: "\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const ko: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var ko = {
94
94
  freeBadge: "\uBB34\uB8CC \uC0AC\uC6A9 \uC911",
95
95
  exportPdf: "PDF\uB85C \uB0B4\uBCF4\uB0B4\uAE30",
96
96
  exportJson: "JSON\uC73C\uB85C \uB0B4\uBCF4\uB0B4\uAE30",
97
- ai: { title: "AI \uC5B4\uC2DC\uC2A4\uD134\uD2B8", placeholder: "\uB370\uC774\uD130\uC5D0 \uB300\uD574 \uBB3B\uAC70\uB098 \uADF8\uB9AC\uB4DC\uC5D0 \uD560 \uC77C\uC744 \uB9D0\uD574 \uBCF4\uC138\uC694", send: "\uBCF4\uB0B4\uAE30", thinking: "\uCC98\uB9AC \uC911\u2026", undo: "\uB418\uB3CC\uB9AC\uAE30", undone: "\uB418\uB3CC\uB838\uC2B5\uB2C8\uB2E4", failed: "\uC5B4\uC2DC\uC2A4\uD134\uD2B8\uAC00 \uC751\uB2F5\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4", skipped: "\uAC74\uB108\uB700", done: "\uC644\uB8CC" },
98
97
  cf: {
99
98
  title: "\uC870\uAC74\uBD80 \uC11C\uC2DD",
100
99
  add: "\uADDC\uCE59 \uCD94\uAC00",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const ptBR: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var ptBR = {
94
94
  freeBadge: "Vers\xE3o gratuita",
95
95
  exportPdf: "Exportar PDF",
96
96
  exportJson: "Exportar JSON",
97
- ai: { title: "Assistente de IA", placeholder: "Pergunte sobre os dados ou diga \xE0 grade o que fazer", send: "Enviar", thinking: "Processando\u2026", undo: "Desfazer", undone: "Desfeito", failed: "O assistente n\xE3o respondeu", skipped: "Ignorado", done: "Pronto" },
98
97
  cf: {
99
98
  title: "Formata\xE7\xE3o condicional",
100
99
  add: "Adicionar regra",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const ru: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var ru = {
94
94
  freeBadge: "\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F",
95
95
  exportPdf: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 PDF",
96
96
  exportJson: "\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 JSON",
97
- ai: { title: "\u0418\u0418-\u043F\u043E\u043C\u043E\u0449\u043D\u0438\u043A", placeholder: "\u0421\u043F\u0440\u043E\u0441\u0438\u0442\u0435 \u043E \u0434\u0430\u043D\u043D\u044B\u0445 \u0438\u043B\u0438 \u0441\u043A\u0430\u0436\u0438\u0442\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u0435, \u0447\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u0442\u044C", send: "\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C", thinking: "\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430\u2026", undo: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C", undone: "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E", failed: "\u041F\u043E\u043C\u043E\u0449\u043D\u0438\u043A \u043D\u0435 \u043E\u0442\u0432\u0435\u0442\u0438\u043B", skipped: "\u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E", done: "\u0413\u043E\u0442\u043E\u0432\u043E" },
98
97
  cf: {
99
98
  title: "\u0423\u0441\u043B\u043E\u0432\u043D\u043E\u0435 \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",
100
99
  add: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u043E",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const th: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var th = {
94
94
  freeBadge: "\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35",
95
95
  exportPdf: "\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 PDF",
96
96
  exportJson: "\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 JSON",
97
- ai: { title: "\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22 AI", placeholder: "\u0E16\u0E32\u0E21\u0E40\u0E01\u0E35\u0E48\u0E22\u0E27\u0E01\u0E31\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 \u0E2B\u0E23\u0E37\u0E2D\u0E1A\u0E2D\u0E01\u0E15\u0E32\u0E23\u0E32\u0E07\u0E27\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E17\u0E33\u0E2D\u0E30\u0E44\u0E23", send: "\u0E2A\u0E48\u0E07", thinking: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E17\u0E33\u0E07\u0E32\u0E19\u2026", undo: "\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33", undone: "\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33\u0E41\u0E25\u0E49\u0E27", failed: "\u0E1C\u0E39\u0E49\u0E0A\u0E48\u0E27\u0E22\u0E44\u0E21\u0E48\u0E15\u0E2D\u0E1A\u0E01\u0E25\u0E31\u0E1A", skipped: "\u0E02\u0E49\u0E32\u0E21", done: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27" },
98
97
  cf: {
99
98
  title: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E15\u0E32\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",
100
99
  add: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E01\u0E0E",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const vi: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var vi = {
94
94
  freeBadge: "B\u1EA3n mi\u1EC5n ph\xED",
95
95
  exportPdf: "Xu\u1EA5t PDF",
96
96
  exportJson: "Xu\u1EA5t JSON",
97
- ai: { title: "Tr\u1EE3 l\xFD AI", placeholder: "H\u1ECFi v\u1EC1 d\u1EEF li\u1EC7u ho\u1EB7c b\u1EA3o b\u1EA3ng c\u1EA7n l\xE0m g\xEC", send: "G\u1EEDi", thinking: "\u0110ang x\u1EED l\xFD\u2026", undo: "Ho\xE0n t\xE1c", undone: "\u0110\xE3 ho\xE0n t\xE1c", failed: "Tr\u1EE3 l\xFD kh\xF4ng ph\u1EA3n h\u1ED3i", skipped: "\u0110\xE3 b\u1ECF qua", done: "Xong" },
98
97
  cf: {
99
98
  title: "\u0110\u1ECBnh d\u1EA1ng c\xF3 \u0111i\u1EC1u ki\u1EC7n",
100
99
  add: "Th\xEAm quy t\u1EAFc",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const zhCN: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var zhCN = {
94
94
  freeBadge: "\u514D\u8D39\u4F7F\u7528\u4E2D",
95
95
  exportPdf: "\u5BFC\u51FA PDF",
96
96
  exportJson: "\u5BFC\u51FA JSON",
97
- ai: { title: "AI \u52A9\u624B", placeholder: "\u8BE2\u95EE\u6570\u636E\uFF0C\u6216\u544A\u8BC9\u8868\u683C\u8981\u505A\u4EC0\u4E48", send: "\u53D1\u9001", thinking: "\u5904\u7406\u4E2D\u2026", undo: "\u64A4\u9500", undone: "\u5DF2\u64A4\u9500", failed: "\u52A9\u624B\u6CA1\u6709\u56DE\u5E94", skipped: "\u5DF2\u8DF3\u8FC7", done: "\u5B8C\u6210" },
98
97
  cf: {
99
98
  title: "\u6761\u4EF6\u683C\u5F0F",
100
99
  add: "\u6DFB\u52A0\u89C4\u5219",
@@ -1,4 +1,4 @@
1
- import { L as LocalePack } from '../types-D5xV-gww.js';
1
+ import { L as LocalePack } from '../types-8dux3w2p.js';
2
2
 
3
3
  declare const zhTW: LocalePack;
4
4
 
@@ -94,7 +94,6 @@ var zhTW = {
94
94
  freeBadge: "\u514D\u8CBB\u7248",
95
95
  exportPdf: "\u532F\u51FA PDF",
96
96
  exportJson: "\u532F\u51FA JSON",
97
- ai: { title: "AI \u52A9\u7406", placeholder: "\u8A62\u554F\u8CC7\u6599\uFF0C\u6216\u544A\u8A34\u8868\u683C\u8981\u505A\u4EC0\u9EBC", send: "\u50B3\u9001", thinking: "\u8655\u7406\u4E2D\u2026", undo: "\u5FA9\u539F", undone: "\u5DF2\u5FA9\u539F", failed: "\u52A9\u7406\u6C92\u6709\u56DE\u61C9", skipped: "\u5DF2\u7565\u904E", done: "\u5B8C\u6210" },
98
97
  cf: {
99
98
  title: "\u8A2D\u5B9A\u683C\u5F0F\u5316\u7684\u689D\u4EF6",
100
99
  add: "\u65B0\u589E\u898F\u5247",
package/dist/styles.css CHANGED
@@ -55,8 +55,14 @@
55
55
  margin-left: auto; display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none;
56
56
  border: 0; border-radius: 5px; background: none; color: var(--fg-muted); cursor: pointer; opacity: 0; transition: opacity .12s;
57
57
  }
58
+ /* the hidden button takes no room, so narrow columns keep their label; on hover it shows over the label's end.
59
+ An active filter's button stays in the row, always visible. */
60
+ .fg-menu-btn:not(.fg-filter-active) {
61
+ position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); margin: 0; background: var(--fg-header-bg);
62
+ }
58
63
  .fg-header-cell.fg-align-right .fg-menu-btn { margin-left: 0; margin-right: auto; }
59
- .fg-header-cell:hover .fg-menu-btn, .fg-menu-btn.fg-filter-active { opacity: 1; }
64
+ .fg-header-cell.fg-align-right .fg-menu-btn:not(.fg-filter-active) { inset-inline-end: auto; inset-inline-start: 6px; }
65
+ .fg-header-cell:hover .fg-menu-btn, .fg-menu-btn:focus-visible, .fg-menu-btn.fg-filter-active { opacity: 1; }
60
66
  .fg-menu-btn:hover { background: var(--fg-row-hover); color: var(--fg-fg); }
61
67
  .fg-menu-btn.fg-filter-active { color: var(--fg-accent); }
62
68
  .fg-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 1; }
@@ -516,7 +522,8 @@ textarea.fg-editor-control { padding-top: 8px; resize: none; }
516
522
 
517
523
  /* autoHeight: grow with the rows */
518
524
  .fg-root.fg-auto-height { height: auto; }
519
- .fg-auto-height .fg-main, .fg-auto-height .fg-grid { flex: none; }
525
+ /* only the height follows the rows: .fg-main still fills the width (the root is a flex row) */
526
+ .fg-auto-height .fg-grid { flex: none; }
520
527
  .fg-auto-height .fg-body { flex: none; min-height: 0; }
521
528
  .fg-auto-height .fg-body-pane-center { overflow-y: hidden; }
522
529
 
@@ -543,19 +550,3 @@ textarea.fg-editor-control { padding-top: 8px; resize: none; }
543
550
  .fg-cf-swatch[aria-pressed="true"] { outline: 2px solid var(--fg-accent); outline-offset: 1px; }
544
551
  .fg-cf-empty { color: var(--fg-muted); padding: 4px 0; }
545
552
 
546
- /* AI assistant */
547
- .fg-ai-panel { width: 374px; display: flex; flex-direction: column; gap: 8px; }
548
- .fg-ai-log { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
549
- .fg-ai-log:empty { display: none; }
550
- .fg-ai-msg { padding: 7px 10px; border-radius: 10px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 92%; }
551
- .fg-ai-user { align-self: flex-end; background: var(--fg-accent); color: var(--fg-accent-fg); border-bottom-right-radius: 3px; }
552
- .fg-ai-ai { align-self: flex-start; background: var(--fg-header-bg); border: 1px solid var(--fg-border); border-bottom-left-radius: 3px; }
553
- .fg-ai-error { align-self: flex-start; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
554
- .fg-ai-wait { color: var(--fg-muted); }
555
- .fg-ai-note { margin-top: 4px; font-size: .9em; color: var(--fg-muted); }
556
- .fg-ai-undo { margin-top: 6px; height: 24px; padding: 0 10px; }
557
- .fg-ai-form { display: flex; gap: 6px; align-items: flex-end; }
558
- .fg-ai-input { flex: 1; resize: vertical; min-height: 40px; max-height: 140px; padding: 6px 8px; font: inherit; }
559
- .fg-ai-tips { display: flex; flex-wrap: wrap; gap: 6px; }
560
- .fg-ai-tip { border: 1px solid var(--fg-border); border-radius: 999px; background: none; color: inherit; font: inherit; font-size: .92em; padding: 3px 10px; cursor: pointer; }
561
- .fg-ai-tip:hover { background: var(--fg-row-hover); }
@@ -388,18 +388,6 @@ interface Messages {
388
388
  /** Context menu: download a PDF of the rows. */
389
389
  exportPdf: string;
390
390
  exportJson: string;
391
- /** The assistant panel. */
392
- ai: {
393
- title: string;
394
- placeholder: string;
395
- send: string;
396
- thinking: string;
397
- undo: string;
398
- undone: string;
399
- failed: string;
400
- skipped: string;
401
- done: string;
402
- };
403
391
  /** Conditional formatting dialog. */
404
392
  cf: {
405
393
  title: string;
@@ -606,118 +594,9 @@ interface ConditionalFormat {
606
594
  min?: number;
607
595
  max?: number;
608
596
  }
609
- /** The AI assistant: the grid asks your server, your server asks the model and answers with actions. */
610
- interface AssistantOptions {
611
- /** Your endpoint (POST JSON). It holds the model API key; the browser never sees it. */
612
- url: string;
613
- headers?: Record<string, string> | (() => Record<string, string>);
614
- credentials?: RequestCredentials;
615
- /** Rows sent as examples (default 5, max 50; 0 sends none). Columns always go as summaries, not rows. */
616
- sampleRows?: number;
617
- /** Extra facts for the model, such as what the screen is for. */
618
- context?: () => Record<string, unknown>;
619
- /** Ideas shown under the input. */
620
- suggestions?: string[];
621
- }
622
- /** A column as the assistant sees it. */
623
- interface AssistantColumn {
624
- id: string;
625
- header: string;
626
- type?: string;
627
- formula?: string;
628
- aggFunc?: string;
629
- hidden?: boolean;
630
- blanks?: number;
631
- distinct?: number;
632
- min?: number | string;
633
- max?: number | string;
634
- avg?: number;
635
- /** Most frequent values of text columns. */
636
- top?: {
637
- value: string;
638
- count: number;
639
- }[];
640
- }
641
- /** What the grid sends to the assistant endpoint. */
642
- interface AssistantRequest {
643
- prompt: string;
644
- locale: string;
645
- /** Rows after the filters. */
646
- rowCount: number;
647
- totalRows: number;
648
- columns: AssistantColumn[];
649
- sample: Row[];
650
- state: {
651
- sort: SortItem[];
652
- filters: Record<string, FilterModel>;
653
- quickFilter: string;
654
- advancedFilter: AdvancedFilter | null;
655
- groupBy: string[];
656
- pivot: PivotConfig | null;
657
- conditionalFormats: ConditionalFormat[];
658
- };
659
- context?: Record<string, unknown>;
660
- }
661
- /** What the assistant endpoint answers with: { message?, actions? }. */
662
- type AssistantAction = {
663
- type: 'sort';
664
- sort: SortItem[];
665
- } | {
666
- type: 'filter';
667
- colId: string;
668
- model: FilterModel | null;
669
- } | {
670
- type: 'clearFilters';
671
- } | {
672
- type: 'quickFilter';
673
- text: string;
674
- } | {
675
- type: 'advancedFilter';
676
- filter: AdvancedFilter | null;
677
- } | {
678
- type: 'groupBy';
679
- colIds: string[];
680
- expand?: boolean;
681
- } | {
682
- type: 'pivot';
683
- pivot: PivotConfig | null;
684
- } | {
685
- type: 'showColumns' | 'hideColumns';
686
- colIds: string[];
687
- } | {
688
- type: 'conditionalFormat';
689
- format: ConditionalFormat;
690
- } | {
691
- type: 'clearConditionalFormats';
692
- } | {
693
- type: 'addColumn';
694
- column: {
695
- id: string;
696
- header?: string;
697
- formula: string;
698
- type?: 'number' | 'text' | 'date';
699
- };
700
- } | {
701
- type: 'summary';
702
- summary: SummaryOptions | null;
703
- } | {
704
- type: 'chart';
705
- chartType?: ChartOptions['type'];
706
- colIds: string[];
707
- title?: string;
708
- } | {
709
- type: 'message';
710
- text: string;
711
- };
712
- interface AssistantResult {
713
- message: string;
714
- applied: AssistantAction[];
715
- skipped: {
716
- action: unknown;
717
- reason: string;
718
- }[];
719
- /** Put the grid back as it was before these actions. */
720
- undo(): void;
597
+ interface RollupOptions {
598
+ /** Columns the rows merge by; only the shown ones count, so hiding one merges the rows by the rest. */
599
+ by: string[];
721
600
  }
722
601
  interface PivotConfig {
723
602
  /** Row fields; every field but the last becomes a group level. */
@@ -764,11 +643,13 @@ interface GridOptions {
764
643
  /** Space in px on the left and right inside every cell and header cell (default: the theme's, 12 at normal density). Wins over `density`. */
765
644
  cellPadding?: number;
766
645
  /**
767
- * Merge rows that agree on every shown column without an `aggFunc`; columns with an `aggFunc` show the
768
- * aggregate of the merged rows. Hiding, showing, adding or removing columns merges the rows again. Merged rows
769
- * cannot be edited. Change it later with setRollup; set a column's aggregate with setColumnAggFunc.
646
+ * Merge rows by columns. `{ by: ['country', 'name', 'company'] }`: rows that agree on the shown `by` columns
647
+ * become one row; hide or remove one of them and the rows merge by the others, show it again and they split.
648
+ * `true`: every shown column without an `aggFunc` is a `by` column. Columns with an `aggFunc` show the aggregate
649
+ * of the merged rows; any other column shows its value when the merged rows share it, else stays empty. Merged
650
+ * rows cannot be edited. Change it later with setRollup; set a column's aggregate with setColumnAggFunc.
770
651
  */
771
- rollup?: boolean;
652
+ rollup?: boolean | RollupOptions;
772
653
  /** Dock a Columns panel on the right. `{ open: true }` starts expanded. */
773
654
  sideBar?: boolean | {
774
655
  open?: boolean;
@@ -822,8 +703,6 @@ interface GridOptions {
822
703
  editType?: 'cell' | 'row';
823
704
  /** Briefly highlight cells whose value changed through applyTransaction (default true). */
824
705
  flashCells?: boolean;
825
- /** An AI assistant answered by your server (see AssistantOptions). */
826
- assistant?: AssistantOptions;
827
706
  /** Rules that colour cells by their values, and data bars, colour scales and icon sets. */
828
707
  conditionalFormats?: ConditionalFormat[];
829
708
  /** Show "Conditional formatting…" in the column menu (default true). */
@@ -1021,16 +900,6 @@ interface GridEvents {
1021
900
  conditionalFormatsChange: {
1022
901
  formats: ConditionalFormat[];
1023
902
  };
1024
- /** The assistant answered and its actions were applied. */
1025
- assistantAnswer: {
1026
- prompt: string;
1027
- message: string;
1028
- applied: AssistantAction[];
1029
- skipped: {
1030
- action: unknown;
1031
- reason: string;
1032
- }[];
1033
- };
1034
903
  /** A row was dropped on this grid (also from another grid of the same drag group). */
1035
904
  rowDrop: RowDropParams & {
1036
905
  fromGrid: GridApi | null;
@@ -1137,10 +1006,6 @@ interface GridApi {
1137
1006
  flushAsyncTransactions(): void;
1138
1007
  setConditionalFormats(formats: ConditionalFormat[]): void;
1139
1008
  getConditionalFormats(): ConditionalFormat[];
1140
- /** Ask the assistant (options.assistant) and apply its answer. */
1141
- askAssistant(prompt: string): Promise<AssistantResult>;
1142
- /** The assistant panel. */
1143
- openAssistant(): void;
1144
1009
  /** The conditional formatting dialog for a column. */
1145
1010
  openConditionalFormats(colId: string): void;
1146
1011
  /** Conditions across columns, applied together with the column filters; null clears it. */
@@ -1201,9 +1066,9 @@ interface GridApi {
1201
1066
  setCellPadding(px: number | null): void;
1202
1067
  /** The cell padding in use, in px. */
1203
1068
  getCellPadding(): number;
1204
- /** Turn the `rollup` option on or off: rows merged by the shown columns without an aggFunc. */
1205
- setRollup(on: boolean): void;
1206
- getRollup(): boolean;
1069
+ /** Change the `rollup` option: `{ by }`, `true`, or `false` for the original rows. */
1070
+ setRollup(rollup: boolean | RollupOptions): void;
1071
+ getRollup(): boolean | RollupOptions;
1207
1072
  /** Set a column's aggregate (group rows, rollup); null removes it, so with rollup the rows merge by that column. */
1208
1073
  setColumnAggFunc(colId: string, aggFunc: Aggregator | null): void;
1209
1074
  setColumnVisible(colId: string, visible: boolean): void;
@@ -1322,4 +1187,4 @@ interface GridApi {
1322
1187
  destroy(): void;
1323
1188
  }
1324
1189
 
1325
- export { type SavedGridState as $, type AdvancedFilter as A, type EditorSpec as B, type CellEvent as C, type Datasource as D, type ExportOptions as E, type FilterModel as F, type GridOptions as G, type FilterOp as H, type FilterType as I, type GridEvents as J, type GridRange as K, type LocalePack as L, type InvalidCell as M, type JsonExportOptions as N, type KeyAction as O, type MergeSelectionGroup as P, type Messages as Q, type Row as R, type NumberFilterModel as S, type NumberOp as T, type PdfOptions as U, type PivotConfig as V, type PrintOptions as W, type Region as X, type RowDragOptions as Y, type RowDropParams as Z, type RowDropPosition as _, type GridApi as a, type SavedStatePart as a0, type ScrollPosition as a1, type SelectOption as a2, type ServerParams as a3, type SetFilterModel as a4, type SortDir as a5, type SortItem as a6, type SpanParams as a7, type SummaryCell as a8, type SummaryOptions as a9, type SummaryRowDef as aa, type TextFilterModel as ab, type TextOp as ac, type TransactionResult as ad, type XlsxCell as ae, type XlsxSheet as af, readXlsx as ag, writeXlsx as ah, type RowTransaction as b, type AdvancedFilterCondition as c, type Aggregator as d, type AssistantAction as e, type AssistantColumn as f, type AssistantOptions as g, type AssistantRequest as h, type AssistantResult as i, type CellParams as j, type CellStyle as k, type ChartHandle as l, type ChartOptions as m, type ColumnDef as n, type ColumnState as o, type ColumnType as p, type CombinedFilterModel as q, type ConditionalFormat as r, type ConditionalFormatType as s, type ConditionalOp as t, type ContextMenuItem as u, type ContextMenuParams as v, type CustomEditor as w, type DateFilterModel as x, type DateOp as y, type EditorParams as z };
1190
+ export { type ServerParams as $, type AdvancedFilter as A, type Messages as B, type CellEvent as C, type Datasource as D, type ExportOptions as E, type FilterModel as F, type GridOptions as G, type NumberOp as H, type InvalidCell as I, type JsonExportOptions as J, type KeyAction as K, type LocalePack as L, type MergeSelectionGroup as M, type NumberFilterModel as N, type PivotConfig as O, type PdfOptions as P, type PrintOptions as Q, type Row as R, type Region as S, type RollupOptions as T, type RowDragOptions as U, type RowDropParams as V, type RowDropPosition as W, type SavedGridState as X, type SavedStatePart as Y, type ScrollPosition as Z, type SelectOption as _, type GridApi as a, type SetFilterModel as a0, type SortDir as a1, type SortItem as a2, type SpanParams as a3, type SummaryCell as a4, type SummaryOptions as a5, type SummaryRowDef as a6, type TextFilterModel as a7, type TextOp as a8, type TransactionResult as a9, type XlsxCell as aa, type XlsxSheet as ab, readXlsx as ac, writeXlsx as ad, type RowTransaction as b, type AdvancedFilterCondition as c, type Aggregator as d, type CellParams as e, type CellStyle as f, type ChartHandle as g, type ChartOptions as h, type ColumnDef as i, type ColumnState as j, type ColumnType as k, type CombinedFilterModel as l, type ConditionalFormat as m, type ConditionalFormatType as n, type ConditionalOp as o, type ContextMenuItem as p, type ContextMenuParams as q, type CustomEditor as r, type DateFilterModel as s, type DateOp as t, type EditorParams as u, type EditorSpec as v, type FilterOp as w, type FilterType as x, type GridEvents as y, type GridRange as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freegridjs/core",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "FreeGrid — a fast data grid for the web: virtual scrolling, grouping, pivot, charts, Excel export, 7 languages. Free core; paid features free with a personal key.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",