@lilydesignsystem/angular-data-grid 0.0.0-stage → 0.9.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.
@@ -0,0 +1,811 @@
1
+ import * as i0 from "@angular/core";
2
+ import { TemplateRef } from "@angular/core";
3
+ type ExportFormat = "csv" | "tsv" | "xlsx";
4
+ /**
5
+ * A live formula and the result it last computed. In an .xlsx the cell keeps the formula with the result cached
6
+ * (a spreadsheet user keeps the live formula); CSV and TSV carry only the result.
7
+ */
8
+ type ExportFormula = {
9
+ formula: string;
10
+ result: unknown;
11
+ };
12
+ /** Whether a cell value is an {@link ExportFormula}. */
13
+ export declare function isExportFormula(value: unknown): value is ExportFormula;
14
+ /** A header row and rows of cell values. A cell is a string, number, boolean, `Date`, an {@link ExportFormula}, or empty. */
15
+ type ExportTable = {
16
+ headers: string[];
17
+ rows: unknown[][];
18
+ };
19
+ type DelimitedOptions = {
20
+ /** Field separator. Default `","` (use `"\t"` for TSV). */
21
+ delimiter?: string;
22
+ /** Write the header row. Default true. */
23
+ header?: boolean;
24
+ /** Prefix a UTF-8 byte-order mark so Excel opens the file as UTF-8. Default false. */
25
+ bom?: boolean;
26
+ /** Defuse spreadsheet formulas: a string starting with `=`, `+`, `-`, `@`, tab or CR gets a leading `'`. Default true. */
27
+ safe?: boolean;
28
+ /** Line ending. Default `"\r\n"` (RFC 4180). */
29
+ eol?: string;
30
+ };
31
+ type XlsxOptions = {
32
+ /** Worksheet name (31 characters at most; `[]:*?/\` are replaced). Default `"Sheet1"`. */
33
+ sheetName?: string;
34
+ /** Write the header row, in bold. Default true. */
35
+ header?: boolean;
36
+ };
37
+ export declare const MIME_TYPES: Record<ExportFormat, string>;
38
+ /** One cell as text. Numbers and booleans are never treated as formulas; only strings are defused. */
39
+ export declare function cellText(value: unknown, safe?: boolean): string;
40
+ /** CSV/TSV text for a table. Fields containing the delimiter, a quote or a line break are quoted. */
41
+ export declare function toDelimited(table: ExportTable, options?: DelimitedOptions): string;
42
+ export declare function toCsv(table: ExportTable, options?: Omit<DelimitedOptions, "delimiter">): string;
43
+ export declare function toTsv(table: ExportTable, options?: Omit<DelimitedOptions, "delimiter">): string;
44
+ /** Column index (0-based) to a spreadsheet column name: 0 → A, 25 → Z, 26 → AA. */
45
+ export declare function columnName(index: number): string;
46
+ /** An .xlsx workbook with one worksheet, as bytes. */
47
+ export declare function toXlsx(table: ExportTable, options?: XlsxOptions): Uint8Array;
48
+ export declare function crc32(bytes: Uint8Array): number;
49
+ /** A ZIP archive holding `entries` uncompressed. */
50
+ export declare function zipStore(entries: {
51
+ name: string;
52
+ data: Uint8Array;
53
+ }[]): Uint8Array;
54
+ /** The file for `table` in `format`, as a `Blob`. CSV and TSV carry a UTF-8 byte-order mark so Excel reads them as UTF-8. */
55
+ export declare function exportBlob(table: ExportTable, format: ExportFormat, options?: {
56
+ sheetName?: string;
57
+ header?: boolean;
58
+ }): Blob;
59
+ /** A filename with the format's extension, without doubling one the name already has. */
60
+ export declare function exportFilename(base: string, format: ExportFormat): string;
61
+ /** Saves a blob through a temporary link. Does nothing outside a browser. */
62
+ export declare function downloadBlob(blob: Blob, filename: string): void;
63
+ type DataGridCellType = "text" | "number" | "link" | "date" | "time" | "time-zone" | "select" | "radio" | "person" | "file" | "rollup" | "formula";
64
+ /** A time of day and the zone it is stated in (an IANA zone id, or a bare offset such as `+01:00`). */
65
+ type DataGridZonedTime = {
66
+ time: string;
67
+ timeZone: string;
68
+ };
69
+ /** One person: the name is always shown as text; the avatar is the consumer's. */
70
+ type DataGridPerson = {
71
+ id: string;
72
+ name?: string;
73
+ email?: string;
74
+ avatarUrl?: string;
75
+ };
76
+ /** One file's metadata. The bytes live elsewhere; the grid never uploads. */
77
+ type DataGridFile = {
78
+ id: string;
79
+ name: string;
80
+ size?: number;
81
+ type?: string;
82
+ href?: string;
83
+ };
84
+ /** What a rollup reduces its related values with. */
85
+ type DataGridAggregate = "count" | "countUnique" | "sum" | "avg" | "median" | "min" | "max" | "range" | "percentTrue" | "percentEmpty";
86
+ /** What a formula engine hands back: a value, or an error message shown as text. */
87
+ type DataGridFormulaResult = {
88
+ value: unknown;
89
+ } | {
90
+ error: string;
91
+ };
92
+ /** What a formula engine is given. `rows` is every row, for references to other rows. */
93
+ type DataGridFormulaContext = {
94
+ row: Record<string, unknown>;
95
+ rows: Record<string, unknown>[];
96
+ columnId: string;
97
+ };
98
+ /** An option of a `select` or `radio` column. The label is displayed; the id is stored. */
99
+ type DataGridOption = {
100
+ id: string;
101
+ label: string;
102
+ disabled?: boolean;
103
+ group?: string;
104
+ [key: string]: unknown;
105
+ };
106
+ /** A link value: an address, or an address with a label. */
107
+ type DataGridLink = {
108
+ href: string;
109
+ label?: string;
110
+ external?: boolean;
111
+ };
112
+ /** The column facets a type can fill in. Structural so this module does not import the grid. */
113
+ type TypedColumn = {
114
+ id: string;
115
+ type?: DataGridCellType;
116
+ locale?: string;
117
+ options?: DataGridOption[];
118
+ sortBy?: "label" | "order";
119
+ exportAs?: "label" | "id" | "email";
120
+ numberFormat?: Intl.NumberFormatOptions;
121
+ dateFormat?: Intl.DateTimeFormatOptions;
122
+ timeFormat?: Intl.DateTimeFormatOptions;
123
+ accessor?: (row: Record<string, unknown>) => unknown;
124
+ format?: (value: unknown, row: Record<string, unknown>) => string;
125
+ compare?: (a: unknown, b: unknown) => number;
126
+ filterText?: (value: unknown, row: Record<string, unknown>) => string;
127
+ exportValue?: (row: Record<string, unknown>) => unknown;
128
+ align?: "start" | "center" | "end";
129
+ editor?: string;
130
+ parse?: (draft: string, row: Record<string, unknown>) => unknown;
131
+ editable?: boolean;
132
+ /** `time-zone`: the zones the editor offers, as `{ id, label }`. */
133
+ timeZones?: DataGridOption[];
134
+ /** `time-zone`: the date (ISO) used to order zoned times and to name a zone. Never computed here. */
135
+ referenceDate?: string;
136
+ /** `rollup`: how the related values are reduced. */
137
+ aggregate?: DataGridAggregate;
138
+ /** `rollup`: anything the named aggregates do not cover. */
139
+ reduce?: (values: unknown[], row: Record<string, unknown>) => unknown;
140
+ /** `rollup`: reads the related values. Defaults to the row's own array at the column id. */
141
+ relation?: (row: Record<string, unknown>) => unknown[];
142
+ /** `rollup` and `formula`: the type of the result, so it formats and sorts like one. */
143
+ resultType?: "number" | "date" | "text";
144
+ /** `formula`: evaluates an expression. Lily ships no engine and never evaluates a string itself. */
145
+ evaluate?: (expression: string, context: DataGridFormulaContext) => DataGridFormulaResult;
146
+ /** `person`: how many people show before "+N". */
147
+ maxPeople?: number;
148
+ /** `file`: formats a size in bytes for display. */
149
+ formatSize?: (bytes: number) => string;
150
+ /** Set by `resolveColumn` for a `formula`: the expression the row holds (the editor shows this, not the result). */
151
+ source?: (row: Record<string, unknown>) => unknown;
152
+ /** Set by `resolveColumn` for a `formula`: the error message for a row, or undefined. */
153
+ errorOf?: (row: Record<string, unknown>) => string | undefined;
154
+ };
155
+ /** An address safe to put in an `href`: http(s), mailto, tel, or a relative one. Anything else (`javascript:`, `data:`) is null. */
156
+ export declare function safeHref(href: unknown): string | null;
157
+ /** A link value as `{ href, label?, external? }`; a plain string is the address. */
158
+ export declare function linkParts(value: unknown): DataGridLink | null;
159
+ export declare function linkLabel(value: unknown): string;
160
+ /** A civil date `YYYY-MM-DD` that exists on the calendar. */
161
+ export declare function isCivilDate(text: unknown): text is string;
162
+ /** A civil time `HH:mm` or `HH:mm:ss`, 24-hour. */
163
+ export declare function isCivilTime(text: unknown): text is string;
164
+ /** A civil date as a `Date` at UTC midnight, or null. Typed, so an export writes a real spreadsheet date. */
165
+ export declare function civilDateToDate(text: unknown): Date | null;
166
+ /** An IANA zone id the platform knows, or a bare offset such as `+01:00`. */
167
+ export declare function isValidTimeZone(timeZone: unknown): timeZone is string;
168
+ /** A zoned time: `{ time: "HH:mm[:ss]", timeZone }` with a real time and a known zone. */
169
+ export declare function isZonedTime(value: unknown): value is DataGridZonedTime;
170
+ /**
171
+ * A zoned time as a number for ordering. With a `referenceDate` (ISO, supplied by the consumer: never computed here)
172
+ * it is the UTC minute of that instant, so equal instants compare equal; without one it is the stated local time and
173
+ * the zone is ignored.
174
+ */
175
+ export declare function zonedMinutes(value: unknown, referenceDate?: string): number | null;
176
+ /** A zoned time as the UTC time of day (`HH:mm`) at a reference date. Null without a valid reference date or value. */
177
+ export declare function zonedUtcTime(value: unknown, referenceDate?: string): string | null;
178
+ /** The people in a value: one object or an array, each with an id. */
179
+ export declare function peopleOf(value: unknown): DataGridPerson[];
180
+ /** A person's text: the name, or the id when there is none (never blank). */
181
+ export declare const personName: (person: DataGridPerson) => string;
182
+ /** The files in a value: an array of `{ id, name, … }`. */
183
+ export declare function filesOf(value: unknown): DataGridFile[];
184
+ /** Reduces related values to one result. An empty set is empty (null), not 0, except `count`. */
185
+ export declare function aggregateValues(kind: DataGridAggregate, values: unknown[]): unknown;
186
+ /** Whether a (parsed) value is unacceptable for the column's type; the grid refuses the edit. Empty is always acceptable. */
187
+ export declare function isInvalidForType(column: TypedColumn, value: unknown): boolean;
188
+ /**
189
+ * The column with its type's defaults filled in under its own props. A column with no `type` is returned as is.
190
+ * `rows` is every row: a `formula` hands it to the consumer's engine for references to other rows. A rollup's and a
191
+ * formula's results are computed once per row each time the columns are resolved (`rows` or `columns` changed),
192
+ * never per comparison or keystroke.
193
+ */
194
+ export declare function resolveColumn<T extends TypedColumn>(column: T, gridLocale?: string, rows?: Record<string, unknown>[]): T;
195
+ type DataGridSortDirection = "ascending" | "descending" | "none";
196
+ type DataGridSort = {
197
+ columnId: string;
198
+ direction: DataGridSortDirection;
199
+ };
200
+ type DataGridSelectionMode = "none" | "single" | "multiple";
201
+ type DataGridRow = Record<string, unknown>;
202
+ /** What `exportHandler` and the `exportFile` output receive, before the file is saved. */
203
+ type DataGridExport = {
204
+ format: ExportFormat;
205
+ /** The file name, with its extension. */
206
+ filename: string;
207
+ /** How many data rows (the header is not counted). */
208
+ rowCount: number;
209
+ /** The file. */
210
+ blob: Blob;
211
+ };
212
+ /** What a column's `cell` template receives (as `$implicit`). */
213
+ type DataGridCellContext = {
214
+ value: unknown;
215
+ formatted: string;
216
+ row: DataGridRow;
217
+ column: DataGridColumn;
218
+ };
219
+ /** What the `cellEdit` output carries after a cell edit is committed. */
220
+ type DataGridCellEdit = {
221
+ rowId: string;
222
+ row: DataGridRow;
223
+ columnId: string;
224
+ /** The parsed new value (a number for the `"number"` editor, the text otherwise). */
225
+ value: unknown;
226
+ /** The cell's value before the edit. */
227
+ previous: unknown;
228
+ };
229
+ /** What a person editor template receives (as `$implicit`). */
230
+ type DataGridPersonEditorContext = {
231
+ value: unknown;
232
+ commit: (value: unknown) => void;
233
+ cancel: () => void;
234
+ };
235
+ type DataGridColumn = {
236
+ /** Stable column identifier; also the default property read from each row. */
237
+ id: string;
238
+ /** Accessible + visible column header text. */
239
+ header: string;
240
+ /** Reads this column's raw value from a row. Defaults to `row[id]`. */
241
+ accessor?: (row: DataGridRow) => unknown;
242
+ /** Formats a raw value for display. Defaults to `String(value)` (`""` for null/undefined). */
243
+ format?: (value: unknown, row: DataGridRow) => string;
244
+ /** Column participates in sorting. */
245
+ sortable?: boolean;
246
+ /** Orders two raw values when sorting. `null`/`undefined` always sort last, before `compare` is called. */
247
+ compare?: (a: unknown, b: unknown) => number;
248
+ /** Column participates in the text filter. Default true. */
249
+ filterable?: boolean;
250
+ /** Column can be resized (pointer + keyboard). */
251
+ resizable?: boolean;
252
+ /** Column can be reordered: Alt+ArrowLeft/Right on its focused header, or dragging the header onto another. */
253
+ movable?: boolean;
254
+ /** Pins the column: its header and cells get `data-pinned="start"` / `"end"` for the consumer's sticky CSS. */
255
+ pinned?: "start" | "end";
256
+ /** Set `false` to leave the column out of an export. Default true. */
257
+ exportable?: boolean;
258
+ /** The value this column exports for a row. */
259
+ exportValue?: (row: DataGridRow) => unknown;
260
+ /** Column can be hidden via the column-visibility control. */
261
+ hidable?: boolean;
262
+ /** Initial pixel width, meaningful only when `resizable`. */
263
+ width?: number;
264
+ /** Custom cell content: a template receiving the cell context as `$implicit`. */
265
+ cell?: TemplateRef<{
266
+ $implicit: DataGridCellContext;
267
+ }>;
268
+ /** The header's content in place of the `header` text. `header` stays the accessible name. */
269
+ headerCell?: TemplateRef<{
270
+ $implicit: DataGridColumn;
271
+ }>;
272
+ /** Cells can be edited in place: F2 or Enter on a focused cell, a double click, or the button `labels.editCell` gates. */
273
+ editable?: boolean;
274
+ /** The editor's control. Default `"text"`; a `type` sets its own. */
275
+ editor?: "text" | "number" | "link" | "date" | "time" | "time-zone" | "select" | "radio" | "person" | "formula";
276
+ /** The kind of value in this column: a bundle of defaults for `format`, `compare`, `filterText`, `exportValue`, `align` and `editor`. */
277
+ type?: DataGridCellType;
278
+ /** BCP 47 locale for this column's formatting and collation. */
279
+ locale?: string;
280
+ /** `select` and `radio`: the choices. */
281
+ options?: DataGridOption[];
282
+ /** `time-zone`: the zones the editor's select offers. */
283
+ timeZones?: DataGridOption[];
284
+ /** `time-zone`: the date (ISO) that orders zoned times and names a zone. Never computed by the grid. */
285
+ referenceDate?: string;
286
+ /** `time-zone`: an export adds a second column holding the UTC time of day at `referenceDate`. */
287
+ exportUtc?: boolean;
288
+ /** `rollup`: how the related values are reduced. */
289
+ aggregate?: "count" | "countUnique" | "sum" | "avg" | "median" | "min" | "max" | "range" | "percentTrue" | "percentEmpty";
290
+ /** `rollup`: a reduction the named aggregates do not cover. */
291
+ reduce?: (values: unknown[], row: DataGridRow) => unknown;
292
+ /** `rollup`: reads the related values. */
293
+ relation?: (row: DataGridRow) => unknown[];
294
+ /** `rollup` and `formula`: the result's type. */
295
+ resultType?: "number" | "date" | "text";
296
+ /** `formula`: evaluates an expression. Lily ships no engine and never evaluates a string itself. */
297
+ evaluate?: (expression: string, context: {
298
+ row: DataGridRow;
299
+ rows: DataGridRow[];
300
+ columnId: string;
301
+ }) => {
302
+ value: unknown;
303
+ } | {
304
+ error: string;
305
+ };
306
+ /** `person`: how many people show before "+N". */
307
+ maxPeople?: number;
308
+ /** `person`: an avatar beside the name. Decorative. */
309
+ avatar?: TemplateRef<{
310
+ $implicit: DataGridPerson;
311
+ }>;
312
+ /** `person`: the editor template (`$implicit`: `{ value, commit, cancel }`). Without it a person cell is read-only. */
313
+ personEditor?: TemplateRef<{
314
+ $implicit: DataGridPersonEditorContext;
315
+ }>;
316
+ /** `file`: formats a size in bytes. */
317
+ formatSize?: (bytes: number) => string;
318
+ /** `file`: the `accept` of the file input. */
319
+ accept?: string;
320
+ /** `file`: whether the input takes several files. Default true. */
321
+ multiple?: boolean;
322
+ /** `select`: sort by option label (default) or by option order. */
323
+ sortBy?: "label" | "order";
324
+ /** `select`/`radio`: export the option's `"label"` or `"id"`. `person`: `"email"`. */
325
+ exportAs?: "label" | "id" | "email";
326
+ /** `number`: options for `Intl.NumberFormat`. */
327
+ numberFormat?: Intl.NumberFormatOptions;
328
+ /** `date`: options for `Intl.DateTimeFormat`. */
329
+ dateFormat?: Intl.DateTimeFormatOptions;
330
+ /** `time`: options for `Intl.DateTimeFormat`. */
331
+ timeFormat?: Intl.DateTimeFormatOptions;
332
+ /** The text the grid's filter matches for a value. */
333
+ filterText?: (value: unknown, row: DataGridRow) => string;
334
+ /** Turns the editor's text into the committed value. */
335
+ parse?: (draft: string, row: DataGridRow) => unknown;
336
+ /** Refuses a value: return a message and the cell stays in edit mode with `aria-invalid`. */
337
+ validate?: (value: unknown, row: DataGridRow) => string | undefined;
338
+ /** Set for a `formula` column: reads the expression a row holds. */
339
+ source?: (row: DataGridRow) => unknown;
340
+ /** Set for a `formula` column: the error message for a row, if any. */
341
+ errorOf?: (row: DataGridRow) => string | undefined;
342
+ /** Body cells of this column are `<th scope="row" role="rowheader">`. */
343
+ rowHeader?: boolean;
344
+ /** Horizontal alignment of the column's cells. */
345
+ align?: "start" | "center" | "end";
346
+ /** Extra class on each body cell of this column. */
347
+ cellClass?: string | ((ctx: DataGridCellContext) => string);
348
+ /** Extra attributes on each body cell of this column. */
349
+ cellAttrs?: (ctx: DataGridCellContext) => Record<string, string>;
350
+ };
351
+ /**
352
+ * Every field is optional, but its presence gates the control it names — no baked-in English fallback.
353
+ * See the Svelte canonical's spec/index.md §5.
354
+ */
355
+ type DataGridLabels = {
356
+ search?: string;
357
+ columnVisibility?: string;
358
+ columnVisibilityOption?: (header: string) => string;
359
+ resizeHandle?: (header: string) => string;
360
+ selectAll?: string;
361
+ selectionColumn?: string;
362
+ selectRow?: (rowLabel: string) => string;
363
+ previousPage?: string;
364
+ nextPage?: string;
365
+ pageStatus?: (page: number, pageCount: number, rowCount: number) => string;
366
+ pageAnnouncement?: (page: number, pageCount: number) => string;
367
+ sortAnnouncement?: (header: string, direction: DataGridSortDirection) => string;
368
+ filterAnnouncement?: (matchCount: number, totalCount: number) => string;
369
+ selectionAnnouncement?: (selectedCount: number) => string;
370
+ columnMoveAnnouncement?: (header: string, position: number, count: number) => string;
371
+ editCell?: (header: string, rowLabel: string) => string;
372
+ cellEditor?: (header: string) => string;
373
+ editAnnouncement?: (header: string, value: string) => string;
374
+ export?: string;
375
+ exportCsv?: string;
376
+ exportTsv?: string;
377
+ exportExcel?: string;
378
+ exportAnnouncement?: (format: ExportFormat, rowCount: number, filename: string) => string;
379
+ invalidValue?: (header: string, type: string) => string;
380
+ opensInNewTab?: (text: string) => string;
381
+ radioGroup?: (header: string, rowLabel: string) => string;
382
+ timeZone?: (header: string) => string;
383
+ exportUtcHeader?: (header: string) => string;
384
+ morePeople?: (count: number) => string;
385
+ removeFile?: (name: string) => string;
386
+ fileInput?: (header: string, rowLabel: string) => string;
387
+ formulaEditor?: (header: string) => string;
388
+ rollupDescription?: (header: string) => string;
389
+ editCancelAnnouncement?: (header: string) => string;
390
+ editError?: (header: string, message: string) => string;
391
+ };
392
+ /** What a footer template receives (as `$implicit`). */
393
+ type DataGridFooterContext = {
394
+ columns: DataGridColumn[];
395
+ rows: DataGridRow[];
396
+ };
397
+ type DataGridEntry = {
398
+ row: DataGridRow;
399
+ id: string;
400
+ };
401
+ type Editing = {
402
+ rowId: string;
403
+ columnId: string;
404
+ draft: string;
405
+ zone?: string;
406
+ error?: string;
407
+ invalid?: boolean;
408
+ };
409
+ type RenderItem = {
410
+ kind: "row";
411
+ index: number;
412
+ } | {
413
+ kind: "spacer";
414
+ rows: number;
415
+ key: string;
416
+ };
417
+ /** Stable per-instance id prefix; SSR-safe (no Math.random / Date.now). */
418
+ export declare function nextDataGridId(): string;
419
+ /** Sets a record of attributes on its host element (Angular cannot spread a dictionary in a template). */
420
+ export declare class DataGridAttrs {
421
+ readonly lilyDataGridAttrs: import("@angular/core/types/core").InputSignal<Record<string, string> | undefined>;
422
+ private readonly host;
423
+ private applied;
424
+ constructor();
425
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataGridAttrs, never>;
426
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DataGridAttrs, "[lilyDataGridAttrs]", never, {
427
+ "lilyDataGridAttrs": {
428
+ "alias": "lilyDataGridAttrs";
429
+ "required": false;
430
+ "isSignal": true;
431
+ };
432
+ }, {}, never, never, true, never>;
433
+ }
434
+ export declare class DataGrid {
435
+ /** Accessible name for the grid, passed through to DataTable. */
436
+ readonly label: import("@angular/core/types/core").InputSignal<string>;
437
+ /** Optional visible caption. */
438
+ readonly caption: import("@angular/core/types/core").InputSignal<string | undefined>;
439
+ /** Column definitions. */
440
+ readonly columns: import("@angular/core/types/core").InputSignal<DataGridColumn[]>;
441
+ /** Row data. */
442
+ readonly rows: import("@angular/core/types/core").InputSignal<DataGridRow[]>;
443
+ /** BCP 47 locale for the typed columns' formatting and collation. Never defaulted: with none, values show as stored. */
444
+ readonly locale: import("@angular/core/types/core").InputSignal<string | undefined>;
445
+ /** Derives a stable id per row. Defaults to the row's index in `rows`. */
446
+ readonly rowId: import("@angular/core/types/core").InputSignal<(row: DataGridRow, index: number) => string>;
447
+ /** Row selection mode. */
448
+ readonly selectionMode: import("@angular/core/types/core").InputSignal<DataGridSelectionMode>;
449
+ /** Rows per page. Unset disables pagination. */
450
+ readonly pageSize: import("@angular/core/types/core").InputSignal<number | undefined>;
451
+ /** If set, persist column widths / hidden columns / sort to localStorage. */
452
+ readonly storageKey: import("@angular/core/types/core").InputSignal<string | undefined>;
453
+ /** User-facing strings. */
454
+ readonly labels: import("@angular/core/types/core").InputSignal<DataGridLabels>;
455
+ /** `"grid"` (default): roving-tabindex grid. `"table"`: a plain table with ordinary tab stops. */
456
+ readonly mode: import("@angular/core/types/core").InputSignal<"table" | "grid">;
457
+ /** Extra class on each body row. */
458
+ readonly rowClass: import("@angular/core/types/core").InputSignal<((row: DataGridRow) => string) | undefined>;
459
+ /** Extra attributes on each body row. */
460
+ readonly rowAttrs: import("@angular/core/types/core").InputSignal<((row: DataGridRow) => Record<string, string>) | undefined>;
461
+ /** Enter on a body cell with no widget, and a click outside any widget, emit `rowActivate` — only when this is true (Angular outputs cannot be tested for a listener). */
462
+ readonly activateRows: import("@angular/core/types/core").InputSignal<boolean>;
463
+ /** Shown in one row spanning every column when no row is to be shown. */
464
+ readonly empty: import("@angular/core/types/core").InputSignal<TemplateRef<void> | undefined>;
465
+ /** Rendered inside a `<tfoot>`: a template receiving `{ columns, rows }` as `$implicit`. */
466
+ readonly footer: import("@angular/core/types/core").InputSignal<TemplateRef<{
467
+ $implicit: DataGridFooterContext;
468
+ }> | undefined>;
469
+ /** Sets `aria-busy` on the table. */
470
+ readonly busy: import("@angular/core/types/core").InputSignal<boolean>;
471
+ /** Wrap the table in a scrollable `data-grid-scroll` region. Default true. */
472
+ readonly scroll: import("@angular/core/types/core").InputSignal<boolean>;
473
+ /** The file name without its extension. Default `"data-grid"`. */
474
+ readonly exportFilename: import("@angular/core/types/core").InputSignal<string>;
475
+ /** What an export holds: `"view"` (default) or `"selected"`. */
476
+ readonly exportScope: import("@angular/core/types/core").InputSignal<"view" | "selected">;
477
+ /** `.xlsx` only: a `formula` column keeps the live expression with the result cached. */
478
+ readonly exportFormulas: import("@angular/core/types/core").InputSignal<boolean>;
479
+ /** Called with the file before it is saved. Return `false` to keep the grid from saving it. */
480
+ readonly exportHandler: import("@angular/core/types/core").InputSignal<((file: DataGridExport) => boolean | void) | undefined>;
481
+ /** Renders only the rows in view, in a scroll region of `height` px (needs `scroll`). */
482
+ readonly virtualize: import("@angular/core/types/core").InputSignal<{
483
+ rowHeight: number;
484
+ height: number;
485
+ overscan?: number;
486
+ } | undefined>;
487
+ /** Extra CSS class on the root. */
488
+ readonly className: import("@angular/core/types/core").InputSignal<string>;
489
+ /** Selected row ids. Two-way bindable: `[(selected)]`. */
490
+ readonly selected: import("@angular/core/types/core").ModelSignal<string[]>;
491
+ /** Text filter. Two-way bindable: `[(filter)]`. */
492
+ readonly filter: import("@angular/core/types/core").ModelSignal<string>;
493
+ /** Current sort. Two-way bindable: `[(sort)]`. */
494
+ readonly sort: import("@angular/core/types/core").ModelSignal<DataGridSort>;
495
+ /** Column ids in display order. Two-way bindable: `[(columnOrder)]`; columns it does not name follow in their `columns` order. */
496
+ readonly columnOrder: import("@angular/core/types/core").ModelSignal<string[]>;
497
+ /** Current 1-indexed page. Two-way bindable: `[(page)]`. */
498
+ readonly page: import("@angular/core/types/core").ModelSignal<number>;
499
+ readonly cellEdit: import("@angular/core/types/_api-chunk").OutputEmitterRef<DataGridCellEdit>;
500
+ readonly filesSelected: import("@angular/core/types/_api-chunk").OutputEmitterRef<{
501
+ rowId: string;
502
+ row: DataGridRow;
503
+ columnId: string;
504
+ files: File[];
505
+ }>;
506
+ readonly fileRemove: import("@angular/core/types/_api-chunk").OutputEmitterRef<{
507
+ rowId: string;
508
+ row: DataGridRow;
509
+ columnId: string;
510
+ fileId: string;
511
+ }>;
512
+ readonly rowActivate: import("@angular/core/types/_api-chunk").OutputEmitterRef<{
513
+ row: DataGridRow;
514
+ id: string;
515
+ }>;
516
+ readonly exportFile: import("@angular/core/types/_api-chunk").OutputEmitterRef<DataGridExport>;
517
+ protected readonly gridId: string;
518
+ protected readonly minColumnWidth = 40;
519
+ private readonly rootRef;
520
+ private readonly scrollRef;
521
+ private readonly injector;
522
+ protected readonly statusMessage: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<string>;
523
+ protected readonly hiddenColumnIds: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<ReadonlySet<string>>;
524
+ private readonly columnWidths;
525
+ private readonly focusedRow;
526
+ private readonly focusedCol;
527
+ private lastSelectedIndex;
528
+ protected readonly editingState: import("@angular/core/types/_chrome_dev_tools_performance-chunk").WritableSignal<Editing | null>;
529
+ private readonly scrollTop;
530
+ private draggingColumnId;
531
+ /** Each column with its type's defaults filled in under its own props. */
532
+ protected readonly resolvedColumns: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridColumn[]>;
533
+ protected readonly isGrid: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
534
+ protected readonly hasSelection: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
535
+ protected readonly colOffset: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<0 | 1>;
536
+ /** Columns in display order: those named in `columnOrder` first, the rest after in their own order. */
537
+ private readonly orderedColumns;
538
+ protected readonly visibleColumns: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridColumn[]>;
539
+ protected readonly hidableColumns: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridColumn[]>;
540
+ private readonly entries;
541
+ /** Each cell's value and formatted text, read once per row object and column (reset when the columns change). */
542
+ private readonly cellCache;
543
+ protected cellFor(column: DataGridColumn, row: DataGridRow): DataGridCellContext;
544
+ /** Lowercased search text per row, built once per rows/columns change. */
545
+ private readonly searchIndex;
546
+ private readonly filteredEntries;
547
+ protected readonly sortedEntries: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridEntry[]>;
548
+ protected readonly pageCount: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
549
+ protected readonly clampedPage: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
550
+ protected readonly pageStart: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
551
+ protected readonly pageEntries: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridEntry[]>;
552
+ protected readonly lastCol: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
553
+ protected readonly activeRow: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
554
+ protected readonly activeCol: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<number>;
555
+ protected readonly indexed: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
556
+ private readonly rowCount;
557
+ protected readonly renderItems: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<RenderItem[]>;
558
+ protected readonly scrollStyle: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<string | null>;
559
+ private readonly selectedSet;
560
+ protected readonly allSelected: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
561
+ protected readonly someSelected: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
562
+ protected readonly footerContext: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridFooterContext>;
563
+ protected readonly exportColumns: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridColumn[]>;
564
+ protected readonly exportEntries: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<DataGridEntry[]>;
565
+ protected readonly hasExportButtons: import("@angular/core/types/_chrome_dev_tools_performance-chunk").Signal<boolean>;
566
+ constructor();
567
+ private announce;
568
+ protected ariaSortFor(column: DataGridColumn): DataGridSortDirection | null;
569
+ protected toggleSort(column: DataGridColumn): void;
570
+ protected onFilterInput(event: Event): void;
571
+ protected isSelected(id: string): boolean;
572
+ private setSelected;
573
+ protected onRowSelectClick(index: number, event: Event): void;
574
+ /** `index` is the row's position in the sorted entries, not on the current page. */
575
+ private toggleRow;
576
+ protected toggleSelectAll(): void;
577
+ protected widthFor(column: DataGridColumn): number | undefined;
578
+ /** Inline style of a column's cells: its width, and its alignment where one is set. */
579
+ protected cellStyle(column: DataGridColumn): string | null;
580
+ private setWidth;
581
+ protected onResizeKeydown(column: DataGridColumn, event: Event): void;
582
+ protected onResizePointerDown(column: DataGridColumn, event: Event): void;
583
+ protected toggleColumnVisibility(columnId: string): void;
584
+ protected goToPage(next: number): void;
585
+ /** Move `columnId` to sit at `toVisibleIndex` among the visible columns. Returns whether it moved. */
586
+ private moveColumn;
587
+ protected onHeaderDragStart(column: DataGridColumn, event: Event): void;
588
+ protected onHeaderDragOver(event: Event): void;
589
+ protected onHeaderDrop(targetId: string, event: Event): void;
590
+ protected onScroll(event: Event): void;
591
+ /** Bring a body row into the scroll region. */
592
+ private revealRow;
593
+ private focusActiveCell;
594
+ private moveFocus;
595
+ /** One cell for an export: typed values stay typed, everything else is the text the grid shows. */
596
+ private exportCell;
597
+ private hasUtcColumn;
598
+ protected runExport(format: ExportFormat): void;
599
+ /** Files dropped on an editable file cell: the same report as the file input. The grid uploads nothing. */
600
+ protected onFileDragOver(column: DataGridColumn, event: Event): void;
601
+ protected onFileDrop(entry: DataGridEntry, column: DataGridColumn, event: Event): void;
602
+ protected onFileInput(entry: DataGridEntry, column: DataGridColumn, event: Event): void;
603
+ /** A cell the person can edit through the grid's edit model (not a rollup, a file cell with its own widgets, or a person cell with no editor). */
604
+ protected isEditable(column: DataGridColumn): boolean;
605
+ protected isEditingCell(entry: DataGridEntry, column: DataGridColumn): boolean;
606
+ protected startEdit(entry: DataGridEntry, column: DataGridColumn): void;
607
+ private parseDraft;
608
+ /** Two link values with the same address and label are the same edit. */
609
+ private isStructurallyEqual;
610
+ /** Validate and report one new value for a cell. Returns false (and keeps editing, if the editor is open) when it is refused. */
611
+ protected commitValue(entry: DataGridEntry, column: DataGridColumn, value: unknown): boolean;
612
+ private commitEdit;
613
+ private cancelEdit;
614
+ protected onEditorKeydown(event: Event): void;
615
+ protected onEditorBlur(): void;
616
+ /** Focus leaving the time-zone editor's pair (not moving between its two controls) commits. */
617
+ protected onZonedFocusout(event: Event): void;
618
+ protected setDraft(event: Event): void;
619
+ protected setZone(event: Event): void;
620
+ protected personEditorContext(entry: DataGridEntry, column: DataGridColumn, ctx: DataGridCellContext): DataGridPersonEditorContext;
621
+ private activateFocusedCell;
622
+ /** The widgets a consumer put in a body cell (never the grid's own controls). */
623
+ private widgetsIn;
624
+ private setWidgetTabindex;
625
+ private normaliseWidgets;
626
+ /** Focus the first widget of a cell; its widgets are tab stops while focus stays inside it. */
627
+ private enterCell;
628
+ private leaveCell;
629
+ /** Pointer or programmatic focus on a cell moves the roving position to it. */
630
+ protected onGridFocusin(event: Event): void;
631
+ protected onGridFocusout(event: Event): void;
632
+ /** A click on a body cell, outside any widget, activates its row. */
633
+ protected onGridClick(event: Event): void;
634
+ /** A double click on an editable body cell starts editing it. */
635
+ protected onGridDblclick(event: Event): void;
636
+ protected onGridKeydown(event: Event): void;
637
+ private restoreView;
638
+ protected rowLabelOf(entry: DataGridEntry): string;
639
+ protected cellClassOf(column: DataGridColumn, ctx: DataGridCellContext): string;
640
+ protected peopleIn(value: unknown): DataGridPerson[];
641
+ protected shownPeople(column: DataGridColumn, value: unknown): DataGridPerson[];
642
+ protected nameOf(person: DataGridPerson): string;
643
+ protected filesIn(value: unknown): DataGridFile[];
644
+ protected linkIn(value: unknown): DataGridLink | null;
645
+ protected hrefOf(href: string | undefined): string | null;
646
+ protected stringOf(value: unknown): string;
647
+ protected ungroupedOptions(column: DataGridColumn): DataGridOption[];
648
+ protected groupsOf(column: DataGridColumn): string[];
649
+ protected optionsInGroup(column: DataGridColumn, group: string): DataGridOption[];
650
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataGrid, never>;
651
+ static ɵcmp: i0.ɵɵComponentDeclaration<DataGrid, "lily-data-grid", never, {
652
+ "label": {
653
+ "alias": "label";
654
+ "required": true;
655
+ "isSignal": true;
656
+ };
657
+ "caption": {
658
+ "alias": "caption";
659
+ "required": false;
660
+ "isSignal": true;
661
+ };
662
+ "columns": {
663
+ "alias": "columns";
664
+ "required": true;
665
+ "isSignal": true;
666
+ };
667
+ "rows": {
668
+ "alias": "rows";
669
+ "required": true;
670
+ "isSignal": true;
671
+ };
672
+ "locale": {
673
+ "alias": "locale";
674
+ "required": false;
675
+ "isSignal": true;
676
+ };
677
+ "rowId": {
678
+ "alias": "rowId";
679
+ "required": false;
680
+ "isSignal": true;
681
+ };
682
+ "selectionMode": {
683
+ "alias": "selectionMode";
684
+ "required": false;
685
+ "isSignal": true;
686
+ };
687
+ "pageSize": {
688
+ "alias": "pageSize";
689
+ "required": false;
690
+ "isSignal": true;
691
+ };
692
+ "storageKey": {
693
+ "alias": "storageKey";
694
+ "required": false;
695
+ "isSignal": true;
696
+ };
697
+ "labels": {
698
+ "alias": "labels";
699
+ "required": false;
700
+ "isSignal": true;
701
+ };
702
+ "mode": {
703
+ "alias": "mode";
704
+ "required": false;
705
+ "isSignal": true;
706
+ };
707
+ "rowClass": {
708
+ "alias": "rowClass";
709
+ "required": false;
710
+ "isSignal": true;
711
+ };
712
+ "rowAttrs": {
713
+ "alias": "rowAttrs";
714
+ "required": false;
715
+ "isSignal": true;
716
+ };
717
+ "activateRows": {
718
+ "alias": "activateRows";
719
+ "required": false;
720
+ "isSignal": true;
721
+ };
722
+ "empty": {
723
+ "alias": "empty";
724
+ "required": false;
725
+ "isSignal": true;
726
+ };
727
+ "footer": {
728
+ "alias": "footer";
729
+ "required": false;
730
+ "isSignal": true;
731
+ };
732
+ "busy": {
733
+ "alias": "busy";
734
+ "required": false;
735
+ "isSignal": true;
736
+ };
737
+ "scroll": {
738
+ "alias": "scroll";
739
+ "required": false;
740
+ "isSignal": true;
741
+ };
742
+ "exportFilename": {
743
+ "alias": "exportFilename";
744
+ "required": false;
745
+ "isSignal": true;
746
+ };
747
+ "exportScope": {
748
+ "alias": "exportScope";
749
+ "required": false;
750
+ "isSignal": true;
751
+ };
752
+ "exportFormulas": {
753
+ "alias": "exportFormulas";
754
+ "required": false;
755
+ "isSignal": true;
756
+ };
757
+ "exportHandler": {
758
+ "alias": "exportHandler";
759
+ "required": false;
760
+ "isSignal": true;
761
+ };
762
+ "virtualize": {
763
+ "alias": "virtualize";
764
+ "required": false;
765
+ "isSignal": true;
766
+ };
767
+ "className": {
768
+ "alias": "className";
769
+ "required": false;
770
+ "isSignal": true;
771
+ };
772
+ "selected": {
773
+ "alias": "selected";
774
+ "required": false;
775
+ "isSignal": true;
776
+ };
777
+ "filter": {
778
+ "alias": "filter";
779
+ "required": false;
780
+ "isSignal": true;
781
+ };
782
+ "sort": {
783
+ "alias": "sort";
784
+ "required": false;
785
+ "isSignal": true;
786
+ };
787
+ "columnOrder": {
788
+ "alias": "columnOrder";
789
+ "required": false;
790
+ "isSignal": true;
791
+ };
792
+ "page": {
793
+ "alias": "page";
794
+ "required": false;
795
+ "isSignal": true;
796
+ };
797
+ }, {
798
+ "selected": "selectedChange";
799
+ "filter": "filterChange";
800
+ "sort": "sortChange";
801
+ "columnOrder": "columnOrderChange";
802
+ "page": "pageChange";
803
+ "cellEdit": "cellEdit";
804
+ "filesSelected": "filesSelected";
805
+ "fileRemove": "fileRemove";
806
+ "rowActivate": "rowActivate";
807
+ "exportFile": "exportFile";
808
+ }, never, never, true, never>;
809
+ }
810
+ export type { DataGridAggregate, DataGridCellContext, DataGridCellEdit, DataGridCellType, DataGridColumn, DataGridEntry, DataGridExport, DataGridFile, DataGridFooterContext, DataGridFormulaContext, DataGridFormulaResult, DataGridLabels, DataGridLink, DataGridOption, DataGridPerson, DataGridPersonEditorContext, DataGridRow, DataGridSelectionMode, DataGridSort, DataGridSortDirection, DataGridZonedTime, DelimitedOptions, ExportFormat, ExportFormula, ExportTable, XlsxOptions };
811
+ //# sourceMappingURL=lilydesignsystem-angular-data-grid.d.ts.map