@ltht-react/timeline 1.0.241 → 1.0.242

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 CHANGED
@@ -1,19 +1,19 @@
1
- # Timeline
2
-
3
- ### Import
4
-
5
- ```js
6
- import Timeline from '@ltht-react/timeline'
7
- ```
8
-
9
- ### Usage
10
-
11
- ```jsx
12
- <Timeline auditTrail={auditTrail} />
13
- ```
14
-
15
- ### Properties
16
-
17
- | Prop | Required | Default | Type | Description |
18
- | :----------- | :------- | :------ | :-------------------- | :----------------- |
19
- | `auditTrail` | Yes | | `Maybe<AuditEvent>[]` | Timeline of events |
1
+ # Timeline
2
+
3
+ ### Import
4
+
5
+ ```js
6
+ import Timeline from '@ltht-react/timeline'
7
+ ```
8
+
9
+ ### Usage
10
+
11
+ ```jsx
12
+ <Timeline auditTrail={auditTrail} />
13
+ ```
14
+
15
+ ### Properties
16
+
17
+ | Prop | Required | Default | Type | Description |
18
+ | :----------- | :------- | :------ | :-------------------- | :----------------- |
19
+ | `auditTrail` | Yes | | `Maybe<AuditEvent>[]` | Timeline of events |
@@ -1,8 +1,8 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
- declare const TimelineAuthor: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
- domainResourceType: TimelineDomainResourceType;
7
- }
8
- export default TimelineAuthor;
1
+ import { FC, HTMLAttributes } from 'react';
2
+ import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
+ declare const TimelineAuthor: FC<Props>;
4
+ interface Props extends HTMLAttributes<HTMLDivElement> {
5
+ domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
+ domainResourceType: TimelineDomainResourceType;
7
+ }
8
+ export default TimelineAuthor;
@@ -1,88 +1,88 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- var jsx_runtime_1 = require("react/jsx-runtime");
33
- var icon_1 = __importDefault(require("@ltht-react/icon"));
34
- var styled_1 = __importDefault(require("@emotion/styled"));
35
- var types_1 = require("@ltht-react/types");
36
- var constants_1 = __importDefault(require("../constants"));
37
- var StyledTimelineItemLeft = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
38
- var TimelineAuthor = function (_a) {
39
- var _b;
40
- var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
41
- if (!domainResource)
42
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
43
- switch (domainResourceType) {
44
- case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
45
- var qr = domainResource;
46
- if (!(qr === null || qr === void 0 ? void 0 : qr.author)) {
47
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
48
- }
49
- return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", (_b = qr === null || qr === void 0 ? void 0 : qr.author) === null || _b === void 0 ? void 0 : _b.display] }), void 0));
50
- }
51
- case types_1.TimelineDomainResourceType.DocumentReference: {
52
- var docRef = domainResource;
53
- var authorList_1 = [];
54
- if ((docRef === null || docRef === void 0 ? void 0 : docRef.author) == null) {
55
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
56
- }
57
- docRef.author.forEach(function (auth) {
58
- if (auth) {
59
- authorList_1.push(auth.specialty ? auth.fullName + " (" + auth.specialty + ")" : "" + auth.fullName);
60
- }
61
- });
62
- if (authorList_1.length === 0) {
63
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
64
- }
65
- return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", authorList_1.join(', ')] }), void 0));
66
- }
67
- case types_1.TimelineDomainResourceType.AuditEvent: {
68
- var audit = domainResource;
69
- var authorName_1 = '';
70
- audit.agent.forEach(function (agent) {
71
- var _a;
72
- (_a = agent === null || agent === void 0 ? void 0 : agent.role) === null || _a === void 0 ? void 0 : _a.forEach(function (role) {
73
- var _a, _b;
74
- var isPrimaryAuthor = !!((_a = role === null || role === void 0 ? void 0 : role.coding) === null || _a === void 0 ? void 0 : _a.find(function (x) { return (x === null || x === void 0 ? void 0 : x.code) === constants_1.default; }));
75
- !authorName_1 && isPrimaryAuthor && (authorName_1 = ((_b = agent.who) === null || _b === void 0 ? void 0 : _b.display) || '');
76
- });
77
- });
78
- if (!authorName_1) {
79
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
80
- }
81
- return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", authorName_1] }), void 0));
82
- }
83
- }
84
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
85
- };
86
- exports.default = TimelineAuthor;
87
- var templateObject_1;
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __rest = (this && this.__rest) || function (s, e) {
18
+ var t = {};
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
+ t[p] = s[p];
21
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
+ t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ var jsx_runtime_1 = require("react/jsx-runtime");
33
+ var icon_1 = __importDefault(require("@ltht-react/icon"));
34
+ var styled_1 = __importDefault(require("@emotion/styled"));
35
+ var types_1 = require("@ltht-react/types");
36
+ var constants_1 = __importDefault(require("../constants"));
37
+ var StyledTimelineItemLeft = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
38
+ var TimelineAuthor = function (_a) {
39
+ var _b;
40
+ var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
41
+ if (!domainResource)
42
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
43
+ switch (domainResourceType) {
44
+ case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
45
+ var qr = domainResource;
46
+ if (!(qr === null || qr === void 0 ? void 0 : qr.author)) {
47
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
48
+ }
49
+ return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", (_b = qr === null || qr === void 0 ? void 0 : qr.author) === null || _b === void 0 ? void 0 : _b.display] }), void 0));
50
+ }
51
+ case types_1.TimelineDomainResourceType.DocumentReference: {
52
+ var docRef = domainResource;
53
+ var authorList_1 = [];
54
+ if ((docRef === null || docRef === void 0 ? void 0 : docRef.author) == null) {
55
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
56
+ }
57
+ docRef.author.forEach(function (auth) {
58
+ if (auth) {
59
+ authorList_1.push(auth.specialty ? auth.fullName + " (" + auth.specialty + ")" : "" + auth.fullName);
60
+ }
61
+ });
62
+ if (authorList_1.length === 0) {
63
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
64
+ }
65
+ return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", authorList_1.join(', ')] }), void 0));
66
+ }
67
+ case types_1.TimelineDomainResourceType.AuditEvent: {
68
+ var audit = domainResource;
69
+ var authorName_1 = '';
70
+ audit.agent.forEach(function (agent) {
71
+ var _a;
72
+ (_a = agent === null || agent === void 0 ? void 0 : agent.role) === null || _a === void 0 ? void 0 : _a.forEach(function (role) {
73
+ var _a, _b;
74
+ var isPrimaryAuthor = !!((_a = role === null || role === void 0 ? void 0 : role.coding) === null || _a === void 0 ? void 0 : _a.find(function (x) { return (x === null || x === void 0 ? void 0 : x.code) === constants_1.default; }));
75
+ !authorName_1 && isPrimaryAuthor && (authorName_1 = ((_b = agent.who) === null || _b === void 0 ? void 0 : _b.display) || '');
76
+ });
77
+ });
78
+ if (!authorName_1) {
79
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
80
+ }
81
+ return (jsx_runtime_1.jsxs(StyledTimelineItemLeft, __assign({}, rest, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "user", size: "medium", color: "grey" }, void 0), " by ", authorName_1] }), void 0));
82
+ }
83
+ }
84
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
85
+ };
86
+ exports.default = TimelineAuthor;
87
+ var templateObject_1;
88
88
  //# sourceMappingURL=timeline-author.js.map
