Skip to content

Commit

Permalink
Merge pull request #3312 from bettyblocks/feat/add-dataList-and-dataT…
Browse files Browse the repository at this point in the history
…able-selectedRecord-component-states-PAGE-3992

Feat/add data list and data table selected record component states page 3992
  • Loading branch information
dylanBetty authored Jan 2, 2024
2 parents 6d4904c + 882c32e commit baf5ae2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [2.171.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.170.2...v2.171.0) (2023-12-28)


### Features

* add kind dropdown to hidden input ([a4c97c9](https://github.com/bettyblocks/material-ui-component-set/commit/a4c97c9c7853a3ede8bb362cee0de41dae76b3e1))

## [2.170.2](https://github.com/bettyblocks/material-ui-component-set/compare/v2.170.1...v2.170.2) (2023-12-28)


### Bug Fixes

* set labelProperty if available ([5f71e66](https://github.com/bettyblocks/material-ui-component-set/commit/5f71e66aa0f57f9764e482cd0b03122e4a3c687b))

## [2.170.1](https://github.com/bettyblocks/material-ui-component-set/compare/v2.170.0...v2.170.1) (2023-12-19)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "component-set",
"version": "2.170.1",
"version": "2.171.0",
"main": "dist/templates.json",
"license": "UNLICENSED",
"private": false,
Expand Down
2 changes: 2 additions & 0 deletions src/components/dataList.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
dataComponentAttribute,
} = options;

const [, setSelectedRecordId] = usePageState(useText(['']));
const rowsPerPage = parseInt(take, 10) || 50;
const { TextField, InputAdornment } = window.MaterialUI.Core;
const { label: searchPropertyLabel } =
Expand Down Expand Up @@ -383,6 +384,7 @@
}, [loading]);

const handleClick = (event, context) => {
setSelectedRecordId(context.modelData.id);
B.triggerEvent('OnItemClick', event, context);
};

Expand Down
2 changes: 2 additions & 0 deletions src/components/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
dataComponentAttribute,
enableFirstLastPageNavigation,
} = options;
const [, setSelectedRecordId] = usePageState(useText(['']));
const repeaterRef = React.createRef();
const tableRef = React.createRef();
const tableContainerRef = React.createRef();
Expand Down Expand Up @@ -490,6 +491,7 @@

const handleRowClick = (endpoint, context) => {
if (isDev) return;
setSelectedRecordId(context.modelData.id);
B.triggerEvent('OnRowClick', endpoint, context);

if (hasLink) {
Expand Down

0 comments on commit baf5ae2

Please sign in to comment.