@shelf/global-renderer 1.0.3-beta.0 → 1.0.4-beta.0

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/DecisionTreeContent/DecisionTreeContent.d.ts +2 -2
  3. package/lib/DecisionTreeContent/DecisionTreeContent.js +68 -63
  4. package/lib/DecisionTreeContent/DecisionTreeContent.styled.js +101 -101
  5. package/lib/DecisionTreeContent/components/Condition.d.ts +2 -2
  6. package/lib/DecisionTreeContent/components/Condition.js +43 -39
  7. package/lib/DecisionTreeContent/components/ContentTable.d.ts +2 -2
  8. package/lib/DecisionTreeContent/components/ContentTable.js +29 -24
  9. package/lib/DecisionTreeContent/components/ExportedMeta.d.ts +3 -3
  10. package/lib/DecisionTreeContent/components/ExportedMeta.js +27 -23
  11. package/lib/DecisionTreeContent/components/Link.d.ts +2 -2
  12. package/lib/DecisionTreeContent/components/Question.d.ts +2 -2
  13. package/lib/DecisionTreeContent/components/Question.js +14 -12
  14. package/lib/DecisionTreeContent/components/Solution.d.ts +2 -2
  15. package/lib/DecisionTreeContent/components/StepHeader.d.ts +2 -2
  16. package/lib/DecisionTreeContent/components/StepHeader.js +50 -38
  17. package/lib/DecisionTreeContent/components/StepTypeIcon.js +17 -14
  18. package/lib/DecisionTreeContent/helpers.d.ts +4 -4
  19. package/lib/DecisionTreeContent/helpers.js +17 -17
  20. package/lib/DecisionTreeContent/types.d.ts +1 -1
  21. package/lib/DecisionTreeDiagram/StaticTreeContainer.d.ts +2 -2
  22. package/lib/DecisionTreeDiagram/StaticTreeContainer.js +10 -7
  23. package/lib/_virtual/index.js +2 -2
  24. package/lib/_virtual/index2.js +1 -1
  25. package/lib/i18next/index.js +6 -6
  26. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/index.js +25 -0
  27. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/de.js +7 -0
  28. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/en.js +7 -0
  29. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/es.js +7 -0
  30. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/pl.js +7 -0
  31. package/lib/node_modules/@shelf/i18n/lib/bundles/pdf-viewer/translations/uk.js +7 -0
  32. package/lib/node_modules/@shelf/i18n/lib/helpers.js +19 -0
  33. package/lib/node_modules/@shelf/i18n/lib/resources/de/pdf-viewer/index.json.js +50 -0
  34. package/lib/node_modules/@shelf/i18n/lib/resources/en/pdf-viewer/index.json.js +50 -0
  35. package/lib/node_modules/@shelf/i18n/lib/resources/es/pdf-viewer/index.json.js +50 -0
  36. package/lib/node_modules/@shelf/i18n/lib/resources/pl/pdf-viewer/index.json.js +50 -0
  37. package/lib/node_modules/@shelf/i18n/lib/resources/uk/pdf-viewer/index.json.js +50 -0
  38. package/lib/node_modules/react-dom/cjs/react-dom.development.js +583 -69
  39. package/lib/node_modules/react-dom/cjs/react-dom.production.min.js +81 -83
  40. package/lib/node_modules/react-dom/client.js +3 -5
  41. package/lib/node_modules/react-dom/index.js +17 -15
  42. package/lib/node_modules/scheduler/index.js +6 -8
  43. package/lib/packages/colors/lib/colors.js +12 -0
  44. package/lib/packages/icons/lib/Containers/IconContainer/IconContainer.js +31 -0
  45. package/lib/packages/icons/lib/Icons/Condition.js +14 -0
  46. package/lib/packages/icons/lib/Icons/DecisionTree.js +18 -0
  47. package/lib/packages/icons/lib/Icons/Link.js +13 -0
  48. package/lib/packages/icons/lib/Icons/Question.js +18 -0
  49. package/lib/packages/icons/lib/Icons/Solution.js +14 -0
  50. package/package.json +13 -8
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.31.1](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.31.0...@shelf/global-renderer@0.31.1) (2023-11-01)
7
+
8
+ **Note:** Version bump only for package @shelf/global-renderer
9
+
10
+ ## [0.31.0](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.30.53...@shelf/global-renderer@0.31.0) (2023-11-01)
11
+
12
+ ### Features
13
+
14
+ - REACT-547 run codemod + manual fixes ([99837b2](https://github.com/shelfio/libs-frontend/commit/99837b2c178ad694f1c7da48b5fb8555be05a5d2))
15
+
16
+ ### Bug Fixes
17
+
18
+ - REACT-547 add colors to deps ([e92c132](https://github.com/shelfio/libs-frontend/commit/e92c132aa4bf97867be4f866a8b8cf38c76a04db))
19
+ - REACT-547 remove client-helpers from deps if not used ([ca73471](https://github.com/shelfio/libs-frontend/commit/ca734719ec5c1b739ba8db5c651dbc2a038d9617))
20
+
6
21
  ### [0.30.53](https://github.com/shelfio/libs-frontend/compare/@shelf/global-renderer@0.30.52...@shelf/global-renderer@0.30.53) (2023-10-31)
7
22
 
8
23
  **Note:** Version bump only for package @shelf/global-renderer
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { RenderDTContentData } from './types';
3
- declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, variables, }: RenderDTContentData) => JSX.Element;
3
+ declare const DecisionTreeContent: ({ title, description, tree, exportedBy, exportedAt, createdBy, fields, variables, }: RenderDTContentData) => React.JSX.Element;
4
4
  export default DecisionTreeContent;
@@ -1,84 +1,89 @@
1
- import { DecisionTree as a } from "@shelf/icons";
2
- import { colors as u } from "@shelf/client-helpers";
1
+ import { $white as u } from "../packages/colors/lib/colors.js";
2
+ import C from "../packages/icons/lib/Icons/DecisionTree.js";
3
3
  import { I18nextProvider as D } from "react-i18next";
4
- import { isEmpty as s } from "lodash";
5
- import { DTContentContainer as C, DTMeta as x, DTIcon as F, DTInternalMeta as S, DTTitle as y, DTDescription as I, CustomFields as M, CustomField as j, FieldName as k, FieldValue as E, DTContent as L } from "./DecisionTreeContent.styled.js";
4
+ import s from "lodash";
5
+ import { DTContentContainer as x, DTMeta as F, DTIcon as S, DTInternalMeta as y, DTTitle as I, DTDescription as M, CustomFields as j, CustomField as k, FieldName as v, FieldValue as E, DTContent as L } from "./DecisionTreeContent.styled.js";
6
6
  import R from "../i18next/index.js";
7
7
  import { convertStepToRenderFormat as $ } from "./helpers.js";
8
- import v from "./components/Question.js";
9
- import w from "./components/Condition.js";
10
- import z from "./components/Solution.js";
11
- import N from "./components/Link.js";
12
- import P from "./components/ContentTable.js";
13
- import Q from "./components/ExportedMeta.js";
14
- import { jsx as o, jsxs as e } from "react/jsx-runtime";
15
- const V = ({
8
+ import w from "./components/Question.js";
9
+ import z from "./components/Condition.js";
10
+ import N from "./components/Solution.js";
11
+ import P from "./components/Link.js";
12
+ import Q from "./components/ContentTable.js";
13
+ import V from "./components/ExportedMeta.js";
14
+ import { jsx as o, jsxs as t } from "react/jsx-runtime";
15
+ const _ = ({
16
16
  step: r,
17
- variables: t
18
- }) => r.type === "Link" ? /* @__PURE__ */ o(N, {
17
+ variables: n
18
+ }) => r.type === "Link" ? /* @__PURE__ */ o(P, {
19
19
  step: r
20
- }) : r.type === "Solution" ? /* @__PURE__ */ o(z, {
20
+ }) : r.type === "Solution" ? /* @__PURE__ */ o(N, {
21
21
  step: r
22
- }) : r.type === "Condition" ? /* @__PURE__ */ o(w, {
22
+ }) : r.type === "Condition" ? /* @__PURE__ */ o(z, {
23
23
  step: r,
24
- variables: t
25
- }) : /* @__PURE__ */ o(v, {
24
+ variables: n
25
+ }) : /* @__PURE__ */ o(w, {
26
26
  step: r,
27
- variables: t
27
+ variables: n
28
28
  }), b = ({
29
29
  title: r,
30
- description: t,
30
+ description: n,
31
31
  tree: d,
32
32
  exportedBy: l,
33
33
  exportedAt: p,
34
34
  createdBy: f,
35
35
  fields: m,
36
- variables: T
36
+ variables: h
37
37
  }) => {
38
- const c = $(d);
39
- return /* @__PURE__ */ o(D, {
40
- i18n: R,
41
- children: /* @__PURE__ */ e(C, {
42
- id: "dt-content-container",
43
- children: [/* @__PURE__ */ o(Q, {
44
- exportedBy: l,
45
- exportedAt: p,
46
- createdBy: f
47
- }), /* @__PURE__ */ e(x, {
48
- children: [/* @__PURE__ */ o(F, {
49
- children: /* @__PURE__ */ o(a, {
50
- iconSize: 20,
51
- color: u.$white
52
- })
53
- }), /* @__PURE__ */ e(S, {
54
- children: [/* @__PURE__ */ o(y, {
55
- children: r
56
- }), /* @__PURE__ */ o(I, {
57
- children: t
38
+ const {
39
+ isEmpty: T
40
+ } = s, c = $(d);
41
+ return (
42
+ // @ts-expect-error: TODO: upgrade i18n
43
+ /* @__PURE__ */ o(D, {
44
+ i18n: R,
45
+ children: /* @__PURE__ */ t(x, {
46
+ id: "dt-content-container",
47
+ children: [/* @__PURE__ */ o(V, {
48
+ exportedBy: l,
49
+ exportedAt: p,
50
+ createdBy: f
51
+ }), /* @__PURE__ */ t(F, {
52
+ children: [/* @__PURE__ */ o(S, {
53
+ children: /* @__PURE__ */ o(C, {
54
+ iconSize: 20,
55
+ color: u
56
+ })
57
+ }), /* @__PURE__ */ t(y, {
58
+ children: [/* @__PURE__ */ o(I, {
59
+ children: r
60
+ }), /* @__PURE__ */ o(M, {
61
+ children: n
62
+ })]
58
63
  })]
64
+ }), !T(m) && /* @__PURE__ */ o(j, {
65
+ children: m?.map(({
66
+ name: e,
67
+ value: i
68
+ }, a) => /* @__PURE__ */ t(k, {
69
+ children: [/* @__PURE__ */ t(v, {
70
+ children: [e, ": "]
71
+ }), /* @__PURE__ */ o(E, {
72
+ children: i
73
+ })]
74
+ }, a))
75
+ }), /* @__PURE__ */ o(Q, {
76
+ tree: c
77
+ }), /* @__PURE__ */ o(L, {
78
+ children: c.map((e, i) => /* @__PURE__ */ o(_, {
79
+ step: e,
80
+ variables: h
81
+ }, i))
59
82
  })]
60
- }), !s(m) && /* @__PURE__ */ o(M, {
61
- children: m?.map(({
62
- name: n,
63
- value: i
64
- }, h) => /* @__PURE__ */ e(j, {
65
- children: [/* @__PURE__ */ e(k, {
66
- children: [n, ": "]
67
- }), /* @__PURE__ */ o(E, {
68
- children: i
69
- })]
70
- }, h))
71
- }), /* @__PURE__ */ o(P, {
72
- tree: c
73
- }), /* @__PURE__ */ o(L, {
74
- children: c.map((n, i) => /* @__PURE__ */ o(V, {
75
- step: n,
76
- variables: T
77
- }, i))
78
- })]
83
+ })
79
84
  })
80
- });
81
- }, _ = b;
85
+ );
86
+ }, oo = b;
82
87
  export {
83
- _ as default
88
+ oo as default
84
89
  };
@@ -1,85 +1,85 @@
1
+ import { $dark as e, $colorDecisionTree as o, $catchyBlue as d, $greyBlue as a, $deepBlue as i, $white as p, $greyThemeText as r } from "../packages/colors/lib/colors.js";
1
2
  import t from "styled-components";
2
- import { colors as i } from "@shelf/client-helpers";
3
- const d = t.div`
3
+ const c = t.div`
4
4
  margin: 0;
5
5
  font-family: 'Open Sans', Arial, sans-serif;
6
- color: ${i.$dark};
6
+ color: ${e};
7
7
  font-size: 14px;
8
- `, a = t.div`
8
+ `, x = t.div`
9
9
  display: flex;
10
- `, p = t.div`
10
+ `, g = t.div`
11
11
  min-width: 40px;
12
12
  width: 40px;
13
13
  height: 40px;
14
- background-color: ${i.$colorDecisionTree};
14
+ background-color: ${o};
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: center;
18
18
  margin-right: 10px;
19
- `, r = t.div`
19
+ `, h = t.div`
20
20
  display: flex;
21
21
  flex-direction: column;
22
- `, s = t.div`
22
+ `, m = t.div`
23
23
  font-size: 20px;
24
24
  line-height: 1.25;
25
25
  padding: 0 5px 5px;
26
- `, l = t.div`
26
+ `, v = t.div`
27
27
  font-size: 14px;
28
28
  padding: 0 0 10px 5px;
29
- `, c = t.div`
29
+ `, f = t.div`
30
30
  float: right;
31
31
  max-width: 100%;
32
32
  width: 100%;
33
- `, x = t.div`
33
+ `, b = t.div`
34
34
  padding-top: 20px;
35
- `, g = t.div`
35
+ `, w = t.div`
36
36
  font-size: 14px;
37
37
  font-weight: 700;
38
38
  display: flex;
39
39
  justify-content: center;
40
- `, h = t.div`
40
+ `, u = t.div`
41
41
  display: flex;
42
42
  padding: 10px 0;
43
- `, m = t.div`
43
+ `, k = t.div`
44
44
  page-break-inside: avoid;
45
- `, v = t.div`
45
+ `, y = t.div`
46
46
  display: flex;
47
47
  width: 20%;
48
- `, f = t.div`
48
+ `, $ = t.div`
49
49
  width: 20px;
50
50
  height: 20px;
51
51
  min-width: 20px;
52
- background-color: ${(e) => e.color || i.$catchyBlue};
52
+ background-color: ${(n) => n.color || d};
53
53
  border-radius: 5px;
54
- `, b = t.div`
54
+ `, T = t.div`
55
55
  line-height: 20px;
56
56
  font-weight: 700;
57
57
  padding-left: 10px;
58
58
  margin-bottom: 10px;
59
59
  margin-right: 50px;
60
- `, u = t.div`
60
+ `, C = t.div`
61
61
  font-size: 20px;
62
62
  padding-bottom: 10px;
63
63
  page-break-inside: avoid;
64
- `, w = t.div`
64
+ `, D = t.div`
65
65
  font-size: 14px;
66
- `, k = t.div`
67
- background-color: ${i.$greyBlue};
68
- border-left: 1px solid ${i.$deepBlue};
66
+ `, L = t.div`
67
+ background-color: ${a};
68
+ border-left: 1px solid ${i};
69
69
  padding: 20px 15px 15px;
70
70
  margin: 10px 0;
71
- `, $ = t.div`
71
+ `, S = t.div`
72
72
  font-weight: bold;
73
73
  padding-bottom: 15px;
74
74
  line-height: 20px;
75
- `, y = t.div`
75
+ `, A = t.div`
76
76
  padding-bottom: 10px;
77
- `, T = t.div`
77
+ `, I = t.div`
78
78
  display: flex;
79
79
  page-break-inside: avoid;
80
80
  padding-bottom: 5px;
81
- `, C = t.div`
82
- background-color: ${i.$white};
81
+ `, z = t.div`
82
+ background-color: ${p};
83
83
  padding: 10px 10px 5px;
84
84
  border-radius: 5px;
85
85
  margin-bottom: 10px;
@@ -87,56 +87,56 @@ const d = t.div`
87
87
  page-break-inside: avoid;
88
88
  `, B = t.div`
89
89
  padding-right: 5px;
90
- `, D = t.div`
90
+ `, N = t.div`
91
91
  display: flex;
92
92
  padding-right: 5px;
93
93
  align-items: center;
94
- `, L = t.img`
94
+ `, F = t.img`
95
95
  width: 14px;
96
96
  height: 14px;
97
- `, S = t.a`
97
+ `, M = t.a`
98
98
  text-decoration: none;
99
- color: ${i.$deepBlue};
99
+ color: ${i};
100
100
  page-break-inside: avoid;
101
101
  max-width: 90%;
102
102
  word-wrap: break-word;
103
- `, A = t.span`
103
+ `, Q = t.span`
104
104
  ${({
105
- isDeleted: e
106
- }) => e ? "text-decoration: line-through" : ""}
107
- `, I = t.div``, z = t.div`
105
+ isDeleted: n
106
+ }) => n ? "text-decoration: line-through" : ""}
107
+ `, j = t.div``, H = t.div`
108
108
  padding-bottom: 5px;
109
109
  &:last-child {
110
110
  padding-bottom: 0;
111
111
  }
112
- `, N = t.a`
113
- color: ${i.$greyThemeText};
112
+ `, P = t.a`
113
+ color: ${r};
114
114
  margin-right: 0;
115
115
  margin-left: auto;
116
116
  text-decoration: none;
117
- `, F = t.div`
118
- color: ${i.$deepBlue};
117
+ `, V = t.div`
118
+ color: ${i};
119
119
  margin-right: 0;
120
120
  margin-left: auto;
121
121
  word-break: break-all;
122
122
  align-items: flex-end;
123
123
  max-width: 80%;
124
- `, M = t.a`
124
+ `, O = t.a`
125
125
  padding: 0 5px;
126
126
  text-decoration: none;
127
- color: ${i.$deepBlue};
127
+ color: ${i};
128
128
  line-height: 20px;
129
- `, Q = t.a`
129
+ `, R = t.a`
130
130
  text-decoration: none;
131
- color: ${i.$deepBlue};
131
+ color: ${i};
132
132
  page-break-inside: avoid;
133
133
  word-break: break-all;
134
- `, j = t.div`
135
- color: ${i.$dark};
134
+ `, U = t.div`
135
+ color: ${e};
136
136
  line-height: 20px;
137
137
  margin-right: 0;
138
138
  margin-left: auto;
139
- `, H = t.div`
139
+ `, W = t.div`
140
140
  display: flex;
141
141
  flex-direction: column;
142
142
  padding-bottom: 15px;
@@ -144,82 +144,82 @@ const d = t.div`
144
144
  max-width: 100%;
145
145
  width: 100%;
146
146
  margin-top: 10px;
147
- `, P = t.div`
147
+ `, q = t.div`
148
148
  line-height: 20px;
149
149
  padding-bottom: 5px;
150
150
  display: flex;
151
151
  page-break-inside: avoid;
152
- `, V = t.a`
152
+ `, E = t.a`
153
153
  text-decoration: none;
154
- color: ${i.$deepBlue};
154
+ color: ${i};
155
155
  line-height: 20px;
156
- `, O = t.div`
156
+ `, G = t.div`
157
157
  margin-right: 5px;
158
- `, R = t.div`
158
+ `, J = t.div`
159
159
  min-height: 19px;
160
160
  min-width: 20px;
161
161
  line-height: 20px;
162
- `, U = t.div`
162
+ `, K = t.div`
163
163
  padding-bottom: 25px;
164
- `, W = t.div`
164
+ `, X = t.div`
165
165
  line-height: 20px;
166
166
  padding-bottom: 5px;
167
167
  page-break-inside: avoid;
168
- `, q = t.div`
168
+ `, Y = t.div`
169
169
  margin-bottom: 5px;
170
170
  margin-left: 55px;
171
- `, E = t.div`
171
+ `, Z = t.div`
172
172
  line-height: 24px;
173
173
  display: flex;
174
174
  padding-bottom: 5px;
175
- `, G = t.div`
175
+ `, _ = t.div`
176
176
  font-weight: 700;
177
- `, J = t.div`
177
+ `, tt = t.div`
178
178
  padding-left: 5px;
179
179
  `;
180
180
  export {
181
- T as Answer,
181
+ I as Answer,
182
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
183
+ M as AnswerTitle,
184
+ Q as AnswerVariable,
185
+ z as AnswerWithAssignments,
186
+ F as AssignmentIcon,
187
+ N as AssignmentIconBlock,
188
+ j as Condition,
189
+ D as Content,
190
+ W as ContentList,
191
+ J as ContentListIcon,
192
+ q as ContentListItem,
193
+ E as ContentListLink,
194
+ G as ContentListNumber,
195
+ C as ContentTitle,
196
+ Z as CustomField,
197
+ Y as CustomFields,
198
+ f as DTContent,
199
+ c as DTContentContainer,
200
+ v as DTDescription,
201
+ g as DTIcon,
202
+ h as DTInternalMeta,
203
+ x as DTMeta,
204
+ m as DTTitle,
205
+ _ as FieldName,
206
+ tt as FieldValue,
207
+ R as LinkUrl,
208
+ X as MataInfo,
209
+ K as MetaBlock,
210
+ U as NoLinks,
211
+ O as ParentLink,
212
+ L as Question,
213
+ A as QuestionDescription,
214
+ S as QuestionTitle,
215
+ H as Rule,
216
+ b as StepContainer,
217
+ y as StepHeader,
218
+ k as StepHeaderBlock,
219
+ P as StepLink,
220
+ w as StepNumber,
221
+ V as StepParents,
222
+ $ as StepType,
223
+ u as StepTypeContainer,
224
+ T as StepTypeTitle
225
225
  };
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import React from '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
- }) => JSX.Element;
7
+ }) => React.JSX.Element;
8
8
  export default _default;
@@ -1,67 +1,71 @@
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";
1
+ import A from "./StepHeader.js";
2
+ import { StepContainer as C, ContentTitle as N, Question as g, AnswerWithAssignments as x, Answer as m, AnswerNumber as D, Condition as u, Rule as v, AnswerTitle as o, AnswerVariable as j, StepLink as w } from "../DecisionTreeContent.styled.js";
3
3
  import i from "../../i18next/index.js";
4
- import { jsxs as t, jsx as e, Fragment as j } from "react/jsx-runtime";
4
+ import { jsxs as r, jsx as e, Fragment as s } from "react/jsx-runtime";
5
5
  const I = ({
6
6
  step: n,
7
- variables: w
7
+ variables: S
8
8
  }) => {
9
- const s = {
9
+ const a = {
10
10
  eq: "=",
11
- neq: "\u2260",
11
+ neq: "",
12
12
  contains: i.t("pdf-viewer.exportDTPDF.contains"),
13
13
  not_contains: i.t("pdf-viewer.exportDTPDF.notContains")
14
- }, a = [...n?.conditions || []];
15
- return /* @__PURE__ */ t(A, {
16
- children: [/* @__PURE__ */ e(P, {
14
+ }, p = [...n?.conditions || []];
15
+ return /* @__PURE__ */ r(C, {
16
+ children: [/* @__PURE__ */ e(A, {
17
17
  step: n
18
- }), /* @__PURE__ */ e(C, {
18
+ }), /* @__PURE__ */ e(N, {
19
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, "."]
20
+ }), /* @__PURE__ */ r(g, {
21
+ children: [p?.map((t, $) => {
22
+ const l = t?.expression?.rules, b = t?.expression?.joiner;
23
+ return l ? /* @__PURE__ */ e(x, {
24
+ children: /* @__PURE__ */ r(m, {
25
+ children: [/* @__PURE__ */ r(D, {
26
+ children: [$ + 1, "."]
27
27
  }), /* @__PURE__ */ e(u, {
28
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]
29
+ const c = S?.find((P) => P.id === d.variableId), h = c?.name, f = c?.isDeleted, T = d?.id === l[l.length - 1]?.id, F = f ? ` (${i.t("pdf-viewer.exportDTPDF.deleted")}) [${a[d.operator]}] ${d?.value}` : ` [${a[d.operator]}] ${d?.value}`;
30
+ return /* @__PURE__ */ r(s, {
31
+ children: [/* @__PURE__ */ e(v, {
32
+ children: h && /* @__PURE__ */ r(o, {
33
+ href: `#${t?.nextStep?.id}`,
34
+ children: [/* @__PURE__ */ e(j, {
35
+ isDeleted: f,
36
+ children: h
37
+ }), F]
38
38
  })
39
- }), $ && !b && /* @__PURE__ */ e(o, {
40
- href: `#${r?.nextStep?.id}`,
39
+ }), b && !T && /* @__PURE__ */ e(o, {
40
+ href: `#${t?.nextStep?.id}`,
41
41
  children: i.t("pdf-viewer.exportDTPDF.andOperator")
42
42
  })]
43
43
  });
44
44
  })
45
- }), r?.nextStep?.number && /* @__PURE__ */ t(v, {
46
- href: `#${r.nextStep?.id}`,
47
- children: [i.t("pdf-viewer.exportDTPDF.step"), " ", r.nextStep.number]
45
+ }), t?.nextStep?.number && /* @__PURE__ */ e(w, {
46
+ href: `#${t.nextStep?.id}`,
47
+ children: /* @__PURE__ */ r(s, {
48
+ children: [i.t("pdf-viewer.exportDTPDF.step"), " ", t.nextStep.number]
49
+ })
48
50
  })]
49
51
  })