@@ -1,7 +1,7 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { ITimelineItem } from '../molecules/timeline-item';
3
- declare const TimelineButton: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- timelineItem: ITimelineItem;
6
- }
7
- export default TimelineButton;
1
+ import { FC, HTMLAttributes } from 'react';
2
+ import { ITimelineItem } from '../molecules/timeline-item';
3
+ declare const TimelineButton: FC<Props>;
4
+ interface Props extends HTMLAttributes<HTMLDivElement> {
5
+ timelineItem: ITimelineItem;
6
+ }
7
+ export default TimelineButton;
@@ -1,37 +1,37 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- var jsx_runtime_1 = require("react/jsx-runtime");
18
- var banner_1 = require("@ltht-react/banner");
19
- var icon_1 = __importDefault(require("@ltht-react/icon"));
20
- var TimelineButton = function (_a) {
21
- var timelineItem = _a.timelineItem, className = _a.className;
22
- var clickHandler = timelineItem.clickHandler, buttonState = timelineItem.buttonState, buttonText = timelineItem.buttonText;
23
- switch (buttonState) {
24
- case 'no-button':
25
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
26
- case 'permission-denied-button':
27
- return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "warning", disabled: true }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : 'Insufficient privileges to view this item' }), void 0));
28
- case 'selectable-button':
29
- return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "info", onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
30
- case 'selected-button':
31
- return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "highlight", icon: jsx_runtime_1.jsx(icon_1.default, { type: "info-circle", color: "info-blue", size: "medium" }, void 0), onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
32
- default:
33
- throw new Error('ButtonState must be a valid value.');
34
- }
35
- };
36
- exports.default = TimelineButton;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var banner_1 = require("@ltht-react/banner");
19
+ var icon_1 = __importDefault(require("@ltht-react/icon"));
20
+ var TimelineButton = function (_a) {
21
+ var timelineItem = _a.timelineItem, className = _a.className;
22
+ var clickHandler = timelineItem.clickHandler, buttonState = timelineItem.buttonState, buttonText = timelineItem.buttonText;
23
+ switch (buttonState) {
24
+ case 'no-button':
25
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
26
+ case 'permission-denied-button':
27
+ return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "warning", disabled: true }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : 'Insufficient privileges to view this item' }), void 0));
28
+ case 'selectable-button':
29
+ return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "info", onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
30
+ case 'selected-button':
31
+ return (jsx_runtime_1.jsx(banner_1.ButtonBanner, __assign({ className: className, type: "highlight", icon: jsx_runtime_1.jsx(icon_1.default, { type: "info-circle", color: "info-blue", size: "medium" }, void 0), onClick: clickHandler }, { children: buttonText !== null && buttonText !== void 0 ? buttonText : '' }), void 0));
32
+ default:
33
+ throw new Error('ButtonState must be a valid value.');
34
+ }
35
+ };
36
+ exports.default = TimelineButton;
37
37
  //# sourceMappingURL=timeline-button.js.map
