@timlassiter11/yatl 1.0.18 → 1.0.19
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/README.md +10 -4
- package/dist/index.d.mts +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.js +529 -415
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +520 -412
- package/dist/index.mjs.map +1 -1
- package/dist/yatl.min.global.js +464 -390
- package/dist/yatl.min.global.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
# YATL (Yet Another Table Library)
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@timlassiter11/yatl)
|
|
4
|
-
[](https://timlassiter11.github.io/YATL/examples/index.html)
|
|
6
|
-
[](LICENSE)
|
|
3
|
+
[](https://www.npmjs.com/package/@timlassiter11/yatl)
|
|
4
|
+
[](LICENSE)
|
|
7
5
|
|
|
8
6
|
YATL is a powerful, feature-rich, and lightweight Web Component data table built with Lit. It handles large datasets with ease using virtual scrolling, offers advanced fuzzy search capabilities, supports state persistence, and works in any framework (React, Vue, Angular, or Vanilla JS).
|
|
9
7
|
|
|
8
|
+
|
|
9
|
+
[Try the Live Demo](https://timlassiter11.github.io/YATL/examples/index.html) | [Check out the Docs](https://timlassiter11.github.io/YATL/docs/index.html)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
|
|
10
15
|
## Why?!?
|
|
11
16
|
|
|
12
17
|
I needed a free and simple table library for vanilla JS that was easy to customize and could handle large datasets... so I created YATL. As the project that I wrote this for grew, so did this library. Now it is a web component built using Lit that is fairly feature rich for simple use cases. There are many other great table libraries out there but if you want something simple to just drop in but with all of the major features already included, YATL might be for you.
|
|
@@ -32,6 +37,7 @@ npm install @timlassiter11/yatl
|
|
|
32
37
|
Alternatively you can manually download the source files from the [releases](https://github.com/timlassiter11/YATL/releases) section.
|
|
33
38
|
|
|
34
39
|
## Examples
|
|
40
|
+
|
|
35
41
|
### Lit
|
|
36
42
|
|
|
37
43
|
```ts
|
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,6 @@ declare global {
|
|
|
20
20
|
declare class YatlButtonGroup extends LitElement {
|
|
21
21
|
static styles: lit.CSSResult[];
|
|
22
22
|
render(): lit_html.TemplateResult<1>;
|
|
23
|
-
private getFlattenedElements;
|
|
24
23
|
private handleSlotChange;
|
|
25
24
|
}
|
|
26
25
|
declare global {
|
|
@@ -44,7 +43,7 @@ declare global {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
|
-
* @
|
|
46
|
+
* @emits yatl-dropdown-toggle - Fired when a dropdown item's checked state changes
|
|
48
47
|
*/
|
|
49
48
|
declare class YatlDropdownItem extends LitElement {
|
|
50
49
|
static styles: lit.CSSResult[];
|
|
@@ -493,6 +492,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
493
492
|
private _rowIdCallback;
|
|
494
493
|
private _data;
|
|
495
494
|
private _filteredData;
|
|
495
|
+
private _dataUpdateTimestamp;
|
|
496
496
|
private _searchQuery;
|
|
497
497
|
private _searchTokenizer;
|
|
498
498
|
private _filters;
|
|
@@ -607,6 +607,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
607
607
|
get data(): T[];
|
|
608
608
|
set data(data: T[]);
|
|
609
609
|
get filteredData(): T[];
|
|
610
|
+
get dataUpdateTimestamp(): Date | null;
|
|
610
611
|
constructor(host?: ReactiveControllerHost, options?: TableControllerOptions<T>);
|
|
611
612
|
attach(host: ReactiveControllerHost): void;
|
|
612
613
|
detach(host: ReactiveControllerHost): void;
|
|
@@ -798,12 +799,12 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
798
799
|
static styles: lit.CSSResult[];
|
|
799
800
|
private tableElement;
|
|
800
801
|
private virtualizer?;
|
|
801
|
-
private dataLastUpdate;
|
|
802
802
|
private resizeState;
|
|
803
803
|
private dragColumn;
|
|
804
804
|
private _controller;
|
|
805
805
|
get controller(): YatlTableController<T>;
|
|
806
806
|
set controller(controller: YatlTableController<T>);
|
|
807
|
+
striped: boolean;
|
|
807
808
|
/**
|
|
808
809
|
* Default sortability for all columns.
|
|
809
810
|
* Can be overridden by setting `sortable` on the specific column definition.
|
|
@@ -975,6 +976,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
975
976
|
get data(): T[];
|
|
976
977
|
set data(value: T[]);
|
|
977
978
|
get filteredData(): T[];
|
|
979
|
+
get dataUpdateTimestamp(): Date | null;
|
|
978
980
|
getColumn(field: NestedKeyOf<T>): ColumnOptions<T> | undefined;
|
|
979
981
|
getDisplayColumn(field: NestedKeyOf<T>): DisplayColumnOptions<T> | undefined;
|
|
980
982
|
/**
|
|
@@ -1191,6 +1193,9 @@ declare global {
|
|
|
1191
1193
|
*
|
|
1192
1194
|
* @slot - Adds contents to the right of the toolbar button group
|
|
1193
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.
|
|
1194
1199
|
*
|
|
1195
1200
|
* @fires yatl-toolbar-search-input - Fired synchronously as the user types in the search box. Useful for real-time highlighting or suggestions.
|
|
1196
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.
|
|
@@ -1220,4 +1225,20 @@ declare global {
|
|
|
1220
1225
|
}
|
|
1221
1226
|
}
|
|
1222
1227
|
|
|
1223
|
-
|
|
1228
|
+
declare function findColumn<TData extends Record<string, unknown>, TCol extends {
|
|
1229
|
+
field: NestedKeyOf<TData>;
|
|
1230
|
+
}>(columns: TCol[], field: NestedKeyOf<TData>): TCol | undefined;
|
|
1231
|
+
declare function isInternalColumn<T>(col: ColumnOptions<T> | undefined | null): col is InternalColumnOptions<T>;
|
|
1232
|
+
declare function isDisplayColumn<T>(col: ColumnOptions<T> | undefined | null): col is DisplayColumnOptions<T>;
|
|
1233
|
+
declare function createState<T>(field: NestedKeyOf<T>, defaults?: Partial<ColumnState<T>>): ColumnState<T>;
|
|
1234
|
+
|
|
1235
|
+
declare const createRegexTokenizer: (exp?: string) => (value: string) => {
|
|
1236
|
+
value: string;
|
|
1237
|
+
quoted: boolean;
|
|
1238
|
+
}[];
|
|
1239
|
+
declare const whitespaceTokenizer: (value: string) => {
|
|
1240
|
+
value: string;
|
|
1241
|
+
quoted: boolean;
|
|
1242
|
+
}[];
|
|
1243
|
+
|
|
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, YatlButton, YatlButtonGroup, YatlColumnReorderEvent, YatlColumnReorderRequestEvent, YatlColumnResizeEvent, YatlColumnSortEvent, YatlColumnSortRequestEvent, YatlColumnToggleEvent, YatlColumnToggleRequestEvent, YatlDropdown, YatlDropdownItem, YatlDropdownToggleEvent, YatlEvent, YatlRowClickEvent, YatlRowSelectEvent, YatlRowSelectRequestEvent, YatlTable, YatlTableController, YatlTableSearchEvent, YatlTableStateChangeEvent, YatlTableUi, YatlTableViewChangeEvent, YatlToolbar, YatlToolbarExportClick, YatlToolbarSearchChange, YatlToolbarSearchInput, createRegexTokenizer, createState, findColumn, isDisplayColumn, isInternalColumn, whitespaceTokenizer };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ declare global {
|
|
|
20
20
|
declare class YatlButtonGroup extends LitElement {
|
|
21
21
|
static styles: lit.CSSResult[];
|
|
22
22
|
render(): lit_html.TemplateResult<1>;
|
|
23
|
-
private getFlattenedElements;
|
|
24
23
|
private handleSlotChange;
|
|
25
24
|
}
|
|
26
25
|
declare global {
|
|
@@ -44,7 +43,7 @@ declare global {
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
/**
|
|
47
|
-
* @
|
|
46
|
+
* @emits yatl-dropdown-toggle - Fired when a dropdown item's checked state changes
|
|
48
47
|
*/
|
|
49
48
|
declare class YatlDropdownItem extends LitElement {
|
|
50
49
|
static styles: lit.CSSResult[];
|
|
@@ -493,6 +492,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
493
492
|
private _rowIdCallback;
|
|
494
493
|
private _data;
|
|
495
494
|
private _filteredData;
|
|
495
|
+
private _dataUpdateTimestamp;
|
|
496
496
|
private _searchQuery;
|
|
497
497
|
private _searchTokenizer;
|
|
498
498
|
private _filters;
|
|
@@ -607,6 +607,7 @@ declare class YatlTableController<T extends object = UnspecifiedRecord> implemen
|
|
|
607
607
|
get data(): T[];
|
|
608
608
|
set data(data: T[]);
|
|
609
609
|
get filteredData(): T[];
|
|
610
|
+
get dataUpdateTimestamp(): Date | null;
|
|
610
611
|
constructor(host?: ReactiveControllerHost, options?: TableControllerOptions<T>);
|
|
611
612
|
attach(host: ReactiveControllerHost): void;
|
|
612
613
|
detach(host: ReactiveControllerHost): void;
|
|
@@ -798,12 +799,12 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
798
799
|
static styles: lit.CSSResult[];
|
|
799
800
|
private tableElement;
|
|
800
801
|
private virtualizer?;
|
|
801
|
-
private dataLastUpdate;
|
|
802
802
|
private resizeState;
|
|
803
803
|
private dragColumn;
|
|
804
804
|
private _controller;
|
|
805
805
|
get controller(): YatlTableController<T>;
|
|
806
806
|
set controller(controller: YatlTableController<T>);
|
|
807
|
+
striped: boolean;
|
|
807
808
|
/**
|
|
808
809
|
* Default sortability for all columns.
|
|
809
810
|
* Can be overridden by setting `sortable` on the specific column definition.
|
|
@@ -975,6 +976,7 @@ declare class YatlTable<T extends object = UnspecifiedRecord> extends LitElement
|
|
|
975
976
|
get data(): T[];
|
|
976
977
|
set data(value: T[]);
|
|
977
978
|
get filteredData(): T[];
|
|
979
|
+
get dataUpdateTimestamp(): Date | null;
|
|
978
980
|
getColumn(field: NestedKeyOf<T>): ColumnOptions<T> | undefined;
|
|
979
981
|
getDisplayColumn(field: NestedKeyOf<T>): DisplayColumnOptions<T> | undefined;
|
|
980
982
|
/**
|
|
@@ -1191,6 +1193,9 @@ declare global {
|
|
|
1191
1193
|
*
|
|
1192
1194
|
* @slot - Adds contents to the right of the toolbar button group
|
|
1193
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.
|
|
1194
1199
|
*
|
|
1195
1200
|
* @fires yatl-toolbar-search-input - Fired synchronously as the user types in the search box. Useful for real-time highlighting or suggestions.
|
|
1196
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.
|
|
@@ -1220,4 +1225,20 @@ declare global {
|
|
|
1220
1225
|
}
|
|
1221
1226
|
}
|
|
1222
1227
|
|
|
1223
|
-
|
|
1228
|
+
declare function findColumn<TData extends Record<string, unknown>, TCol extends {
|
|
1229
|
+
field: NestedKeyOf<TData>;
|
|
1230
|
+
}>(columns: TCol[], field: NestedKeyOf<TData>): TCol | undefined;
|
|
1231
|
+
declare function isInternalColumn<T>(col: ColumnOptions<T> | undefined | null): col is InternalColumnOptions<T>;
|
|
1232
|
+
declare function isDisplayColumn<T>(col: ColumnOptions<T> | undefined | null): col is DisplayColumnOptions<T>;
|
|
1233
|
+
declare function createState<T>(field: NestedKeyOf<T>, defaults?: Partial<ColumnState<T>>): ColumnState<T>;
|
|
1234
|
+
|
|
1235
|
+
declare const createRegexTokenizer: (exp?: string) => (value: string) => {
|
|
1236
|
+
value: string;
|
|
1237
|
+
quoted: boolean;
|
|
1238
|
+
}[];
|
|
1239
|
+
declare const whitespaceTokenizer: (value: string) => {
|
|
1240
|
+
value: string;
|
|
1241
|
+
quoted: boolean;
|
|
1242
|
+
}[];
|
|
1243
|
+
|
|
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, YatlButton, YatlButtonGroup, YatlColumnReorderEvent, YatlColumnReorderRequestEvent, YatlColumnResizeEvent, YatlColumnSortEvent, YatlColumnSortRequestEvent, YatlColumnToggleEvent, YatlColumnToggleRequestEvent, YatlDropdown, YatlDropdownItem, YatlDropdownToggleEvent, YatlEvent, YatlRowClickEvent, YatlRowSelectEvent, YatlRowSelectRequestEvent, YatlTable, YatlTableController, YatlTableSearchEvent, YatlTableStateChangeEvent, YatlTableUi, YatlTableViewChangeEvent, YatlToolbar, YatlToolbarExportClick, YatlToolbarSearchChange, YatlToolbarSearchInput, createRegexTokenizer, createState, findColumn, isDisplayColumn, isInternalColumn, whitespaceTokenizer };
|