@ltht-react/flag-detail 2.0.135 → 2.0.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/package.json +7 -7
- package/src/index.tsx +85 -85
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# FlagDetail
|
|
2
|
-
|
|
3
|
-
<!-- STORY -->
|
|
4
|
-
|
|
5
|
-
### Import
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import FlagDetail from '@ltht-react/flag-detail'
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Usage
|
|
12
|
-
|
|
13
|
-
```jsx
|
|
14
|
-
<FlagDetail />
|
|
15
|
-
```
|
|
1
|
+
# FlagDetail
|
|
2
|
+
|
|
3
|
+
<!-- STORY -->
|
|
4
|
+
|
|
5
|
+
### Import
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import FlagDetail from '@ltht-react/flag-detail'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<FlagDetail />
|
|
15
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/flag-detail",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.137",
|
|
4
4
|
"description": "ltht-react clinical FlagDetail component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@emotion/react": "^11.0.0",
|
|
30
30
|
"@emotion/styled": "^11.0.0",
|
|
31
|
-
"@ltht-react/button": "^2.0.
|
|
32
|
-
"@ltht-react/styles": "^2.0.
|
|
33
|
-
"@ltht-react/type-detail": "^2.0.
|
|
34
|
-
"@ltht-react/types": "^2.0.
|
|
35
|
-
"@ltht-react/utils": "^2.0.
|
|
31
|
+
"@ltht-react/button": "^2.0.137",
|
|
32
|
+
"@ltht-react/styles": "^2.0.137",
|
|
33
|
+
"@ltht-react/type-detail": "^2.0.137",
|
|
34
|
+
"@ltht-react/types": "^2.0.137",
|
|
35
|
+
"@ltht-react/utils": "^2.0.137",
|
|
36
36
|
"react": "^18.2.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "8f8de949dd580b6433ab60a5930c81aad2ef52e0"
|
|
39
39
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import { FC } from 'react'
|
|
2
|
-
import styled from '@emotion/styled'
|
|
3
|
-
import { DetailViewType, Flag } from '@ltht-react/types'
|
|
4
|
-
import { getStringExtension } from '@ltht-react/utils'
|
|
5
|
-
import { Button, ButtonProps } from '@ltht-react/button'
|
|
6
|
-
import { MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
CodeableConceptDetail,
|
|
10
|
-
StringDetail,
|
|
11
|
-
PeriodDetail,
|
|
12
|
-
NarrativeDetail,
|
|
13
|
-
ResourceReferenceDetail,
|
|
14
|
-
CollapsibleDetailCollectionProps,
|
|
15
|
-
CollapsibleDetailCollection,
|
|
16
|
-
} from '@ltht-react/type-detail'
|
|
17
|
-
|
|
18
|
-
const StyledControlsContainer = styled.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
margin: auto 10px auto 10px;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
|
|
23
|
-
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
24
|
-
margin: 10px 0 0 0;
|
|
25
|
-
flex-flow: row wrap;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
29
|
-
margin: 10px 5px 0 0;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
|
-
`
|
|
33
|
-
const StyledButton = styled(Button)`
|
|
34
|
-
margin: 2px 0 2px 0;
|
|
35
|
-
font-size: 0.8em !important;
|
|
36
|
-
padding: 1px 5px;
|
|
37
|
-
|
|
38
|
-
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
39
|
-
margin: 2px 5px 2px 0;
|
|
40
|
-
width: fit-content;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
44
|
-
margin: 2px 0 2px 0;
|
|
45
|
-
width: 100%;
|
|
46
|
-
max-width: 200px;
|
|
47
|
-
}
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
const FlagDetail: FC<Props> = ({ flag, controls = [], viewType = DetailViewType.Compact }) => {
|
|
51
|
-
let buttons = <></>
|
|
52
|
-
if (controls.length) {
|
|
53
|
-
buttons = (
|
|
54
|
-
<StyledControlsContainer>
|
|
55
|
-
{controls.map((props, index) => (
|
|
56
|
-
<StyledButton key={index} {...props} />
|
|
57
|
-
))}
|
|
58
|
-
</StyledControlsContainer>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<CollapsibleDetailCollection viewType={viewType}>
|
|
64
|
-
<CodeableConceptDetail term="Code" concept={flag?.code} />
|
|
65
|
-
<StringDetail term="Status" description={flag.status.toString()} />
|
|
66
|
-
<CodeableConceptDetail term="Category" concept={flag?.category} />
|
|
67
|
-
<PeriodDetail period={flag?.period} />
|
|
68
|
-
<NarrativeDetail narrative={flag?.text} />
|
|
69
|
-
<StringDetail
|
|
70
|
-
term="Advice"
|
|
71
|
-
description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
|
|
72
|
-
parse={false}
|
|
73
|
-
/>
|
|
74
|
-
{buttons}
|
|
75
|
-
<ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
|
|
76
|
-
</CollapsibleDetailCollection>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
interface Props extends CollapsibleDetailCollectionProps {
|
|
81
|
-
flag: Flag
|
|
82
|
-
controls?: ButtonProps[]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default FlagDetail
|
|
1
|
+
import { FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
import { DetailViewType, Flag } from '@ltht-react/types'
|
|
4
|
+
import { getStringExtension } from '@ltht-react/utils'
|
|
5
|
+
import { Button, ButtonProps } from '@ltht-react/button'
|
|
6
|
+
import { MOBILE_MAXIMUM_MEDIA_QUERY, SMALL_SCREEN_MAXIMUM_MEDIA_QUERY } from '@ltht-react/styles'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
CodeableConceptDetail,
|
|
10
|
+
StringDetail,
|
|
11
|
+
PeriodDetail,
|
|
12
|
+
NarrativeDetail,
|
|
13
|
+
ResourceReferenceDetail,
|
|
14
|
+
CollapsibleDetailCollectionProps,
|
|
15
|
+
CollapsibleDetailCollection,
|
|
16
|
+
} from '@ltht-react/type-detail'
|
|
17
|
+
|
|
18
|
+
const StyledControlsContainer = styled.div`
|
|
19
|
+
display: flex;
|
|
20
|
+
margin: auto 10px auto 10px;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
|
|
23
|
+
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
24
|
+
margin: 10px 0 0 0;
|
|
25
|
+
flex-flow: row wrap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
29
|
+
margin: 10px 5px 0 0;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
const StyledButton = styled(Button)`
|
|
34
|
+
margin: 2px 0 2px 0;
|
|
35
|
+
font-size: 0.8em !important;
|
|
36
|
+
padding: 1px 5px;
|
|
37
|
+
|
|
38
|
+
${MOBILE_MAXIMUM_MEDIA_QUERY} {
|
|
39
|
+
margin: 2px 5px 2px 0;
|
|
40
|
+
width: fit-content;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${SMALL_SCREEN_MAXIMUM_MEDIA_QUERY} {
|
|
44
|
+
margin: 2px 0 2px 0;
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: 200px;
|
|
47
|
+
}
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
const FlagDetail: FC<Props> = ({ flag, controls = [], viewType = DetailViewType.Compact }) => {
|
|
51
|
+
let buttons = <></>
|
|
52
|
+
if (controls.length) {
|
|
53
|
+
buttons = (
|
|
54
|
+
<StyledControlsContainer>
|
|
55
|
+
{controls.map((props, index) => (
|
|
56
|
+
<StyledButton key={index} {...props} />
|
|
57
|
+
))}
|
|
58
|
+
</StyledControlsContainer>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<CollapsibleDetailCollection viewType={viewType}>
|
|
64
|
+
<CodeableConceptDetail term="Code" concept={flag?.code} />
|
|
65
|
+
<StringDetail term="Status" description={flag.status.toString()} />
|
|
66
|
+
<CodeableConceptDetail term="Category" concept={flag?.category} />
|
|
67
|
+
<PeriodDetail period={flag?.period} />
|
|
68
|
+
<NarrativeDetail narrative={flag?.text} />
|
|
69
|
+
<StringDetail
|
|
70
|
+
term="Advice"
|
|
71
|
+
description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
|
|
72
|
+
parse={false}
|
|
73
|
+
/>
|
|
74
|
+
{buttons}
|
|
75
|
+
<ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
|
|
76
|
+
</CollapsibleDetailCollection>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface Props extends CollapsibleDetailCollectionProps {
|
|
81
|
+
flag: Flag
|
|
82
|
+
controls?: ButtonProps[]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default FlagDetail
|