This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clinical-item-view] Add row vs column view prop
- Loading branch information
ry061521
committed
Aug 30, 2023
1 parent
2bfc18e
commit e91e252
Showing
101 changed files
with
613 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/terra-clinical-item-view/src/terra-dev-site/doc/example/ItemViewTwoColumnByRow.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import IconBriefcase from 'terra-icon/lib/icon/IconBriefcase'; | ||
import IconPerson from 'terra-icon/lib/icon/IconPerson'; | ||
import ItemView from 'terra-clinical-item-view'; | ||
|
||
const display1 = <ItemView.Display icon={<IconPerson />} iconAlignment="inline" text="Asif Khan" />; | ||
const display2 = <ItemView.Display icon={<IconBriefcase />} iconAlignment="inline" text="Care Position: Primary" />; | ||
const display3 = <ItemView.Display text="Room 100A" />; | ||
const display4 = <ItemView.Display text="Acuity: 5" />; | ||
const display5 = <ItemView.Display text="Start Time: 08-05-2016 12:00:00" />; | ||
const display6 = <ItemView.Display text="End Time: 08-05-2016 16:00:00" />; | ||
const displays = [display1, display2, display3, display4, display5, display6]; | ||
|
||
export default () => <ItemView displays={displays} layout="twoColumns" trueColumn={false} />; |
23 changes: 23 additions & 0 deletions
23
...nical-item-view/src/terra-dev-site/test/clinical-item-view/DisplaysItemViewByRow.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import IconAlert from 'terra-icon/lib/icon/IconAlert'; | ||
import ItemView from '../../../ItemView'; | ||
|
||
const display1 = <ItemView.Display icon={<IconAlert />} iconAlignment="inline" text="display1 Text display1 Text display1 Text display1 Text display1 Text display1 Text display1 Text display1 Text" key="123" />; | ||
const display2 = <ItemView.Display icon={<IconAlert />} iconAlignment="inline" text="display2 Text display2 Text display2 Text display2 Text display2 Text display2 Text display2 Text display2 Text display2 Text" key="124" />; | ||
const display3 = <ItemView.Display text="display 3" key="125" />; | ||
const display4 = <ItemView.Display text="display 4" key="126" />; | ||
const display5 = <ItemView.Display text="display 5" key="127" />; | ||
const display6 = <ItemView.Display text="display 6" key="128" />; | ||
const displays = [display1, display2, display3, display4, display5, display6]; | ||
|
||
const views = () => ( | ||
<div> | ||
<h2>Two Column Layout by Row </h2> | ||
<ItemView displays={displays} trueColumn={false} layout="twoColumns" id="test-displays-two-row" /> | ||
<br /> | ||
<h2>Two Column Layout by Row with Start TextEmphasis </h2> | ||
<ItemView displays={displays} trueColumn={false} layout="twoColumns" textEmphasis="start" id="test-displays-two-row-start" /> | ||
</div> | ||
); | ||
|
||
export default views; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...em-view/src/terra-dev-site/test/clinical-item-view/OverflowDisplaysItemViewByRow.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import IconAlert from 'terra-icon/lib/icon/IconAlert'; | ||
import IconInformation from 'terra-icon/lib/icon/IconInformation'; | ||
import classNames from 'classnames/bind'; | ||
import ItemView from '../../../ItemView'; | ||
import styles from './ItemViewCommon.test.module.scss'; | ||
|
||
const cx = classNames.bind(styles); | ||
|
||
const display1 = <ItemView.Display text="display1display1display1display1display1display1display1display1display1display1display1display1display1display1" key="123" />; | ||
const display2 = <ItemView.Display text="display2display2display2display2display2display2display2display2display2display2display2display2display2display2" key="124" />; | ||
const display3 = <ItemView.Display text="display 3" key="125" />; | ||
const display4 = <ItemView.Display text="display 4" key="126" />; | ||
const display5 = <ItemView.Display text="display 5" key="127" />; | ||
const display6 = <ItemView.Display text="display 6" key="128" />; | ||
const displays = [display1, display2, display3, display4, display5, display6]; | ||
const isTruncatedDisplay1 = <ItemView.Display isTruncated text="display1display1display1display1display1display1display1display1display1display1display1display1display1display1" key="1234" />; | ||
const isTruncatedDisplay2 = <ItemView.Display isTruncated text="display2display2display2display2display2display2display2display2display2display2display2display2display2display2" key="1245" />; | ||
const partialTruncatedDisplays = [isTruncatedDisplay1, isTruncatedDisplay2, display3, display4, display5, display6]; | ||
const leftPartialTruncatedDisplays = [isTruncatedDisplay1, display2, display3, display4, display5, display6]; | ||
const rightPartialTruncatedDisplays = [display1, isTruncatedDisplay2, display3, display4, display5, display6]; | ||
|
||
const accessoryStart = id => <IconAlert id={id} />; | ||
const accessoryEnd = id => <IconInformation id={id} />; | ||
const comment = id => <ItemView.Comment id={id} text="comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1" />; | ||
|
||
const views = () => ( | ||
<div className={cx('overflow-displays-itemview')}> | ||
<p>Applied width of 900px to show the default vs truncated styling.</p> | ||
<br /> | ||
<h2>Default ItemView</h2> | ||
<ItemView trueColumn={false} comment={comment(2)} startAccessory={accessoryStart(10)} endAccessory={accessoryEnd(18)} displays={displays} layout="twoColumns" id="ItemView-by-row-two-wrap" /> | ||
<br /> | ||
<h2>Truncated ItemView</h2> | ||
<ItemView trueColumn={false} displays={displays} isTruncated comment={comment(4)} startAccessory={accessoryStart(12)} endAccessory={accessoryEnd(20)} layout="twoColumns" textEmphasis="start" id="ItemView-by-row-two-truncate" /> | ||
<br /> | ||
<p> The next examples include when ItemView has `isTruncated` set to `false` while the ItemDisplays passed in to the ItemView have the `isTruncated` prop set to `true`.</p> | ||
<h2>Left and Right Displays Truncated</h2> | ||
<ItemView trueColumn={false} displays={partialTruncatedDisplays} comment={comment(6)} startAccessory={accessoryStart(14)} endAccessory={accessoryEnd(22)} layout="twoColumns" textEmphasis="start" id="ItemView-by-row-two-partial-truncate" /> | ||
<br /> | ||
<h2>Left Display Truncated</h2> | ||
<ItemView trueColumn={false} displays={leftPartialTruncatedDisplays} comment={comment(7)} startAccessory={accessoryStart(15)} endAccessory={accessoryEnd(23)} layout="twoColumns" textEmphasis="start" id="ItemView-by-row-two-partial-left-truncate" /> | ||
<br /> | ||
<h2>Right Display Truncated</h2> | ||
<ItemView trueColumn={false} displays={rightPartialTruncatedDisplays} comment={comment(8)} startAccessory={accessoryStart(16)} endAccessory={accessoryEnd(24)} layout="twoColumns" textEmphasis="start" id="ItemView-by-row-two-partial-right-truncate" /> | ||
</div> | ||
); | ||
|
||
export default views; |
Oops, something went wrong.