@ltht-react/plan-definition-editor 1.0.111 → 1.0.113

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/lib/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { PlanDefinition } from '@ltht-react/types';
2
- import { FC } from 'react';
3
- export declare const SelectedPlanDetail: FC<ISelectedPlanDetailProps>;
4
- export interface ProblemState {
5
- problemId: string;
6
- state: boolean;
7
- }
8
- export declare type OnProblemChange = (e: ProblemState[]) => void;
9
- export interface ISelectedPlanDetailProps {
10
- planDefinition: PlanDefinition;
11
- selectedProblemIds: string[];
12
- onProblemChange: OnProblemChange;
13
- }
14
- export default SelectedPlanDetail;
1
+ import { PlanDefinition } from '@ltht-react/types';
2
+ import { FC } from 'react';
3
+ export declare const SelectedPlanDetail: FC<ISelectedPlanDetailProps>;
4
+ export interface ProblemState {
5
+ problemId: string;
6
+ state: boolean;
7
+ }
8
+ export declare type OnProblemChange = (e: ProblemState[]) => void;
9
+ export interface ISelectedPlanDetailProps {
10
+ planDefinition: PlanDefinition;
11
+ selectedProblemIds: string[];
12
+ onProblemChange: OnProblemChange;
13
+ }
14
+ export default SelectedPlanDetail;
package/lib/index.js CHANGED
@@ -1,96 +1,96 @@
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
- exports.SelectedPlanDetail = void 0;
22
- var jsx_runtime_1 = require("react/jsx-runtime");
23
- var react_1 = require("@emotion/react");
24
- var styled_1 = __importDefault(require("@emotion/styled"));
25
- var styles_1 = require("@ltht-react/styles");
26
- var icon_1 = __importDefault(require("@ltht-react/icon"));
27
- var input_1 = require("@ltht-react/input");
28
- var react_2 = require("react");
29
- var toggleRowWidth = '3.5rem';
30
- var toggleInputMixin = react_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > div:first-of-type {\n text-align: right;\n width: ", ";\n padding-right: 1rem;\n }\n"], ["\n > div:first-of-type {\n text-align: right;\n width: ", ";\n padding-right: 1rem;\n }\n"])), toggleRowWidth);
31
- var StyledProblemToggleRow = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n font-weight: bold;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n"], ["\n display: flex;\n font-weight: bold;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n"])), toggleInputMixin);
32
- var StyledEducationToggleRow = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n\n > label svg {\n margin-right: 0.5rem;\n }\n"], ["\n display: flex;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n\n > label svg {\n margin-right: 0.5rem;\n }\n"])), toggleInputMixin);
33
- var StyledTargetRow = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n\n svg {\n align: right;\n margin-right: 1rem;\n }\n\n > span:first-of-type {\n text-align: right;\n display: block;\n width: ", ";\n }\n\n > div:first-of-type {\n flex: 1;\n text-align: left;\n }\n"], ["\n display: flex;\n align-items: center;\n ", "\n\n svg {\n align: right;\n margin-right: 1rem;\n }\n\n > span:first-of-type {\n text-align: right;\n display: block;\n width: ", ";\n }\n\n > div:first-of-type {\n flex: 1;\n text-align: left;\n }\n"])), toggleInputMixin, toggleRowWidth);
34
- var StyledListItem = styled_1.default.li(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-bottom: 1rem;\n\n ", " {\n }\n"], ["\n margin-bottom: 1rem;\n\n ", " {\n }\n"])), styles_1.WIDESCREEN_MINIMUM_MEDIA_QUERY);
35
- var StyledSectionToggle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n font-weight: bold;\n color: black;\n display: flex;\n align-items: center;\n padding: 0.5rem 0.25rem;\n ", "\n"], ["\n background-color: ", ";\n font-weight: bold;\n color: black;\n display: flex;\n align-items: center;\n padding: 0.5rem 0.25rem;\n ", "\n"])), styles_1.BANNER_COLOURS.INFO.BACKGROUND, toggleInputMixin);
36
- var StyledProblemSection = styled_1.default.ul(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n list-style: none;\n padding: 0.25rem 0.25rem;\n margin-bottom: 1rem;\n"], ["\n list-style: none;\n padding: 0.25rem 0.25rem;\n margin-bottom: 1rem;\n"])));
37
- var SelectedPlanDetail = function (_a) {
38
- var planDefinition = _a.planDefinition, selectedProblemIds = _a.selectedProblemIds, onProblemChange = _a.onProblemChange;
39
- // Split actions from plan definition into clinical problem based and education based
40
- var _b = react_2.useMemo(function () {
41
- var _a, _b;
42
- var problemActions = (_a = planDefinition.action) === null || _a === void 0 ? void 0 : _a.filter(function (action) { var _a; return (action === null || action === void 0 ? void 0 : action.code) && (action === null || action === void 0 ? void 0 : action.code[0]) && (action === null || action === void 0 ? void 0 : action.code[0].coding) && ((_a = action === null || action === void 0 ? void 0 : action.code[0].coding[0]) === null || _a === void 0 ? void 0 : _a.code) === 'problem'; });
43
- var educationActions = (_b = planDefinition.action) === null || _b === void 0 ? void 0 : _b.filter(function (action) { var _a; return (action === null || action === void 0 ? void 0 : action.code) && (action === null || action === void 0 ? void 0 : action.code[0]) && (action === null || action === void 0 ? void 0 : action.code[0].coding) && ((_a = action === null || action === void 0 ? void 0 : action.code[0].coding[0]) === null || _a === void 0 ? void 0 : _a.code) === 'education'; });
44
- return {
45
- problemActions: problemActions,
46
- educationActions: educationActions,
47
- };
48
- }, [planDefinition.action]), problemActions = _b.problemActions, educationActions = _b.educationActions;
49
- // Calculate whether all problems in the given categories are enabled
50
- var _c = react_2.useMemo(function () {
51
- var _a, _b;
52
- return ({
53
- allProblemsOn: (_a = problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (pa) { return pa === null || pa === void 0 ? void 0 : pa.elementId; }).every(function (id) { return selectedProblemIds.includes(id); })) !== null && _a !== void 0 ? _a : false,
54
- allEducationOn: (_b = educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (ea) { return ea === null || ea === void 0 ? void 0 : ea.elementId; }).every(function (id) { return selectedProblemIds.includes(id); })) !== null && _b !== void 0 ? _b : false,
55
- });
56
- }, [educationActions, problemActions, selectedProblemIds]), allProblemsOn = _c.allProblemsOn, allEducationOn = _c.allEducationOn;
57
- var handleSingleActionChange = function (e) {
58
- onProblemChange(e);
59
- };
60
- var handleToggleAllProblemsClick = function (e) {
61
- var newState = problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (p) { return ({ problemId: p === null || p === void 0 ? void 0 : p.elementId, state: e.target.checked }); });
62
- newState && onProblemChange(newState);
63
- };
64
- var handleToggleAllEducationClick = function (e) {
65
- var newState = educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (p) { return ({ problemId: p === null || p === void 0 ? void 0 : p.elementId, state: e.target.checked }); });
66
- newState && onProblemChange(newState);
67
- };
68
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsxs(StyledSectionToggle, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: allProblemsOn, onChange: function (e) { return handleToggleAllProblemsClick(e); }, id: "problem-toggle-all" }, void 0) }, void 0),
69
- jsx_runtime_1.jsx("label", __assign({ htmlFor: "problem-toggle-all" }, { children: "Patient Problems" }), void 0)] }, void 0),
70
- jsx_runtime_1.jsx(StyledProblemSection, { children: problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (problem, pidx) {
71
- var _a, _b, _c;
72
- var goal = (_a = planDefinition.goal) === null || _a === void 0 ? void 0 : _a.find(function (g) { var _a; return (problem === null || problem === void 0 ? void 0 : problem.goalId) && problem.goalId.length > 0 && ((_a = g === null || g === void 0 ? void 0 : g.elementId) === null || _a === void 0 ? void 0 : _a.includes(problem.goalId[0])); });
73
- return (jsx_runtime_1.jsxs(StyledListItem, { children: [jsx_runtime_1.jsxs(StyledProblemToggleRow, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: selectedProblemIds.includes(problem === null || problem === void 0 ? void 0 : problem.elementId), onChange: function (e) {
74
- return handleSingleActionChange([{ problemId: problem === null || problem === void 0 ? void 0 : problem.elementId, state: e.target.checked }]);
75
- }, id: "problem-" + pidx }, void 0) }, void 0),
76
- jsx_runtime_1.jsx("label", __assign({ htmlFor: "problem-" + pidx }, { children: problem === null || problem === void 0 ? void 0 : problem.description }), void 0)] }, void 0),
77
- jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsxs(StyledTargetRow, { children: [jsx_runtime_1.jsx("span", { children: jsx_runtime_1.jsx(icon_1.default, { type: "bullseye", size: "large" }, void 0) }, void 0),
78
- jsx_runtime_1.jsx("div", { children: (_b = goal === null || goal === void 0 ? void 0 : goal.description) === null || _b === void 0 ? void 0 : _b.text }, void 0)] }, void 0),
79
- (_c = problem === null || problem === void 0 ? void 0 : problem.action) === null || _c === void 0 ? void 0 : _c.map(function (interventionPlan, ipidx) {
80
- var _a;
81
- return (jsx_runtime_1.jsx(StyledTargetRow, { children: jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx("p", { children: interventionPlan === null || interventionPlan === void 0 ? void 0 : interventionPlan.description }, void 0),
82
- jsx_runtime_1.jsx("ul", { children: (_a = interventionPlan === null || interventionPlan === void 0 ? void 0 : interventionPlan.action) === null || _a === void 0 ? void 0 : _a.map(function (intervention, idx) { return (jsx_runtime_1.jsx("li", { children: intervention === null || intervention === void 0 ? void 0 : intervention.description }, "intervention-" + idx)); }) }, void 0)] }, void 0) }, "intervention-plan-" + ipidx));
83
- })] }, void 0)] }, "problem-" + pidx));
84
- }) }, void 0),
85
- jsx_runtime_1.jsxs(StyledSectionToggle, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: allEducationOn, onChange: function (e) { return handleToggleAllEducationClick(e); }, id: "education-toggle-all" }, void 0) }, void 0),
86
- jsx_runtime_1.jsx("label", __assign({ htmlFor: "education-toggle-all" }, { children: "Patient Education" }), void 0)] }, void 0),
87
- jsx_runtime_1.jsx(StyledProblemSection, { children: jsx_runtime_1.jsx(StyledListItem, { children: jsx_runtime_1.jsx("div", { children: educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (g, eaidx) { return (jsx_runtime_1.jsxs(StyledEducationToggleRow, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: selectedProblemIds.includes(g === null || g === void 0 ? void 0 : g.elementId), onChange: function (e) {
88
- return handleSingleActionChange([{ problemId: g === null || g === void 0 ? void 0 : g.elementId, state: e.target.checked }]);
89
- }, id: "education-" + eaidx }, void 0) }, void 0),
90
- jsx_runtime_1.jsxs("label", __assign({ htmlFor: "education-" + eaidx }, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "bullseye", size: "large" }, void 0),
91
- g === null || g === void 0 ? void 0 : g.description] }), void 0)] }, "education-" + eaidx)); }) }, void 0) }, void 0) }, void 0)] }, void 0));
92
- };
93
- exports.SelectedPlanDetail = SelectedPlanDetail;
94
- exports.default = exports.SelectedPlanDetail;
95
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
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
+ exports.SelectedPlanDetail = void 0;
22
+ var jsx_runtime_1 = require("react/jsx-runtime");
23
+ var react_1 = require("@emotion/react");
24
+ var styled_1 = __importDefault(require("@emotion/styled"));
25
+ var styles_1 = require("@ltht-react/styles");
26
+ var icon_1 = __importDefault(require("@ltht-react/icon"));
27
+ var input_1 = require("@ltht-react/input");
28
+ var react_2 = require("react");
29
+ var toggleRowWidth = '3.5rem';
30
+ var toggleInputMixin = react_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > div:first-of-type {\n text-align: right;\n width: ", ";\n padding-right: 1rem;\n }\n"], ["\n > div:first-of-type {\n text-align: right;\n width: ", ";\n padding-right: 1rem;\n }\n"])), toggleRowWidth);
31
+ var StyledProblemToggleRow = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n font-weight: bold;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n"], ["\n display: flex;\n font-weight: bold;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n"])), toggleInputMixin);
32
+ var StyledEducationToggleRow = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n\n > label svg {\n margin-right: 0.5rem;\n }\n"], ["\n display: flex;\n align-items: center;\n ", "\n margin-bottom: 0.25rem;\n\n > label svg {\n margin-right: 0.5rem;\n }\n"])), toggleInputMixin);
33
+ var StyledTargetRow = styled_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n\n svg {\n align: right;\n margin-right: 1rem;\n }\n\n > span:first-of-type {\n text-align: right;\n display: block;\n width: ", ";\n }\n\n > div:first-of-type {\n flex: 1;\n text-align: left;\n }\n"], ["\n display: flex;\n align-items: center;\n ", "\n\n svg {\n align: right;\n margin-right: 1rem;\n }\n\n > span:first-of-type {\n text-align: right;\n display: block;\n width: ", ";\n }\n\n > div:first-of-type {\n flex: 1;\n text-align: left;\n }\n"])), toggleInputMixin, toggleRowWidth);
34
+ var StyledListItem = styled_1.default.li(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-bottom: 1rem;\n\n ", " {\n }\n"], ["\n margin-bottom: 1rem;\n\n ", " {\n }\n"])), styles_1.WIDESCREEN_MINIMUM_MEDIA_QUERY);
35
+ var StyledSectionToggle = styled_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n font-weight: bold;\n color: black;\n display: flex;\n align-items: center;\n padding: 0.5rem 0.25rem;\n ", "\n"], ["\n background-color: ", ";\n font-weight: bold;\n color: black;\n display: flex;\n align-items: center;\n padding: 0.5rem 0.25rem;\n ", "\n"])), styles_1.BANNER_COLOURS.INFO.BACKGROUND, toggleInputMixin);
36
+ var StyledProblemSection = styled_1.default.ul(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n list-style: none;\n padding: 0.25rem 0.25rem;\n margin-bottom: 1rem;\n"], ["\n list-style: none;\n padding: 0.25rem 0.25rem;\n margin-bottom: 1rem;\n"])));
37
+ var SelectedPlanDetail = function (_a) {
38
+ var planDefinition = _a.planDefinition, selectedProblemIds = _a.selectedProblemIds, onProblemChange = _a.onProblemChange;
39
+ // Split actions from plan definition into clinical problem based and education based
40
+ var _b = react_2.useMemo(function () {
41
+ var _a, _b;
42
+ var problemActions = (_a = planDefinition.action) === null || _a === void 0 ? void 0 : _a.filter(function (action) { var _a; return (action === null || action === void 0 ? void 0 : action.code) && (action === null || action === void 0 ? void 0 : action.code[0]) && (action === null || action === void 0 ? void 0 : action.code[0].coding) && ((_a = action === null || action === void 0 ? void 0 : action.code[0].coding[0]) === null || _a === void 0 ? void 0 : _a.code) === 'problem'; });
43
+ var educationActions = (_b = planDefinition.action) === null || _b === void 0 ? void 0 : _b.filter(function (action) { var _a; return (action === null || action === void 0 ? void 0 : action.code) && (action === null || action === void 0 ? void 0 : action.code[0]) && (action === null || action === void 0 ? void 0 : action.code[0].coding) && ((_a = action === null || action === void 0 ? void 0 : action.code[0].coding[0]) === null || _a === void 0 ? void 0 : _a.code) === 'education'; });
44
+ return {
45
+ problemActions: problemActions,
46
+ educationActions: educationActions,
47
+ };
48
+ }, [planDefinition.action]), problemActions = _b.problemActions, educationActions = _b.educationActions;
49
+ // Calculate whether all problems in the given categories are enabled
50
+ var _c = react_2.useMemo(function () {
51
+ var _a, _b;
52
+ return ({
53
+ allProblemsOn: (_a = problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (pa) { return pa === null || pa === void 0 ? void 0 : pa.elementId; }).every(function (id) { return selectedProblemIds.includes(id); })) !== null && _a !== void 0 ? _a : false,
54
+ allEducationOn: (_b = educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (ea) { return ea === null || ea === void 0 ? void 0 : ea.elementId; }).every(function (id) { return selectedProblemIds.includes(id); })) !== null && _b !== void 0 ? _b : false,
55
+ });
56
+ }, [educationActions, problemActions, selectedProblemIds]), allProblemsOn = _c.allProblemsOn, allEducationOn = _c.allEducationOn;
57
+ var handleSingleActionChange = function (e) {
58
+ onProblemChange(e);
59
+ };
60
+ var handleToggleAllProblemsClick = function (e) {
61
+ var newState = problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (p) { return ({ problemId: p === null || p === void 0 ? void 0 : p.elementId, state: e.target.checked }); });
62
+ newState && onProblemChange(newState);
63
+ };
64
+ var handleToggleAllEducationClick = function (e) {
65
+ var newState = educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (p) { return ({ problemId: p === null || p === void 0 ? void 0 : p.elementId, state: e.target.checked }); });
66
+ newState && onProblemChange(newState);
67
+ };
68
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [jsx_runtime_1.jsxs(StyledSectionToggle, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: allProblemsOn, onChange: function (e) { return handleToggleAllProblemsClick(e); }, id: "problem-toggle-all" }, void 0) }, void 0),
69
+ jsx_runtime_1.jsx("label", __assign({ htmlFor: "problem-toggle-all" }, { children: "Patient Problems" }), void 0)] }, void 0),
70
+ jsx_runtime_1.jsx(StyledProblemSection, { children: problemActions === null || problemActions === void 0 ? void 0 : problemActions.map(function (problem, pidx) {
71
+ var _a, _b, _c;
72
+ var goal = (_a = planDefinition.goal) === null || _a === void 0 ? void 0 : _a.find(function (g) { var _a; return (problem === null || problem === void 0 ? void 0 : problem.goalId) && problem.goalId.length > 0 && ((_a = g === null || g === void 0 ? void 0 : g.elementId) === null || _a === void 0 ? void 0 : _a.includes(problem.goalId[0])); });
73
+ return (jsx_runtime_1.jsxs(StyledListItem, { children: [jsx_runtime_1.jsxs(StyledProblemToggleRow, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: selectedProblemIds.includes(problem === null || problem === void 0 ? void 0 : problem.elementId), onChange: function (e) {
74
+ return handleSingleActionChange([{ problemId: problem === null || problem === void 0 ? void 0 : problem.elementId, state: e.target.checked }]);
75
+ }, id: "problem-" + pidx }, void 0) }, void 0),
76
+ jsx_runtime_1.jsx("label", __assign({ htmlFor: "problem-" + pidx }, { children: problem === null || problem === void 0 ? void 0 : problem.description }), void 0)] }, void 0),
77
+ jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsxs(StyledTargetRow, { children: [jsx_runtime_1.jsx("span", { children: jsx_runtime_1.jsx(icon_1.default, { type: "bullseye", size: "large" }, void 0) }, void 0),
78
+ jsx_runtime_1.jsx("div", { children: (_b = goal === null || goal === void 0 ? void 0 : goal.description) === null || _b === void 0 ? void 0 : _b.text }, void 0)] }, void 0),
79
+ (_c = problem === null || problem === void 0 ? void 0 : problem.action) === null || _c === void 0 ? void 0 : _c.map(function (interventionPlan, ipidx) {
80
+ var _a;
81
+ return (jsx_runtime_1.jsx(StyledTargetRow, { children: jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx("p", { children: interventionPlan === null || interventionPlan === void 0 ? void 0 : interventionPlan.description }, void 0),
82
+ jsx_runtime_1.jsx("ul", { children: (_a = interventionPlan === null || interventionPlan === void 0 ? void 0 : interventionPlan.action) === null || _a === void 0 ? void 0 : _a.map(function (intervention, idx) { return (jsx_runtime_1.jsx("li", { children: intervention === null || intervention === void 0 ? void 0 : intervention.description }, "intervention-" + idx)); }) }, void 0)] }, void 0) }, "intervention-plan-" + ipidx));
83
+ })] }, void 0)] }, "problem-" + pidx));
84
+ }) }, void 0),
85
+ jsx_runtime_1.jsxs(StyledSectionToggle, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: allEducationOn, onChange: function (e) { return handleToggleAllEducationClick(e); }, id: "education-toggle-all" }, void 0) }, void 0),
86
+ jsx_runtime_1.jsx("label", __assign({ htmlFor: "education-toggle-all" }, { children: "Patient Education" }), void 0)] }, void 0),
87
+ jsx_runtime_1.jsx(StyledProblemSection, { children: jsx_runtime_1.jsx(StyledListItem, { children: jsx_runtime_1.jsx("div", { children: educationActions === null || educationActions === void 0 ? void 0 : educationActions.map(function (g, eaidx) { return (jsx_runtime_1.jsxs(StyledEducationToggleRow, { children: [jsx_runtime_1.jsx("div", { children: jsx_runtime_1.jsx(input_1.Toggle, { checked: selectedProblemIds.includes(g === null || g === void 0 ? void 0 : g.elementId), onChange: function (e) {
88
+ return handleSingleActionChange([{ problemId: g === null || g === void 0 ? void 0 : g.elementId, state: e.target.checked }]);
89
+ }, id: "education-" + eaidx }, void 0) }, void 0),
90
+ jsx_runtime_1.jsxs("label", __assign({ htmlFor: "education-" + eaidx }, { children: [jsx_runtime_1.jsx(icon_1.default, { type: "bullseye", size: "large" }, void 0),
91
+ g === null || g === void 0 ? void 0 : g.description] }), void 0)] }, "education-" + eaidx)); }) }, void 0) }, void 0) }, void 0)] }, void 0));
92
+ };
93
+ exports.SelectedPlanDetail = SelectedPlanDetail;
94
+ exports.default = exports.SelectedPlanDetail;
95
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
96
96
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ltht-react/plan-definition-editor",
3
- "version": "1.0.111",
3
+ "version": "1.0.113",
4
4
  "description": "ltht-react component for selecting problems from a PlanDefinition.",
5
5
  "author": "LTHT",
6
6
  "homepage": "",
@@ -27,11 +27,11 @@
27
27
  "dependencies": {
28
28
  "@emotion/react": "^11.0.0",
29
29
  "@emotion/styled": "^11.0.0",
30
- "@ltht-react/icon": "^1.3.266",
31
- "@ltht-react/input": "^1.3.266",
32
- "@ltht-react/styles": "^1.3.258",
33
- "@ltht-react/types": "^1.0.262",
30
+ "@ltht-react/icon": "^1.3.268",
31
+ "@ltht-react/input": "^1.3.268",
32
+ "@ltht-react/styles": "^1.3.260",
33
+ "@ltht-react/types": "^1.0.264",
34
34
  "react": "^17.0.0"
35
35
  },
36
- "gitHead": "b12caae66acbc93f1bcc40663aa3b108bcea1d68"
36
+ "gitHead": "c47d5d393ce392e37627f8246cc6a1e46a5b4a93"
37
37
  }