@nanahoshi/mona-ui 0.39.1 → 0.40.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.
Files changed (61) hide show
  1. package/docs/api/grid.md +214 -17
  2. package/docs/api/i18n.md +2 -0
  3. package/docs/api/locales.md +14 -14
  4. package/docs/grid-selection.md +134 -9
  5. package/docs/grid-state-export.md +56 -6
  6. package/docs/grid-tree.md +279 -0
  7. package/fesm2022/{nanahoshi-mona-ui-grid-grid-colgroup.component-Lv3GunpV.mjs → nanahoshi-mona-ui-grid-grid-colgroup.component-DpszxgFY.mjs} +2 -2
  8. package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BYH9XbCV.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CpvzAcX8.mjs} +4 -3
  9. package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BoSXXLKQ.mjs → nanahoshi-mona-ui-grid-grid-list.component-tRmEWiQR.mjs} +5 -5
  10. package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-Df2gfS0X.mjs → nanahoshi-mona-ui-grid-grid-row.component-eET6dh2Q.mjs} +52 -35
  11. package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-xjrcCXXF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-8h2EMexB.mjs} +5 -5
  12. package/fesm2022/{nanahoshi-mona-ui-grid-grid.styles-aPD3c2A6.mjs → nanahoshi-mona-ui-grid-grid.styles-wAf6jsT9.mjs} +646 -20
  13. package/fesm2022/nanahoshi-mona-ui-grid.mjs +1663 -22
  14. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +8 -0
  15. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +2 -0
  16. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +8 -0
  17. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +8 -0
  18. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +8 -0
  19. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +2 -0
  20. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +8 -0
  21. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +2 -0
  22. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +2 -0
  23. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +2 -0
  24. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +8 -0
  25. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +2 -0
  26. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +2 -0
  27. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +2 -0
  28. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +2 -0
  29. package/i18n/catalogs/en-US.messages.json +2 -0
  30. package/llms.txt +4 -3
  31. package/locales/ar-sa/ar-sa.messages.json +2 -0
  32. package/locales/de-de/de-de.messages.json +2 -0
  33. package/locales/es-es/es-es.messages.json +2 -0
  34. package/locales/fr-fr/fr-fr.messages.json +2 -0
  35. package/locales/id-id/id-id.messages.json +2 -0
  36. package/locales/it-it/it-it.messages.json +2 -0
  37. package/locales/ja-jp/ja-jp.messages.json +2 -0
  38. package/locales/ko-kr/ko-kr.messages.json +2 -0
  39. package/locales/pl-pl/pl-pl.messages.json +2 -0
  40. package/locales/pt-br/pt-br.messages.json +2 -0
  41. package/locales/ru-ru/ru-ru.messages.json +2 -0
  42. package/locales/tr-tr/tr-tr.messages.json +2 -0
  43. package/locales/zh-cn/zh-cn.messages.json +2 -0
  44. package/locales/zh-tw/zh-tw.messages.json +2 -0
  45. package/package.json +1 -1
  46. package/types/nanahoshi-mona-ui-grid.d.ts +305 -3
  47. package/types/nanahoshi-mona-ui-i18n.d.ts +4 -0
  48. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +2 -0
  49. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +2 -0
  50. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +2 -0
  51. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +2 -0
  52. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +2 -0
  53. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +2 -0
  54. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +2 -0
  55. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +2 -0
  56. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +2 -0
  57. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +2 -0
  58. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +2 -0
  59. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +2 -0
  60. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +2 -0
  61. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +2 -0
