diff --git a/package.json b/package.json index d06310a4a..7fba862a5 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/components/table/ArcTable.ts b/src/components/table/ArcTable.ts index be8578edd..d66930a12 100644 --- a/src/components/table/ArcTable.ts +++ b/src/components/table/ArcTable.ts @@ -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'; @@ -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, @@ -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) { + updateConfig(userConfig: Partial) { const keys = Object.keys(userConfig); /* Make sure there are actual properties given. */ @@ -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. }); diff --git a/yarn.lock b/yarn.lock index 5e6fe6274..1929d3c26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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"