50
- }, r.id) : null;
51
- }), /* @__PURE__ */ e(f, {
52
- children: /* @__PURE__ */ t(x, {
53
- children: [/* @__PURE__ */ t(m, {
54
- children: [a.length + 1, "."]
52
+ }, t.id) : null;
53
+ }), /* @__PURE__ */ e(x, {
54
+ children: /* @__PURE__ */ r(m, {
55
+ children: [/* @__PURE__ */ r(D, {
56
+ children: [p.length + 1, "."]
55
57
  }), /* @__PURE__ */ e(u, {
56
- children: /* @__PURE__ */ e(D, {
58
+ children: /* @__PURE__ */ e(v, {
57
59
  children: /* @__PURE__ */ e(o, {
58
60
  href: `#${n?.defaultNextStep?.id}`,
59
61
  children: i.t("pdf-viewer.exportDTPDF.default")
60
62
  })
61
63
  })
62
- }), n?.defaultNextStep?.id && /* @__PURE__ */ t(v, {
64
+ }), n?.defaultNextStep?.id && /* @__PURE__ */ e(w, {
63
65
  href: `#${n.defaultNextStep?.id}`,
64
- children: [i.t("pdf-viewer.exportDTPDF.step"), " ", n.defaultNextStep?.number]
66
+ children: /* @__PURE__ */ r(s, {
67
+ children: [i.t("pdf-viewer.exportDTPDF.step"), " ", n.defaultNextStep?.number]
68
+ })
65
69
  })]
66
70
  })
67
71
  })]
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DTStep } from '../types';
3
3
  declare const _default: ({ tree }: {
4
4
  tree: DTStep[];
5
- }) => JSX.Element;
5
+ }) => React.JSX.Element;
6
6
  export default _default;