@@ -54,6 +54,11 @@ interface ColumnConfig {
54
54
  readonly editTemplate: TemplateRef<unknown> | null;
55
55
  /** Whether the column can be edited. The grid resolves it from {@link configuredEditable} when that is set. */
56
56
  readonly editable: boolean;
57
+ /**
58
+ * Whether the column shows a tree's expand toggles, indented by each row's level, when the grid has
59
+ * `monaGridTree`. Left out on every column, the first visible data column shows them.
60
+ */
61
+ readonly expandable?: boolean;
57
62
  /** The data property the column shows. A command column uses its `stateKey`, or `"commands"`. */
58
63
  readonly field: string;
59
64
  /** Whether the column can be filtered when the grid's filtering is enabled. */
@@ -172,6 +177,41 @@ interface CellEditEventOptions {
172
177
  }
173
178
  /** The field holding a row's key, or a function returning it. */
174
179
  type GridKeySelector<TData, TKey = unknown> = string | Selector<TData, TKey> | null;
180
+ /** A body cell, by its row's uid and its column's id. */
181
+ interface GridCellAddress {
182
+ readonly columnId: string;
183
+ readonly rowUid: string;
184
+ }
185
+ /** A range of cells from where the selection started (`anchor`) to where it was extended to (`focus`). */
186
+ interface GridCellRangeState {
187
+ readonly anchor: GridCellAddress;
188
+ readonly focus: GridCellAddress;
189
+ }
190
+ /**
191
+ * The cells a range selection covers: the data items of its rows and the fields of its columns, each in the order
192
+ * the grid shows them.
193
+ */
194
+ interface GridCellRange<T = Record<PropertyKey, unknown>> {
195
+ readonly fields: readonly string[];
196
+ readonly rows: readonly T[];
197
+ }
198
+ /** One row's pasted values: the row as it was, and as it is with the values in. */
199
+ interface GridRangePasteChange<T = Record<PropertyKey, unknown>> {
200
+ /** The fields that took a pasted value. */
201
+ readonly fields: readonly string[];
202
+ readonly originalRowData: T;
203
+ /** A copy of the row with the pasted values; save it to change the grid's data. */
204
+ readonly rowData: T;
205
+ }
206
+ /** What a paste into the grid's cells would change. The grid doesn't change its data itself. */
207
+ interface GridRangePasteEvent<T = Record<PropertyKey, unknown>> {
208
+ /** The rows that take pasted values, in the order the grid shows them. */
209
+ readonly changes: readonly GridRangePasteChange<T>[];
210
+ /** How many cells kept their value: their column can't be edited, or the text doesn't fit its type. */
211
+ readonly skippedCells: number;
212
+ /** The pasted text, as it came from the clipboard. */
213
+ readonly text: string;
214
+ }
175
215
  export declare class RowEditEvent extends PreventableEvent {
176
216
  #private;
177
217
  constructor(options: RowEditEventOptions);
@@ -663,6 +703,47 @@ export declare class GridNoDataTemplateDirective {
663
703
  static ɵfac: i0.ɵɵFactoryDeclaration<GridNoDataTemplateDirective, never>;
664
704
  static ɵdir: i0.ɵɵDirectiveDeclaration<GridNoDataTemplateDirective, "ng-template[monaGridNoDataTemplate]", never, {}, {}, never, never, true, never>;
665
705
  }
706
+ /**
707
+ * Lets the user select a rectangle of cells: drag across them with the mouse, Shift+click the far corner, or extend
708
+ * from the focused cell with Shift and the arrow keys. Ctrl+A selects every cell and Escape clears the range.
709
+ * Ctrl+C copies the range as tab-separated text, which spreadsheets paste as cells. With `monaGridEditable`, Ctrl+V
710
+ * pastes such text from the focused cell, or from the range's first cell, and `rangePaste` reports what changes.
711
+ */
712
+ export declare class GridRangeSelectableDirective<T = Record<PropertyKey, unknown>> {
713
+ #private;
714
+ /**
715
+ * @description Turns range selection on; `false` turns it off.
716
+ * @default true
717
+ */
718
+ readonly enabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
719
+ /**
720
+ * @description Emitted when the user changes the selected range, with the data items of its rows and the
721
+ * fields of its columns, and with `null` when the range is cleared.
722
+ */
723
+ readonly rangeChange: import("@angular/core").OutputEmitterRef<GridCellRange<T> | null>;
724
+ /**
725
+ * @description Emitted after a paste into the cells, with each changed row's data as it was and with the pasted
726
+ * values. The grid doesn't change its data: save `rowData` as you would an edit. Only editable columns take
727
+ * values, and only text that fits the column's type.
728
+ */
729
+ readonly rangePaste: import("@angular/core").OutputEmitterRef<GridRangePasteEvent<T>>;
730
+ constructor();
731
+ /** Clears the selected range. */
732
+ clearRange(): void;
733
+ /** Selects every cell of the current page, or of the whole view in a virtual grid. */
734
+ selectAll(): void;
735
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridRangeSelectableDirective<any>, never>;
736
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GridRangeSelectableDirective<any>, "mona-grid[monaGridRangeSelectable]", ["monaGridRangeSelectable"], {
737
+ "enabled": {
738
+ "alias": "monaGridRangeSelectable";
739
+ "required": false;
740
+ "isSignal": true;
741
+ };
742
+ }, {
743
+ "rangeChange": "rangeChange";
744
+ "rangePaste": "rangePaste";
745
+ }, never, never, true, never>;
746
+ }
666
747
  declare class ColumnReorderEvent extends PreventableEvent {
667
748
  #private;
668
749
  constructor(column: Column, oldIndex: number, newIndex: number);
@@ -1006,6 +1087,108 @@ export declare class GridToolbarTemplateDirective {
1006
1087
  static ɵfac: i0.ɵɵFactoryDeclaration<GridToolbarTemplateDirective, never>;
1007
1088
  static ɵdir: i0.ɵɵDirectiveDeclaration<GridToolbarTemplateDirective, "ng-template[monaGridToolbarTemplate]", never, {}, {}, never, never, true, never>;
1008
1089
  }
1090
+ /** The field holding a data item's children, or a function returning them. */
1091
+ type GridTreeChildren<T = Record<PropertyKey, unknown>> = string | {
1092
+ children(dataItem: T): Iterable<T> | null | undefined;
1093
+ }["children"];
1094
+ /** How a tree grid finds each row's parent: from nested children, or from a parent key in flat data. */
1095
+ interface GridTreeOptions {
1096
+ readonly children: GridTreeChildren | null;
1097
+ readonly parentKey: GridKeySelector<unknown> | null;
1098
+ }
1099
+ /**
1100
+ * Shows the grid's rows as a tree: each row can have child rows, shown below it, indented, when it's expanded.
1101
+ * Give either `children`, for data items that hold their children, or `parentKey`, for flat data whose items
1102
+ * name their parent's `rowKey` value.
1103
+ */
1104
+ export declare class GridTreeDirective<T = Record<PropertyKey, unknown>> {
1105
+ #private;
1106
+ /**
1107
+ * @description The field holding a data item's child items, or a function returning them. Use it when the
1108
+ * grid's `data` holds the root items and each item holds its children.
1109
+ * @default ""
1110
+ */
1111
+ readonly children: import("@angular/core").InputSignal<GridTreeChildren<T>>;
1112
+ /**
1113
+ * @description The parent key of each data item: the field holding the `rowKey` value of its parent, or a
1114
+ * function returning it. Use it when the grid's `data` is flat; the grid needs a `rowKey`. An item whose parent
1115
+ * isn't in the data is a root.
1116
+ * @default ""
1117
+ */
1118
+ readonly parentKey: import("@angular/core").InputSignal<GridKeySelector<T>>;
1119
+ /**
1120
+ * @description The keys of the expanded tree rows: their `rowKey` values, or the data items when the grid has
1121
+ * no `rowKey`. Rows start collapsed. It's apart from the grid's own `expandedKeys`, which opens detail rows.
1122
+ * @default []
1123
+ */
1124
+ readonly treeExpandedKeys: import("@angular/core").InputSignal<Iterable<unknown>>;
1125
+ /**
1126
+ * @description Emitted with every expanded tree row's key when the user expands or collapses a row, and when
1127
+ * filtering expands the rows above its matches. Not emitted for a `treeExpandedKeys` value set from code.
1128
+ */
1129
+ readonly treeExpandedKeysChange: import("@angular/core").OutputEmitterRef<unknown[]>;
1130
+ constructor();
1131
+ /** Collapses every row, and emits `treeExpandedKeysChange`. */
1132
+ collapseAll(): void;
1133
+ /** Expands every row that has children, so the whole tree shows, and emits `treeExpandedKeysChange`. */
1134
+ expandAll(): void;
1135
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridTreeDirective<any>, never>;
1136
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GridTreeDirective<any>, "mona-grid[monaGridTree]", ["monaGridTree"], {
1137
+ "children": {
1138
+ "alias": "children";
1139
+ "required": false;
1140
+ "isSignal": true;
1141
+ };
1142
+ "parentKey": {
1143
+ "alias": "parentKey";
1144
+ "required": false;
1145
+ "isSignal": true;
1146
+ };
1147
+ "treeExpandedKeys": {
1148
+ "alias": "treeExpandedKeys";
1149
+ "required": false;
1150
+ "isSignal": true;
1151
+ };
1152
+ }, {
1153
+ "treeExpandedKeysChange": "treeExpandedKeysChange";
1154
+ }, never, never, true, never>;
1155
+ }
1156
+ /** A TrueType font file (`.ttf` or `.ttc`): its bytes, or the URL to fetch it from. */
1157
+ type GridPdfFontSource = ArrayBuffer | Uint8Array | string;
1158
+ /**
1159
+ * The font a PDF export embeds for the text Helvetica can't show, such as Chinese, Japanese or Korean. It must have
1160
+ * TrueType outlines: most `.otf` files have CFF outlines, and web fonts (`.woff`, `.woff2`) are compressed, so the
1161
+ * export rejects both. A variable font prints at its default instance, which is often its lightest weight, so prefer
1162
+ * a static font of the weight you want.
1163
+ */
1164
+ interface GridPdfFont {
1165
+ /** The bold face, for the header and the title. Without it, the regular face is drawn thicker. */
1166
+ readonly bold?: GridPdfFontSource;
1167
+ /** Which font of a TrueType collection (`.ttc`) to use, from 0. */
1168
+ readonly collectionIndex?: number;
1169
+ readonly regular: GridPdfFontSource;
1170
+ }
1171
+ /** A paper size by name, or a page's width and height in points (1/72 inch). */
1172
+ type GridPdfPaperSize = "A3" | "A4" | "Legal" | "Letter" | readonly [number, number];
1173
+ interface GridPdfExportOptions {
1174
+ /** The file's name. Defaults to `export.pdf`. */
1175
+ readonly filename?: string;
1176
+ /**
1177
+ * A TrueType font to embed. Without it, text is set in Helvetica, which shows Western European characters only;
1178
+ * other characters print as `?`. Only the glyphs the document uses are embedded.
1179
+ */
1180
+ readonly font?: GridPdfFont;
1181
+ /** The text size in points before a wide table is scaled to fit the page. Defaults to 9. */
1182
+ readonly fontSize?: number;
1183
+ /** The margin around the page, in points. Defaults to 36 (half an inch). */
1184
+ readonly margin?: number;
1185
+ /** Defaults to `portrait`. */
1186
+ readonly orientation?: "landscape" | "portrait";
1187
+ /** Defaults to `A4`. */
1188
+ readonly paperSize?: GridPdfPaperSize;
1189
+ /** A title printed above the table on the first page, and stored as the document's title. */
1190
+ readonly title?: string;
1191
+ }
1009
1192
  export declare class GridExportDirective {
1010
1193
  #private;
1011
1194
  /** Exports the visible columns of the current view as CSV (only the loaded page with server binding). */
@@ -1015,6 +1198,13 @@ export declare class GridExportDirective {
1015
1198
  * header cells and values that keep their types. Resolves once the download has started.
1016
1199
  */
1017
1200
  exportExcel(filename?: string): Promise<void>;
1201
+ /**
1202
+ * Exports the same rows and columns as `exportCsv` as a PDF table, with the column groups and titles at the top
1203
+ * of every page and cells as the grid shows them. Pass a file name, or options for the paper, a title and a
1204
+ * TrueType font for scripts Helvetica can't show, such as Chinese, Japanese or Korean. Resolves once the download
1205
+ * has started; rejects when the font can't be read.
1206
+ */
1207
+ exportPdf(options?: GridPdfExportOptions | string): Promise<void>;
1018
1208
  static ɵfac: i0.ɵɵFactoryDeclaration<GridExportDirective, never>;
1019
1209
  static ɵdir: i0.ɵɵDirectiveDeclaration<GridExportDirective, "mona-grid[monaGridExport]", ["monaGridExport"], {}, {}, never, never, true, never>;
1020
1210
  }
@@ -1163,6 +1353,12 @@ export declare class GridColumnComponent implements GridColumnDefinition {
1163
1353
  * @default null
1164
1354
  */
1165
1355
  readonly editable: import("@angular/core").InputSignalWithTransform<boolean | null, unknown>;
1356
+ /**
1357
+ * @description In a tree grid (`monaGridTree`), whether this column shows the expand toggles and indents its
1358
+ * cells by each row's level. Without it on any column, the first visible data column does.
1359
+ * @default false
1360
+ */
1361
+ readonly expandable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
1166
1362
  /**
1167
1363
  * @description The field name of the data property to display in this column.
1168
1364
  */
@@ -1233,6 +1429,11 @@ export declare class GridColumnComponent implements GridColumnDefinition {
1233
1429
  "required": false;
1234
1430
  "isSignal": true;
1235
1431
  };
1432
+ "expandable": {
1433
+ "alias": "expandable";
1434
+ "required": false;
1435
+ "isSignal": true;
1436
+ };
1236
1437
  "field": {
1237
1438
  "alias": "field";
1238
1439
  "required": false;
@@ -1499,6 +1700,27 @@ interface PaginationState {
1499
1700
  readonly skip: number;
1500
1701
  readonly take: number;
1501
1702
  }
1703
+ /** Where a row sits in a tree grid. */
1704
+ interface GridTreeRowInfo {
1705
+ /** Whether the row's children are shown; always `false` for a row without children. */
1706
+ readonly expanded: boolean;
1707
+ /** Whether the row has children that pass the filter. */
1708
+ readonly hasChildren: boolean;
1709
+ /** The row's depth, from 1 for a root row, as `aria-level` counts it. */
1710
+ readonly level: number;
1711
+ readonly parentUid: string | null;
1712
+ /** The row's place among its shown siblings, from 1. */
1713
+ readonly posInSet: number;
1714
+ /** How many shown siblings the row has, itself included. */
1715
+ readonly setSize: number;
1716
+ }
1717
+ interface GridTreeView {
1718
+ /** Every row that passes the filter, in tree order, whether or not its parents are expanded. */
1719
+ readonly allRows: readonly Row[];
1720
+ readonly info: ReadonlyMap<string, GridTreeRowInfo>;
1721
+ /** The rows shown: those whose parents are all expanded. */
1722
+ readonly rows: readonly Row[];
1723
+ }
1502
1724
  interface RowEditDataItem extends Record<string, unknown> {
1503
1725
  readonly $rowId: string;
1504
1726
  }
@@ -1523,6 +1745,20 @@ declare class GridService {
1523
1745
  readonly cancel$: Subject<GridCancelEvent>;
1524
1746
  readonly cellEdit$: Subject<CellEditEvent>;
1525
1747
  /** Set of currently collapsed group keys (global, shared by both paginated and virtual list). */
1748
+ /** The range of cells the user selected, while range selection is on. */
1749
+ readonly cellRange: import("@angular/core").WritableSignal<GridCellRangeState | null>;
1750
+ /**
1751
+ * The selected range as row and column indices into `rangeRows` and `rangeColumns`, both ends included, or
1752
+ * `null` without a range or when its cells aren't in the view any more.
1753
+ */
1754
+ readonly cellRangeBounds: import("@angular/core").Signal<{
1755
+ firstColumn: number;
1756
+ firstRow: number;
1757
+ lastColumn: number;
1758
+ lastRow: number;
1759
+ } | null>;
1760
+ /** Emits after the user changes the selected range, and when it's cleared. */
1761
+ readonly cellRangeChange$: Subject<void>;
1526
1762
  readonly collapsedGroupKeys: import("@angular/core").WritableSignal<ImmutableSet<string>>;
1527
1763
  readonly columnReorder$: Subject<ColumnReorderEvent>;
1528
1764
  readonly columnResize$: Subject<ColumnResizeEvent>;
@@ -1580,6 +1816,11 @@ declare class GridService {
1580
1816
  readonly pageReset$: Subject<void>;
1581
1817
  readonly pagerTotal: import("@angular/core").Signal<number>;
1582
1818
  readonly paginationState: import("@angular/core").WritableSignal<PaginationState>;
1819
+ /** The columns a range of cells spans: the visible data columns, in the order they're shown. */
1820
+ readonly rangeColumns: import("@angular/core").Signal<Column[]>;
1821
+ /** The rows a range of cells spans: the current page's, or every row of a virtual grid's view. */
1822
+ readonly rangeRows: import("@angular/core").Signal<ImmutableList<Row>>;
1823
+ readonly rangeSelectionEnabled: import("@angular/core").WritableSignal<boolean>;
1583
1824
  readonly remove$: Subject<GridRemoveEvent>;
1584
1825
  /** How many rows the body draws, detail and group rows included; the body list keeps it current. */
1585
1826
  readonly renderedBodyRowCount: import("@angular/core").WritableSignal<number>;
@@ -1621,6 +1862,17 @@ declare class GridService {
1621
1862
  }>;
1622
1863
  readonly structuralColumns: import("@angular/core").Signal<readonly StructuralColumnDescriptor[]>;
1623
1864
  readonly tableWidth: import("@angular/core").Signal<number | null>;
1865
+ /** The column that shows a tree's toggles: the first visible data column marked `expandable`, or else the first. */
1866
+ readonly treeColumnId: import("@angular/core").Signal<string | null>;
1867
+ readonly treeEnabled: import("@angular/core").Signal<boolean>;
1868
+ /** The keys of the expanded tree rows: their `rowKey` values, or the data items without a `rowKey`. */
1869
+ readonly treeExpandedKeys: import("@angular/core").WritableSignal<ImmutableSet<unknown>>;
1870
+ /** Emits the expanded tree rows' keys after the user expands or collapses a row. */
1871
+ readonly treeExpandedKeysChange$: Subject<unknown[]>;
1872
+ /** The rows above the filter's matches, which have to be expanded for every match to show. */
1873
+ readonly treeMatchAncestorUids: import("@angular/core").Signal<string[]>;
1874
+ /** The tree grid's rows in display order with each one's place in the tree, or `null` without `monaGridTree`. */
1875
+ readonly treeView: import("@angular/core").Signal<GridTreeView | null>;
1624
1876
  readonly viewPageRows: import("@angular/core").Signal<ImmutableList<Row>>;
1625
1877
  readonly viewRowCount: import("@angular/core").Signal<number>;
1626
1878
  readonly viewRows: import("@angular/core").Signal<ImmutableList<Row>>;
@@ -1636,6 +1888,8 @@ declare class GridService {
1636
1888
  cancelAddRow(originalEvent?: Event, reason?: GridCancelReason): boolean;
1637
1889
  cancelEdit(originalEvent?: Event, reason?: GridCancelReason): boolean;
1638
1890
  captureState(options?: GridStatePersistenceOptions): GridState;
1891
+ /** Clears the selected range of cells. */
1892
+ clearCellRange(): void;
1639
1893
  clearCollapsedGroups(predicate?: (key: string) => boolean): void;
1640
1894
  clearColumnGrouping(column: Column): void;
1641
1895
  commitRowEdit(originalEvent?: Event): boolean;
@@ -1651,6 +1905,8 @@ declare class GridService {
1651
1905
  * or to drop an edit from code. Does nothing when no edit is open.
1652
1906
  */
1653
1907
  endEdit(): void;
1908
+ /** Expands the given tree rows, as filtering does for the rows above its matches, and reports the change. */
1909
+ expandTreeRows(uids: Iterable<string>): void;
1654
1910
  findTextWidthOfColumn(column: Column, element: HTMLTableCellElement): number;
1655
1911
  /**
1656
1912
  * The `aria-rowindex` of each body row, after the rows before the body and the detail rows opened above
@@ -1660,10 +1916,25 @@ declare class GridService {
1660
1916
  count: number;
1661
1917
  indices: readonly number[];
1662
1918
  };
1919
+ /** The selected range's rows and columns, or `null` without a range. */
1920
+ getCellRange(): {
1921
+ readonly columns: readonly Column[];
1922
+ readonly rows: readonly Row[];
1923
+ } | null;
1924
+ /**
1925
+ * The selected range as tab-separated text, with each cell as the grid shows it, and tells assistive technology
1926
+ * how many cells it holds. `null` without a range.
1927
+ */
1928
+ getCellRangeText(): string | null;
1663
1929
  getColumnStateId(column: Column): string | null;
1664
1930
  getColumnWidth(column: Column): number;
1665
1931
  getDataState(): GridDataState;
1666
1932
  /** Every applied filter: the column filters, then the filters across columns. */
1933
+ /**
1934
+ * The rows an export writes: the view's rows, or in a tree grid every row that passes the filter, in tree order
1935
+ * whether or not its parents are expanded.
1936
+ */
1937
+ getExportRows(): readonly Row[];
1667
1938
  getFilterDescriptors(): CompositeFilterDescriptor[];
1668
1939
  getGroupDescriptors(columns: Iterable<Column>): GroupDescriptor[];
1669
1940
  /** The accessible name of a row command button; `row` is null for the add row. */
@@ -1673,9 +1944,14 @@ declare class GridService {
1673
1944
  getRowReorderAriaLabel(row: Row, absoluteIndex: number): string;
1674
1945
  /** Sort order shared by models, persistence, and server requests. */
1675
1946
  getSortDescriptors(): SortDescriptor[];
1947
+ /** The uid of a tree row's parent, or `null` for a root row or outside a tree grid. */
1948
+ getTreeParentUid(rowUid: string): string | null;
1949
+ /** The row's place in the tree, or `null` when the grid isn't a tree or the row isn't in its view. */
1950
+ getTreeRowInfo(row: Row): GridTreeRowInfo | null;
1676
1951
  handleMultipleSelection(event: GridSelectionModifiers, row: Row): void;
1677
1952
  handleRowClick(event: GridSelectionModifiers, row: Row): void;
1678
1953
  handleSingleSelection(event: GridSelectionModifiers, row: Row): void;
1954
+ isCellInRange(rowUid: string, columnId: string): boolean;
1679
1955
  isGroupCollapsed(groupKey: string): boolean;
1680
1956
  /** Whether a selection value came from the `selectedKeys` input rather than from the user. */
1681
1957
  isLoadedSelection(keys: ImmutableSet<unknown>): boolean;
@@ -1701,9 +1977,18 @@ declare class GridService {
1701
1977
  * later shows its sort; a repeated field keeps its last descriptor.
1702
1978
  */
1703
1979
  loadSorts(sorts: Iterable<SortDescriptor> | null | undefined): void;
1980
+ /** Sets the expanded tree rows from the `expandedKeys` input, without reporting a change. */
1981
+ loadTreeExpandedKeys(keys: Iterable<unknown> | null | undefined): void;
1704
1982
  moveGroupColumn(column: Column, moveAs: "prev" | "next"): void;
1705
1983
  normalizeRenderedWidth(width: number): number;
1706
1984
  /** Ends an update whose row left the data or the view; the cancel can't be prevented. */
1985
+ /**
1986
+ * Works out what pasting tab-separated text changes: from the selected range's first cell, or from `at` without a
1987
+ * range. A single value fills the whole range. Only editable columns take values, and only text that fits the
1988
+ * column's type. Selects the cells the text covered and tells assistive technology how many cells changed.
1989
+ * Returns `null` when the grid doesn't take pastes: range selection or editing is off, or an editor is open.
1990
+ */
1991
+ pasteIntoCells(text: string, at: GridCellAddress | null): GridRangePasteEvent | null;
1707
1992
  reconcileEditSession(): void;
1708
1993
  removeRow(row: Row, originalEvent?: Event): boolean;
1709
1994
  /**
@@ -1724,6 +2009,8 @@ declare class GridService {
1724
2009
  resolveAggregateValue(bucket: GridAggregateBucket | null, aggregateFunction: AggregateFunction | null): unknown;
1725
2010
  saveAddRow(originalEvent?: Event): boolean;
1726
2011
  /** Ctrl+A or Cmd+A in the body: selects every row in the select-all scope. */
2012
+ /** Selects every cell of the view: all its rows, or the page's, and every visible data column. */
2013
+ selectAllCells(): boolean;
1727
2014
  selectAllRowsFromKeyboard(): boolean;
1728
2015
  selectRow(row: Row): void;
1729
2016
  /**
@@ -1731,9 +2018,13 @@ declare class GridService {
1731
2018
  * from the anchor row to this one. Returns false when rows can't be selected.
1732
2019
  */
1733
2020
  selectRowFromKeyboard(rowUid: string, extend: boolean): boolean;
2021
+ /** Expands every tree row that has children, or collapses them all, and reports the change. */
2022
+ setAllTreeRowsExpanded(expanded: boolean): void;
1734
2023
  setBulkSelection(selected: boolean): void;
1735
2024
  setCalculatedWidth(columnId: string, value: number | null): void;
1736
2025
  setCalculatedWidths(widthByColumnId: ReadonlyMap<string, number | null>): void;
2026
+ /** Selects the cells from `anchor` to `focus`, both included, and reports the change. */
2027
+ setCellRange(anchor: GridCellAddress, focus: GridCellAddress): void;
1737
2028
  setColumnDefinitions(configs: readonly ColumnConfig[]): void;
1738
2029
  setColumnFiltered(columnId: string, value: boolean): void;
1739
2030
  setColumnGroupSortDirection(columnId: string, value: SortDirection | null): void;
@@ -1752,6 +2043,8 @@ declare class GridService {
1752
2043
  setGroupableOptions(options: Partial<GroupableOptions>): void;
1753
2044
  setNewRowFactory(factory: () => Record<PropertyKey, unknown>): void;
1754
2045
  setPageState(state: Partial<PaginationState>): void;
2046
+ /** Turns range selection on or off; turning it off clears the range. */
2047
+ setRangeSelectionEnabled(enabled: boolean): void;
1755
2048
  /** Replaces the column reorder options; the feature is on unless `enabled` is `false`. */
1756
2049
  setReorderableOptions(options: Partial<ReorderableOptions>): void;
1757
2050
  /** Replaces the column resize options; the feature is on unless `enabled` is `false`. */
@@ -1771,12 +2064,17 @@ declare class GridService {
1771
2064
  setServerTotal(total: number): void;
1772
2065
  /** Replaces the sorting options; the feature is on unless `enabled` is `false`. */
1773
2066
  setSortableOptions(options: Partial<SortableOptions>): void;
2067
+ /** Turns the tree on with the given options, or off with `null`, and reads the data again. */
2068
+ setTreeOptions(options: GridTreeOptions | null): void;
2069
+ /** Expands or collapses a tree row and reports the change; a row without children doesn't change. */
2070
+ setTreeRowExpanded(row: Row, expanded: boolean): void;
1774
2071
  setVirtualScrollOptions(options: VirtualScrollOptions): void;
1775
2072
  startAddRow(originalEvent?: Event): boolean;
1776
2073
  startCellEdit(uid: string, row: Row, column: Column, originalEvent?: Event): boolean;
1777
2074
  startRowEdit(row: Row, originalEvent?: Event, focusColumnId?: string | null): boolean;
1778
2075
  stopCellEdit(originalEvent?: Event): boolean;
1779
2076
  toggleGroupCollapse(groupKey: string): void;
2077
+ toggleTreeRow(row: Row): void;
1780
2078
  updateColumn(columnId: string, patch: Partial<Omit<Column, "id">>): void;
1781
2079
  /** Tells assistive technology why a commit didn't go through. */
1782
2080
  private announceInvalid;
@@ -1794,6 +2092,8 @@ declare class GridService {
1794
2092
  private deserializeFilters;
1795
2093
  private emitGroupChange;
1796
2094
  private findLongestCellContentOfColumn;
2095
+ /** The rows the footer aggregates count: the view's rows, or in a tree grid every row that passes the filter. */
2096
+ private getAggregateSourceRows;
1797
2097
  private getColumnById;
1798
2098
  private getColumnLockBucket;
1799
2099
  private getRowDataItemSelectionKey;
@@ -1884,9 +2184,9 @@ export declare class GridComponent<T> implements GridVariantInput {
1884
2184
  protected readonly footerTableClass: import("@angular/core").Signal<string>;
1885
2185
  protected readonly footerVisible: import("@angular/core").Signal<boolean>;
1886
2186
  protected readonly gridDetailTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
1887
- /** A treegrid while rows are grouped, a grid otherwise. */
1888
2187
  protected readonly gridHeaderElement: import("@angular/core").Signal<ElementRef<HTMLDivElement>>;
1889
2188
  protected readonly gridHeaderTableElement: import("@angular/core").Signal<ElementRef<HTMLTableElement>>;
2189
+ /** A treegrid while rows are grouped or the grid is a tree, a grid otherwise. */
1890
2190
  protected readonly gridRole: import("@angular/core").Signal<"grid" | "treegrid">;
1891
2191
  protected readonly gridService: GridService;
1892
2192
  protected readonly gridWidthSet: import("@angular/core").WritableSignal<boolean>;
@@ -1912,7 +2212,7 @@ export declare class GridComponent<T> implements GridVariantInput {
1912
2212
  protected readonly headerTableColumnWrapClass: import("@angular/core").Signal<string>;
1913
2213
  protected readonly headerTableRowClass: import("@angular/core").Signal<string>;
1914
2214
  protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaGridMessages>;
1915
- protected readonly multiselectable: import("@angular/core").Signal<boolean | undefined>;
2215
+ protected readonly multiselectable: import("@angular/core").Signal<boolean>;
1916
2216
  protected readonly noDataClass: import("@angular/core").Signal<string>;
1917
2217
  protected readonly noDataTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
1918
2218
  /** The column whose group chip has its menu open. */
@@ -2141,6 +2441,8 @@ export declare const GRID_DEFAULT_MESSAGES: {
2141
2441
  cancel: string;
2142
2442
  cancelNewRow: string;
2143
2443
  cancelRowEdit: (rowNumber: number) => string;
2444
+ cellsCopied: (count: number) => string;
2445
+ cellsPasted: (count: number) => string;
2144
2446
  clearFilter: (column: string) => string;
2145
2447
  collapseDetail: (rowNumber: number) => string;
2146
2448
  columnGrouped: (column: string) => string;
@@ -2194,4 +2496,4 @@ export declare const GRID_DEFAULT_MESSAGES: {
2194
2496
  sortOrder: (position: number) => string;
2195
2497
  toolbar: string;
2196
2498
  };
2197
- export type { AggregateFunction, Column, ColumnConfig, ColumnFormat, ColumnFormatFunction, ColumnGroup, ColumnKind, ColumnReorderEvent, ColumnResizeEvent, ColumnSortComparator, ColumnSortEvent, EditableOptions, GridCancelReason, GridColumnLockedPosition, GridDataState, GridEditFormContext, GridEditOperation, GridEditSchemaFactory, GridEditSession, GridEditTemplateContext, GridKeySelector, GridRowClass, GridRowClassValue, GridRowCommand, GridSaveOperation, GridToolbarContext, GridToolbarTemplateContext, ReorderableOptions, ResizableOptions, ResizeMethod, Row, RowReorderableOptions };
2499
+ export type { AggregateFunction, Column, ColumnConfig, ColumnFormat, ColumnFormatFunction, ColumnGroup, ColumnKind, ColumnReorderEvent, ColumnResizeEvent, ColumnSortComparator, ColumnSortEvent, EditableOptions, GridCancelReason, GridCellRange, GridColumnLockedPosition, GridDataState, GridEditFormContext, GridEditOperation, GridEditSchemaFactory, GridEditSession, GridEditTemplateContext, GridKeySelector, GridPdfExportOptions, GridPdfFont, GridPdfFontSource, GridPdfPaperSize, GridRangePasteChange, GridRangePasteEvent, GridRowClass, GridRowClassValue, GridRowCommand, GridSaveOperation, GridToolbarContext, GridToolbarTemplateContext, GridTreeChildren, ReorderableOptions, ResizableOptions, ResizeMethod, Row, RowReorderableOptions };
@@ -627,6 +627,10 @@ export interface MonaGridMessages {
627
627
  readonly cancel: string;
628
628
  readonly cancelNewRow: string;
629
629
  cancelRowEdit(rowNumber: number): string;
630
+ /** Announced when a range of cells is copied, with how many cells it holds. */
631
+ cellsCopied(count: number): string;
632
+ /** Announced after a paste into the cells, with how many cells took a value. */
633
+ cellsPasted(count: number): string;
630
634
  clearFilter(column: string): string;
631
635
  /** The name of the button that closes a row's detail row. */
632
636
  collapseDetail(rowNumber: number): string;
@@ -386,6 +386,8 @@ export declare const MONA_AR_SA_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_DE_DE_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_ES_ES_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_FR_FR_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_ID_ID_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_IT_IT_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_JA_JP_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_KO_KR_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_PL_PL_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_PT_BR_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_RU_RU_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_TR_TR_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_ZH_CN_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;
@@ -386,6 +386,8 @@ export declare const MONA_ZH_TW_LOCALE: {
386
386
  cancel: string;
387
387
  cancelNewRow: string;
388
388
  cancelRowEdit: (rowNumber: number) => string;
389
+ cellsCopied: (count: number) => string;
390
+ cellsPasted: (count: number) => string;
389
391
  clearFilter: (column: string) => string;
390
392
  collapseDetail: (rowNumber: number) => string;
391
393
  columnGrouped: (column: string) => string;