@ltht-react/timeline 1.0.92 → 1.0.94

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.
@@ -1,70 +1,70 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- var jsx_runtime_1 = require("react/jsx-runtime");
22
- var styled_1 = __importDefault(require("@emotion/styled"));
23
- var banner_1 = __importDefault(require("@ltht-react/banner"));
24
- var icon_1 = require("@ltht-react/icon");
25
- var styles_1 = require("@ltht-react/styles");
26
- var hooks_1 = require("@ltht-react/hooks");
27
- var utils_1 = require("@ltht-react/utils");
28
- var timeline_description_1 = __importDefault(require("../atoms/timeline-description"));
29
- var timeline_author_1 = __importDefault(require("../atoms/timeline-author"));
30
- var timeline_status_1 = __importDefault(require("../atoms/timeline-status"));
31
- var timeline_title_1 = __importDefault(require("../atoms/timeline-title"));
32
- var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
33
- var StyledTimelineItem = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n padding: 0.5rem;\n"], ["\n background-color: ", ";\n padding: 0.5rem;\n"])), function (_a) {
34
- var isSelected = _a.isSelected;
35
- return (isSelected ? styles_1.HIGHLIGHT_GREEN.VALUE : styles_1.TRANSLUCENT_DARK_BLUE);
36
- });
37
- var StyledTimelineItemLeft = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
38
- var StyledTimelineItemRight = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
39
- var StyledTimelineTime = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: black;\n"], ["\n color: black;\n"])));
40
- var StyledTimelineItemTop = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"], ["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"])));
41
- var StyledTimelineItemMiddle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: black;\n padding-bottom: 1rem;\n"], ["\n color: black;\n padding-bottom: 1rem;\n"])));
42
- var StyledTimelineItemBottom = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: grey;\n display: flex;\n"], ["\n color: grey;\n display: flex;\n"])));
43
- var StyledTitle = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"], ["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"])), function (_a) {
44
- var isMobile = _a.isMobile;
45
- return (isMobile ? 'medium' : 'large');
46
- });
47
- var StyledDescription = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: black;\n font-size: small;\n"], ["\n color: black;\n font-size: small;\n"])));
48
- var StyledStatus = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
49
- var StyledBanner = styled_1.default(banner_1.default)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"], ["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"])));
50
- var StyledBannerContent = styled_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject([""], [""])));
51
- var TimelineItem = function (_a) {
52
- var _b;
53
- var timelineItem = _a.timelineItem, domainResourceType = _a.domainResourceType;
54
- var width = hooks_1.useWindowSize().width;
55
- var isMobile = utils_1.isMobileView(width);
56
- if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
57
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
58
- }
59
- var itemKey = "timelineItem_" + timelineItem.domainResource.id;
60
- return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected: (_b = timelineItem.isSelected) !== null && _b !== void 0 ? _b : false }, { children: [jsx_runtime_1.jsxs(StyledTimelineItemTop, { children: [jsx_runtime_1.jsx(StyledTitle, __assign({ isMobile: isMobile }, { children: jsx_runtime_1.jsx(timeline_title_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }), void 0),
61
- isMobile && (jsx_runtime_1.jsx(StyledTimelineTime, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0))] }, void 0),
62
- jsx_runtime_1.jsx(StyledTimelineItemMiddle, { children: jsx_runtime_1.jsx(StyledDescription, { children: jsx_runtime_1.jsx(timeline_description_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0) }, void 0),
63
- jsx_runtime_1.jsxs(StyledTimelineItemBottom, { children: [jsx_runtime_1.jsx(StyledTimelineItemLeft, { children: jsx_runtime_1.jsx(timeline_author_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
64
- jsx_runtime_1.jsx(StyledTimelineItemRight, { children: jsx_runtime_1.jsx(StyledStatus, { children: jsx_runtime_1.jsx(timeline_status_1.default, {}, void 0) }, void 0) }, void 0)] }, void 0),
65
- timelineItem.clickHandler && !timelineItem.isSelected && (jsx_runtime_1.jsx(StyledBanner, __assign({ type: "info", onClick: timelineItem.clickHandler }, { children: timelineItem.clickPrompt && jsx_runtime_1.jsx(StyledBannerContent, { children: timelineItem.clickPrompt }, void 0) }), void 0)),
66
- timelineItem.clickHandler && timelineItem.isSelected && (jsx_runtime_1.jsx(StyledBanner, __assign({ type: "highlight", icon: jsx_runtime_1.jsx(icon_1.InfoCircleIcon, { status: "info", size: "medium" }, void 0), onClick: timelineItem.clickHandler }, { children: timelineItem.deselectPrompt && jsx_runtime_1.jsx(StyledBannerContent, { children: timelineItem.deselectPrompt }, void 0) }), void 0))] }), itemKey));
67
- };
68
- exports.default = TimelineItem;
69
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var styled_1 = __importDefault(require("@emotion/styled"));
23
+ var banner_1 = __importDefault(require("@ltht-react/banner"));
24
+ var icon_1 = require("@ltht-react/icon");
25
+ var styles_1 = require("@ltht-react/styles");
26
+ var hooks_1 = require("@ltht-react/hooks");
27
+ var utils_1 = require("@ltht-react/utils");
28
+ var timeline_description_1 = __importDefault(require("../atoms/timeline-description"));
29
+ var timeline_author_1 = __importDefault(require("../atoms/timeline-author"));
30
+ var timeline_status_1 = __importDefault(require("../atoms/timeline-status"));
31
+ var timeline_title_1 = __importDefault(require("../atoms/timeline-title"));
32
+ var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
33
+ var StyledTimelineItem = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n padding: 0.5rem;\n"], ["\n background-color: ", ";\n padding: 0.5rem;\n"])), function (_a) {
34
+ var isSelected = _a.isSelected;
35
+ return (isSelected ? styles_1.HIGHLIGHT_GREEN.VALUE : styles_1.TRANSLUCENT_DARK_BLUE);
36
+ });
37
+ var StyledTimelineItemLeft = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 1;\n"], ["\n flex-grow: 1;\n"])));
38
+ var StyledTimelineItemRight = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
39
+ var StyledTimelineTime = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: black;\n"], ["\n color: black;\n"])));
40
+ var StyledTimelineItemTop = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"], ["\n display: flex;\n color: black;\n padding-bottom: 0.25rem;\n"])));
41
+ var StyledTimelineItemMiddle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: black;\n padding-bottom: 1rem;\n"], ["\n color: black;\n padding-bottom: 1rem;\n"])));
42
+ var StyledTimelineItemBottom = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: grey;\n display: flex;\n"], ["\n color: grey;\n display: flex;\n"])));
43
+ var StyledTitle = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"], ["\n flex-grow: 1;\n color: black;\n font-size: ", ";\n font-weight: bold;\n"])), function (_a) {
44
+ var isMobile = _a.isMobile;
45
+ return (isMobile ? 'medium' : 'large');
46
+ });
47
+ var StyledDescription = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: black;\n font-size: small;\n"], ["\n color: black;\n font-size: small;\n"])));
48
+ var StyledStatus = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n text-align: right;\n"], ["\n text-align: right;\n"])));
49
+ var StyledBanner = styled_1.default(banner_1.default)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"], ["\n margin: -0.5rem;\n margin-top: 0.5rem;\n"])));
50
+ var StyledBannerContent = styled_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject([""], [""])));
51
+ var TimelineItem = function (_a) {
52
+ var _b;
53
+ var timelineItem = _a.timelineItem, domainResourceType = _a.domainResourceType;
54
+ var width = hooks_1.useWindowSize().width;
55
+ var isMobile = utils_1.isMobileView(width);
56
+ if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
57
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
58
+ }
59
+ var itemKey = "timelineItem_" + timelineItem.domainResource.id;
60
+ return (jsx_runtime_1.jsxs(StyledTimelineItem, __assign({ isSelected: (_b = timelineItem.isSelected) !== null && _b !== void 0 ? _b : false }, { children: [jsx_runtime_1.jsxs(StyledTimelineItemTop, { children: [jsx_runtime_1.jsx(StyledTitle, __assign({ isMobile: isMobile }, { children: jsx_runtime_1.jsx(timeline_title_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }), void 0),
61
+ isMobile && (jsx_runtime_1.jsx(StyledTimelineTime, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0))] }, void 0),
62
+ jsx_runtime_1.jsx(StyledTimelineItemMiddle, { children: jsx_runtime_1.jsx(StyledDescription, { children: jsx_runtime_1.jsx(timeline_description_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0) }, void 0),
63
+ jsx_runtime_1.jsxs(StyledTimelineItemBottom, { children: [jsx_runtime_1.jsx(StyledTimelineItemLeft, { children: jsx_runtime_1.jsx(timeline_author_1.default, { domainResource: timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
64
+ jsx_runtime_1.jsx(StyledTimelineItemRight, { children: jsx_runtime_1.jsx(StyledStatus, { children: jsx_runtime_1.jsx(timeline_status_1.default, {}, void 0) }, void 0) }, void 0)] }, void 0),
65
+ timelineItem.clickHandler && !timelineItem.isSelected && (jsx_runtime_1.jsx(StyledBanner, __assign({ type: "info", onClick: timelineItem.clickHandler }, { children: timelineItem.clickPrompt && jsx_runtime_1.jsx(StyledBannerContent, { children: timelineItem.clickPrompt }, void 0) }), void 0)),
66
+ timelineItem.clickHandler && timelineItem.isSelected && (jsx_runtime_1.jsx(StyledBanner, __assign({ type: "highlight", icon: jsx_runtime_1.jsx(icon_1.InfoCircleIcon, { status: "info", size: "medium" }, void 0), onClick: timelineItem.clickHandler }, { children: timelineItem.deselectPrompt && jsx_runtime_1.jsx(StyledBannerContent, { children: timelineItem.deselectPrompt }, void 0) }), void 0))] }), itemKey));
67
+ };
68
+ exports.default = TimelineItem;
69
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
70
70
  //# sourceMappingURL=timeline-item.js.map
@@ -1,9 +1,9 @@
1
- import { FC } from 'react';
2
- import { Maybe, TimelineDomainResourceType } from '@ltht-react/types';
3
- import { ITimelineItem } from '../molecules/timeline-item';
4
- declare const Timeline: FC<IProps>;
5
- interface IProps {
6
- timelineItems: Maybe<ITimelineItem>[];
7
- domainResourceType: TimelineDomainResourceType;
8
- }
9
- export default Timeline;
1
+ import { FC } from 'react';
2
+ import { Maybe, TimelineDomainResourceType } from '@ltht-react/types';
3
+ import { ITimelineItem } from '../molecules/timeline-item';
4
+ declare const Timeline: FC<IProps>;
5
+ interface IProps {
6
+ timelineItems: Maybe<ITimelineItem>[];
7
+ domainResourceType: TimelineDomainResourceType;
8
+ }
9
+ export default Timeline;
@@ -1,170 +1,170 @@
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- var jsx_runtime_1 = require("react/jsx-runtime");
22
- var styled_1 = __importDefault(require("@emotion/styled"));
23
- var icon_1 = require("@ltht-react/icon");
24
- var styles_1 = require("@ltht-react/styles");
25
- var types_1 = require("@ltht-react/types");
26
- var utils_1 = require("@ltht-react/utils");
27
- var hooks_1 = require("@ltht-react/hooks");
28
- var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
29
- var timeline_item_1 = __importDefault(require("../molecules/timeline-item"));
30
- var StyledTimeline = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: -0.75rem;\n"], ["\n margin: -0.75rem;\n"])));
31
- var StyledTimelineDayBody = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: white;\n position: relative;\n\n &:before {\n content: '';\n position: absolute;\n z-index: 1;\n height: ", ";\n left: calc(50% - 1px);\n border-width: 0 0 0 2px;\n border-color: ", ";\n border-style: solid;\n }\n"], ["\n background-color: white;\n position: relative;\n\n &:before {\n content: '';\n position: absolute;\n z-index: 1;\n height: ", ";\n left: calc(50% - 1px);\n border-width: 0 0 0 2px;\n border-color: ", ";\n border-style: solid;\n }\n"])), function (_a) {
32
- var isMobile = _a.isMobile;
33
- return (isMobile ? '0%' : '100%');
34
- }, styles_1.TEXT_COLOURS.INFO);
35
- var StyledTimelineDayHeader = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n padding: 0.5rem;\n text-align: center;\n font-weight: bold;\n"], ["\n background-color: ", ";\n padding: 0.5rem;\n text-align: center;\n font-weight: bold;\n"])), styles_1.BANNER_COLOURS.DEFAULT.BACKGROUND);
36
- var StyledTimelineDayItem = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n width: 100%;\n justify-content: center;\n padding: ", ";\n margin: ", ";\n"], ["\n display: inline-block;\n width: 100%;\n justify-content: center;\n padding: ", ";\n margin: ", ";\n"])), function (_a) {
37
- var isMobile = _a.isMobile;
38
- return (isMobile ? '' : '0 0.5rem');
39
- }, function (_a) {
40
- var isMobile = _a.isMobile;
41
- return (isMobile ? '0.5rem 0' : '1rem 0');
42
- });
43
- var StyledTimelineDayContent = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: ", ";\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n"], ["\n width: ", ";\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n"])), function (_a) {
44
- var isMobile = _a.isMobile;
45
- return (isMobile ? '100%' : '49%');
46
- });
47
- var StyledTimelineDayLine = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 2%;\n vertical-align: top;\n margin-top: 0.125rem;\n display: inline-block;\n text-align: center;\n position: relative;\n height: 100%;\n"], ["\n width: 2%;\n vertical-align: top;\n margin-top: 0.125rem;\n display: inline-block;\n text-align: center;\n position: relative;\n height: 100%;\n"])));
48
- var StyledTimelineDayTimeLeft = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: right;\n font-weight: bold;\n"], ["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: right;\n font-weight: bold;\n"])));
49
- var StyledTimelineDayTimeRight = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: left;\n font-weight: bold;\n"], ["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: left;\n font-weight: bold;\n"])));
50
- var StyledOuterCircle = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n .icon__circle {\n position: absolute;\n z-index: 1;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: ", ";\n font-size: 0.75rem;\n }\n"], ["\n .icon__circle {\n position: absolute;\n z-index: 1;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: ", ";\n font-size: 0.75rem;\n }\n"])), styles_1.TEXT_COLOURS.INFO);
51
- var StyledInnerCircle = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n .icon__circle {\n position: absolute;\n z-index: 2;\n top: 0.125rem;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: white;\n font-size: 0.5rem;\n }\n"], ["\n .icon__circle {\n position: absolute;\n z-index: 2;\n top: 0.125rem;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: white;\n font-size: 0.5rem;\n }\n"])));
52
- var Timeline = function (_a) {
53
- var timelineItems = _a.timelineItems, domainResourceType = _a.domainResourceType;
54
- var width = hooks_1.useWindowSize().width;
55
- var isMobile = utils_1.isMobileView(width);
56
- var timelineDates = {};
57
- timelineItems === null || timelineItems === void 0 ? void 0 : timelineItems.forEach(function (timelineItem) {
58
- var _a, _b, _c, _d, _e, _f, _g;
59
- if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
60
- return;
61
- }
62
- var date = '';
63
- var displayDate = '';
64
- switch (domainResourceType) {
65
- case types_1.TimelineDomainResourceType.DocumentReference: {
66
- var docRef = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
67
- if (!((_a = docRef.created) === null || _a === void 0 ? void 0 : _a.value)) {
68
- return;
69
- }
70
- date = utils_1.formatDate(new Date(docRef.created.value));
71
- displayDate = utils_1.formatDateExplicitMonth(new Date(docRef.created.value));
72
- break;
73
- }
74
- case types_1.TimelineDomainResourceType.AuditEvent: {
75
- var audit = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
76
- if (!((_c = (_b = audit.period) === null || _b === void 0 ? void 0 : _b.start) === null || _c === void 0 ? void 0 : _c.value)) {
77
- return;
78
- }
79
- date = utils_1.formatDate(new Date((_e = (_d = audit.period) === null || _d === void 0 ? void 0 : _d.start) === null || _e === void 0 ? void 0 : _e.value));
80
- displayDate = utils_1.formatDateExplicitMonth(new Date((_g = (_f = audit.period) === null || _f === void 0 ? void 0 : _f.start) === null || _g === void 0 ? void 0 : _g.value));
81
- break;
82
- }
83
- default:
84
- throw Error('Unrecognised resource type');
85
- }
86
- var lookup = timelineDates[date];
87
- if (!lookup) {
88
- timelineDates[date] = { item: [timelineItem], formattedDate: displayDate };
89
- }
90
- else {
91
- lookup.item.push(timelineItem);
92
- timelineDates[date] = lookup;
93
- }
94
- });
95
- var position = 0;
96
- return (jsx_runtime_1.jsx(StyledTimeline, __assign({ "data-testid": "timeline" }, { children: Object.entries(timelineDates).map(function (_a) {
97
- var _b;
98
- var dateKey = _a[0], value = _a[1];
99
- position += 1;
100
- return (jsx_runtime_1.jsxs("div", __assign({ "data-testid": dateKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayHeader, { children: value.formattedDate }, void 0),
101
- jsx_runtime_1.jsx(StyledTimelineDayBody, __assign({ isMobile: isMobile }, { children: (_b = value.item) === null || _b === void 0 ? void 0 : _b.map(function (timelineItem, idx) {
102
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
103
- var content = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
104
- if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
105
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
106
- }
107
- var currentTime = '';
108
- var previousTime = '';
109
- switch (domainResourceType) {
110
- case types_1.TimelineDomainResourceType.DocumentReference: {
111
- var docRef = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
112
- if (!((_a = docRef.created) === null || _a === void 0 ? void 0 : _a.value)) {
113
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
114
- }
115
- currentTime = utils_1.formatTime(new Date(docRef.created.value));
116
- previousTime = currentTime;
117
- if (idx > 0) {
118
- var previousItem = (_b = value.item[idx - 1]) === null || _b === void 0 ? void 0 : _b.domainResource;
119
- if (!((_c = previousItem === null || previousItem === void 0 ? void 0 : previousItem.created) === null || _c === void 0 ? void 0 : _c.value)) {
120
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
121
- }
122
- previousTime = utils_1.formatTime(new Date((_d = previousItem === null || previousItem === void 0 ? void 0 : previousItem.created) === null || _d === void 0 ? void 0 : _d.value));
123
- }
124
- break;
125
- }
126
- case types_1.TimelineDomainResourceType.AuditEvent: {
127
- var audit = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
128
- if (!((_f = (_e = audit.period) === null || _e === void 0 ? void 0 : _e.start) === null || _f === void 0 ? void 0 : _f.value)) {
129
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
130
- }
131
- currentTime = utils_1.formatTime(new Date((_h = (_g = audit.period) === null || _g === void 0 ? void 0 : _g.start) === null || _h === void 0 ? void 0 : _h.value));
132
- previousTime = currentTime;
133
- if (idx > 0) {
134
- var previousItem = (_j = value.item[idx - 1]) === null || _j === void 0 ? void 0 : _j.domainResource;
135
- if (!((_l = (_k = previousItem === null || previousItem === void 0 ? void 0 : previousItem.period) === null || _k === void 0 ? void 0 : _k.start) === null || _l === void 0 ? void 0 : _l.value)) {
136
- return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
137
- }
138
- previousTime = utils_1.formatTime(new Date((_o = (_m = previousItem === null || previousItem === void 0 ? void 0 : previousItem.period) === null || _m === void 0 ? void 0 : _m.start) === null || _o === void 0 ? void 0 : _o.value));
139
- }
140
- break;
141
- }
142
- }
143
- if (currentTime !== previousTime) {
144
- position += 1;
145
- }
146
- var itemKey = "timeline_day_item_" + dateKey + "_" + currentTime + "_" + idx;
147
- if (isMobile) {
148
- content = (jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: true }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0));
149
- }
150
- else if (position % 2 === 1) {
151
- var contentKey = "content_left_" + itemKey;
152
- content = (jsx_runtime_1.jsxs("div", __assign({ "data-testid": contentKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: false }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0),
153
- jsx_runtime_1.jsxs(StyledTimelineDayLine, { children: [jsx_runtime_1.jsx(StyledOuterCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0),
154
- jsx_runtime_1.jsx(StyledInnerCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0)] }, void 0),
155
- jsx_runtime_1.jsx(StyledTimelineDayTimeRight, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0)] }), contentKey));
156
- }
157
- else if (position % 2 === 0) {
158
- var contentKey = "content_right_" + itemKey;
159
- content = (jsx_runtime_1.jsxs("div", __assign({ "data-testid": contentKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayTimeLeft, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
160
- jsx_runtime_1.jsxs(StyledTimelineDayLine, { children: [jsx_runtime_1.jsx(StyledOuterCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0),
161
- jsx_runtime_1.jsx(StyledInnerCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0)] }, void 0),
162
- jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: false }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0)] }), contentKey));
163
- }
164
- return (jsx_runtime_1.jsx(StyledTimelineDayItem, __assign({ isMobile: isMobile, "data-testid": itemKey }, { children: content }), itemKey));
165
- }) }), void 0)] }), dateKey));
166
- }) }), "timeline"));
167
- };
168
- exports.default = Timeline;
169
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
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 __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ var jsx_runtime_1 = require("react/jsx-runtime");
22
+ var styled_1 = __importDefault(require("@emotion/styled"));
23
+ var icon_1 = require("@ltht-react/icon");
24
+ var styles_1 = require("@ltht-react/styles");
25
+ var types_1 = require("@ltht-react/types");
26
+ var utils_1 = require("@ltht-react/utils");
27
+ var hooks_1 = require("@ltht-react/hooks");
28
+ var timeline_time_1 = __importDefault(require("../atoms/timeline-time"));
29
+ var timeline_item_1 = __importDefault(require("../molecules/timeline-item"));
30
+ var StyledTimeline = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: -0.75rem;\n"], ["\n margin: -0.75rem;\n"])));
31
+ var StyledTimelineDayBody = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: white;\n position: relative;\n\n &:before {\n content: '';\n position: absolute;\n z-index: 1;\n height: ", ";\n left: calc(50% - 1px);\n border-width: 0 0 0 2px;\n border-color: ", ";\n border-style: solid;\n }\n"], ["\n background-color: white;\n position: relative;\n\n &:before {\n content: '';\n position: absolute;\n z-index: 1;\n height: ", ";\n left: calc(50% - 1px);\n border-width: 0 0 0 2px;\n border-color: ", ";\n border-style: solid;\n }\n"])), function (_a) {
32
+ var isMobile = _a.isMobile;
33
+ return (isMobile ? '0%' : '100%');
34
+ }, styles_1.TEXT_COLOURS.INFO);
35
+ var StyledTimelineDayHeader = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n padding: 0.5rem;\n text-align: center;\n font-weight: bold;\n"], ["\n background-color: ", ";\n padding: 0.5rem;\n text-align: center;\n font-weight: bold;\n"])), styles_1.BANNER_COLOURS.DEFAULT.BACKGROUND);
36
+ var StyledTimelineDayItem = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n width: 100%;\n justify-content: center;\n padding: ", ";\n margin: ", ";\n"], ["\n display: inline-block;\n width: 100%;\n justify-content: center;\n padding: ", ";\n margin: ", ";\n"])), function (_a) {
37
+ var isMobile = _a.isMobile;
38
+ return (isMobile ? '' : '0 0.5rem');
39
+ }, function (_a) {
40
+ var isMobile = _a.isMobile;
41
+ return (isMobile ? '0.5rem 0' : '1rem 0');
42
+ });
43
+ var StyledTimelineDayContent = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: ", ";\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n"], ["\n width: ", ";\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n"])), function (_a) {
44
+ var isMobile = _a.isMobile;
45
+ return (isMobile ? '100%' : '49%');
46
+ });
47
+ var StyledTimelineDayLine = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 2%;\n vertical-align: top;\n margin-top: 0.125rem;\n display: inline-block;\n text-align: center;\n position: relative;\n height: 100%;\n"], ["\n width: 2%;\n vertical-align: top;\n margin-top: 0.125rem;\n display: inline-block;\n text-align: center;\n position: relative;\n height: 100%;\n"])));
48
+ var StyledTimelineDayTimeLeft = styled_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: right;\n font-weight: bold;\n"], ["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: right;\n font-weight: bold;\n"])));
49
+ var StyledTimelineDayTimeRight = styled_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: left;\n font-weight: bold;\n"], ["\n width: 49%;\n padding: 0 0.5rem;\n display: inline-block;\n vertical-align: top;\n text-align: left;\n font-weight: bold;\n"])));
50
+ var StyledOuterCircle = styled_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n .icon__circle {\n position: absolute;\n z-index: 1;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: ", ";\n font-size: 0.75rem;\n }\n"], ["\n .icon__circle {\n position: absolute;\n z-index: 1;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: ", ";\n font-size: 0.75rem;\n }\n"])), styles_1.TEXT_COLOURS.INFO);
51
+ var StyledInnerCircle = styled_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n .icon__circle {\n position: absolute;\n z-index: 2;\n top: 0.125rem;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: white;\n font-size: 0.5rem;\n }\n"], ["\n .icon__circle {\n position: absolute;\n z-index: 2;\n top: 0.125rem;\n transform: translate(-50%);\n -webkit-transform: translate(-50%);\n -ms-transform: translate(-50%);\n left: 50%;\n color: white;\n font-size: 0.5rem;\n }\n"])));
52
+ var Timeline = function (_a) {
53
+ var timelineItems = _a.timelineItems, domainResourceType = _a.domainResourceType;
54
+ var width = hooks_1.useWindowSize().width;
55
+ var isMobile = utils_1.isMobileView(width);
56
+ var timelineDates = {};
57
+ timelineItems === null || timelineItems === void 0 ? void 0 : timelineItems.forEach(function (timelineItem) {
58
+ var _a, _b, _c, _d, _e, _f, _g;
59
+ if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
60
+ return;
61
+ }
62
+ var date = '';
63
+ var displayDate = '';
64
+ switch (domainResourceType) {
65
+ case types_1.TimelineDomainResourceType.DocumentReference: {
66
+ var docRef = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
67
+ if (!((_a = docRef.created) === null || _a === void 0 ? void 0 : _a.value)) {
68
+ return;
69
+ }
70
+ date = utils_1.formatDate(new Date(docRef.created.value));
71
+ displayDate = utils_1.formatDateExplicitMonth(new Date(docRef.created.value));
72
+ break;
73
+ }
74
+ case types_1.TimelineDomainResourceType.AuditEvent: {
75
+ var audit = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
76
+ if (!((_c = (_b = audit.period) === null || _b === void 0 ? void 0 : _b.start) === null || _c === void 0 ? void 0 : _c.value)) {
77
+ return;
78
+ }
79
+ date = utils_1.formatDate(new Date((_e = (_d = audit.period) === null || _d === void 0 ? void 0 : _d.start) === null || _e === void 0 ? void 0 : _e.value));
80
+ displayDate = utils_1.formatDateExplicitMonth(new Date((_g = (_f = audit.period) === null || _f === void 0 ? void 0 : _f.start) === null || _g === void 0 ? void 0 : _g.value));
81
+ break;
82
+ }
83
+ default:
84
+ throw Error('Unrecognised resource type');
85
+ }
86
+ var lookup = timelineDates[date];
87
+ if (!lookup) {
88
+ timelineDates[date] = { item: [timelineItem], formattedDate: displayDate };
89
+ }
90
+ else {
91
+ lookup.item.push(timelineItem);
92
+ timelineDates[date] = lookup;
93
+ }
94
+ });
95
+ var position = 0;
96
+ return (jsx_runtime_1.jsx(StyledTimeline, __assign({ "data-testid": "timeline" }, { children: Object.entries(timelineDates).map(function (_a) {
97
+ var _b;
98
+ var dateKey = _a[0], value = _a[1];
99
+ position += 1;
100
+ return (jsx_runtime_1.jsxs("div", __assign({ "data-testid": dateKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayHeader, { children: value.formattedDate }, void 0),
101
+ jsx_runtime_1.jsx(StyledTimelineDayBody, __assign({ isMobile: isMobile }, { children: (_b = value.item) === null || _b === void 0 ? void 0 : _b.map(function (timelineItem, idx) {
102
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
103
+ var content = jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
104
+ if (!(timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource)) {
105
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
106
+ }
107
+ var currentTime = '';
108
+ var previousTime = '';
109
+ switch (domainResourceType) {
110
+ case types_1.TimelineDomainResourceType.DocumentReference: {
111
+ var docRef = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
112
+ if (!((_a = docRef.created) === null || _a === void 0 ? void 0 : _a.value)) {
113
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
114
+ }
115
+ currentTime = utils_1.formatTime(new Date(docRef.created.value));
116
+ previousTime = currentTime;
117
+ if (idx > 0) {
118
+ var previousItem = (_b = value.item[idx - 1]) === null || _b === void 0 ? void 0 : _b.domainResource;
119
+ if (!((_c = previousItem === null || previousItem === void 0 ? void 0 : previousItem.created) === null || _c === void 0 ? void 0 : _c.value)) {
120
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
121
+ }
122
+ previousTime = utils_1.formatTime(new Date((_d = previousItem === null || previousItem === void 0 ? void 0 : previousItem.created) === null || _d === void 0 ? void 0 : _d.value));
123
+ }
124
+ break;
125
+ }
126
+ case types_1.TimelineDomainResourceType.AuditEvent: {
127
+ var audit = timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource;
128
+ if (!((_f = (_e = audit.period) === null || _e === void 0 ? void 0 : _e.start) === null || _f === void 0 ? void 0 : _f.value)) {
129
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
130
+ }
131
+ currentTime = utils_1.formatTime(new Date((_h = (_g = audit.period) === null || _g === void 0 ? void 0 : _g.start) === null || _h === void 0 ? void 0 : _h.value));
132
+ previousTime = currentTime;
133
+ if (idx > 0) {
134
+ var previousItem = (_j = value.item[idx - 1]) === null || _j === void 0 ? void 0 : _j.domainResource;
135
+ if (!((_l = (_k = previousItem === null || previousItem === void 0 ? void 0 : previousItem.period) === null || _k === void 0 ? void 0 : _k.start) === null || _l === void 0 ? void 0 : _l.value)) {
136
+ return jsx_runtime_1.jsx(jsx_runtime_1.Fragment, {}, void 0);
137
+ }
138
+ previousTime = utils_1.formatTime(new Date((_o = (_m = previousItem === null || previousItem === void 0 ? void 0 : previousItem.period) === null || _m === void 0 ? void 0 : _m.start) === null || _o === void 0 ? void 0 : _o.value));
139
+ }
140
+ break;
141
+ }
142
+ }
143
+ if (currentTime !== previousTime) {
144
+ position += 1;
145
+ }
146
+ var itemKey = "timeline_day_item_" + dateKey + "_" + currentTime + "_" + idx;
147
+ if (isMobile) {
148
+ content = (jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: true }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0));
149
+ }
150
+ else if (position % 2 === 1) {
151
+ var contentKey = "content_left_" + itemKey;
152
+ content = (jsx_runtime_1.jsxs("div", __assign({ "data-testid": contentKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: false }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0),
153
+ jsx_runtime_1.jsxs(StyledTimelineDayLine, { children: [jsx_runtime_1.jsx(StyledOuterCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0),
154
+ jsx_runtime_1.jsx(StyledInnerCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0)] }, void 0),
155
+ jsx_runtime_1.jsx(StyledTimelineDayTimeRight, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0)] }), contentKey));
156
+ }
157
+ else if (position % 2 === 0) {
158
+ var contentKey = "content_right_" + itemKey;
159
+ content = (jsx_runtime_1.jsxs("div", __assign({ "data-testid": contentKey }, { children: [jsx_runtime_1.jsx(StyledTimelineDayTimeLeft, { children: jsx_runtime_1.jsx(timeline_time_1.default, { domainResource: timelineItem === null || timelineItem === void 0 ? void 0 : timelineItem.domainResource, domainResourceType: domainResourceType }, void 0) }, void 0),
160
+ jsx_runtime_1.jsxs(StyledTimelineDayLine, { children: [jsx_runtime_1.jsx(StyledOuterCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0),
161
+ jsx_runtime_1.jsx(StyledInnerCircle, { children: jsx_runtime_1.jsx(icon_1.CircleIcon, { status: "info", size: "medium" }, void 0) }, void 0)] }, void 0),
162
+ jsx_runtime_1.jsx(StyledTimelineDayContent, __assign({ isMobile: false }, { children: jsx_runtime_1.jsx(timeline_item_1.default, { timelineItem: timelineItem, domainResourceType: domainResourceType }, void 0) }), void 0)] }), contentKey));
163
+ }
164
+ return (jsx_runtime_1.jsx(StyledTimelineDayItem, __assign({ isMobile: isMobile, "data-testid": itemKey }, { children: content }), itemKey));
165
+ }) }), void 0)] }), dateKey));
166
+ }) }), "timeline"));
167
+ };
168
+ exports.default = Timeline;
169
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10;
170
170
  //# sourceMappingURL=timeline.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/timeline",
