Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
table-search-issue debounce in search of f-table-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr committed Jun 11, 2024
1 parent 265dea5 commit b9862d6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/flow-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# Change Log

## [2.9.13] - 2024-06-11

### Improvements

- `getComputedStyle` api usage removed, since it might cause render delay.

## [2.9.12] - 2024-05-27

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ollion/flow-core",
"version": "2.9.12",
"version": "2.9.13",
"description": "Core package of flow design system",
"module": "dist/flow-core.es.js",
"main": "dist/flow-core.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ $hexagon-clip-path: polygon(
}

&[variant="hexagon"] {
clip-path: $hexagon-clip-path;
&:after {
clip-path: $hexagon-clip-path;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/flow-table/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

# Change Log

## [2.4.7] - 2024-06-11

### Improvements

- `f-table-schema` 300ms debounce added in search to avoid browser freeze.

## [2.4.6] - 2024-05-27

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-table/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ollion/flow-table",
"version": "2.4.6",
"version": "2.4.7",
"description": "Table component for flow library",
"module": "dist/flow-table.es.js",
"main": "dist/flow-table.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,16 @@ export class FTableSchema extends FRoot {
@query("#f-table-element")
tableElement?: FTable;

@query("#f-table-search")
tableSearchElement!: FSearch;

@query(".f-table-schema-wrapper")
fTableWrapper!: HTMLDivElement;

nextEmitted = false;

searchTimeout?: number;

get max() {
return this.rowsPerPage ?? 50;
}
Expand Down Expand Up @@ -411,8 +416,14 @@ export class FTableSchema extends FRoot {
}

search(event: CustomEvent) {
this.searchScope = event.detail.scope;
this.searchTerm = event.detail.value;
this.tableSearchElement.loading = true;
if (this.searchTimeout) {
clearTimeout(this.searchTimeout);
}
this.searchTimeout = setTimeout(() => {
this.searchScope = event.detail.scope;
this.searchTerm = event.detail.value;
}, 300);
}
get noDataTemplate() {
if (this.data.rows.length === 0 && this.data.header) {
Expand Down Expand Up @@ -445,6 +456,7 @@ export class FTableSchema extends FRoot {
.width=${this.offsetWidth ? `${this.offsetWidth}px` : `100%`}
>
<f-search
id="f-table-search"
.scope=${["all", ...Object.keys(this.data.header)]}
.selected-scope=${this.searchScope}
.value=${this.searchTerm}
Expand Down Expand Up @@ -523,6 +535,7 @@ export class FTableSchema extends FRoot {
if (this.tableElement) {
await this.tableElement.updateHeaderSelectionCheckboxState();
}
this.tableSearchElement.loading = false;
});
}

Expand Down

0 comments on commit b9862d6

Please sign in to comment.