@ltht-react/flag-detail 2.0.136 → 2.0.138
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/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.tsx +86 -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/lib/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var FlagDetail = function (_a) {
|
|
|
33
33
|
if (controls.length) {
|
|
34
34
|
buttons = ((0, jsx_runtime_1.jsx)(StyledControlsContainer, { children: controls.map(function (props, index) { return ((0, jsx_runtime_1.jsx)(StyledButton, __assign({}, props), index)); }) }));
|
|
35
35
|
}
|
|
36
|
-
return ((0, jsx_runtime_1.jsxs)(type_detail_1.CollapsibleDetailCollection, { viewType: viewType, children: [(0, jsx_runtime_1.jsx)(type_detail_1.
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(type_detail_1.CollapsibleDetailCollection, { viewType: viewType, children: [(0, jsx_runtime_1.jsx)(type_detail_1.StringDetail, { term: "Code", description: (0, utils_1.codeableConceptCodeSummary)(flag === null || flag === void 0 ? void 0 : flag.code) }), (0, jsx_runtime_1.jsx)(type_detail_1.CodeableConceptDetail, { term: "Name", concept: flag === null || flag === void 0 ? void 0 : flag.code }), (0, jsx_runtime_1.jsx)(type_detail_1.StringDetail, { term: "Status", description: flag.status.toString() }), (0, jsx_runtime_1.jsx)(type_detail_1.CodeableConceptDetail, { term: "Category", concept: flag === null || flag === void 0 ? void 0 : flag.category }), (0, jsx_runtime_1.jsx)(type_detail_1.PeriodDetail, { period: flag === null || flag === void 0 ? void 0 : flag.period }), (0, jsx_runtime_1.jsx)(type_detail_1.NarrativeDetail, { term: "Description", narrative: flag === null || flag === void 0 ? void 0 : flag.text }), (0, jsx_runtime_1.jsx)(type_detail_1.StringDetail, { term: "Advice", description: (0, utils_1.getStringExtension)(flag === null || flag === void 0 ? void 0 : flag.extension, 'https://leedsth.nhs.uk/alert/advice'), parse: false }), buttons, (0, jsx_runtime_1.jsx)(type_detail_1.ResourceReferenceDetail, { term: "Author", resourceReference: flag === null || flag === void 0 ? void 0 : flag.author })] }));
|
|
37
37
|
};
|
|
38
38
|
exports.default = FlagDetail;
|
|
39
39
|
var templateObject_1, templateObject_2;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,2CAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,2DAAoC;AACpC,2CAAwD;AACxD,2CAAkF;AAClF,6CAAwD;AACxD,6CAAiG;AAEjG,uDAQgC;AAEhC,IAAM,uBAAuB,GAAG,gBAAM,CAAC,GAAG,iSAAA,qFAKtC,EAA0B,kEAK1B,EAAgC,mEAInC,KATG,mCAA0B,EAK1B,yCAAgC,CAInC,CAAA;AACD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tC,uBAAC,6BAAe,IAAC,IAAI,EAAC,aAAa,EAAC,SAAS,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,GAAI,EAC7D,uBAAC,0BAAY,IACX,IAAI,EAAC,QAAQ,EACb,WAAW,EAAE,IAAA,0BAAkB,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,EAAE,qCAAqC,CAAC,EACvF,KAAK,EAAE,KAAK,GACZ,EACD,OAAO,EACR,uBAAC,qCAAuB,IAAC,IAAI,EAAC,QAAQ,EAAC,iBAAiB,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,GAAI,IAC9C,CAC/B,CAAA;AACH,CAAC,CAAA;AAOD,kBAAe,UAAU,CAAA"}
|
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.138",
|
|
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.138",
|
|
32
|
+
"@ltht-react/styles": "^2.0.138",
|
|
33
|
+
"@ltht-react/type-detail": "^2.0.138",
|
|
34
|
+
"@ltht-react/types": "^2.0.138",
|
|
35
|
+
"@ltht-react/utils": "^2.0.138",
|
|
36
36
|
"react": "^18.2.0"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "5dc9de48844854943aa1f6392d640c213a43c850"
|
|
39
39
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,85 +1,86 @@
|
|
|
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
|
-
<
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
import { FC } from 'react'
|
|
2
|
+
import styled from '@emotion/styled'
|
|
3
|
+
import { DetailViewType, Flag } from '@ltht-react/types'
|
|
4
|
+
import { codeableConceptCodeSummary, 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
|
+
<StringDetail term="Code" description={codeableConceptCodeSummary(flag?.code)} />
|
|
65
|
+
<CodeableConceptDetail term="Name" concept={flag?.code} />
|
|
66
|
+
<StringDetail term="Status" description={flag.status.toString()} />
|
|
67
|
+
<CodeableConceptDetail term="Category" concept={flag?.category} />
|
|
68
|
+
<PeriodDetail period={flag?.period} />
|
|
69
|
+
<NarrativeDetail term="Description" narrative={flag?.text} />
|
|
70
|
+
<StringDetail
|
|
71
|
+
term="Advice"
|
|
72
|
+
description={getStringExtension(flag?.extension, 'https://leedsth.nhs.uk/alert/advice')}
|
|
73
|
+
parse={false}
|
|
74
|
+
/>
|
|
75
|
+
{buttons}
|
|
76
|
+
<ResourceReferenceDetail term="Author" resourceReference={flag?.author} />
|
|
77
|
+
</CollapsibleDetailCollection>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface Props extends CollapsibleDetailCollectionProps {
|
|
82
|
+
flag: Flag
|
|
83
|
+
controls?: ButtonProps[]
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default FlagDetail
|