@timlassiter11/yatl 1.0.19 → 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 +87 -177
- package/dist/index.d.ts +87 -177
- package/dist/index.js +548 -1263
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +538 -1244
- package/dist/index.mjs.map +1 -1
- package/dist/theme.css +52 -0
- package/dist/yatl.min.global.js +103 -629
- package/dist/yatl.min.global.js.map +1 -1
- package/package.json +8 -12
- package/LICENSE +0 -21
- package/README.md +0 -380
package/dist/index.d.mts
CHANGED
|
@@ -1,62 +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 handleSlotChange;
|
|
24
|
-
}
|
|
25
|
-
declare global {
|
|
26
|
-
interface HTMLElementTagNameMap {
|
|
27
|
-
'yatl-button-group': YatlButtonGroup;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare class YatlDropdown extends LitElement {
|
|
32
|
-
static styles: lit.CSSResult[];
|
|
33
|
-
private detailsElement;
|
|
34
|
-
open: boolean;
|
|
35
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
36
|
-
private handleDropdownTriggerClick;
|
|
37
|
-
private handleDocumentClick;
|
|
38
|
-
}
|
|
39
|
-
declare global {
|
|
40
|
-
interface HTMLElementTagNameMap {
|
|
41
|
-
'yatl-dropdown': YatlDropdown;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @emits yatl-dropdown-toggle - Fired when a dropdown item's checked state changes
|
|
47
|
-
*/
|
|
48
|
-
declare class YatlDropdownItem extends LitElement {
|
|
49
|
-
static styles: lit.CSSResult[];
|
|
50
|
-
value: string;
|
|
51
|
-
checked: boolean;
|
|
52
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
53
|
-
private handleCheckboxChanged;
|
|
54
|
-
}
|
|
55
|
-
declare global {
|
|
56
|
-
interface HTMLElementTagNameMap {
|
|
57
|
-
'yatl-dropdown-item': YatlDropdownItem;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
4
|
|
|
61
5
|
type NestedKeyOf<ObjectType> = ObjectType extends object ? {
|
|
62
6
|
[Key in keyof ObjectType & (string | number)]: NonNullable<ObjectType[Key]> extends unknown[] ? `${Key}` : NonNullable<ObjectType[Key]> extends object ? // Recurse with the non-nullable type
|
|
@@ -66,6 +10,9 @@ type NestedKeyOf<ObjectType> = ObjectType extends object ? {
|
|
|
66
10
|
* Default type for the table.
|
|
67
11
|
*/
|
|
68
12
|
type UnspecifiedRecord = Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* Valid types for Row IDs
|
|
15
|
+
*/
|
|
69
16
|
type RowId = string | number;
|
|
70
17
|
/**
|
|
71
18
|
* Known compareable type
|
|
@@ -228,7 +175,7 @@ interface InternalColumnOptions<T> extends BaseColumnOptions<T> {
|
|
|
228
175
|
* Marks this column as internal-only.
|
|
229
176
|
* It will be indexed for search and filtering, but strictly excluded from the UI.
|
|
230
177
|
*/
|
|
231
|
-
|
|
178
|
+
role: 'internal';
|
|
232
179
|
}
|
|
233
180
|
type ColumnOptions<T> = DisplayColumnOptions<T> | InternalColumnOptions<T>;
|
|
234
181
|
/**
|
|
@@ -288,6 +235,10 @@ type RowSelectionMethod = 'single' | 'multi';
|
|
|
288
235
|
* @returns the part string or list of part strings that should be added to this row.
|
|
289
236
|
*/
|
|
290
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
|
+
*/
|
|
291
242
|
interface StorageOptions {
|
|
292
243
|
/**
|
|
293
244
|
* The unique key used to store the table state in the browser.
|
|
@@ -333,11 +284,20 @@ interface TableState<T> {
|
|
|
333
284
|
type RestorableTableState<T> = Partial<Omit<TableState<T>, 'columns'>> & {
|
|
334
285
|
columns?: RestorableColumnState<T>[];
|
|
335
286
|
};
|
|
287
|
+
/**
|
|
288
|
+
* Options for configuring what date should be exported.
|
|
289
|
+
*/
|
|
336
290
|
interface ExportOptions {
|
|
291
|
+
/** Include all rows including filtered out rows */
|
|
337
292
|
includeAllRows?: boolean;
|
|
293
|
+
/** Include columns that have been hidden */
|
|
338
294
|
includeHiddenColumns?: boolean;
|
|
295
|
+
/** Include columns marked as internal */
|
|
339
296
|
includeInternalColumns?: boolean;
|
|
340
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Options for configuring a table controller
|
|
300
|
+
*/
|
|
341
301
|
interface TableControllerOptions<T extends object> {
|
|
342
302
|
enableSearchTokenization?: boolean;
|
|
343
303
|
enableSearchScoring?: boolean;
|
|
@@ -352,8 +312,9 @@ interface TableControllerOptions<T extends object> {
|
|
|
352
312
|
/**
|
|
353
313
|
* Base event class that bubbles and is composed.
|
|
354
314
|
*/
|
|
355
|
-
declare class YatlEvent extends Event {
|
|
315
|
+
declare abstract class YatlEvent extends Event {
|
|
356
316
|
constructor(name: string, options?: EventInit);
|
|
317
|
+
abstract clone(): YatlEvent;
|
|
357
318
|
}
|
|
358
319
|
declare class YatlRowClickEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
359
320
|
readonly row: T;
|
|
@@ -363,26 +324,30 @@ declare class YatlRowClickEvent<T extends object = UnspecifiedRecord> extends Ya
|
|
|
363
324
|
readonly originalEvent: MouseEvent;
|
|
364
325
|
static readonly EVENT_NAME = "yatl-row-click";
|
|
365
326
|
constructor(row: T, rowId: RowId, index: number, field: NestedKeyOf<T>, originalEvent: MouseEvent);
|
|
327
|
+
clone(): YatlRowClickEvent<T>;
|
|
366
328
|
}
|
|
367
|
-
declare class
|
|
329
|
+
declare class YatlRowSelectRequest extends YatlEvent {
|
|
368
330
|
readonly rowId: RowId;
|
|
369
331
|
readonly selected: boolean;
|
|
370
332
|
readonly currentlySelectedRows: RowId[];
|
|
371
333
|
static readonly EVENT_NAME = "yatl-row-select-request";
|
|
372
334
|
constructor(rowId: RowId, selected: boolean, currentlySelectedRows: RowId[]);
|
|
335
|
+
clone(): YatlRowSelectRequest;
|
|
373
336
|
}
|
|
374
337
|
declare class YatlRowSelectEvent extends YatlEvent {
|
|
375
338
|
readonly selectedIds: RowId[];
|
|
376
339
|
readonly previouslySelectedRows: RowId[];
|
|
377
340
|
static readonly EVENT_NAME = "yatl-row-select";
|
|
378
341
|
constructor(selectedIds: RowId[], previouslySelectedRows: RowId[]);
|
|
342
|
+
clone(): YatlRowSelectEvent;
|
|
379
343
|
}
|
|
380
|
-
declare class
|
|
344
|
+
declare class YatlColumnSortRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
381
345
|
readonly field: NestedKeyOf<T>;
|
|
382
346
|
readonly order: SortOrder | null;
|
|
383
347
|
readonly multisort: boolean;
|
|
384
348
|
static readonly EVENT_NAME = "yatl-column-sort-request";
|
|
385
349
|
constructor(field: NestedKeyOf<T>, order: SortOrder | null, multisort: boolean);
|
|
350
|
+
clone(): YatlColumnSortRequest<T>;
|
|
386
351
|
}
|
|
387
352
|
declare class YatlColumnSortEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
388
353
|
readonly field: NestedKeyOf<T>;
|
|
@@ -390,96 +355,88 @@ declare class YatlColumnSortEvent<T extends object = UnspecifiedRecord> extends
|
|
|
390
355
|
readonly multisort: boolean;
|
|
391
356
|
static readonly EVENT_NAME = "yatl-column-sort";
|
|
392
357
|
constructor(field: NestedKeyOf<T>, order: SortOrder | null, multisort: boolean);
|
|
358
|
+
clone(): YatlColumnSortEvent<T>;
|
|
393
359
|
}
|
|
394
|
-
declare class
|
|
395
|
-
readonly field:
|
|
360
|
+
declare class YatlColumnToggleRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
361
|
+
readonly field: NestedKeyOf<T>;
|
|
396
362
|
readonly visibility: boolean;
|
|
397
363
|
static readonly EVENT_NAME = "yatl-column-toggle-request";
|
|
398
|
-
constructor(field:
|
|
364
|
+
constructor(field: NestedKeyOf<T>, visibility: boolean);
|
|
365
|
+
clone(): YatlColumnToggleRequest<T>;
|
|
399
366
|
}
|
|
400
367
|
declare class YatlColumnToggleEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
401
368
|
readonly field: NestedKeyOf<T>;
|
|
402
369
|
readonly visible: boolean;
|
|
403
370
|
static readonly EVENT_NAME = "yatl-column-toggle";
|
|
404
371
|
constructor(field: NestedKeyOf<T>, visible: boolean);
|
|
372
|
+
clone(): YatlColumnToggleEvent<T>;
|
|
405
373
|
}
|
|
406
374
|
declare class YatlColumnResizeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
407
375
|
readonly field: NestedKeyOf<T>;
|
|
408
376
|
readonly width: number | null;
|
|
409
377
|
static readonly EVENT_NAME = "yatl-column-resize";
|
|
410
378
|
constructor(field: NestedKeyOf<T>, width: number | null);
|
|
379
|
+
clone(): YatlColumnResizeEvent<T>;
|
|
411
380
|
}
|
|
412
|
-
declare class
|
|
381
|
+
declare class YatlColumnReorderRequest<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
413
382
|
readonly movedColumn: NestedKeyOf<T>;
|
|
414
383
|
readonly originalIndex: number;
|
|
415
384
|
readonly newIndex: number;
|
|
416
385
|
static readonly EVENT_NAME = "yatl-column-reorder-request";
|
|
417
386
|
constructor(movedColumn: NestedKeyOf<T>, originalIndex: number, newIndex: number);
|
|
387
|
+
clone(): YatlColumnReorderRequest<T>;
|
|
418
388
|
}
|
|
419
389
|
declare class YatlColumnReorderEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
420
390
|
readonly order: NestedKeyOf<T>[];
|
|
421
391
|
static readonly EVENT_NAME = "yatl-column-reorder";
|
|
422
392
|
constructor(order: NestedKeyOf<T>[]);
|
|
393
|
+
clone(): YatlColumnReorderEvent<T>;
|
|
423
394
|
}
|
|
424
395
|
declare class YatlTableSearchEvent extends YatlEvent {
|
|
425
396
|
readonly query: string;
|
|
426
397
|
static readonly EVENT_NAME = "yatl-table-search";
|
|
427
398
|
constructor(query: string);
|
|
399
|
+
clone(): YatlTableSearchEvent;
|
|
428
400
|
}
|
|
429
401
|
declare class YatlTableViewChangeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
430
402
|
readonly data: T[];
|
|
431
403
|
static readonly EVENT_NAME = "yatl-table-view-change";
|
|
432
404
|
constructor(data: T[]);
|
|
405
|
+
clone(): YatlTableViewChangeEvent<T>;
|
|
433
406
|
}
|
|
434
407
|
declare class YatlTableStateChangeEvent<T extends object = UnspecifiedRecord> extends YatlEvent {
|
|
435
408
|
readonly state: TableState<T>;
|
|
436
409
|
readonly triggers: string[];
|
|
437
410
|
static readonly EVENT_NAME = "yatl-table-state-change";
|
|
438
411
|
constructor(state: TableState<T>, triggers: string[]);
|
|
439
|
-
|
|
440
|
-
declare class YatlDropdownToggleEvent extends YatlEvent {
|
|
441
|
-
readonly value: string;
|
|
442
|
-
readonly checked: boolean;
|
|
443
|
-
static readonly EVENT_NAME = "yatl-dropdown-toggle";
|
|
444
|
-
constructor(value: string, checked: boolean);
|
|
445
|
-
}
|
|
446
|
-
declare class YatlToolbarSearchInput extends YatlEvent {
|
|
447
|
-
readonly value: string;
|
|
448
|
-
static readonly EVENT_NAME = "yatl-toolbar-search-input";
|
|
449
|
-
constructor(value: string);
|
|
450
|
-
}
|
|
451
|
-
declare class YatlToolbarSearchChange extends YatlEvent {
|
|
452
|
-
readonly value: string;
|
|
453
|
-
static readonly EVENT_NAME = "yatl-toolbar-search-change";
|
|
454
|
-
constructor(value: string);
|
|
455
|
-
}
|
|
456
|
-
declare class YatlToolbarExportClick extends YatlEvent {
|
|
457
|
-
static readonly EVENT_NAME = "yatl-toolbar-export-click";
|
|
458
|
-
constructor();
|
|
412
|
+
clone(): YatlTableStateChangeEvent<T>;
|
|
459
413
|
}
|
|
460
414
|
declare global {
|
|
461
415
|
interface HTMLElementEventMap {
|
|
462
416
|
[YatlRowClickEvent.EVENT_NAME]: YatlRowClickEvent;
|
|
463
|
-
[
|
|
417
|
+
[YatlRowSelectRequest.EVENT_NAME]: YatlRowSelectRequest;
|
|
464
418
|
[YatlRowSelectEvent.EVENT_NAME]: YatlRowSelectEvent;
|
|
465
|
-
[
|
|
419
|
+
[YatlColumnSortRequest.EVENT_NAME]: YatlColumnSortRequest;
|
|
466
420
|
[YatlColumnSortEvent.EVENT_NAME]: YatlColumnSortEvent;
|
|
467
|
-
[
|
|
421
|
+
[YatlColumnToggleRequest.EVENT_NAME]: YatlColumnToggleRequest;
|
|
468
422
|
[YatlColumnToggleEvent.EVENT_NAME]: YatlColumnToggleEvent;
|
|
469
423
|
[YatlColumnResizeEvent.EVENT_NAME]: YatlColumnResizeEvent;
|
|
470
|
-
[
|
|
424
|
+
[YatlColumnReorderRequest.EVENT_NAME]: YatlColumnReorderRequest;
|
|
471
425
|
[YatlColumnReorderEvent.EVENT_NAME]: YatlColumnReorderEvent;
|
|
472
426
|
[YatlTableSearchEvent.EVENT_NAME]: YatlTableSearchEvent;
|
|
473
427
|
[YatlTableViewChangeEvent.EVENT_NAME]: YatlTableViewChangeEvent;
|
|
474
428
|
[YatlTableStateChangeEvent.EVENT_NAME]: YatlTableStateChangeEvent;
|
|
475
|
-
[YatlDropdownToggleEvent.EVENT_NAME]: YatlDropdownToggleEvent;
|
|
476
|
-
[YatlToolbarSearchInput.EVENT_NAME]: YatlToolbarSearchInput;
|
|
477
|
-
[YatlToolbarSearchChange.EVENT_NAME]: YatlToolbarSearchChange;
|
|
478
|
-
[YatlToolbarExportClick.EVENT_NAME]: YatlToolbarExportClick;
|
|
479
429
|
}
|
|
480
430
|
}
|
|
481
431
|
|
|
482
|
-
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 {
|
|
483
440
|
private hosts;
|
|
484
441
|
private _enableSearchTokenization;
|
|
485
442
|
private _enableSearchScoring;
|
|
@@ -625,6 +582,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
625
582
|
getColumnState(field: NestedKeyOf<T>): ColumnState<T>;
|
|
626
583
|
updateColumnState(field: NestedKeyOf<T>, state: RestorableColumnState<T>): void;
|
|
627
584
|
search(query: string): void;
|
|
585
|
+
getColumnFilterValues(field: NestedKeyOf<T>, includeNull?: boolean): Map<unknown, number>;
|
|
628
586
|
/**
|
|
629
587
|
* Sorts the table by a specified column and order.
|
|
630
588
|
* If `order` is `null`, the sort on this column is removed.
|
|
@@ -680,8 +638,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
680
638
|
deselectAll(): void;
|
|
681
639
|
/**
|
|
682
640
|
* Export the current visible table data to a CSV file.
|
|
683
|
-
* @param
|
|
684
|
-
* @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.
|
|
685
642
|
*/
|
|
686
643
|
export(options?: ExportOptions): Blob;
|
|
687
644
|
/**
|
|
@@ -729,18 +686,17 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
729
686
|
updateRowAtIndex(index: number, data: Partial<T>): void;
|
|
730
687
|
/**
|
|
731
688
|
* Deletes the row with the matching ID.
|
|
732
|
-
* @param
|
|
689
|
+
* @param rowIds - The IDs rows to delete
|
|
733
690
|
*/
|
|
734
691
|
deleteRow(...rowIds: RowId[]): void;
|
|
735
692
|
/**
|
|
736
693
|
* Deletes a row at a specific original index from the table.
|
|
737
|
-
* @param
|
|
694
|
+
* @param indexes - The original indexes of rows to delete.
|
|
738
695
|
*/
|
|
739
696
|
deleteRowAtIndex(...indexes: number[]): void;
|
|
740
697
|
getRowId(row: T): RowId;
|
|
741
698
|
getRowIndex(row: T): number;
|
|
742
699
|
getRowHighlightIndicies(row: T): Record<string, [number, number][]> | undefined;
|
|
743
|
-
private dispatchEvent;
|
|
744
700
|
hostConnected(): void;
|
|
745
701
|
hostDisconnected(): void;
|
|
746
702
|
hostUpdate(): void;
|
|
@@ -774,6 +730,16 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
774
730
|
private saveStateToStorage;
|
|
775
731
|
private loadStateFromStorage;
|
|
776
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
|
+
};
|
|
777
743
|
|
|
778
744
|
/**
|
|
779
745
|
* A virtualized data table capable of handling complex sorting, filtering, and tokenized searching.
|
|
@@ -801,6 +767,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
801
767
|
private virtualizer?;
|
|
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>);
|
|
@@ -1045,7 +1012,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1045
1012
|
/**
|
|
1046
1013
|
* Export the current visible table data to a CSV file.
|
|
1047
1014
|
* @param filename - The name of the file to save.
|
|
1048
|
-
* @param
|
|
1015
|
+
* @param options - Options for configuring what should be exported.
|
|
1049
1016
|
*/
|
|
1050
1017
|
export(filename: string, options?: ExportOptions): void;
|
|
1051
1018
|
scrollToRow(row: T): Promise<void>;
|
|
@@ -1101,7 +1068,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1101
1068
|
updateRowAtIndex(index: number, data: Partial<T>): void;
|
|
1102
1069
|
/**
|
|
1103
1070
|
* Deletes the row with the matching ID.
|
|
1104
|
-
* @param
|
|
1071
|
+
* @param rowIds - The IDs rows to delete
|
|
1105
1072
|
*/
|
|
1106
1073
|
deleteRow(...rowIds: RowId[]): void;
|
|
1107
1074
|
/**
|
|
@@ -1117,6 +1084,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1117
1084
|
protected renderHeader(): TemplateResult<1>;
|
|
1118
1085
|
protected renderCellContents(value: unknown, column: DisplayColumnOptions<T>, row: T): {} | null | undefined;
|
|
1119
1086
|
protected renderCell(column: DisplayColumnOptions<T>, row: T): TemplateResult<1>;
|
|
1087
|
+
protected renderCheckbox(row: T, selected: boolean): TemplateResult<1>;
|
|
1120
1088
|
protected renderRowSelectorCell(row: T, selected: boolean): TemplateResult<1>;
|
|
1121
1089
|
protected renderRowNumberCell(rowNumber: number): TemplateResult<1>;
|
|
1122
1090
|
protected renderRow(row: T, renderIndex: number): TemplateResult<1>;
|
|
@@ -1124,7 +1092,12 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
1124
1092
|
protected renderFooter(): TemplateResult<1> | typeof nothing;
|
|
1125
1093
|
protected render(): TemplateResult<1>;
|
|
1126
1094
|
private renderCellWrapper;
|
|
1095
|
+
connectedCallback(): void;
|
|
1127
1096
|
disconnectedCallback(): void;
|
|
1097
|
+
private readonly eventNames;
|
|
1098
|
+
private addControllerListeners;
|
|
1099
|
+
private removeControllerListeners;
|
|
1100
|
+
private redispatchControllerEvent;
|
|
1128
1101
|
private hasVisibleColumn;
|
|
1129
1102
|
/**
|
|
1130
1103
|
* Gets the width of each column in the
|
|
@@ -1150,87 +1123,24 @@ declare global {
|
|
|
1150
1123
|
}
|
|
1151
1124
|
}
|
|
1152
1125
|
|
|
1153
|
-
/**
|
|
1154
|
-
* A "Batteries Included" wrapper for `<yatl-table>` that provides a built-in toolbar.
|
|
1155
|
-
*
|
|
1156
|
-
* This element extends the core table engine to automatically render UI controls
|
|
1157
|
-
* for common user actions, such as toggling column visibility and exporting data.
|
|
1158
|
-
*
|
|
1159
|
-
* It inherits all properties and events from `<yatl-table>`.
|
|
1160
|
-
*
|
|
1161
|
-
* @element yatl-table-ui
|
|
1162
|
-
*
|
|
1163
|
-
* @slot toolbar - Adds contents to the right of the toolbar button group
|
|
1164
|
-
* @slot toolbar-button-group - Adds content into the toolbar button group.
|
|
1165
|
-
* @slot footer - Inherited from `yatl-table`. Content to display in the table footer area.
|
|
1166
|
-
* @slot body - Inherited from `yatl-table`. Custom rendering for the table body.
|
|
1167
|
-
*/
|
|
1168
|
-
declare class YatlTableUi<T extends object = UnspecifiedRecord> extends YatlTable<T> {
|
|
1169
|
-
static styles: lit.CSSResult[];
|
|
1170
|
-
/**
|
|
1171
|
-
* Toggles the visibility of the column picker button in the toolbar. Defaults to `true`.
|
|
1172
|
-
*/
|
|
1173
|
-
showColumnPicker: boolean;
|
|
1174
|
-
/**
|
|
1175
|
-
* Toggles the visibility of the CSV export button in the toolbar. Defaults to `true`.
|
|
1176
|
-
*/
|
|
1177
|
-
showExportButton: boolean;
|
|
1178
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
1179
|
-
private handleTableExportClicked;
|
|
1180
|
-
}
|
|
1181
|
-
declare global {
|
|
1182
|
-
interface HTMLElementTagNameMap {
|
|
1183
|
-
'yatl-table-ui': YatlTableUi;
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
/**
|
|
1188
|
-
* A table toolbar component with a search input, column picker, and export button.
|
|
1189
|
-
*
|
|
1190
|
-
* @element yatl-toolbar
|
|
1191
|
-
* @summary Provides a cohesive set of controls for searching, exporting, and managing column visibility,
|
|
1192
|
-
* along with a flexible slot for custom actions.
|
|
1193
|
-
*
|
|
1194
|
-
* @slot - Adds contents to the right of the toolbar button group
|
|
1195
|
-
* @slot toolbar-button-group - Adds content into the toolbar button group.
|
|
1196
|
-
* @slot column-picker-trigger - Replaces the button used to trigger the column picker.
|
|
1197
|
-
* @slot column-picker-icon - Replaces the icon for the column picker button.
|
|
1198
|
-
* @slot export-button-icon - Replaces the icon for the export button.
|
|
1199
|
-
*
|
|
1200
|
-
* @fires yatl-toolbar-search-input - Fired synchronously as the user types in the search box. Useful for real-time highlighting or suggestions.
|
|
1201
|
-
* @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.
|
|
1202
|
-
* @fires yatl-toolbar-export-click - Fired when the export button is clicked. Payload indicates the requested format.
|
|
1203
|
-
* @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.
|
|
1204
|
-
*
|
|
1205
|
-
*/
|
|
1206
|
-
declare class YatlToolbar<T extends object = UnspecifiedRecord> extends LitElement {
|
|
1207
|
-
static styles: lit.CSSResult[];
|
|
1208
|
-
private _controller?;
|
|
1209
|
-
get controller(): YatlTableController<T> | undefined;
|
|
1210
|
-
set controller(controller: YatlTableController<T> | undefined);
|
|
1211
|
-
showColumnPicker: boolean;
|
|
1212
|
-
showExportButton: boolean;
|
|
1213
|
-
protected render(): lit_html.TemplateResult<1>;
|
|
1214
|
-
protected renderColumnPicker(): lit_html.TemplateResult<1>;
|
|
1215
|
-
protected renderColumnVisibilityToggle(column: DisplayColumnOptions<T>): lit_html.TemplateResult<1>;
|
|
1216
|
-
private handleDropdownToggle;
|
|
1217
|
-
protected renderExportButton(): lit_html.TemplateResult<1>;
|
|
1218
|
-
private onSearchInput;
|
|
1219
|
-
private onSearchChange;
|
|
1220
|
-
private onExportClick;
|
|
1221
|
-
}
|
|
1222
|
-
declare global {
|
|
1223
|
-
interface HTMLElementTagNameMap {
|
|
1224
|
-
'yatl-toolbar': YatlToolbar;
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
1126
|
declare function findColumn<TData extends Record<string, unknown>, TCol extends {
|
|
1229
1127
|
field: NestedKeyOf<TData>;
|
|
1230
1128
|
}>(columns: TCol[], field: NestedKeyOf<TData>): TCol | undefined;
|
|
1231
1129
|
declare function isInternalColumn<T>(col: ColumnOptions<T> | undefined | null): col is InternalColumnOptions<T>;
|
|
1232
1130
|
declare function isDisplayColumn<T>(col: ColumnOptions<T> | undefined | null): col is DisplayColumnOptions<T>;
|
|
1233
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>)[];
|
|
1133
|
+
|
|
1134
|
+
declare function isRowIdType(value: unknown): value is RowId;
|
|
1135
|
+
declare function isRowSelectionMethod(value: string | null): value is RowSelectionMethod;
|
|
1136
|
+
/**
|
|
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
|
|
1141
|
+
*/
|
|
1142
|
+
declare function getNestedValue(obj: object, path: string): unknown;
|
|
1143
|
+
declare function setNestedValue(obj: object, path: string, value: unknown): void;
|
|
1234
1144
|
|
|
1235
1145
|
declare const createRegexTokenizer: (exp?: string) => (value: string) => {
|
|
1236
1146
|
value: string;
|
|
@@ -1241,4 +1151,4 @@ declare const whitespaceTokenizer: (value: string) => {
|
|
|
1241
1151
|
quoted: boolean;
|
|
1242
1152
|
}[];
|
|
1243
1153
|
|
|
1244
|
-
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 };
|