Skip to content

Commit

Permalink
fix(table): upgrade gridjs to version 6.0.6
Browse files Browse the repository at this point in the history
This upgrades gridjs to version 6.0.6. This version includes a fix for a bug that was causing
the table to not resize when the resizable property was set to true.
  • Loading branch information
dominicegginton committed Aug 4, 2023
1 parent 8bcd45a commit 60209b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@floating-ui/dom": "^0.3.1",
"@lit-labs/react": "^1.1.0",
"date-fns": "^2.29.1",
"gridjs": "^5.0.2",
"gridjs": "6.0.6",
"lit": "^2.4.1",
"react": "^18.2.0",
"tabbable": "^5.3.3"
Expand Down
11 changes: 5 additions & 6 deletions src/components/table/ArcTable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { html, LitElement } from 'lit';
import { property, query } from 'lit/decorators.js';
import { Grid, Row, createElement, UserConfig } from 'gridjs';
import { Grid, Row, createElement, Config } from 'gridjs';
import { TCell, TColumn } from 'gridjs/dist/src/types';
import { Language } from 'gridjs/dist/src/i18n/language';
import { ComponentChildren, ComponentType, Attributes } from 'preact';
Expand Down Expand Up @@ -81,11 +81,10 @@ export default class ArcTable extends LitElement {
error: 'An error occurred while fetching your data.',
...this.language,
},
pagination: {
enabled: this.pagination,
pagination: this.pagination ? {
limit: this.paginationLimit,
summary: this.paginationSummary,
},
} : false,
resizable: this.resizable,
sort: this.sort,
search: this.search,
Expand Down Expand Up @@ -122,7 +121,7 @@ export default class ArcTable extends LitElement {
* GridJS provides support for more advanced features than the arc-table requires.
* To allow the flexibility that GridJS provides, the given userConfig needs to be checked.
* */
updateConfig(userConfig: Partial<UserConfig>) {
updateConfig(userConfig: Partial<Config>) {
const keys = Object.keys(userConfig);

/* Make sure there are actual properties given. */
Expand All @@ -135,7 +134,7 @@ export default class ArcTable extends LitElement {
this._grid.forceRender();

/* Each property of the component itself will also require an update, but only if they exist in the ArcTable API */
keys.forEach((key: keyof UserConfig) => {
keys.forEach((key: keyof Config) => {
if (!(key in this)) return; // Make sure that the given key exists on the ArcTable (this) class.
(this as any)[key] = userConfig[key]; // Update the value of a given key.
});
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7554,12 +7554,12 @@ grapheme-splitter@^1.0.4:
resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e"
integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==

gridjs@^5.0.2:
version "5.1.0"
resolved "https://registry.yarnpkg.com/gridjs/-/gridjs-5.1.0.tgz#77563e766c1faf6e8042577404098bb05ec514d0"
integrity sha512-ElT4RccHVZXR6mAn0Neh7jRv0yLPYLl9tWr9EC1tIJ7UC035kScGc/VMSJlPmOTyUU6qPUz1mtmzg/i8+IT24g==
gridjs@6.0.6:
version "6.0.6"
resolved "https://registry.yarnpkg.com/gridjs/-/gridjs-6.0.6.tgz#7983f08d4bc9d4a9616ee2c7bbfc01ef6bf4ddd2"
integrity sha512-TZ20nY+weE/wlyXOd3A9FJyJlsJ/MrHr6frMgUHFN29RmWZCYtnyfF0zuspXC81oePwSJeSZ8HY651aeyX8+rQ==
dependencies:
preact "^10.10.6"
preact "^10.11.3"

handlebars@^4.4.3, handlebars@^4.7.7:
version "4.7.7"
Expand Down Expand Up @@ -10838,10 +10838,10 @@ postcss@^8.4.18:
picocolors "^1.0.0"
source-map-js "^1.0.2"

preact@^10.10.6:
version "10.11.2"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.11.2.tgz#e43f2a2f2985dedb426bb4c765b7bb037734f8a8"
integrity sha512-skAwGDFmgxhq1DCBHke/9e12ewkhc7WYwjuhHB8HHS8zkdtITXLRmUMTeol2ldxvLwYtwbFeifZ9uDDWuyL4Iw==
preact@^10.11.3:
version "10.16.0"
resolved "https://registry.yarnpkg.com/preact/-/preact-10.16.0.tgz#68a06d70b191b8a313ea722d61e09c6b2a79a37e"
integrity sha512-XTSj3dJ4roKIC93pald6rWuB2qQJO9gO2iLLyTe87MrjQN+HklueLsmskbywEWqCHlclgz3/M4YLL2iBr9UmMA==

prelude-ls@^1.2.1:
version "1.2.1"
Expand Down

0 comments on commit 60209b5

Please sign in to comment.