Skip to content

Commit

Permalink
0.0.232 - defaulting wrapIndexCellText to false and fixed a bug where…
Browse files Browse the repository at this point in the history
… increasing the index column width with no pagination was throwing an error
  • Loading branch information
OvidijusParsiunas committed Apr 14, 2023
1 parent 06fd16a commit 8f43569
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions component/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "active-table",
"version": "0.0.230",
"version": "0.0.232",
"description": "Framework agnostic table component for editable data experience",
"main": "./dist/activeTable.js",
"module": "./dist/activeTable.js",
Expand Down
3 changes: 1 addition & 2 deletions component/src/activeTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ export class ActiveTable extends LitElement {
})
displayAddNewColumn = true;

// WORK - not sure if this should be set here
@property({type: Object})
displayIndexColumn: IndexColumnT = {wrapIndexCellText: true};
displayIndexColumn: IndexColumnT = {wrapIndexCellText: false};

// REF-22 - to be used by the client
// frame components are comprised of index column, add new column column and add new row row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class UpdateIndexColumnWidth {
}

private static updatedBasedOnTableStyle(at: ActiveTable, lastCell: HTMLElement, forceWrap = false) {
const firstRow = at._pagination.visibleRows[0];
const firstRow = at.pagination ? at._pagination.visibleRows[0] : (at._tableBodyElementRef?.children[0] as HTMLElement);
if (forceWrap) {
UpdateIndexColumnWidth.forceWrap(at, firstRow);
// when 'block' display style is not set on the table
Expand Down
18 changes: 9 additions & 9 deletions other-packages/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions other-packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "active-table-react",
"version": "0.0.27",
"version": "0.0.28",
"description": "Active Table wrapper for React",
"main": "./dist/activeTable.js",
"module": "./dist/activeTable.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
"license": "MIT",
"dependencies": {
"@lit-labs/react": "^1.1.1",
"active-table": "^0.0.230"
"active-table": "^0.0.232"
},
"devDependencies": {
"@types/react": "^18.0.28",
Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/column.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ A toggle for the index column on the left. <br />
When `wrapIndexCellText` is set to _true_, the index column width will be static and any overflowing digits inside its cells will be wrapped within its boundaries. This is
useful in a scenario where `width`/`maxWidth` is set within [`tableStyle`](./table#tableStyle) and the addition of any more columns would cause the width to be breached
due to all columns having the mimimal width of _33px_. Hence by keeping index column width narrow - more columns can be added without breaching the set `width`/`maxWidth`.
If `wrapIndexCellText` is set to _false_ and [`preserveNarrowColumns`](#preserveNarrowColumns) is set to _true_, if the table width is about to be breached,
it will be automatically set to _true_ and the index width will be set back to the initial width. <br />
If `wrapIndexCellText` is set to _false_ and [`preserveNarrowColumns`](#preserveNarrowColumns) is set to _true_ - if the table width is also about to be breached,
`wrapIndexCellText` will be automatically set to _true_ and the index width will be set back to the initial width. <br />
You can set the index column style via [`frameComponentsStyle`](./table#frameComponentsStyle).

#### Example
Expand Down
30 changes: 15 additions & 15 deletions website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@docusaurus/theme-search-algolia": "^2.3.1",
"@lit-labs/react": "^1.1.1",
"@mdx-js/react": "^1.6.22",
"active-table-react": "^0.0.27",
"active-table-react": "^0.0.28",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
Expand Down

0 comments on commit 8f43569

Please sign in to comment.