Skip to content

Commit

Permalink
Merge pull request #30 from rdkcentral/feat/row
Browse files Browse the repository at this point in the history
feat(Row): update Row render logic
  • Loading branch information
Chris Lorenzo authored May 11, 2021
2 parents 02e5f53 + 48d9e33 commit 95052cb
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 112 deletions.
20 changes: 10 additions & 10 deletions components/Column/__snapshots__/Column.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 80,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -222,7 +222,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 400,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -451,7 +451,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 80,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -471,7 +471,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 400,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -700,7 +700,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 80,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -720,7 +720,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 400,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -949,7 +949,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 80,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -969,7 +969,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 400,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -1198,7 +1198,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 80,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -1218,7 +1218,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 400,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down
40 changes: 20 additions & 20 deletions components/Keyboard/__snapshots__/Keyboard.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,7 @@ Object {
"enabled": false,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -2212,7 +2212,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -4268,7 +4268,7 @@ Object {
"enabled": false,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -4288,7 +4288,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -6344,7 +6344,7 @@ Object {
"enabled": false,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -6364,7 +6364,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -8420,7 +8420,7 @@ Object {
"enabled": false,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -8440,7 +8440,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -9040,7 +9040,7 @@ Object {
"enabled": false,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -9060,7 +9060,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -11281,7 +11281,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -11301,7 +11301,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -13445,7 +13445,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -13465,7 +13465,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -15609,7 +15609,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -15629,7 +15629,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -17773,7 +17773,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -17793,7 +17793,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down Expand Up @@ -18417,7 +18417,7 @@ Object {
"enabled": true,
"flex": false,
"flexItem": false,
"h": 0,
"h": 60,
"isComponent": undefined,
"mount": 0,
"mountX": 0,
Expand All @@ -18437,7 +18437,7 @@ Object {
"Items",
],
"visible": true,
"w": 0,
"w": 790,
"x": 0,
"y": 0,
"zIndex": 0,
Expand Down
30 changes: 30 additions & 0 deletions components/Row/Row.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,33 @@ scrollIndex|number|false|0|Item index at which scrolling begins, provided the su
selected|<DocsLink id="lng.Component" />|true|-|selected item
selectedIndex|number|false|0|index of selected item
w|number|false|`stage.w`|width of the `Row`
alwaysScroll|boolean|false|determines whether the row will stop scrolling as it nears the right to prevent white space
lazyScroll|boolean|false|will only scroll the row if the item is off screen
onScreenItems|array|true|contains a list of items that are currently on screen (within the bounds of the container)

### Child Item Properties
The `Row` component will utilize the following properties on each individual element in its `items` array:

name|type|readonly|description
--|--|--|--
centerInParent|boolean|false|if set to true on an individual element in the `items` array, this will vertically center the child

### Methods

#### onScreenEffect(onScreenItems: lng.Component[]): void

A callback that can be overridden to do something with the items that are currently on screen. This will be called on every new render.

#### appendItems(items: lng.Component[]): void

Adds items to the end of the child list

##### Arguments

name|type|required|default|description
--|--|--|--|--
items|<DocsLink id="lng.Component">lng.Component[]</DocsLink>|false|[]|list of items to append

#### render(): void

Called when item focus changes. Render is responsible for the scroll behavior
Loading

0 comments on commit 95052cb

Please sign in to comment.