@@ -1,8 +1,8 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
- declare const TimelineDescription: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
- domainResourceType: TimelineDomainResourceType;
7
- }
8
- export default TimelineDescription;
1
+ import { FC, HTMLAttributes } from 'react';
2
+ import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
+ declare const TimelineDescription: FC<Props>;
4
+ interface Props extends HTMLAttributes<HTMLDivElement> {
5
+ domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
+ domainResourceType: TimelineDomainResourceType;
7
+ }
8
+ export default TimelineDescription;
@@ -1,67 +1,67 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- var jsx_runtime_1 = require("react/jsx-runtime");
33
- var types_1 = require("@ltht-react/types");
34
- var react_html_parser_1 = __importDefault(require("react-html-parser"));
35
- var styled_1 = __importDefault(require("@emotion/styled"));
36
- var StyledDescription = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n p {\n margin: 0 0.2rem;\n display: inline;\n }\n"], ["\n p {\n margin: 0 0.2rem;\n display: inline;\n }\n"])));
37
- var TimelineDescription = function (_a) {
38
- var _b, _c;
39
- var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
40
- if (!domainResource)
41
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
42
- switch (domainResourceType) {
43
- case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
44
- var qr = domainResource;
45
- if (!((_b = qr.questionnaire) === null || _b === void 0 ? void 0 : _b.description)) {
46
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
47
- }
48
- return jsx_runtime_1.jsx(StyledDescription, __assign({}, rest, { children: react_html_parser_1.default((_c = qr.questionnaire) === null || _c === void 0 ? void 0 : _c.description) }), void 0);
49
- }
50
- case types_1.TimelineDomainResourceType.DocumentReference: {
51
- var docRef = domainResource;
52
- return docRef.description ? jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: docRef.description }, void 0) : jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
53
- }
54
- case types_1.TimelineDomainResourceType.AuditEvent: {
55
- var audit = domainResource;
56
- if (!audit.outcomeDesc) {
57
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
58
- }
59
- return jsx_runtime_1.jsx(StyledDescription, __assign({}, rest, { children: react_html_parser_1.default(audit.outcomeDesc) }), void 0);
60
- }
61
- default:
62
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
63
- }
64
- };
65
- exports.default = TimelineDescription;
66
- var templateObject_1;
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __rest = (this && this.__rest) || function (s, e) {
18
+ var t = {};
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
+ t[p] = s[p];
21
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
+ t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ var jsx_runtime_1 = require("react/jsx-runtime");
33
+ var types_1 = require("@ltht-react/types");
34
+ var react_html_parser_1 = __importDefault(require("react-html-parser"));
35
+ var styled_1 = __importDefault(require("@emotion/styled"));
36
+ var StyledDescription = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n p {\n margin: 0 0.2rem;\n display: inline;\n }\n"], ["\n p {\n margin: 0 0.2rem;\n display: inline;\n }\n"])));
37
+ var TimelineDescription = function (_a) {
38
+ var _b, _c;
39
+ var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
40
+ if (!domainResource)
41
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
42
+ switch (domainResourceType) {
43
+ case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
44
+ var qr = domainResource;
45
+ if (!((_b = qr.questionnaire) === null || _b === void 0 ? void 0 : _b.description)) {
46
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
47
+ }
48
+ return jsx_runtime_1.jsx(StyledDescription, __assign({}, rest, { children: react_html_parser_1.default((_c = qr.questionnaire) === null || _c === void 0 ? void 0 : _c.description) }), void 0);
49
+ }
50
+ case types_1.TimelineDomainResourceType.DocumentReference: {
51
+ var docRef = domainResource;
52
+ return docRef.description ? jsx_runtime_1.jsx(jsx_runtime_1.Fragment, { children: docRef.description }, void 0) : jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
53
+ }
54
+ case types_1.TimelineDomainResourceType.AuditEvent: {
55
+ var audit = domainResource;
56
+ if (!audit.outcomeDesc) {
57
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
58
+ }
59
+ return jsx_runtime_1.jsx(StyledDescription, __assign({}, rest, { children: react_html_parser_1.default(audit.outcomeDesc) }), void 0);
60
+ }
61
+ default:
62
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
63
+ }
64
+ };
65
+ exports.default = TimelineDescription;
66
+ var templateObject_1;
67
67
  //# sourceMappingURL=timeline-description.js.map
