@shelf/global-renderer 1.0.0 → 1.0.1-beta.1
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/CHANGELOG.md +2366 -44
- package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
- package/lib/DecisionTreeContent/DecisionTreeContent.js +84 -0
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.d.ts +47 -11483
- package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +225 -0
- package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Condition.js +73 -0
- package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
- package/lib/DecisionTreeContent/components/ContentTable.js +26 -0
- package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
- package/lib/DecisionTreeContent/components/ExportedMeta.js +29 -0
- package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Link.js +18 -0
- package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Question.js +55 -0
- package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
- package/lib/DecisionTreeContent/components/Solution.js +20 -0
- package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
- package/lib/DecisionTreeContent/components/StepHeader.js +46 -0
- package/lib/DecisionTreeContent/components/StepTypeIcon.js +30 -0
- package/lib/DecisionTreeContent/helpers.d.ts +4 -4
- package/lib/DecisionTreeContent/helpers.js +56 -0
- package/lib/DecisionTreeContent/renderDTContent.js +12 -0
- package/lib/DecisionTreeContent/types.d.ts +1 -1
- package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
- package/lib/DecisionTreeDiagram/StaticTreeContainer.js +27 -0
- package/lib/DecisionTreeDiagram/renderStaticDTDiagram.js +26 -0
- package/lib/_virtual/_commonjsHelpers.js +4 -0
- package/lib/_virtual/advancedFormat.js +4 -0
- package/lib/_virtual/client.js +4 -0
- package/lib/_virtual/dayjs.min.js +4 -0
- package/lib/_virtual/index.js +4 -0
- package/lib/_virtual/index2.js +4 -0
- package/lib/_virtual/localeData.js +4 -0
- package/lib/_virtual/localizedFormat.js +4 -0
- package/lib/_virtual/react-dom.development.js +4 -0
- package/lib/_virtual/react-dom.production.min.js +4 -0
- package/lib/_virtual/scheduler.development.js +4 -0
- package/lib/_virtual/scheduler.production.min.js +4 -0
- package/lib/i18next/index.js +18 -0
- package/lib/index.js +4 -20383
- package/lib/node_modules/@shelf/datetime/lib/getDateFormatTemplates.js +15 -0
- package/lib/node_modules/@shelf/datetime/lib/getDateWithCustomFormat.js +10 -0
- package/lib/node_modules/@shelf/datetime/lib/getTimeFormatTemplates.js +17 -0
- package/lib/node_modules/@shelf/datetime/lib/isDate.js +4 -0
- package/lib/node_modules/@shelf/datetime/node_modules/dayjs/dayjs.min.js +295 -0
- package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/advancedFormat.js +54 -0
- package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localeData.js +82 -0
- package/lib/node_modules/@shelf/datetime/node_modules/dayjs/plugin/localizedFormat.js +28 -0
- package/lib/node_modules/react-dom/cjs/react-dom.development.js +12880 -0
- package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +5643 -0
- package/lib/node_modules/react-dom/client.js +28 -0
- package/lib/node_modules/react-dom/index.js +17 -0
- package/lib/node_modules/scheduler/cjs/scheduler.development.js +278 -0
- package/lib/node_modules/scheduler/cjs/scheduler.production.min.js +231 -0
- package/lib/node_modules/scheduler/index.js +12 -0
- package/package.json +16 -19
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import t from "styled-components";
|
|
2
|
+
import { colors as i } from "@shelf/client-helpers";
|
|
3
|
+
const d = t.div`
|
|
4
|
+
margin: 0;
|
|
5
|
+
font-family: 'Open Sans', Arial, sans-serif;
|
|
6
|
+
color: ${i.$dark};
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
`, a = t.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
`, p = t.div`
|
|
11
|
+
min-width: 40px;
|
|
12
|
+
width: 40px;
|
|
13
|
+
height: 40px;
|
|
14
|
+
background-color: ${i.$colorDecisionTree};
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
margin-right: 10px;
|
|
19
|
+
`, r = t.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`, s = t.div`
|
|
23
|
+
font-size: 20px;
|
|
24
|
+
line-height: 1.25;
|
|
25
|
+
padding: 0 5px 5px;
|
|
26
|
+
`, l = t.div`
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
padding: 0 0 10px 5px;
|
|
29
|
+
`, c = t.div`
|
|
30
|
+
float: right;
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
width: 100%;
|
|
33
|
+
`, x = t.div`
|
|
34
|
+
padding-top: 20px;
|
|
35
|
+
`, g = t.div`
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
`, h = t.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
padding: 10px 0;
|
|
43
|
+
`, m = t.div`
|
|
44
|
+
page-break-inside: avoid;
|
|
45
|
+
`, v = t.div`
|
|
46
|
+
display: flex;
|
|
47
|
+
width: 20%;
|
|
48
|
+
`, f = t.div`
|
|
49
|
+
width: 20px;
|
|
50
|
+
height: 20px;
|
|
51
|
+
min-width: 20px;
|
|
52
|
+
background-color: ${(e) => e.color || i.$catchyBlue};
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
`, b = t.div`
|
|
55
|
+
line-height: 20px;
|
|
56
|
+
font-weight: 700;
|
|
57
|
+
padding-left: 10px;
|
|
58
|
+
margin-bottom: 10px;
|
|
59
|
+
margin-right: 50px;
|
|
60
|
+
`, u = t.div`
|
|
61
|
+
font-size: 20px;
|
|
62
|
+
padding-bottom: 10px;
|
|
63
|
+
page-break-inside: avoid;
|
|
64
|
+
`, w = t.div`
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
`, k = t.div`
|
|
67
|
+
background-color: ${i.$greyBlue};
|
|
68
|
+
border-left: 1px solid ${i.$deepBlue};
|
|
69
|
+
padding: 20px 15px 15px;
|
|
70
|
+
margin: 10px 0;
|
|
71
|
+
`, $ = t.div`
|
|
72
|
+
font-weight: bold;
|
|
73
|
+
padding-bottom: 15px;
|
|
74
|
+
line-height: 20px;
|
|
75
|
+
`, y = t.div`
|
|
76
|
+
padding-bottom: 10px;
|
|
77
|
+
`, T = t.div`
|
|
78
|
+
display: flex;
|
|
79
|
+
page-break-inside: avoid;
|
|
80
|
+
padding-bottom: 5px;
|
|
81
|
+
`, C = t.div`
|
|
82
|
+
background-color: ${i.$white};
|
|
83
|
+
padding: 10px 10px 5px;
|
|
84
|
+
border-radius: 5px;
|
|
85
|
+
margin-bottom: 10px;
|
|
86
|
+
line-height: 20px;
|
|
87
|
+
page-break-inside: avoid;
|
|
88
|
+
`, B = t.div`
|
|
89
|
+
padding-right: 5px;
|
|
90
|
+
`, D = t.div`
|
|
91
|
+
display: flex;
|
|
92
|
+
padding-right: 5px;
|
|
93
|
+
align-items: center;
|
|
94
|
+
`, L = t.img`
|
|
95
|
+
width: 14px;
|
|
96
|
+
height: 14px;
|
|
97
|
+
`, S = t.a`
|
|
98
|
+
text-decoration: none;
|
|
99
|
+
color: ${i.$deepBlue};
|
|
100
|
+
page-break-inside: avoid;
|
|
101
|
+
max-width: 90%;
|
|
102
|
+
word-wrap: break-word;
|
|
103
|
+
`, A = t.span`
|
|
104
|
+
${({
|
|
105
|
+
isDeleted: e
|
|
106
|
+
}) => e ? "text-decoration: line-through" : ""}
|
|
107
|
+
`, I = t.div``, z = t.div`
|
|
108
|
+
padding-bottom: 5px;
|
|
109
|
+
&:last-child {
|
|
110
|
+
padding-bottom: 0;
|
|
111
|
+
}
|
|
112
|
+
`, N = t.a`
|
|
113
|
+
color: ${i.$greyThemeText};
|
|
114
|
+
margin-right: 0;
|
|
115
|
+
margin-left: auto;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
`, F = t.div`
|
|
118
|
+
color: ${i.$deepBlue};
|
|
119
|
+
margin-right: 0;
|
|
120
|
+
margin-left: auto;
|
|
121
|
+
word-break: break-all;
|
|
122
|
+
align-items: flex-end;
|
|
123
|
+
max-width: 80%;
|
|
124
|
+
`, M = t.a`
|
|
125
|
+
padding: 0 5px;
|
|
126
|
+
text-decoration: none;
|
|
127
|
+
color: ${i.$deepBlue};
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
`, Q = t.a`
|
|
130
|
+
text-decoration: none;
|
|
131
|
+
color: ${i.$deepBlue};
|
|
132
|
+
page-break-inside: avoid;
|
|
133
|
+
word-break: break-all;
|
|
134
|
+
`, j = t.div`
|
|
135
|
+
color: ${i.$dark};
|
|
136
|
+
line-height: 20px;
|
|
137
|
+
margin-right: 0;
|
|
138
|
+
margin-left: auto;
|
|
139
|
+
`, H = t.div`
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
padding-bottom: 15px;
|
|
143
|
+
float: left;
|
|
144
|
+
max-width: 100%;
|
|
145
|
+
width: 100%;
|
|
146
|
+
margin-top: 10px;
|
|
147
|
+
`, P = t.div`
|
|
148
|
+
line-height: 20px;
|
|
149
|
+
padding-bottom: 5px;
|
|
150
|
+
display: flex;
|
|
151
|
+
page-break-inside: avoid;
|
|
152
|
+
`, V = t.a`
|
|
153
|
+
text-decoration: none;
|
|
154
|
+
color: ${i.$deepBlue};
|
|
155
|
+
line-height: 20px;
|
|
156
|
+
`, O = t.div`
|
|
157
|
+
margin-right: 5px;
|
|
158
|
+
`, R = t.div`
|
|
159
|
+
min-height: 19px;
|
|
160
|
+
min-width: 20px;
|
|
161
|
+
line-height: 20px;
|
|
162
|
+
`, U = t.div`
|
|
163
|
+
padding-bottom: 25px;
|
|
164
|
+
`, W = t.div`
|
|
165
|
+
line-height: 20px;
|
|
166
|
+
padding-bottom: 5px;
|
|
167
|
+
page-break-inside: avoid;
|
|
168
|
+
`, q = t.div`
|
|
169
|
+
margin-bottom: 5px;
|
|
170
|
+
margin-left: 55px;
|
|
171
|
+
`, E = t.div`
|
|
172
|
+
line-height: 24px;
|
|
173
|
+
display: flex;
|
|
174
|
+
padding-bottom: 5px;
|
|
175
|
+
`, G = t.div`
|
|
176
|
+
font-weight: 700;
|
|
177
|
+
`, J = t.div`
|
|
178
|
+
padding-left: 5px;
|
|
179
|
+
`;
|
|
180
|
+
export {
|
|
181
|
+
T as Answer,
|
|
182
|
+
B as AnswerNumber,
|
|
183
|
+
S as AnswerTitle,
|
|
184
|
+
A as AnswerVariable,
|
|
185
|
+
C as AnswerWithAssignments,
|
|
186
|
+
L as AssignmentIcon,
|
|
187
|
+
D as AssignmentIconBlock,
|
|
188
|
+
I as Condition,
|
|
189
|
+
w as Content,
|
|
190
|
+
H as ContentList,
|
|
191
|
+
R as ContentListIcon,
|
|
192
|
+
P as ContentListItem,
|
|
193
|
+
V as ContentListLink,
|
|
194
|
+
O as ContentListNumber,
|
|
195
|
+
u as ContentTitle,
|
|
196
|
+
E as CustomField,
|
|
197
|
+
q as CustomFields,
|
|
198
|
+
c as DTContent,
|
|
199
|
+
d as DTContentContainer,
|
|
200
|
+
l as DTDescription,
|
|
201
|
+
p as DTIcon,
|
|
202
|
+
r as DTInternalMeta,
|
|
203
|
+
a as DTMeta,
|
|
204
|
+
s as DTTitle,
|
|
205
|
+
G as FieldName,
|
|
206
|
+
J as FieldValue,
|
|
207
|
+
Q as LinkUrl,
|
|
208
|
+
W as MataInfo,
|
|
209
|
+
U as MetaBlock,
|
|
210
|
+
j as NoLinks,
|
|
211
|
+
M as ParentLink,
|
|
212
|
+
k as Question,
|
|
213
|
+
y as QuestionDescription,
|
|
214
|
+
$ as QuestionTitle,
|
|
215
|
+
z as Rule,
|
|
216
|
+
x as StepContainer,
|
|
217
|
+
v as StepHeader,
|
|
218
|
+
m as StepHeaderBlock,
|
|
219
|
+
N as StepLink,
|
|
220
|
+
g as StepNumber,
|
|
221
|
+
F as StepParents,
|
|
222
|
+
f as StepType,
|
|
223
|
+
h as StepTypeContainer,
|
|
224
|
+
b as StepTypeTitle
|
|
225
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
3
|
import { DTStep } from '../types';
|
|
4
4
|
declare const _default: ({ step, variables, }: {
|
|
5
5
|
step: DTStep;
|
|
6
6
|
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
7
|
-
}) =>
|
|
7
|
+
}) => JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import P from "./StepHeader.js";
|
|
2
|
+
import { StepContainer as A, ContentTitle as C, Question as N, AnswerWithAssignments as f, Answer as x, AnswerNumber as m, Condition as u, Rule as D, AnswerTitle as o, AnswerVariable as g, StepLink as v } from "../DecisionTreeContent.styled.js";
|
|
3
|
+
import i from "../../i18next/index.js";
|
|
4
|
+
import { jsxs as t, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
5
|
+
const I = ({
|
|
6
|
+
step: n,
|
|
7
|
+
variables: w
|
|
8
|
+
}) => {
|
|
9
|
+
const s = {
|
|
10
|
+
eq: "=",
|
|
11
|
+
neq: "\u2260",
|
|
12
|
+
contains: i.t("pdf-viewer.exportDTPDF.contains"),
|
|
13
|
+
not_contains: i.t("pdf-viewer.exportDTPDF.notContains")
|
|
14
|
+
}, a = [...n?.conditions || []];
|
|
15
|
+
return /* @__PURE__ */ t(A, {
|
|
16
|
+
children: [/* @__PURE__ */ e(P, {
|
|
17
|
+
step: n
|
|
18
|
+
}), /* @__PURE__ */ e(C, {
|
|
19
|
+
children: n.title
|
|
20
|
+
}), /* @__PURE__ */ t(N, {
|
|
21
|
+
children: [a?.map((r, S) => {
|
|
22
|
+
const l = r?.expression?.rules, $ = r?.expression?.joiner;
|
|
23
|
+
return l ? /* @__PURE__ */ e(f, {
|
|
24
|
+
children: /* @__PURE__ */ t(x, {
|
|
25
|
+
children: [/* @__PURE__ */ t(m, {
|
|
26
|
+
children: [S + 1, "."]
|
|
27
|
+
}), /* @__PURE__ */ e(u, {
|
|
28
|
+
children: l.map((d) => {
|
|
29
|
+
const p = w?.find((F) => F.id === d.variableId), c = p?.name, h = p?.isDeleted, b = d?.id === l[l.length - 1]?.id, T = h ? ` (${i.t("pdf-viewer.exportDTPDF.deleted")}) [${s[d.operator]}] ${d?.value}` : ` [${s[d.operator]}] ${d?.value}`;
|
|
30
|
+
return /* @__PURE__ */ t(j, {
|
|
31
|
+
children: [/* @__PURE__ */ e(D, {
|
|
32
|
+
children: c && /* @__PURE__ */ t(o, {
|
|
33
|
+
href: `#${r?.nextStep?.id}`,
|
|
34
|
+
children: [/* @__PURE__ */ e(g, {
|
|
35
|
+
isDeleted: h,
|
|
36
|
+
children: c
|
|
37
|
+
}), T]
|
|
38
|
+
})
|
|
39
|
+
}), $ && !b && /* @__PURE__ */ e(o, {
|
|
40
|
+
href: `#${r?.nextStep?.id}`,
|
|
41
|
+
children: i.t("pdf-viewer.exportDTPDF.andOperator")
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
})
|
|
45
|
+
}), r?.nextStep?.number && /* @__PURE__ */ t(v, {
|
|
46
|
+
href: `#${r.nextStep?.id}`,
|
|
47
|
+
children: [i.t("pdf-viewer.exportDTPDF.step"), " ", r.nextStep.number]
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
50
|
+
}, r.id) : null;
|
|
51
|
+
}), /* @__PURE__ */ e(f, {
|
|
52
|
+
children: /* @__PURE__ */ t(x, {
|
|
53
|
+
children: [/* @__PURE__ */ t(m, {
|
|
54
|
+
children: [a.length + 1, "."]
|
|
55
|
+
}), /* @__PURE__ */ e(u, {
|
|
56
|
+
children: /* @__PURE__ */ e(D, {
|
|
57
|
+
children: /* @__PURE__ */ e(o, {
|
|
58
|
+
href: `#${n?.defaultNextStep?.id}`,
|
|
59
|
+
children: i.t("pdf-viewer.exportDTPDF.default")
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
}), n?.defaultNextStep?.id && /* @__PURE__ */ t(v, {
|
|
63
|
+
href: `#${n.defaultNextStep?.id}`,
|
|
64
|
+
children: [i.t("pdf-viewer.exportDTPDF.step"), " ", n.defaultNextStep?.number]
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
I as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isEmpty as r } from "lodash";
|
|
2
|
+
import { colors as i } from "@shelf/client-helpers";
|
|
3
|
+
import { ContentList as p, ContentListItem as s, ContentListNumber as l, ContentListIcon as c, ContentListLink as m } from "../DecisionTreeContent.styled.js";
|
|
4
|
+
import d from "./StepTypeIcon.js";
|
|
5
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
6
|
+
const a = ({
|
|
7
|
+
tree: n
|
|
8
|
+
}) => /* @__PURE__ */ o(p, {
|
|
9
|
+
children: !r(n) && n.map((t) => /* @__PURE__ */ e(s, {
|
|
10
|
+
children: [/* @__PURE__ */ e(l, {
|
|
11
|
+
children: [t.number, "."]
|
|
12
|
+
}), /* @__PURE__ */ o(c, {
|
|
13
|
+
children: /* @__PURE__ */ o(d, {
|
|
14
|
+
type: t.type,
|
|
15
|
+
iconSize: 12,
|
|
16
|
+
color: i.$deepBlue
|
|
17
|
+
})
|
|
18
|
+
}), /* @__PURE__ */ o(m, {
|
|
19
|
+
href: `#${t.id}`,
|
|
20
|
+
children: t.title || t?.question?.title
|
|
21
|
+
})]
|
|
22
|
+
}, t.id))
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
a as default
|
|
26
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
declare const _default: ({ exportedAt, exportedBy, createdBy, }: {
|
|
3
|
-
exportedAt:
|
|
3
|
+
exportedAt: Date;
|
|
4
4
|
exportedBy: string;
|
|
5
5
|
createdBy: string;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => JSX.Element;
|
|
7
7
|
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MetaBlock as p, MataInfo as e } from "../DecisionTreeContent.styled.js";
|
|
2
|
+
import { getDateAndTime as n } from "../helpers.js";
|
|
3
|
+
import t from "../../i18next/index.js";
|
|
4
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
5
|
+
const c = ({
|
|
6
|
+
exportedAt: o,
|
|
7
|
+
exportedBy: a,
|
|
8
|
+
createdBy: i
|
|
9
|
+
}) => /* @__PURE__ */ f(p, {
|
|
10
|
+
children: [/* @__PURE__ */ r(e, {
|
|
11
|
+
children: t.t("pdf-viewer.exportDTPDF.exportedInfo", {
|
|
12
|
+
date: n(o),
|
|
13
|
+
exportedBy: a,
|
|
14
|
+
interpolation: {
|
|
15
|
+
escapeValue: !1
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
}), /* @__PURE__ */ r(e, {
|
|
19
|
+
children: t.t("pdf-viewer.exportDTPDF.createdInfo", {
|
|
20
|
+
createdBy: i,
|
|
21
|
+
interpolation: {
|
|
22
|
+
escapeValue: !1
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
c as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StepContainer as i, ContentTitle as n, LinkUrl as t } from "../DecisionTreeContent.styled.js";
|
|
2
|
+
import l from "./StepHeader.js";
|
|
3
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
const u = ({
|
|
5
|
+
step: r
|
|
6
|
+
}) => /* @__PURE__ */ o(i, {
|
|
7
|
+
children: [/* @__PURE__ */ e(l, {
|
|
8
|
+
step: r
|
|
9
|
+
}), /* @__PURE__ */ e(n, {
|
|
10
|
+
children: r.title
|
|
11
|
+
}), r.url && /* @__PURE__ */ e(t, {
|
|
12
|
+
href: r.url,
|
|
13
|
+
children: r.url
|
|
14
|
+
})]
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
u as default
|
|
18
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { DecisionTree } from '@shelf/types-ddb';
|
|
3
3
|
import { DTStep } from '../types';
|
|
4
4
|
declare const _default: ({ step, variables, }: {
|
|
5
5
|
step: DTStep;
|
|
6
6
|
variables: Pick<DecisionTree.ContextualVariableDefaults, 'name' | 'id' | 'isDeleted'>[];
|
|
7
|
-
}) =>
|
|
7
|
+
}) => JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import h from "./StepHeader.js";
|
|
2
|
+
import { StepContainer as V, ContentTitle as u, Content as g, Question as b, QuestionTitle as T, QuestionDescription as f, AnswerWithAssignments as x, Answer as o, AnswerNumber as D, AnswerTitle as s, StepLink as w, AssignmentIconBlock as M, AssignmentIcon as F, AnswerVariable as L } from "../DecisionTreeContent.styled.js";
|
|
3
|
+
import d from "../../i18next/index.js";
|
|
4
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
5
|
+
const S = "data:image/svg;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAM1BMVEVHcEwqWJYrV5crVpcrV5crV5crV5cqV5grV5cuWJcrV5crVpUrV5crWJcqVpgrVpcrV5f4E2OkAAAAEHRSTlMAIbdw6Nb2T90Ph0KhyTVaZXFVxwAAAPZJREFUOMvFlMsWgyAMRAVRjID6/19bEqW8QTeaTUm54jCT4zB8XYerPvAMFRNWDaVNcaGyL1O+gLLZLsdwf7d/zKx0Ku1sntzw2b0sYLXrBRwJk23XmlZjG+4aHTYZCsLLHdFwqDtA8pRbBcILZrmzYIntKPl6KeT2R3ciALzaiocb6KXF8GpWqGD9YNU5curODGASf++bKF0+SK2B8lMA76P4+smkEkqopMEjG2QbpaGVpw0za6F+8EgHNFCM1fjb6TpKw8LygcxRFaW0hV2CMhEPXviOBDWp8dwrj1GdxUkR69e+LrdQsWDVKNoUzz/Fd9Gv6weN4h7TPdxgMQAAAABJRU5ErkJggg==", K = ({
|
|
6
|
+
step: n,
|
|
7
|
+
variables: a
|
|
8
|
+
}) => /* @__PURE__ */ r(V, {
|
|
9
|
+
children: [/* @__PURE__ */ e(h, {
|
|
10
|
+
step: n
|
|
11
|
+
}), /* @__PURE__ */ e(u, {
|
|
12
|
+
children: n.title
|
|
13
|
+
}), n.content && /* @__PURE__ */ e(g, {
|
|
14
|
+
className: "fr-view custom-theme",
|
|
15
|
+
dangerouslySetInnerHTML: {
|
|
16
|
+
__html: n.content
|
|
17
|
+
}
|
|
18
|
+
}), /* @__PURE__ */ r(b, {
|
|
19
|
+
children: [/* @__PURE__ */ e(T, {
|
|
20
|
+
children: n?.question?.title
|
|
21
|
+
}), /* @__PURE__ */ e(f, {
|
|
22
|
+
children: n?.question?.description
|
|
23
|
+
}), n?.question?.answers?.map((t, c) => /* @__PURE__ */ r(x, {
|
|
24
|
+
children: [/* @__PURE__ */ r(o, {
|
|
25
|
+
children: [/* @__PURE__ */ r(D, {
|
|
26
|
+
children: [c + 1, "."]
|
|
27
|
+
}), /* @__PURE__ */ e(s, {
|
|
28
|
+
href: `#${t.nextStep?.id}`,
|
|
29
|
+
children: t?.title
|
|
30
|
+
}), t?.nextStep?.number && /* @__PURE__ */ r(w, {
|
|
31
|
+
href: `#${t.nextStep?.id}`,
|
|
32
|
+
children: [d.t("pdf-viewer.exportDTPDF.step"), " ", t.nextStep.number]
|
|
33
|
+
})]
|
|
34
|
+
}), t?.assignments && t?.assignments.map((A, p) => {
|
|
35
|
+
const i = a?.find((m) => m.id === A.variableId), l = i?.isDeleted;
|
|
36
|
+
return i ? /* @__PURE__ */ r(o, {
|
|
37
|
+
children: [/* @__PURE__ */ e(M, {
|
|
38
|
+
children: /* @__PURE__ */ e(F, {
|
|
39
|
+
src: S
|
|
40
|
+
})
|
|
41
|
+
}), /* @__PURE__ */ r(s, {
|
|
42
|
+
href: `#${t.nextStep?.id}`,
|
|
43
|
+
children: [/* @__PURE__ */ e(L, {
|
|
44
|
+
isDeleted: l,
|
|
45
|
+
children: i?.name
|
|
46
|
+
}), l ? ` (${d.t("pdf-viewer.exportDTPDF.deleted")})` : "", " =", ` ${A.value}`]
|
|
47
|
+
})]
|
|
48
|
+
}, p) : null;
|
|
49
|
+
})]
|
|
50
|
+
}, c))]
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
K as default
|
|
55
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StepContainer as n, ContentTitle as o, Content as r } from "../DecisionTreeContent.styled.js";
|
|
2
|
+
import i from "./StepHeader.js";
|
|
3
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
const s = ({
|
|
5
|
+
step: t
|
|
6
|
+
}) => /* @__PURE__ */ m(n, {
|
|
7
|
+
children: [/* @__PURE__ */ e(i, {
|
|
8
|
+
step: t
|
|
9
|
+
}), /* @__PURE__ */ e(o, {
|
|
10
|
+
children: t.title
|
|
11
|
+
}), t.content && /* @__PURE__ */ e(r, {
|
|
12
|
+
className: "fr-view custom-theme",
|
|
13
|
+
dangerouslySetInnerHTML: {
|
|
14
|
+
__html: t.content
|
|
15
|
+
}
|
|
16
|
+
})]
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
s as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { toLower as c, get as a, isEmpty as m } from "lodash";
|
|
2
|
+
import { colors as i } from "@shelf/client-helpers";
|
|
3
|
+
import { StepHeaderBlock as h, StepNumber as S, StepTypeContainer as f, StepHeader as u, StepType as D, StepTypeTitle as T, NoLinks as x, StepParents as y, ParentLink as P } from "../DecisionTreeContent.styled.js";
|
|
4
|
+
import t from "../../i18next/index.js";
|
|
5
|
+
import { jsxs as r, jsx as o, Fragment as l } from "react/jsx-runtime";
|
|
6
|
+
const $ = {
|
|
7
|
+
question: i.$catchyBlue,
|
|
8
|
+
solution: i.$dark,
|
|
9
|
+
link: i.$yellow,
|
|
10
|
+
condition: i.$greenCheck
|
|
11
|
+
}, L = ({
|
|
12
|
+
step: e
|
|
13
|
+
}) => {
|
|
14
|
+
const n = c(e.type);
|
|
15
|
+
return /* @__PURE__ */ r(h, {
|
|
16
|
+
id: e.id,
|
|
17
|
+
children: [/* @__PURE__ */ r(S, {
|
|
18
|
+
children: [t.t("pdf-viewer.exportDTPDF.step"), " ", e.number, e.isFirstStep ? ` - ${t.t("pdf-viewer.exportDTPDF.startingPoint")}` : ""]
|
|
19
|
+
}), /* @__PURE__ */ r(f, {
|
|
20
|
+
children: [/* @__PURE__ */ r(u, {
|
|
21
|
+
children: [/* @__PURE__ */ o(D, {
|
|
22
|
+
color: e?.settings?.borderColor || a($, n)
|
|
23
|
+
}), /* @__PURE__ */ o(T, {
|
|
24
|
+
children: t.t(`pdf-viewer.exportDTPDF.${n}`)
|
|
25
|
+
})]
|
|
26
|
+
}), m(e.parentSteps) ? /* @__PURE__ */ o(x, {
|
|
27
|
+
children: t.t("pdf-viewer.exportDTPDF.noLinks")
|
|
28
|
+
}) : /* @__PURE__ */ r(y, {
|
|
29
|
+
children: [t.t("pdf-viewer.exportDTPDF.parentSteps"), ":", e.parentSteps.map((p, d) => {
|
|
30
|
+
const s = d === e.parentSteps.length - 1;
|
|
31
|
+
return /* @__PURE__ */ r(l, {
|
|
32
|
+
children: [/* @__PURE__ */ o(P, {
|
|
33
|
+
href: `#${p.id}`,
|
|
34
|
+
children: p.number
|
|
35
|
+
}, d), !s && /* @__PURE__ */ o(l, {
|
|
36
|
+
children: "|"
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
})]
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
L as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Solution as o, Question as r, Link as u, Condition as i } from "@shelf/icons";
|
|
2
|
+
import { jsx as t, Fragment as a } from "react/jsx-runtime";
|
|
3
|
+
const s = ({
|
|
4
|
+
type: n,
|
|
5
|
+
...e
|
|
6
|
+
}) => {
|
|
7
|
+
switch (n) {
|
|
8
|
+
case "Condition":
|
|
9
|
+
return /* @__PURE__ */ t(i, {
|
|
10
|
+
...e
|
|
11
|
+
});
|
|
12
|
+
case "Link":
|
|
13
|
+
return /* @__PURE__ */ t(u, {
|
|
14
|
+
...e
|
|
15
|
+
});
|
|
16
|
+
case "Question":
|
|
17
|
+
return /* @__PURE__ */ t(r, {
|
|
18
|
+
...e
|
|
19
|
+
});
|
|
20
|
+
case "Solution":
|
|
21
|
+
return /* @__PURE__ */ t(o, {
|
|
22
|
+
...e
|
|
23
|
+
});
|
|
24
|
+
default:
|
|
25
|
+
return /* @__PURE__ */ t(a, {});
|
|
26
|
+
}
|
|
27
|
+
}, d = s;
|
|
28
|
+
export {
|
|
29
|
+
d as default
|
|
30
|
+
};
|
|
@@ -6,10 +6,10 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
6
6
|
number: number;
|
|
7
7
|
}[];
|
|
8
8
|
number: number;
|
|
9
|
-
type: import("@shelf/types-ddb/lib/decision-tree").StepType;
|
|
10
9
|
title?: string | undefined;
|
|
10
|
+
url?: string | undefined;
|
|
11
11
|
id: string;
|
|
12
|
-
|
|
12
|
+
type?: import("@shelf/types-ddb/lib/decision-tree").StepType | undefined;
|
|
13
13
|
question: {
|
|
14
14
|
id: string;
|
|
15
15
|
title?: string | undefined;
|
|
@@ -25,7 +25,6 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
25
25
|
}[];
|
|
26
26
|
};
|
|
27
27
|
textS3Key?: string | undefined;
|
|
28
|
-
url?: string | undefined;
|
|
29
28
|
settings?: import("@shelf/types-ddb/lib/decision-tree").StepSettings | undefined;
|
|
30
29
|
defaultNextStep?: ({
|
|
31
30
|
id: string;
|
|
@@ -34,6 +33,7 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
34
33
|
number?: string | undefined;
|
|
35
34
|
}) | undefined;
|
|
36
35
|
conditions?: (import("@shelf/types-ddb/lib/decision-tree").Condition[] & import("./types").ConditionType[]) | undefined;
|
|
36
|
+
content?: string | undefined;
|
|
37
37
|
isFirstStep?: boolean | undefined;
|
|
38
38
|
linkedSteps?: {
|
|
39
39
|
id?: string | undefined;
|
|
@@ -41,4 +41,4 @@ export declare const getTreeWithParentSteps: (tree: Omit<DTStep, 'parentSteps'>[
|
|
|
41
41
|
}[] | undefined;
|
|
42
42
|
}[];
|
|
43
43
|
export declare const convertStepToRenderFormat: (tree: DTStepFromApi[]) => DTStep[];
|
|
44
|
-
export declare const getDateAndTime: (date:
|
|
44
|
+
export declare const getDateAndTime: (date: Date) => string;
|