3
- "version": "1.0.92",
3
+ "version": "1.0.94",
4
4
  "description": "> TODO: description",
5
5
  "author": "Jonny Dyson",
6
6
  "homepage": "",
@@ -23,14 +23,14 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@emotion/styled": "^11.0.0",
26
- "@ltht-react/banner": "^1.0.77",
27
- "@ltht-react/hooks": "^1.0.94",
28
- "@ltht-react/icon": "^1.3.104",
29
- "@ltht-react/styles": "^1.3.96",
30
- "@ltht-react/types": "^1.0.100",
31
- "@ltht-react/utils": "^1.1.102",
26
+ "@ltht-react/banner": "^1.0.79",
27
+ "@ltht-react/hooks": "^1.0.96",
28
+ "@ltht-react/icon": "^1.3.106",
29
+ "@ltht-react/styles": "^1.3.98",
30
+ "@ltht-react/types": "^1.0.102",
31
+ "@ltht-react/utils": "^1.1.104",
32
32
  "react": "^17.0.0",
33
33
  "react-html-parser": "^2.0.2"
34
34
  },
35
- "gitHead": "2f6716e66cc159177586942f09efe3f146f7f39b"
35
+ "gitHead": "e2d8836676c208c6e1cfd184bba189b7c7e2a564"
36
36
  }
package/lib/methods.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { AuditEvent, DocumentReference } from '@ltht-react/types';
2
- declare const isDocumentReference: (domainResource: AuditEvent | DocumentReference) => boolean;
3
- export default isDocumentReference;
package/lib/methods.js DELETED
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var isDocumentReference = function (domainResource) {
4
- var docRef = domainResource;
5
- return docRef.status !== undefined;
6
- };
7
- exports.default = isDocumentReference;
8
- //# sourceMappingURL=methods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"methods.js","sourceRoot":"","sources":["../src/methods.ts"],"names":[],"mappings":";;AAEA,IAAM,mBAAmB,GAAG,UAAC,cAA8C;IACzE,IAAM,MAAM,GAAG,cAAmC,CAAA;IAClD,OAAO,MAAM,CAAC,MAAM,KAAK,SAAS,CAAA;AACpC,CAAC,CAAA;AAED,kBAAe,mBAAmB,CAAA"}