@timlassiter11/yatl 1.0.18 → 1.2.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.
- package/dist/index.d.mts +103 -172
- package/dist/index.d.ts +103 -172
- package/dist/index.js +650 -1251
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +629 -1227
- package/dist/index.mjs.map +1 -1
- package/dist/theme.css +52 -0
- package/dist/yatl.min.global.js +229 -681
- package/dist/yatl.min.global.js.map +1 -1
- package/package.json +10 -14
- package/LICENSE +0 -21
- package/README.md +0 -374
package/dist/index.d.mts
CHANGED
|
@@ -1,63 +1,6 @@
|
|
|
1
|
-
import * as lit_html from 'lit-html';
|
|
2
1
|
import * as lit from 'lit';
|
|
3
|
-
import {
|
|
4
|
-
export { html, noChange, nothing, svg } from 'lit';
|
|
2
|
+
import { TemplateResult, ReactiveController, ReactiveControllerHost, LitElement, nothing } from 'lit';
|
|
5
3
|
import { DirectiveResult } from 'lit/directive.js';
|
|
6
|
-
export { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
7
|
-
|
|
8
|
-
declare class YatlButton extends LitElement {
|
|
9
|
-
static styles: lit.CSSResult[];
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
type: 'button' | 'submit' | 'reset';
|
|
12
|
-
render(): lit_html.TemplateResult<1>;
|
|
13
|
-
}
|
|
14
|
-
declare global {
|
|
15
|
-
interface HTMLElementTagNameMap {
|
|
16
|
-
'yatl-button': YatlButton;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare class YatlButtonGroup extends LitElement {
|
|
21
|
-
static styles: lit.CSSResult[];
|
|
22
|
-
render(): lit_html.TemplateResult<1>;
|
|
23
|
-
private getFlattenedElements;
|
|
24
|
-
private handleSlotChange;
|
|
25
|
-
}
|
|
26
|
-
declare global {
|
|
27
|
-
interface HTMLElementTagNameMap {
|
|
28
|
-
'yatl-button-group': YatlButtonGroup;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare class YatlDropdown extends LitElement {
|
|
33
|
-
static styles: lit.CSSResult[];
|
|
34
|
-
private detailsElement;
|
|
35
|
-
open: boolean;
|
|
36
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
37
|
-
private handleDropdownTriggerClick;
|
|
38
|
-
private handleDocumentClick;
|
|
39
|
-
}
|
|
40
|
-
declare global {
|
|
41
|
-
interface HTMLElementTagNameMap {
|
|
42
|
-
'yatl-dropdown': YatlDropdown;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @fires yatl-dropdown-toggle - Fired when a dropdown item's checked state changes
|
|
48
|
-
*/
|
|
49
|
-
declare class YatlDropdownItem extends LitElement {
|
|
50
|
-
static styles: lit.CSSResult[];
|
|
51
|
-
value: string;
|
|
52
|
-
checked: boolean;
|
|
53
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
54
|
-
private handleCheckboxChanged;
|
|
55
|
-
}
|
|
56
|
-
declare global {
|
|
57
|
-
interface HTMLElementTagNameMap {
|
|
58
|
-
'yatl-dropdown-item': YatlDropdownItem;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
4
|
|
|
62
5
|
type NestedKeyOf<ObjectType> = ObjectType extends object ? {
|
|
63
6
|
[Key in keyof ObjectType & (string | number)]: NonNullable<ObjectType[Key]> extends unknown[] ? `${Key}` : NonNullable<ObjectType[Key]> extends object ? // Recurse with the non-nullable type
|
|
@@ -67,6 +10,9 @@ type NestedKeyOf<ObjectType> = ObjectType extends object ? {
|
|
|
67
10
|
* Default type for the table.
|
|
68
11
|
*/
|
|
69
12
|
type UnspecifiedRecord = Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* Valid types for Row IDs
|
|
15
|
+
*/
|
|
70
16
|
type RowId = string | number;
|
|
71
17
|
/**
|
|
72
18
|
* Known compareable type
|
|
@@ -229,7 +175,7 @@ interface InternalColumnOptions<T> extends BaseColumnOptions<T> {
|
|
|
229
175
|
* Marks this column as internal-only.
|
|
230
176
|
* It will be indexed for search and filtering, but strictly excluded from the UI.
|
|
231
177
|
*/
|
|
232
|
-
|
|
178
|
+
role: 'internal';
|
|
233
179
|
}
|
|
234
180
|
type ColumnOptions<T> = DisplayColumnOptions<T> | InternalColumnOptions<T>;
|
|
235
181
|
/**
|
|
@@ -289,6 +235,10 @@ type RowSelectionMethod = 'single' | 'multi';
|
|
|
289
235
|
* @returns the part string or list of part strings that should be added to this row.
|
|
290
236
|
*/
|
|
291
237
|
type RowPartsCallback<T> = (row: T) => string | string[];
|
|
238
|
+
/**
|
|
239
|
+
* Options used to configure what state information
|
|
240
|
+
* should be saved and restored automatically.
|
|
241
|
+
*/
|
|
292
242
|
interface StorageOptions {
|
|
293
243
|
/**
|
|
294
244
|
* The unique key used to store the table state in the browser.
|
|
@@ -334,11 +284,20 @@ interface TableState<T> {
|
|
|
334
284
|
type RestorableTableState<T> = Partial<Omit<TableState<T>, 'columns'>> & {
|
|
335
285
|
columns?: RestorableColumnState<T>[];
|
|
336
286
|
};
|
|
287
|
+
/**
|
|
288
|
+
* Options for configuring what date should be exported.
|
|
289
|
+
*/
|
|
337
290
|
interface ExportOptions {
|
|
291
|
+
/** Include all rows including filtered out rows */
|
|
338
292
|
includeAllRows?: boolean;
|
|
293
|
+
/** Include columns that have been hidden */
|
|
339
294
|
includeHiddenColumns?: boolean;
|
|
295
|
+
/** Include columns marked as internal */
|
|
340
296
|
includeInternalColumns?: boolean;
|
|
341
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Options for configuring a table controller
|
|
300
|
+
*/
|
|
342
301
|
interface TableControllerOptions<T extends object> {
|
|
343
302
|
enableSearchTokenization?: boolean;
|
|
344
303
|
enableSearchScoring?: boolean;
|
|
@@ -353,8 +312,9 @@ interface TableControllerOptions<T extends object> {
|
|
|
353
312
|
/**
|
|
354
313
|
* Base event class that bubbles and is composed.
|
|
355
314
|
*/
|
|
356
|
-
declare class YatlEvent extends Event {
|
|
315
|
+
declare abstract class YatlEvent extends Event {
|
|
357
316
|
constructor(name: string, options?: EventInit);
|
|
317
|
+
abstract clone(): YatlEvent;
|
|
358
318
|
}
|
|
359
319
|
declare class YatlRowClickEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
360
320
|
readonly row: T;
|
|
@@ -364,26 +324,30 @@ declare class YatlRowClickEvent<T extends object = UnspecifiedRecord> extends Ya
|
|
|
364
324
|
readonly originalEvent: MouseEvent;
|
|
365
325
|
static readonly EVENT_NAME = "yatl-row-click";
|
|
366
326
|
constructor(row: T, rowId: RowId, index: number, field: NestedKeyOf<T>, originalEvent: MouseEvent);
|
|
327
|
+
clone(): YatlRowClickEvent<T>;
|
|
367
328
|
}
|
|
368
|
-
declare class
|
|
329
|
+
declare class YatlRowSelectRequest extends YatlEvent {
|
|
369
330
|
readonly rowId: RowId;
|
|
370
331
|
readonly selected: boolean;
|
|
371
332
|
readonly currentlySelectedRows: RowId[];
|
|
372
333
|
static readonly EVENT_NAME = "yatl-row-select-request";
|
|
373
334
|
constructor(rowId: RowId, selected: boolean, currentlySelectedRows: RowId[]);
|
|
335
|
+
clone(): YatlRowSelectRequest;
|
|
374
336
|
}
|
|
375
337
|
declare class YatlRowSelectEvent extends YatlEvent {
|
|
376
338
|
readonly selectedIds: RowId[];
|
|
377
339
|
readonly previouslySelectedRows: RowId[];
|
|
378
340
|
static readonly EVENT_NAME = "yatl-row-select";
|
|
379
341
|
constructor(selectedIds: RowId[], previouslySelectedRows: RowId[]);
|
|
342
|
+
clone(): YatlRowSelectEvent;
|
|
380
343
|
}
|
|
381
|
-
declare class
|
|
344
|
+
declare class YatlColumnSortRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
382
345
|
readonly field: NestedKeyOf<T>;
|
|
383
346
|
readonly order: SortOrder | null;
|
|
384
347
|
readonly multisort: boolean;
|
|
385
348
|
static readonly EVENT_NAME = "yatl-column-sort-request";
|
|
386
349
|
constructor(field: NestedKeyOf<T>, order: SortOrder | null, multisort: boolean);
|
|
350
|
+
clone(): YatlColumnSortRequest<T>;
|
|
387
351
|
}
|
|
388
352
|
declare class YatlColumnSortEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
389
353
|
readonly field: NestedKeyOf<T>;
|
|
@@ -391,96 +355,88 @@ declare class YatlColumnSortEvent<T extends object = UnspecifiedRecord> extends
|
|
|
391
355
|
readonly multisort: boolean;
|
|
392
356
|
static readonly EVENT_NAME = "yatl-column-sort";
|
|
393
357
|
constructor(field: NestedKeyOf<T>, order: SortOrder | null, multisort: boolean);
|
|
358
|
+
clone(): YatlColumnSortEvent<T>;
|
|
394
359
|
}
|
|
395
|
-
declare class
|
|
396
|
-
readonly field:
|
|
360
|
+
declare class YatlColumnToggleRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
361
|
+
readonly field: NestedKeyOf<T>;
|
|
397
362
|
readonly visibility: boolean;
|
|
398
363
|
static readonly EVENT_NAME = "yatl-column-toggle-request";
|
|
399
|
-
constructor(field:
|
|
364
|
+
constructor(field: NestedKeyOf<T>, visibility: boolean);
|
|
365
|
+
clone(): YatlColumnToggleRequest<T>;
|
|
400
366
|
}
|
|
401
367
|
declare class YatlColumnToggleEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
402
368
|
readonly field: NestedKeyOf<T>;
|
|
403
369
|
readonly visible: boolean;
|
|
404
370
|
static readonly EVENT_NAME = "yatl-column-toggle";
|
|
405
371
|
constructor(field: NestedKeyOf<T>, visible: boolean);
|
|
372
|
+
clone(): YatlColumnToggleEvent<T>;
|
|
406
373
|
}
|
|
407
374
|
declare class YatlColumnResizeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
408
375
|
readonly field: NestedKeyOf<T>;
|
|
409
376
|
readonly width: number | null;
|
|
410
377
|
static readonly EVENT_NAME = "yatl-column-resize";
|
|
411
378
|
constructor(field: NestedKeyOf<T>, width: number | null);
|
|
379
|
+
clone(): YatlColumnResizeEvent<T>;
|
|
412
380
|
}
|
|
413
|
-
declare class
|
|
381
|
+
declare class YatlColumnReorderRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
414
382
|
readonly movedColumn: NestedKeyOf<T>;
|
|
415
383
|
readonly originalIndex: number;
|
|
416
384
|
readonly newIndex: number;
|
|
417
385
|
static readonly EVENT_NAME = "yatl-column-reorder-request";
|
|
418
386
|
constructor(movedColumn: NestedKeyOf<T>, originalIndex: number, newIndex: number);
|
|
387
|
+
clone(): YatlColumnReorderRequest<T>;
|
|
419
388
|
}
|
|
420
389
|
declare class YatlColumnReorderEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
421
390
|
readonly order: NestedKeyOf<T>[];
|
|
422
391
|
static readonly EVENT_NAME = "yatl-column-reorder";
|
|
423
392
|
constructor(order: NestedKeyOf<T>[]);
|
|
393
|
+
clone(): YatlColumnReorderEvent<T>;
|
|
424
394
|
}
|
|
425
395
|
declare class YatlTableSearchEvent extends YatlEvent {
|
|
426
396
|
readonly query: string;
|
|
427
397
|
static readonly EVENT_NAME = "yatl-table-search";
|
|
428
398
|
constructor(query: string);
|
|
399
|
+
clone(): YatlTableSearchEvent;
|
|
429
400
|
}
|
|
430
401
|
declare class YatlTableViewChangeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
431
402
|
readonly data: T[];
|
|
432
403
|
static readonly EVENT_NAME = "yatl-table-view-change";
|
|
433
404
|
constructor(data: T[]);
|
|
405
|
+
clone(): YatlTableViewChangeEvent<T>;
|
|
434
406
|
}
|
|
435
407
|
declare class YatlTableStateChangeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
436
408
|
readonly state: TableState<T>;
|
|
437
409
|
readonly triggers: string[];
|
|
438
410
|
static readonly EVENT_NAME = "yatl-table-state-change";
|
|
439
411
|
constructor(state: TableState<T>, triggers: string[]);
|
|
440
|
-
|
|
441
|
-
declare class YatlDropdownToggleEvent extends YatlEvent {
|
|
442
|
-
readonly value: string;
|
|
443
|
-
readonly checked: boolean;
|
|
444
|
-
static readonly EVENT_NAME = "yatl-dropdown-toggle";
|
|
445
|
-
constructor(value: string, checked: boolean);
|
|
446
|
-
}
|
|
447
|
-
declare class YatlToolbarSearchInput extends YatlEvent {
|
|
448
|
-
readonly value: string;
|
|
449
|
-
static readonly EVENT_NAME = "yatl-toolbar-search-input";
|
|
450
|
-
constructor(value: string);
|
|
451
|
-
}
|
|
452
|
-
declare class YatlToolbarSearchChange extends YatlEvent {
|
|
453
|
-
readonly value: string;
|
|
454
|
-
static readonly EVENT_NAME = "yatl-toolbar-search-change";
|
|
455
|
-
constructor(value: string);
|
|
456
|
-
}
|
|
457
|
-
declare class YatlToolbarExportClick extends YatlEvent {
|
|
458
|
-
static readonly EVENT_NAME = "yatl-toolbar-export-click";
|
|
459
|
-
constructor();
|
|
412
|
+
clone(): YatlTableStateChangeEvent<T>;
|
|
460
413
|
}
|
|
461
414
|
declare global {
|
|
462
415
|
interface HTMLElementEventMap {
|
|
463
416
|
[YatlRowClickEvent.EVENT_NAME]: YatlRowClickEvent;
|
|
464
|
-
[
|
|
417
|
+
[YatlRowSelectRequest.EVENT_NAME]: YatlRowSelectRequest;
|
|
465
418
|
[YatlRowSelectEvent.EVENT_NAME]: YatlRowSelectEvent;
|
|
466
|
-
[
|
|
419
|
+
[YatlColumnSortRequest.EVENT_NAME]: YatlColumnSortRequest;
|
|
467
420
|
[YatlColumnSortEvent.EVENT_NAME]: YatlColumnSortEvent;
|
|
468
|
-
[
|
|
421
|
+
[YatlColumnToggleRequest.EVENT_NAME]: YatlColumnToggleRequest;
|
|
469
422
|
[YatlColumnToggleEvent.EVENT_NAME]: YatlColumnToggleEvent;
|
|
470
423
|
[YatlColumnResizeEvent.EVENT_NAME]: YatlColumnResizeEvent;
|
|
471
|
-
[
|
|
424
|
+
[YatlColumnReorderRequest.EVENT_NAME]: YatlColumnReorderRequest;
|
|
472
425
|
[YatlColumnReorderEvent.EVENT_NAME]: YatlColumnReorderEvent;
|
|
473
426
|
[YatlTableSearchEvent.EVENT_NAME]: YatlTableSearchEvent;
|
|
474
427
|
[YatlTableViewChangeEvent.EVENT_NAME]: YatlTableViewChangeEvent;
|
|
475
428
|
[YatlTableStateChangeEvent.EVENT_NAME]: YatlTableStateChangeEvent;
|
|
476
|
-
[YatlDropdownToggleEvent.EVENT_NAME]: YatlDropdownToggleEvent;
|
|
477
|
-
[YatlToolbarSearchInput.EVENT_NAME]: YatlToolbarSearchInput;
|
|
478
|
-
[YatlToolbarSearchChange.EVENT_NAME]: YatlToolbarSearchChange;
|
|
479
|
-
[YatlToolbarExportClick.EVENT_NAME]: YatlToolbarExportClick;
|
|
480
429
|
}
|
|
481
430
|
}
|
|
482
431
|
|
|
483
|
-
declare class
|
|
432
|
+
declare class TypedEventTarget<TEventMap extends Record<string, Event>> extends EventTarget {
|
|
433
|
+
addEventListener<K extends keyof TEventMap>(type: K, listener: (this: TEventMap, ev: TEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
434
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
435
|
+
removeEventListener<K extends keyof TEventMap>(type: K, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
|
|
436
|
+
dispatchEvent<K extends keyof TEventMap>(event: TEventMap[K]): boolean;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
declare class YatlTableController<T extends object = UnspecifiedRecord> extends TypedEventTarget<ControllerEventMap> implements ReactiveController {
|
|
484
440
|
private hosts;
|
|
485
441
|
private _enableSearchTokenization;
|
|
486
442
|
private _enableSearchScoring;
|
|
@@ -493,6 +449,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
493
449
|
private _rowIdCallback;
|
|
494
450
|
private _data;
|
|
495
451
|
private _filteredData;
|
|
452
|
+
private _dataUpdateTimestamp;
|
|
496
453
|
private _searchQuery;
|
|
497
454
|
private _searchTokenizer;
|
|
498
455
|
private _filters;
|
|
@@ -607,6 +564,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
607
564
|
get data(): T[];
|
|
608
565
|
set data(data: T[]);
|
|
609
566
|
get filteredData(): T[];
|
|
567
|
+
get dataUpdateTimestamp(): Date | null;
|
|
610
568
|
constructor(host?: ReactiveControllerHost, options?: TableControllerOptions<T>);
|
|
611
569
|
attach(host: ReactiveControllerHost): void;
|
|
612
570
|
detach(host: ReactiveControllerHost): void;
|
|
@@ -624,6 +582,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
624
582
|
getColumnState(field: NestedKeyOf<T>): ColumnState<T>;
|
|
625
583
|
updateColumnState(field: NestedKeyOf<T>, state: RestorableColumnState<T>): void;
|
|
626
584
|
search(query: string): void;
|
|
585
|
+
getColumnFilterValues(field: NestedKeyOf<T>, includeNull?: boolean): Map<unknown, number>;
|
|
627
586
|
/**
|
|
628
587
|
* Sorts the table by a specified column and order.
|
|
629
588
|
* If `order` is `null`, the sort on this column is removed.
|
|
@@ -679,8 +638,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
679
638
|
deselectAll(): void;
|
|
680
639
|
/**
|
|
681
640
|
* Export the current visible table data to a CSV file.
|
|
682
|
-
* @param
|
|
683
|
-
* @param all - If `true`, exports all original data (ignoring filters). If `false` (default), exports only the currently visible (filtered and sorted) rows.
|
|
641
|
+
* @param options - Options for configuring what should be exported.
|
|
684
642
|
*/
|
|
685
643
|
export(options?: ExportOptions): Blob;
|
|
686
644
|
/**
|
|
@@ -728,18 +686,17 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
728
686
|
updateRowAtIndex(index: number, data: Partial<T>): void;
|
|
729
687
|
/**
|
|
730
688
|
* Deletes the row with the matching ID.
|
|
731
|
-
* @param
|
|
689
|
+
* @param rowIds - The IDs rows to delete
|
|
732
690
|
*/
|
|
733
691
|
deleteRow(...rowIds: RowId[]): void;
|
|
734
692
|
/**
|
|
735
693
|
* Deletes a row at a specific original index from the table.
|
|
736
|
-
* @param
|
|
694
|
+
* @param indexes - The original indexes of rows to delete.
|
|
737
695
|
*/
|
|
738
696
|
deleteRowAtIndex(...indexes: number[]): void;
|
|
739
697
|
getRowId(row: T): RowId;
|
|
740
698
|
getRowIndex(row: T): number;
|
|
741
699
|
getRowHighlightIndicies(row: T): Record<string, [number, number][]> | undefined;
|
|
742
|
-
private dispatchEvent;
|
|
743
700
|
hostConnected(): void;
|
|
744
701
|
hostDisconnected(): void;
|
|
745
702
|
hostUpdate(): void;
|
|
@@ -773,6 +730,16 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
773
730
|
private saveStateToStorage;
|
|
774
731
|
private loadStateFromStorage;
|
|
775
732
|
}
|
|
733
|
+
type ControllerEventMap = {
|
|
734
|
+
[YatlColumnReorderEvent.EVENT_NAME]: YatlColumnReorderEvent;
|
|
735
|
+
[YatlColumnResizeEvent.EVENT_NAME]: YatlColumnResizeEvent;
|
|
736
|
+
[YatlColumnSortEvent.EVENT_NAME]: YatlColumnSortEvent;
|
|
737
|
+
[YatlColumnToggleEvent.EVENT_NAME]: YatlColumnToggleEvent;
|
|
738
|
+
[YatlRowSelectEvent.EVENT_NAME]: YatlRowSelectEvent;
|
|
739
|
+
[YatlTableSearchEvent.EVENT_NAME]: YatlTableSearchEvent;
|
|
740
|
+
[YatlTableStateChangeEvent.EVENT_NAME]: YatlTableStateChangeEvent;
|
|
741
|
+
[YatlTableViewChangeEvent.EVENT_NAME]: YatlTableViewChangeEvent;
|
|
742
|
+
};
|
|
776
743
|
|
|
777
744
|
/**
|
|
778
745
|
* A virtualized data table capable of handling complex sorting, filtering, and tokenized searching.
|
|
@@ -798,12 +765,13 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
798
765
|
static styles: lit.CSSResult[];
|
|
799
766
|
private tableElement;
|
|
800
767
|
private virtualizer?;
|
|
801
|
-
private dataLastUpdate;
|
|
802
768
|
private resizeState;
|
|
803
769
|
private dragColumn;
|
|
770
|
+
private useYatlUi;
|
|
804
771
|
private _controller;
|
|
805
772
|
get controller(): YatlTableController<T>;
|
|
806
773
|
set controller(controller: YatlTableController<T>);
|
|
774
|
+
striped: boolean;
|
|
807
775
|
/**
|
|
808
776
|
* Default sortability for all columns.
|
|
809
777
|
* Can be overridden by setting `sortable` on the specific column definition.
|
|
@@ -975,6 +943,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
975
943
|
get data(): T[];
|
|
976
944
|
set data(value: T[]);
|
|
977
945
|
get filteredData(): T[];
|
|
946
|
+
get dataUpdateTimestamp(): Date | null;
|
|
978
947
|
getColumn(field: NestedKeyOf<T>): ColumnOptions<T> | undefined;
|
|
979
948
|
getDisplayColumn(field: NestedKeyOf<T>): DisplayColumnOptions<T> | undefined;
|
|
980
949
|
/**
|
|
@@ -1043,7 +1012,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1043
1012
|
/**
|
|
1044
1013
|
* Export the current visible table data to a CSV file.
|
|
1045
1014
|
* @param filename - The name of the file to save.
|
|
1046
|
-
* @param
|
|
1015
|
+
* @param options - Options for configuring what should be exported.
|
|
1047
1016
|
*/
|
|
1048
1017
|
export(filename: string, options?: ExportOptions): void;
|
|
1049
1018
|
scrollToRow(row: T): Promise<void>;
|
|
@@ -1099,7 +1068,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1099
1068
|
updateRowAtIndex(index: number, data: Partial<T>): void;
|
|
1100
1069
|
/**
|
|
1101
1070
|
* Deletes the row with the matching ID.
|
|
1102
|
-
* @param
|
|
1071
|
+
* @param rowIds - The IDs rows to delete
|
|
1103
1072
|
*/
|
|
1104
1073
|
deleteRow(...rowIds: RowId[]): void;
|
|
1105
1074
|
/**
|
|
@@ -1115,6 +1084,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1115
1084
|
protected renderHeader(): TemplateResult<1>;
|
|
1116
1085
|
protected renderCellContents(value: unknown, column: DisplayColumnOptions<T>, row: T): {} | null | undefined;
|
|
1117
1086
|
protected renderCell(column: DisplayColumnOptions<T>, row: T): TemplateResult<1>;
|
|
1087
|
+
protected renderCheckbox(row: T, selected: boolean): TemplateResult<1>;
|
|
1118
1088
|
protected renderRowSelectorCell(row: T, selected: boolean): TemplateResult<1>;
|
|
1119
1089
|
protected renderRowNumberCell(rowNumber: number): TemplateResult<1>;
|
|
1120
1090
|
protected renderRow(row: T, renderIndex: number): TemplateResult<1>;
|
|
@@ -1122,7 +1092,12 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1122
1092
|
protected renderFooter(): TemplateResult<1> | typeof nothing;
|
|
1123
1093
|
protected render(): TemplateResult<1>;
|
|
1124
1094
|
private renderCellWrapper;
|
|
1095
|
+
connectedCallback(): void;
|
|
1125
1096
|
disconnectedCallback(): void;
|
|
1097
|
+
private readonly eventNames;
|
|
1098
|
+
private addControllerListeners;
|
|
1099
|
+
private removeControllerListeners;
|
|
1100
|
+
private redispatchControllerEvent;
|
|
1126
1101
|
private hasVisibleColumn;
|
|
1127
1102
|
/**
|
|
1128
1103
|
* Gets the width of each column in the
|
|
@@ -1148,76 +1123,32 @@ declare global {
|
|
|
1148
1123
|
}
|
|
1149
1124
|
}
|
|
1150
1125
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
*
|
|
1159
|
-
* @element yatl-table-ui
|
|
1160
|
-
*
|
|
1161
|
-
* @slot toolbar - Adds contents to the right of the toolbar button group
|
|
1162
|
-
* @slot toolbar-button-group - Adds content into the toolbar button group.
|
|
1163
|
-
* @slot footer - Inherited from `yatl-table`. Content to display in the table footer area.
|
|
1164
|
-
* @slot body - Inherited from `yatl-table`. Custom rendering for the table body.
|
|
1165
|
-
*/
|
|
1166
|
-
declare class YatlTableUi<T extends object = UnspecifiedRecord> extends YatlTable<T> {
|
|
1167
|
-
static styles: lit.CSSResult[];
|
|
1168
|
-
/**
|
|
1169
|
-
* Toggles the visibility of the column picker button in the toolbar. Defaults to `true`.
|
|
1170
|
-
*/
|
|
1171
|
-
showColumnPicker: boolean;
|
|
1172
|
-
/**
|
|
1173
|
-
* Toggles the visibility of the CSV export button in the toolbar. Defaults to `true`.
|
|
1174
|
-
*/
|
|
1175
|
-
showExportButton: boolean;
|
|
1176
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
1177
|
-
private handleTableExportClicked;
|
|
1178
|
-
}
|
|
1179
|
-
declare global {
|
|
1180
|
-
interface HTMLElementTagNameMap {
|
|
1181
|
-
'yatl-table-ui': YatlTableUi;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1126
|
+
declare function findColumn<TData extends Record<string, unknown>, TCol extends {
|
|
1127
|
+
field: NestedKeyOf<TData>;
|
|
1128
|
+
}>(columns: TCol[], field: NestedKeyOf<TData>): TCol | undefined;
|
|
1129
|
+
declare function isInternalColumn<T>(col: ColumnOptions<T> | undefined | null): col is InternalColumnOptions<T>;
|
|
1130
|
+
declare function isDisplayColumn<T>(col: ColumnOptions<T> | undefined | null): col is DisplayColumnOptions<T>;
|
|
1131
|
+
declare function createState<T>(field: NestedKeyOf<T>, defaults?: Partial<ColumnState<T>>): ColumnState<T>;
|
|
1132
|
+
declare function getColumnStateChanges<T>(oldState: ColumnState<T> | undefined, newState: ColumnState<T>): (keyof ColumnState<T>)[];
|
|
1184
1133
|
|
|
1134
|
+
declare function isRowIdType(value: unknown): value is RowId;
|
|
1135
|
+
declare function isRowSelectionMethod(value: string | null): value is RowSelectionMethod;
|
|
1185
1136
|
/**
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
* @
|
|
1189
|
-
* @
|
|
1190
|
-
* along with a flexible slot for custom actions.
|
|
1191
|
-
*
|
|
1192
|
-
* @slot - Adds contents to the right of the toolbar button group
|
|
1193
|
-
* @slot toolbar-button-group - Adds content into the toolbar button group.
|
|
1194
|
-
*
|
|
1195
|
-
* @fires yatl-toolbar-search-input - Fired synchronously as the user types in the search box. Useful for real-time highlighting or suggestions.
|
|
1196
|
-
* @fires yatl-toolbar-search-change - Fired when the user commits a search query (e.g., on 'Enter' or blur). Use this for triggering the actual table filter.
|
|
1197
|
-
* @fires yatl-toolbar-export-click - Fired when the export button is clicked. Payload indicates the requested format.
|
|
1198
|
-
* @fires yatl-column-toggle-request - Fired when a column's visibility is toggled in the dropdown. The consumer must handle this by updating the table state.
|
|
1199
|
-
*
|
|
1137
|
+
* Get a value from an object based on a path.
|
|
1138
|
+
* @param obj - The object to get the value from
|
|
1139
|
+
* @param path - The path of the value
|
|
1140
|
+
* @returns The value found at the given path
|
|
1200
1141
|
*/
|
|
1201
|
-
declare
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
protected renderExportButton(): lit_html.TemplateResult<1>;
|
|
1213
|
-
private onSearchInput;
|
|
1214
|
-
private onSearchChange;
|
|
1215
|
-
private onExportClick;
|
|
1216
|
-
}
|
|
1217
|
-
declare global {
|
|
1218
|
-
interface HTMLElementTagNameMap {
|
|
1219
|
-
'yatl-toolbar': YatlToolbar;
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1142
|
+
declare function getNestedValue(obj: object, path: string): unknown;
|
|
1143
|
+
declare function setNestedValue(obj: object, path: string, value: unknown): void;
|
|
1144
|
+
|
|
1145
|
+
declare const createRegexTokenizer: (exp?: string) => (value: string) => {
|
|
1146
|
+
value: string;
|
|
1147
|
+
quoted: boolean;
|
|
1148
|
+
}[];
|
|
1149
|
+
declare const whitespaceTokenizer: (value: string) => {
|
|
1150
|
+
value: string;
|
|
1151
|
+
quoted: boolean;
|
|
1152
|
+
}[];
|
|
1222
1153
|
|
|
1223
|
-
export { type BaseColumnOptions, type CellPartsCallback, type CellRenderCallback, type ColumnFilterCallback, type ColumnOptions, type ColumnRole, type ColumnState, type Compareable, type DisplayColumnOptions, type ExportOptions, type FilterCallback, type Filters, type InternalColumnOptions, type NestedKeyOf, type QueryToken, type Renderable, type RestorableColumnState, type RestorableTableState, type RowId, type RowIdCallback, type RowPartsCallback, type RowSelectionMethod, type SortOrder, type SortState, type SortValueCallback, type StorageOptions, type TableControllerOptions, type TableState, type TokenizerCallback, type UnspecifiedRecord, type ValueFormatterCallback,
|
|
1154
|
+
export { type BaseColumnOptions, type CellPartsCallback, type CellRenderCallback, type ColumnFilterCallback, type ColumnOptions, type ColumnRole, type ColumnState, type Compareable, type ControllerEventMap, type DisplayColumnOptions, type ExportOptions, type FilterCallback, type Filters, type InternalColumnOptions, type NestedKeyOf, type QueryToken, type Renderable, type RestorableColumnState, type RestorableTableState, type RowId, type RowIdCallback, type RowPartsCallback, type RowSelectionMethod, type SortOrder, type SortState, type SortValueCallback, type StorageOptions, type TableControllerOptions, type TableState, type TokenizerCallback, TypedEventTarget, type UnspecifiedRecord, type ValueFormatterCallback, YatlColumnReorderEvent, YatlColumnReorderRequest, YatlColumnResizeEvent, YatlColumnSortEvent, YatlColumnSortRequest, YatlColumnToggleEvent, YatlColumnToggleRequest, YatlEvent, YatlRowClickEvent, YatlRowSelectEvent, YatlRowSelectRequest, YatlTable, YatlTableController, YatlTableSearchEvent, YatlTableStateChangeEvent, YatlTableViewChangeEvent, createRegexTokenizer, createState, findColumn, getColumnStateChanges, getNestedValue, isDisplayColumn, isInternalColumn, isRowIdType, isRowSelectionMethod, setNestedValue, whitespaceTokenizer };
|