@@ -1,8 +1,8 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
- declare const TimelineTime: FC<Props>;
4
- interface Props extends HTMLAttributes<HTMLDivElement> {
5
- domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
- domainResourceType: TimelineDomainResourceType;
7
- }
8
- export default TimelineTime;
1
+ import { FC, HTMLAttributes } from 'react';
2
+ import { AuditEvent, DocumentReference, Maybe, QuestionnaireResponse, TimelineDomainResourceType } from '@ltht-react/types';
3
+ declare const TimelineTime: FC<Props>;
4
+ interface Props extends HTMLAttributes<HTMLDivElement> {
5
+ domainResource?: Maybe<AuditEvent | QuestionnaireResponse | DocumentReference>;
6
+ domainResourceType: TimelineDomainResourceType;
7
+ }
8
+ export default TimelineTime;
@@ -1,63 +1,63 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- var jsx_runtime_1 = require("react/jsx-runtime");
26
- var types_1 = require("@ltht-react/types");
27
- var utils_1 = require("@ltht-react/utils");
28
- var TimelineTime = function (_a) {
29
- var _b, _c, _d;
30
- var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
31
- if (!domainResource)
32
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
33
- switch (domainResourceType) {
34
- case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
35
- var qr = domainResource;
36
- if (!((_b = qr === null || qr === void 0 ? void 0 : qr.authored) === null || _b === void 0 ? void 0 : _b.value)) {
37
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
38
- }
39
- var time = utils_1.formatTime(new Date(qr === null || qr === void 0 ? void 0 : qr.authored.value));
40
- return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
41
- }
42
- case types_1.TimelineDomainResourceType.DocumentReference: {
43
- var docRef = domainResource;
44
- if (docRef && ((_c = docRef === null || docRef === void 0 ? void 0 : docRef.created) === null || _c === void 0 ? void 0 : _c.value)) {
45
- var time = utils_1.formatTime(new Date(docRef.created.value));
46
- return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
47
- }
48
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
49
- }
50
- case types_1.TimelineDomainResourceType.AuditEvent: {
51
- var audit = domainResource;
52
- if (audit && ((_d = audit === null || audit === void 0 ? void 0 : audit.recorded) === null || _d === void 0 ? void 0 : _d.value)) {
53
- var time = utils_1.formatTime(new Date(audit.recorded.value));
54
- return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
55
- }
56
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
57
- }
58
- default:
59
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
60
- }
61
- };
62
- exports.default = TimelineTime;
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var types_1 = require("@ltht-react/types");
27
+ var utils_1 = require("@ltht-react/utils");
28
+ var TimelineTime = function (_a) {
29
+ var _b, _c, _d;
30
+ var domainResource = _a.domainResource, domainResourceType = _a.domainResourceType, rest = __rest(_a, ["domainResource", "domainResourceType"]);
31
+ if (!domainResource)
32
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
33
+ switch (domainResourceType) {
34
+ case types_1.TimelineDomainResourceType.QuestionnaireResponse: {
35
+ var qr = domainResource;
36
+ if (!((_b = qr === null || qr === void 0 ? void 0 : qr.authored) === null || _b === void 0 ? void 0 : _b.value)) {
37
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
38
+ }
39
+ var time = utils_1.formatTime(new Date(qr === null || qr === void 0 ? void 0 : qr.authored.value));
40
+ return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
41
+ }
42
+ case types_1.TimelineDomainResourceType.DocumentReference: {
43
+ var docRef = domainResource;
44
+ if (docRef && ((_c = docRef === null || docRef === void 0 ? void 0 : docRef.created) === null || _c === void 0 ? void 0 : _c.value)) {
45
+ var time = utils_1.formatTime(new Date(docRef.created.value));
46
+ return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
47
+ }
48
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
49
+ }
50
+ case types_1.TimelineDomainResourceType.AuditEvent: {
51
+ var audit = domainResource;
52
+ if (audit && ((_d = audit === null || audit === void 0 ? void 0 : audit.recorded) === null || _d === void 0 ? void 0 : _d.value)) {
53
+ var time = utils_1.formatTime(new Date(audit.recorded.value));
54
+ return jsx_runtime_1.jsx("div", __assign({}, rest, { children: time }), void 0);
55
+ }
56
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
57
+ }
58
+ default:
59
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
60
+ }
61
+ };
62
+ exports.default = TimelineTime;
63
63
  //# sourceMappingURL=timeline-time.js.map
@@ -1,3 +1,3 @@
1
- import { FC, HTMLAttributes } from 'react';
2
- declare const TimelineTitleRedacted: FC<HTMLAttributes<HTMLDivElement>>;
3
- export default TimelineTitleRedacted;
1
+ import { FC, HTMLAttributes } from 'react';
2
+ declare const TimelineTitleRedacted: FC<HTMLAttributes<HTMLDivElement>>;
3
+ export default TimelineTitleRedacted;