@isettingkit/business-rules 0.1.6 → 0.1.8
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/dist/index.es.d.ts +20 -33
- package/dist/index.es.js +183 -183
- package/package.json +1 -1
package/dist/index.es.d.ts
CHANGED
|
@@ -14,23 +14,7 @@ export declare interface IBusinessRuleCard {
|
|
|
14
14
|
|
|
15
15
|
export declare interface IBusinessRuleView {
|
|
16
16
|
decision: IRuleDecision;
|
|
17
|
-
textValues:
|
|
18
|
-
selectOptions: string;
|
|
19
|
-
selectOption: string;
|
|
20
|
-
rangeMin: (label: string) => string;
|
|
21
|
-
rangeMax: (label: string) => string;
|
|
22
|
-
reasonForChange: string;
|
|
23
|
-
change: string;
|
|
24
|
-
changePlaceholder: string;
|
|
25
|
-
termStart: string;
|
|
26
|
-
termEnd: string;
|
|
27
|
-
cancel: string;
|
|
28
|
-
confirm: string;
|
|
29
|
-
none: string;
|
|
30
|
-
FactsThatConditionIt: string;
|
|
31
|
-
criteria: string;
|
|
32
|
-
Terms: string;
|
|
33
|
-
};
|
|
17
|
+
textValues: IRulesFormTextValues;
|
|
34
18
|
}
|
|
35
19
|
|
|
36
20
|
export declare interface IRulesForm {
|
|
@@ -39,22 +23,25 @@ export declare interface IRulesForm {
|
|
|
39
23
|
onCloseModal: () => void;
|
|
40
24
|
onCancel: () => void;
|
|
41
25
|
onSubmitEvent: (dataDecision: IRuleDecision) => void;
|
|
42
|
-
textValues:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
26
|
+
textValues: IRulesFormTextValues;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare interface IRulesFormTextValues {
|
|
30
|
+
cancel: string;
|
|
31
|
+
change: string;
|
|
32
|
+
changePlaceholder: string;
|
|
33
|
+
confirm: string;
|
|
34
|
+
criteria: string;
|
|
35
|
+
factsThatConditionIt: string;
|
|
36
|
+
none: string;
|
|
37
|
+
rangeMax: (label: string) => string;
|
|
38
|
+
rangeMin: (label: string) => string;
|
|
39
|
+
reasonForChange: string;
|
|
40
|
+
selectOption: string;
|
|
41
|
+
selectOptions: string;
|
|
42
|
+
termEnd: string;
|
|
43
|
+
terms: string;
|
|
44
|
+
termStart: string;
|
|
58
45
|
}
|
|
59
46
|
|
|
60
47
|
export declare const RulesForm: (prop: IRulesForm) => JSX_2.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { useFormik as N } from "formik";
|
|
3
|
+
import { useState as D, useEffect as R } from "react";
|
|
4
|
+
import { DecisionConditionRenderer as O, ValueValidationSchema as $, ValueHowToSetUp as T, ValueDataType as F } from "@isettingkit/input";
|
|
5
|
+
import { Divider as y } from "@inubekit/divider";
|
|
5
6
|
import { Stack as a } from "@inubekit/stack";
|
|
6
7
|
import { Text as x } from "@inubekit/text";
|
|
7
8
|
import { Toggle as U } from "@inubekit/toggle";
|
|
8
|
-
import { Textarea as
|
|
9
|
-
import { Date as
|
|
10
|
-
import { Checkbox as
|
|
11
|
-
import { DecisionConditionRenderer as O, ValueValidationSchema as q, ValueHowToSetUp as y, ValueDataType as A } from "@isettingkit/input";
|
|
9
|
+
import { Textarea as _ } from "@inubekit/textarea";
|
|
10
|
+
import { Date as A } from "@inubekit/date";
|
|
11
|
+
import { Checkbox as q } from "@inubekit/checkbox";
|
|
12
12
|
import { Button as L } from "@inubekit/button";
|
|
13
13
|
import { DecisionViewConditionRenderer as E } from "@isettingkit/view";
|
|
14
14
|
import { MdOutlineRemoveRedEye as B, MdOutlineDelete as Q } from "react-icons/md";
|
|
15
15
|
import { Icon as H } from "@inubekit/icon";
|
|
16
16
|
import { inube as G } from "@inubekit/foundations";
|
|
17
17
|
import I from "styled-components";
|
|
18
|
-
const P = (
|
|
18
|
+
const P = (o) => {
|
|
19
19
|
const {
|
|
20
|
-
label:
|
|
20
|
+
label: n,
|
|
21
21
|
labelText: i,
|
|
22
22
|
onHandleChange: l,
|
|
23
23
|
placeholder: d,
|
|
24
|
-
required:
|
|
25
|
-
value:
|
|
26
|
-
} =
|
|
24
|
+
required: h,
|
|
25
|
+
value: u = ""
|
|
26
|
+
} = o, [r, g] = D(u);
|
|
27
27
|
return /* @__PURE__ */ c(a, { direction: "column", margin: "10px 4px", children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
28
|
+
/* @__PURE__ */ e(x, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: i }),
|
|
29
|
+
/* @__PURE__ */ e(a, { margin: "10px 0", children: /* @__PURE__ */ e(
|
|
30
|
+
_,
|
|
31
31
|
{
|
|
32
32
|
id: "reasonChange",
|
|
33
|
-
label:
|
|
34
|
-
onChange: (
|
|
35
|
-
p
|
|
33
|
+
label: n,
|
|
34
|
+
onChange: (p) => {
|
|
35
|
+
g(p.target.value), l(p);
|
|
36
36
|
},
|
|
37
37
|
placeholder: d,
|
|
38
|
-
required:
|
|
39
|
-
value:
|
|
38
|
+
required: h,
|
|
39
|
+
value: r,
|
|
40
40
|
maxLength: 120,
|
|
41
41
|
fullwidth: !0
|
|
42
42
|
}
|
|
43
43
|
) })
|
|
44
44
|
] });
|
|
45
|
-
}, Z = (
|
|
45
|
+
}, Z = (o) => {
|
|
46
46
|
const {
|
|
47
|
-
checked:
|
|
47
|
+
checked: n,
|
|
48
48
|
children: i,
|
|
49
49
|
handleToggleChange: l,
|
|
50
50
|
id: d,
|
|
51
|
-
labelToggle:
|
|
52
|
-
name:
|
|
53
|
-
valueToggle:
|
|
54
|
-
} =
|
|
55
|
-
|
|
51
|
+
labelToggle: h,
|
|
52
|
+
name: u,
|
|
53
|
+
valueToggle: r = ""
|
|
54
|
+
} = o, [g, C] = D(n), p = (f) => {
|
|
55
|
+
C(f.target.checked), l(f);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
/* @__PURE__ */
|
|
57
|
+
return R(() => {
|
|
58
|
+
C(n);
|
|
59
|
+
}, [n]), /* @__PURE__ */ c(j, { children: [
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
61
|
U,
|
|
62
62
|
{
|
|
63
|
-
checked:
|
|
63
|
+
checked: g,
|
|
64
64
|
id: d,
|
|
65
65
|
margin: "10px",
|
|
66
|
-
name:
|
|
67
|
-
onChange:
|
|
66
|
+
name: u,
|
|
67
|
+
onChange: p,
|
|
68
68
|
size: "small",
|
|
69
|
-
value:
|
|
70
|
-
children: /* @__PURE__ */
|
|
69
|
+
value: r,
|
|
70
|
+
children: /* @__PURE__ */ e(x, { size: "medium", type: "label", weight: "bold", children: h })
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
|
|
73
|
+
g && /* @__PURE__ */ e(j, { children: i })
|
|
74
74
|
] });
|
|
75
|
-
}, J = (
|
|
75
|
+
}, J = (o) => {
|
|
76
76
|
const {
|
|
77
|
-
onHandleStartChange:
|
|
77
|
+
onHandleStartChange: n,
|
|
78
78
|
onHandleEndChange: i,
|
|
79
79
|
labelStart: l,
|
|
80
80
|
labelEnd: d,
|
|
81
|
-
checkedClosed:
|
|
82
|
-
required:
|
|
83
|
-
valueStart:
|
|
84
|
-
valueEnd:
|
|
85
|
-
} =
|
|
86
|
-
return /* @__PURE__ */ c(
|
|
81
|
+
checkedClosed: h = !1,
|
|
82
|
+
required: u = !1,
|
|
83
|
+
valueStart: r = "",
|
|
84
|
+
valueEnd: g = ""
|
|
85
|
+
} = o, [C, p] = D(h), [f, w] = D(r), [S, k] = D(g);
|
|
86
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
87
87
|
/* @__PURE__ */ c(a, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
89
89
|
x,
|
|
90
90
|
{
|
|
91
91
|
appearance: "gray",
|
|
@@ -96,21 +96,21 @@ const P = (r) => {
|
|
|
96
96
|
children: "Vigencia"
|
|
97
97
|
}
|
|
98
98
|
) }),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ e(
|
|
100
100
|
a,
|
|
101
101
|
{
|
|
102
102
|
alignContent: "center",
|
|
103
103
|
justifyContent: "center",
|
|
104
104
|
wrap: "wrap",
|
|
105
105
|
gap: "4px",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
|
|
106
|
+
children: /* @__PURE__ */ e(
|
|
107
|
+
q,
|
|
108
108
|
{
|
|
109
109
|
label: "Cerrada",
|
|
110
110
|
onChange: ({ target: t }) => {
|
|
111
|
-
|
|
111
|
+
p(t.checked);
|
|
112
112
|
},
|
|
113
|
-
checked:
|
|
113
|
+
checked: C,
|
|
114
114
|
value: ""
|
|
115
115
|
}
|
|
116
116
|
)
|
|
@@ -118,62 +118,62 @@ const P = (r) => {
|
|
|
118
118
|
)
|
|
119
119
|
] }),
|
|
120
120
|
/* @__PURE__ */ c(a, { justifyContent: "space-between", gap: "24px", children: [
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
121
|
+
/* @__PURE__ */ e(a, { width: "189px", children: /* @__PURE__ */ e(
|
|
122
|
+
A,
|
|
123
123
|
{
|
|
124
124
|
id: "dateStart",
|
|
125
125
|
label: l,
|
|
126
126
|
onChange: (t) => {
|
|
127
|
-
w(t.target.value),
|
|
127
|
+
w(t.target.value), n(t);
|
|
128
128
|
},
|
|
129
129
|
value: f,
|
|
130
|
-
required:
|
|
130
|
+
required: u,
|
|
131
131
|
size: "compact"
|
|
132
132
|
}
|
|
133
133
|
) }),
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
C && /* @__PURE__ */ e(a, { width: "189px", children: /* @__PURE__ */ e(
|
|
135
|
+
A,
|
|
136
136
|
{
|
|
137
137
|
id: "dateEnd",
|
|
138
138
|
label: d,
|
|
139
139
|
onChange: (t) => {
|
|
140
140
|
k(t.target.value), i(t);
|
|
141
141
|
},
|
|
142
|
-
value:
|
|
143
|
-
required:
|
|
142
|
+
value: S,
|
|
143
|
+
required: u,
|
|
144
144
|
size: "compact"
|
|
145
145
|
}
|
|
146
146
|
) })
|
|
147
147
|
] })
|
|
148
148
|
] });
|
|
149
|
-
}, K = (
|
|
150
|
-
var
|
|
149
|
+
}, K = (o) => {
|
|
150
|
+
var m;
|
|
151
151
|
const {
|
|
152
|
-
decision:
|
|
152
|
+
decision: n,
|
|
153
153
|
formik: i,
|
|
154
154
|
onChangeCondition: l,
|
|
155
155
|
onChangeDecision: d,
|
|
156
|
-
onStartChange:
|
|
157
|
-
onEndChange:
|
|
158
|
-
textValues:
|
|
159
|
-
onCancel:
|
|
160
|
-
onSubmit:
|
|
161
|
-
} =
|
|
156
|
+
onStartChange: h,
|
|
157
|
+
onEndChange: u,
|
|
158
|
+
textValues: r,
|
|
159
|
+
onCancel: g,
|
|
160
|
+
onSubmit: C
|
|
161
|
+
} = o, [p, f] = D(!1), [w, S] = D(!0), k = (t) => {
|
|
162
162
|
f(t.target.checked);
|
|
163
|
-
},
|
|
164
|
-
t.target.value ?
|
|
165
|
-
},
|
|
163
|
+
}, v = (t) => {
|
|
164
|
+
t.target.value ? S(!1) : S(!0);
|
|
165
|
+
}, s = (t, b) => t.errors[b] ? "invalid" : "pending";
|
|
166
166
|
return /* @__PURE__ */ c(a, { direction: "column", gap: "24px", children: [
|
|
167
167
|
/* @__PURE__ */ c(a, { direction: "column", gap: "16", children: [
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
168
|
+
/* @__PURE__ */ e(x, { weight: "bold", size: "medium", children: r.criteria }),
|
|
169
|
+
n.decision && /* @__PURE__ */ e(
|
|
170
170
|
O,
|
|
171
171
|
{
|
|
172
|
-
element:
|
|
172
|
+
element: n.decision,
|
|
173
173
|
onDecision: d,
|
|
174
|
-
valueData: i.values[
|
|
175
|
-
message: i.errors[
|
|
176
|
-
status:
|
|
174
|
+
valueData: i.values[n.decision.name],
|
|
175
|
+
message: i.errors[n.decision.name],
|
|
176
|
+
status: s(i, n.decision.name),
|
|
177
177
|
textValues: {
|
|
178
178
|
selectOptions: "Select an option",
|
|
179
179
|
selectOption: "Option selected",
|
|
@@ -183,25 +183,25 @@ const P = (r) => {
|
|
|
183
183
|
}
|
|
184
184
|
)
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
187
187
|
/* @__PURE__ */ c(a, { direction: "column", children: [
|
|
188
188
|
/* @__PURE__ */ c(a, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ e(x, { children: r.factsThatConditionIt }),
|
|
190
|
+
/* @__PURE__ */ e(
|
|
191
191
|
U,
|
|
192
192
|
{
|
|
193
193
|
id: "toogleNone",
|
|
194
194
|
onChange: k,
|
|
195
|
-
checked:
|
|
195
|
+
checked: p,
|
|
196
196
|
size: "small",
|
|
197
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ e(x, { size: "medium", type: "label", weight: "bold", children: r.none })
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
] }),
|
|
201
|
-
|
|
201
|
+
n.conditions && n.conditions.map((t) => /* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
202
202
|
Z,
|
|
203
203
|
{
|
|
204
|
-
checked: !
|
|
204
|
+
checked: !p,
|
|
205
205
|
handleToggleChange: (b) => {
|
|
206
206
|
b.target.checked || l(
|
|
207
207
|
{
|
|
@@ -216,14 +216,14 @@ const P = (r) => {
|
|
|
216
216
|
id: t.name.replace(" ", ""),
|
|
217
217
|
labelToggle: t.name.split(/(?=[A-Z])/).join(" "),
|
|
218
218
|
name: t.name.replace(" ", ""),
|
|
219
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ e(
|
|
220
220
|
O,
|
|
221
221
|
{
|
|
222
222
|
element: t,
|
|
223
223
|
onDecision: l,
|
|
224
224
|
valueData: i.values[t.name],
|
|
225
225
|
message: i.errors[t.name],
|
|
226
|
-
status:
|
|
226
|
+
status: s(i, t.name),
|
|
227
227
|
textValues: {
|
|
228
228
|
selectOptions: "Select an option",
|
|
229
229
|
selectOption: "Option selected",
|
|
@@ -235,166 +235,166 @@ const P = (r) => {
|
|
|
235
235
|
}
|
|
236
236
|
) }, t.name))
|
|
237
237
|
] }),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
239
|
+
/* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
240
240
|
P,
|
|
241
241
|
{
|
|
242
|
-
label:
|
|
243
|
-
labelText:
|
|
244
|
-
onHandleChange:
|
|
245
|
-
placeholder:
|
|
242
|
+
label: r.reasonForChange,
|
|
243
|
+
labelText: r.change,
|
|
244
|
+
onHandleChange: v,
|
|
245
|
+
placeholder: r.changePlaceholder,
|
|
246
246
|
required: !0
|
|
247
247
|
}
|
|
248
248
|
) }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
250
|
+
/* @__PURE__ */ e(a, { direction: "column", children: n.decision && /* @__PURE__ */ e(
|
|
251
251
|
J,
|
|
252
252
|
{
|
|
253
|
-
onHandleStartChange: (t) =>
|
|
254
|
-
onHandleEndChange: (t) =>
|
|
255
|
-
labelStart:
|
|
256
|
-
labelEnd:
|
|
257
|
-
checkedClosed: !!
|
|
258
|
-
valueStart:
|
|
253
|
+
onHandleStartChange: (t) => h(t.target.value),
|
|
254
|
+
onHandleEndChange: (t) => u(t.target.value),
|
|
255
|
+
labelStart: r.termStart,
|
|
256
|
+
labelEnd: r.termEnd,
|
|
257
|
+
checkedClosed: !!n.decision.endDate,
|
|
258
|
+
valueStart: n.decision.startDate.toLocaleDateString(
|
|
259
259
|
"en-CA"
|
|
260
260
|
),
|
|
261
|
-
valueEnd: ((
|
|
261
|
+
valueEnd: ((m = n.decision.endDate) == null ? void 0 : m.toLocaleDateString("en-CA")) || ""
|
|
262
262
|
}
|
|
263
263
|
) }),
|
|
264
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
265
265
|
/* @__PURE__ */ c(a, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ e(L, { appearance: "gray", onClick: g, children: r.cancel }),
|
|
267
|
+
/* @__PURE__ */ e(
|
|
268
268
|
L,
|
|
269
269
|
{
|
|
270
|
-
onClick:
|
|
270
|
+
onClick: C,
|
|
271
271
|
disabled: w || !i.isValid,
|
|
272
272
|
type: "submit",
|
|
273
|
-
children:
|
|
273
|
+
children: r.confirm
|
|
274
274
|
}
|
|
275
275
|
)
|
|
276
276
|
] })
|
|
277
277
|
] });
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
var b;
|
|
285
|
-
const t = (b = D == null ? void 0 : D.conditions) == null ? void 0 : b.map((V) => V.name === m ? { ...V, value: C } : V);
|
|
286
|
-
return { ...D, conditions: t };
|
|
278
|
+
}, Ce = (o) => {
|
|
279
|
+
const { id: n, decision: i, onCancel: l, onSubmitEvent: d, textValues: h } = o, [u, r] = D(i), g = (s, m) => {
|
|
280
|
+
r((t) => {
|
|
281
|
+
var z;
|
|
282
|
+
const b = (z = t == null ? void 0 : t.conditions) == null ? void 0 : z.map((V) => V.name === m ? { ...V, value: s } : V);
|
|
283
|
+
return { ...t, conditions: b };
|
|
287
284
|
});
|
|
288
|
-
},
|
|
289
|
-
|
|
290
|
-
(m) =>
|
|
285
|
+
}, C = (s) => {
|
|
286
|
+
r(
|
|
287
|
+
(m) => v(m, "value", s)
|
|
291
288
|
);
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
(m) =>
|
|
289
|
+
}, p = (s) => {
|
|
290
|
+
r(
|
|
291
|
+
(m) => v(m, "endDate", new Date(s))
|
|
295
292
|
);
|
|
296
|
-
}, f = (
|
|
297
|
-
|
|
298
|
-
(m) =>
|
|
293
|
+
}, f = (s) => {
|
|
294
|
+
r(
|
|
295
|
+
(m) => v(m, "startDate", new Date(s))
|
|
299
296
|
);
|
|
300
|
-
}, { validationSchema: w, initialValues:
|
|
301
|
-
initialValues:
|
|
297
|
+
}, { validationSchema: w, initialValues: S } = $(u), k = N({
|
|
298
|
+
initialValues: S,
|
|
302
299
|
validationSchema: w,
|
|
303
300
|
validateOnChange: !1,
|
|
304
301
|
onSubmit: () => {
|
|
305
|
-
d(
|
|
302
|
+
d(u);
|
|
306
303
|
}
|
|
304
|
+
}), v = (s, m, t) => ({
|
|
305
|
+
...s,
|
|
306
|
+
decision: { ...s.decision, [m]: t }
|
|
307
307
|
});
|
|
308
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ e(
|
|
309
309
|
K,
|
|
310
310
|
{
|
|
311
|
-
id:
|
|
311
|
+
id: n,
|
|
312
312
|
formik: k,
|
|
313
|
-
decision:
|
|
313
|
+
decision: u,
|
|
314
314
|
onCancel: l,
|
|
315
|
-
onSubmit: () => d(
|
|
316
|
-
onChangeCondition:
|
|
317
|
-
onChangeDecision:
|
|
318
|
-
onStartChange:
|
|
319
|
-
onEndChange:
|
|
320
|
-
textValues:
|
|
315
|
+
onSubmit: () => d(u),
|
|
316
|
+
onChangeCondition: g,
|
|
317
|
+
onChangeDecision: C,
|
|
318
|
+
onStartChange: f,
|
|
319
|
+
onEndChange: p,
|
|
320
|
+
textValues: h
|
|
321
321
|
}
|
|
322
322
|
);
|
|
323
|
-
}, M = (
|
|
324
|
-
if (!
|
|
323
|
+
}, M = (o) => {
|
|
324
|
+
if (!o)
|
|
325
325
|
return;
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
326
|
+
const n = o.value || o.possibleValue;
|
|
327
|
+
if (!n)
|
|
328
328
|
return;
|
|
329
|
-
if (((l) => typeof l == "object" && l !== null)(
|
|
330
|
-
switch (
|
|
331
|
-
case
|
|
332
|
-
return
|
|
333
|
-
case
|
|
334
|
-
return
|
|
335
|
-
case
|
|
329
|
+
if (((l) => typeof l == "object" && l !== null)(n))
|
|
330
|
+
switch (o.howToSetUp) {
|
|
331
|
+
case T.LIST_OF_VALUES_MULTI:
|
|
332
|
+
return n.listSelected;
|
|
333
|
+
case T.LIST_OF_VALUES:
|
|
334
|
+
return n.listSelected ?? n.list;
|
|
335
|
+
case T.RANGE:
|
|
336
336
|
return {
|
|
337
|
-
rangeFrom:
|
|
338
|
-
rangeTo:
|
|
337
|
+
rangeFrom: n.rangeFrom,
|
|
338
|
+
rangeTo: n.rangeTo
|
|
339
339
|
};
|
|
340
340
|
default:
|
|
341
|
-
return
|
|
341
|
+
return n.value;
|
|
342
342
|
}
|
|
343
|
-
return
|
|
344
|
-
}, be = (
|
|
343
|
+
return n;
|
|
344
|
+
}, be = (o) => {
|
|
345
345
|
var l, d;
|
|
346
|
-
const { decision:
|
|
346
|
+
const { decision: n, textValues: i } = o;
|
|
347
347
|
return /* @__PURE__ */ c(a, { direction: "column", gap: "24px", children: [
|
|
348
348
|
/* @__PURE__ */ c(a, { direction: "column", gap: "16px", children: [
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.criteria }),
|
|
350
|
+
/* @__PURE__ */ e(a, { justifyContent: "space-between", children: n.decision && /* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
351
351
|
E,
|
|
352
352
|
{
|
|
353
|
-
element:
|
|
354
|
-
valueData: M(
|
|
353
|
+
element: n.decision,
|
|
354
|
+
valueData: M(n.decision)
|
|
355
355
|
}
|
|
356
|
-
) },
|
|
356
|
+
) }, n.decision.name) })
|
|
357
357
|
] }),
|
|
358
358
|
/* @__PURE__ */ c(a, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
359
|
+
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.factsThatConditionIt }),
|
|
360
|
+
n.conditions && n.conditions.map((h) => /* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
361
361
|
E,
|
|
362
362
|
{
|
|
363
|
-
element:
|
|
364
|
-
valueData: M(
|
|
363
|
+
element: h,
|
|
364
|
+
valueData: M(h)
|
|
365
365
|
}
|
|
366
|
-
) },
|
|
366
|
+
) }, h.name))
|
|
367
367
|
] }),
|
|
368
368
|
/* @__PURE__ */ c(a, { direction: "column", gap: "12px", children: [
|
|
369
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.terms }),
|
|
370
370
|
/* @__PURE__ */ c(a, { justifyContent: "space-between", children: [
|
|
371
|
-
((l =
|
|
371
|
+
((l = n == null ? void 0 : n.decision) == null ? void 0 : l.startDate) && /* @__PURE__ */ e(
|
|
372
372
|
E,
|
|
373
373
|
{
|
|
374
374
|
element: {
|
|
375
375
|
name: "startDate",
|
|
376
376
|
description: i.termStart,
|
|
377
|
-
value: String(
|
|
378
|
-
howToSetUp:
|
|
379
|
-
typeData:
|
|
377
|
+
value: String(n.startDate),
|
|
378
|
+
howToSetUp: T.EQUAL,
|
|
379
|
+
typeData: F.DATE
|
|
380
380
|
},
|
|
381
381
|
valueData: new Date(
|
|
382
|
-
|
|
382
|
+
n.decision.startDate
|
|
383
383
|
).toLocaleDateString("en-CA")
|
|
384
384
|
},
|
|
385
385
|
"startDate"
|
|
386
386
|
),
|
|
387
|
-
((d =
|
|
387
|
+
((d = n == null ? void 0 : n.decision) == null ? void 0 : d.endDate) && /* @__PURE__ */ e(
|
|
388
388
|
E,
|
|
389
389
|
{
|
|
390
390
|
element: {
|
|
391
391
|
name: "endDate",
|
|
392
392
|
description: i.termEnd,
|
|
393
|
-
value: String(
|
|
394
|
-
howToSetUp:
|
|
395
|
-
typeData:
|
|
393
|
+
value: String(n.endDate),
|
|
394
|
+
howToSetUp: T.EQUAL,
|
|
395
|
+
typeData: F.DATE
|
|
396
396
|
},
|
|
397
|
-
valueData: new Date(
|
|
397
|
+
valueData: new Date(n.decision.endDate).toLocaleDateString(
|
|
398
398
|
"en-CA"
|
|
399
399
|
)
|
|
400
400
|
},
|
|
@@ -430,32 +430,32 @@ const P = (r) => {
|
|
|
430
430
|
background-color: #ebecf0;
|
|
431
431
|
border-radius: 8px;
|
|
432
432
|
}
|
|
433
|
-
`, xe = (
|
|
434
|
-
const { children:
|
|
433
|
+
`, xe = (o) => {
|
|
434
|
+
const { children: n, handleDelete: i, handleView: l, id: d } = o;
|
|
435
435
|
return /* @__PURE__ */ c(W, { children: [
|
|
436
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ e(a, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(a, { direction: "column", margin: "10px", children: n }) }) }),
|
|
437
437
|
/* @__PURE__ */ c(a, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
438
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ e(y, {}),
|
|
439
439
|
/* @__PURE__ */ c(a, { gap: "16px", justifyContent: "end", children: [
|
|
440
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ e(
|
|
441
441
|
H,
|
|
442
442
|
{
|
|
443
443
|
appearance: "dark",
|
|
444
444
|
size: "24px",
|
|
445
445
|
cursorHover: !0,
|
|
446
|
-
icon: /* @__PURE__ */
|
|
446
|
+
icon: /* @__PURE__ */ e(B, {}),
|
|
447
447
|
onClick: () => {
|
|
448
448
|
l(d);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ e(
|
|
453
453
|
H,
|
|
454
454
|
{
|
|
455
455
|
cursorHover: !0,
|
|
456
456
|
appearance: "dark",
|
|
457
457
|
size: "24px",
|
|
458
|
-
icon: /* @__PURE__ */
|
|
458
|
+
icon: /* @__PURE__ */ e(Q, {}),
|
|
459
459
|
onClick: () => {
|
|
460
460
|
i(d);
|
|
461
461
|
}
|