@isettingkit/business-rules 0.1.14 → 0.1.15
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.js +138 -138
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as h, jsx as n, Fragment as
|
|
1
|
+
import { jsxs as h, jsx as n, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import { useFormik as Q } from "formik";
|
|
3
3
|
import { useState as x, useEffect as P } from "react";
|
|
4
4
|
import { Divider as V } from "@inubekit/divider";
|
|
5
5
|
import { Stack as o } from "@inubekit/stack";
|
|
6
6
|
import { Text as y } from "@inubekit/text";
|
|
7
7
|
import { Toggle as $ } from "@inubekit/toggle";
|
|
8
|
-
import { ValueHowToSetUp as f, ValueDataType as
|
|
9
|
-
import { Textarea as
|
|
8
|
+
import { ValueHowToSetUp as f, ValueDataType as j, parsePercentageString as Z, DecisionConditionRenderer as L } from "@isettingkit/input";
|
|
9
|
+
import { Textarea as J } from "@inubekit/textarea";
|
|
10
10
|
import { Date as M } from "@inubekit/date";
|
|
11
|
-
import { Checkbox as
|
|
11
|
+
import { Checkbox as K } from "@inubekit/checkbox";
|
|
12
12
|
import { Button as z } from "@inubekit/button";
|
|
13
|
-
import { object as B, string as
|
|
13
|
+
import { object as B, string as H, number as F, mixed as I } from "yup";
|
|
14
14
|
import { DecisionViewConditionRenderer as A } from "@isettingkit/view";
|
|
15
|
-
import { MdOutlineRemoveRedEye as
|
|
15
|
+
import { MdOutlineRemoveRedEye as W, MdOutlineDelete as X } from "react-icons/md";
|
|
16
16
|
import { Icon as N } from "@inubekit/icon";
|
|
17
|
-
import { inube as
|
|
17
|
+
import { inube as Y } from "@inubekit/foundations";
|
|
18
18
|
import G from "styled-components";
|
|
19
|
-
const
|
|
19
|
+
const ee = (t) => {
|
|
20
20
|
const {
|
|
21
21
|
label: e,
|
|
22
22
|
labelText: a,
|
|
23
23
|
onHandleChange: i,
|
|
24
24
|
placeholder: l,
|
|
25
|
-
required:
|
|
25
|
+
required: c,
|
|
26
26
|
value: m = ""
|
|
27
|
-
} = t, [
|
|
27
|
+
} = t, [d, b] = x(m);
|
|
28
28
|
return /* @__PURE__ */ h(o, { direction: "column", margin: "10px 4px", children: [
|
|
29
29
|
/* @__PURE__ */ n(y, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: a }),
|
|
30
30
|
/* @__PURE__ */ n(o, { margin: "10px 0", children: /* @__PURE__ */ n(
|
|
31
|
-
|
|
31
|
+
J,
|
|
32
32
|
{
|
|
33
33
|
id: "reasonChange",
|
|
34
34
|
label: e,
|
|
35
|
-
onChange: (
|
|
36
|
-
b(
|
|
35
|
+
onChange: (p) => {
|
|
36
|
+
b(p.target.value), i(p);
|
|
37
37
|
},
|
|
38
38
|
placeholder: l,
|
|
39
|
-
required:
|
|
40
|
-
value:
|
|
39
|
+
required: c,
|
|
40
|
+
value: d,
|
|
41
41
|
maxLength: 120,
|
|
42
42
|
fullwidth: !0
|
|
43
43
|
}
|
|
44
44
|
) })
|
|
45
45
|
] });
|
|
46
|
-
},
|
|
46
|
+
}, ne = (t) => {
|
|
47
47
|
const {
|
|
48
48
|
checked: e,
|
|
49
49
|
children: a,
|
|
50
50
|
handleToggleChange: i,
|
|
51
51
|
id: l,
|
|
52
|
-
labelToggle:
|
|
52
|
+
labelToggle: c,
|
|
53
53
|
name: m,
|
|
54
|
-
valueToggle:
|
|
55
|
-
} = t, [b, C] = x(e),
|
|
54
|
+
valueToggle: d = ""
|
|
55
|
+
} = t, [b, C] = x(e), p = (v) => {
|
|
56
56
|
C(v.target.checked), i(v);
|
|
57
57
|
};
|
|
58
58
|
return P(() => {
|
|
59
59
|
C(e);
|
|
60
|
-
}, [e]), /* @__PURE__ */ h(
|
|
60
|
+
}, [e]), /* @__PURE__ */ h(R, { children: [
|
|
61
61
|
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
62
62
|
$,
|
|
63
63
|
{
|
|
@@ -65,26 +65,26 @@ const Y = (t) => {
|
|
|
65
65
|
id: l,
|
|
66
66
|
margin: "10px",
|
|
67
67
|
name: m,
|
|
68
|
-
onChange:
|
|
68
|
+
onChange: p,
|
|
69
69
|
size: "small",
|
|
70
|
-
value:
|
|
71
|
-
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children:
|
|
70
|
+
value: d,
|
|
71
|
+
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: c })
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
74
|
-
b && /* @__PURE__ */ n(
|
|
74
|
+
b && /* @__PURE__ */ n(R, { children: a })
|
|
75
75
|
] });
|
|
76
|
-
},
|
|
76
|
+
}, te = (t) => {
|
|
77
77
|
const {
|
|
78
78
|
onHandleStartChange: e,
|
|
79
79
|
onHandleEndChange: a,
|
|
80
80
|
labelStart: i,
|
|
81
81
|
labelEnd: l,
|
|
82
|
-
checkedClosed:
|
|
82
|
+
checkedClosed: c = !1,
|
|
83
83
|
required: m = !1,
|
|
84
|
-
valueStart:
|
|
84
|
+
valueStart: d = "",
|
|
85
85
|
valueEnd: b = ""
|
|
86
|
-
} = t, [C,
|
|
87
|
-
return /* @__PURE__ */ h(
|
|
86
|
+
} = t, [C, p] = x(c), [v, E] = x(d), [S, T] = x(b);
|
|
87
|
+
return /* @__PURE__ */ h(R, { children: [
|
|
88
88
|
/* @__PURE__ */ h(o, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
89
89
|
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
90
90
|
y,
|
|
@@ -105,11 +105,11 @@ const Y = (t) => {
|
|
|
105
105
|
wrap: "wrap",
|
|
106
106
|
gap: "4px",
|
|
107
107
|
children: /* @__PURE__ */ n(
|
|
108
|
-
|
|
108
|
+
K,
|
|
109
109
|
{
|
|
110
110
|
label: "Cerrada",
|
|
111
|
-
onChange: ({ target:
|
|
112
|
-
|
|
111
|
+
onChange: ({ target: s }) => {
|
|
112
|
+
p(s.checked);
|
|
113
113
|
},
|
|
114
114
|
checked: C,
|
|
115
115
|
value: ""
|
|
@@ -124,8 +124,8 @@ const Y = (t) => {
|
|
|
124
124
|
{
|
|
125
125
|
id: "dateStart",
|
|
126
126
|
label: i,
|
|
127
|
-
onChange: (
|
|
128
|
-
E(
|
|
127
|
+
onChange: (s) => {
|
|
128
|
+
E(s.target.value), e(s);
|
|
129
129
|
},
|
|
130
130
|
value: v,
|
|
131
131
|
required: m,
|
|
@@ -137,10 +137,10 @@ const Y = (t) => {
|
|
|
137
137
|
{
|
|
138
138
|
id: "dateEnd",
|
|
139
139
|
label: l,
|
|
140
|
-
onChange: (
|
|
141
|
-
T(
|
|
140
|
+
onChange: (s) => {
|
|
141
|
+
T(s.target.value), a(s);
|
|
142
142
|
},
|
|
143
|
-
value:
|
|
143
|
+
value: S,
|
|
144
144
|
required: m,
|
|
145
145
|
size: "compact"
|
|
146
146
|
}
|
|
@@ -153,22 +153,22 @@ const Y = (t) => {
|
|
|
153
153
|
switch (t.valueUse) {
|
|
154
154
|
case f.LIST_OF_VALUES:
|
|
155
155
|
return {
|
|
156
|
-
schema:
|
|
156
|
+
schema: I().test(
|
|
157
157
|
"isArrayOrString",
|
|
158
158
|
"Must be an array of strings/numbers or a single string",
|
|
159
159
|
(l) => Array.isArray(l) ? l.every(
|
|
160
|
-
(
|
|
160
|
+
(c) => typeof c == "string" || typeof c == "number"
|
|
161
161
|
) : typeof l == "string"
|
|
162
162
|
),
|
|
163
163
|
value: e
|
|
164
164
|
};
|
|
165
165
|
case f.LIST_OF_VALUES_MULTI:
|
|
166
166
|
return {
|
|
167
|
-
schema:
|
|
167
|
+
schema: I().test(
|
|
168
168
|
"isArrayOrString",
|
|
169
169
|
"Must be an array of strings/numbers or a single string",
|
|
170
170
|
(l) => Array.isArray(l) ? l.every(
|
|
171
|
-
(
|
|
171
|
+
(c) => typeof c == "string" || typeof c == "number"
|
|
172
172
|
) : typeof l == "string"
|
|
173
173
|
),
|
|
174
174
|
value: e
|
|
@@ -176,8 +176,8 @@ const Y = (t) => {
|
|
|
176
176
|
case f.RANGE:
|
|
177
177
|
return {
|
|
178
178
|
schema: B({
|
|
179
|
-
from:
|
|
180
|
-
to:
|
|
179
|
+
from: F().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
180
|
+
to: F().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
|
|
181
181
|
}),
|
|
182
182
|
value: {
|
|
183
183
|
from: a,
|
|
@@ -187,21 +187,21 @@ const Y = (t) => {
|
|
|
187
187
|
case f.GREATER_THAN:
|
|
188
188
|
case f.LESS_THAN:
|
|
189
189
|
case f.EQUAL:
|
|
190
|
-
return t.dataType ===
|
|
191
|
-
schema:
|
|
190
|
+
return t.dataType === j.PERCENTAGE ? {
|
|
191
|
+
schema: F().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
192
192
|
value: e
|
|
193
193
|
} : {
|
|
194
|
-
schema:
|
|
194
|
+
schema: H().required("Required"),
|
|
195
195
|
value: e
|
|
196
196
|
};
|
|
197
197
|
default:
|
|
198
198
|
return {
|
|
199
|
-
schema:
|
|
199
|
+
schema: H(),
|
|
200
200
|
value: void 0
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, ae = (t) => {
|
|
205
205
|
const e = {}, a = {};
|
|
206
206
|
if (t) {
|
|
207
207
|
const i = _(t);
|
|
@@ -225,42 +225,42 @@ const Y = (t) => {
|
|
|
225
225
|
if (a) return a;
|
|
226
226
|
}
|
|
227
227
|
return "";
|
|
228
|
-
},
|
|
229
|
-
var
|
|
228
|
+
}, re = (t) => {
|
|
229
|
+
var D;
|
|
230
230
|
const {
|
|
231
231
|
decision: e,
|
|
232
232
|
formik: a,
|
|
233
233
|
onChangeCondition: i,
|
|
234
234
|
onChangeDecision: l,
|
|
235
|
-
onStartChange:
|
|
235
|
+
onStartChange: c,
|
|
236
236
|
onEndChange: m,
|
|
237
|
-
textValues:
|
|
237
|
+
textValues: d,
|
|
238
238
|
onCancel: b,
|
|
239
239
|
onSubmit: C
|
|
240
|
-
} = t, [
|
|
240
|
+
} = t, [p, v] = x(!1), [E, S] = x(!0), T = {
|
|
241
241
|
name: e.name,
|
|
242
242
|
dataType: e.dataType,
|
|
243
|
-
value: e.value,
|
|
243
|
+
value: e.dataType === "percentage" ? Z(e.value) : e.value,
|
|
244
244
|
valueUse: e.valueUse,
|
|
245
245
|
possibleValue: e.possibleValue
|
|
246
246
|
};
|
|
247
247
|
P(() => {
|
|
248
248
|
console.log("Updated formik.errors in RulesFormUI:", a.errors);
|
|
249
249
|
}, [a.errors]);
|
|
250
|
-
const
|
|
250
|
+
const k = (r) => {
|
|
251
251
|
v(r.target.checked);
|
|
252
|
-
},
|
|
253
|
-
r.target.value ?
|
|
254
|
-
},
|
|
255
|
-
const
|
|
256
|
-
return typeof
|
|
257
|
-
},
|
|
258
|
-
const
|
|
259
|
-
return
|
|
252
|
+
}, w = (r) => {
|
|
253
|
+
r.target.value ? S(!1) : S(!0);
|
|
254
|
+
}, u = (r) => {
|
|
255
|
+
const g = U(a.errors[r] || {});
|
|
256
|
+
return typeof g == "string" ? g ? "invalid" : "pending" : g;
|
|
257
|
+
}, s = (r) => {
|
|
258
|
+
const g = U(a.errors[r] || {});
|
|
259
|
+
return g;
|
|
260
260
|
};
|
|
261
261
|
return /* @__PURE__ */ h(o, { direction: "column", gap: "24px", children: [
|
|
262
262
|
/* @__PURE__ */ h(o, { direction: "column", gap: "16", children: [
|
|
263
|
-
/* @__PURE__ */ n(y, { weight: "bold", size: "medium", children:
|
|
263
|
+
/* @__PURE__ */ n(y, { weight: "bold", size: "medium", children: d.criteria }),
|
|
264
264
|
e && /* @__PURE__ */ n(
|
|
265
265
|
L,
|
|
266
266
|
{
|
|
@@ -268,7 +268,7 @@ const Y = (t) => {
|
|
|
268
268
|
onDecision: l,
|
|
269
269
|
valueData: a.values[e.name],
|
|
270
270
|
message: a.errors[e.name],
|
|
271
|
-
status:
|
|
271
|
+
status: u(e.name),
|
|
272
272
|
textValues: {
|
|
273
273
|
selectOptions: "Select an option",
|
|
274
274
|
selectOption: "Option selected",
|
|
@@ -281,24 +281,24 @@ const Y = (t) => {
|
|
|
281
281
|
/* @__PURE__ */ n(V, { dashed: !0 }),
|
|
282
282
|
/* @__PURE__ */ h(o, { direction: "column", children: [
|
|
283
283
|
/* @__PURE__ */ h(o, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
284
|
-
/* @__PURE__ */ n(y, { children:
|
|
284
|
+
/* @__PURE__ */ n(y, { children: d.factsThatConditionIt }),
|
|
285
285
|
/* @__PURE__ */ n(
|
|
286
286
|
$,
|
|
287
287
|
{
|
|
288
288
|
id: "toogleNone",
|
|
289
|
-
onChange:
|
|
290
|
-
checked:
|
|
289
|
+
onChange: k,
|
|
290
|
+
checked: p,
|
|
291
291
|
size: "small",
|
|
292
|
-
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children:
|
|
292
|
+
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: d.none })
|
|
293
293
|
}
|
|
294
294
|
)
|
|
295
295
|
] }),
|
|
296
296
|
e.conditions && e.conditions.map((r) => /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
297
|
-
|
|
297
|
+
ne,
|
|
298
298
|
{
|
|
299
|
-
checked: !
|
|
300
|
-
handleToggleChange: (
|
|
301
|
-
|
|
299
|
+
checked: !p,
|
|
300
|
+
handleToggleChange: (g) => {
|
|
301
|
+
g.target.checked || i(
|
|
302
302
|
{
|
|
303
303
|
value: "",
|
|
304
304
|
to: 0,
|
|
@@ -317,13 +317,13 @@ const Y = (t) => {
|
|
|
317
317
|
element: r,
|
|
318
318
|
onDecision: i,
|
|
319
319
|
valueData: a.values[r.name],
|
|
320
|
-
message:
|
|
321
|
-
status:
|
|
320
|
+
message: s(r.name),
|
|
321
|
+
status: u(r.name),
|
|
322
322
|
textValues: {
|
|
323
323
|
selectOptions: "Select an option",
|
|
324
324
|
selectOption: "Option selected",
|
|
325
|
-
rangeMin: (
|
|
326
|
-
rangeMax: (
|
|
325
|
+
rangeMin: (g) => `Minimum ${g}`,
|
|
326
|
+
rangeMax: (g) => `Maximum ${g}`
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
)
|
|
@@ -332,96 +332,96 @@ const Y = (t) => {
|
|
|
332
332
|
] }),
|
|
333
333
|
/* @__PURE__ */ n(V, { dashed: !0 }),
|
|
334
334
|
/* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
335
|
-
|
|
335
|
+
ee,
|
|
336
336
|
{
|
|
337
|
-
label:
|
|
338
|
-
labelText:
|
|
339
|
-
onHandleChange:
|
|
340
|
-
placeholder:
|
|
337
|
+
label: d.reasonForChange,
|
|
338
|
+
labelText: d.change,
|
|
339
|
+
onHandleChange: w,
|
|
340
|
+
placeholder: d.changePlaceholder,
|
|
341
341
|
required: !0
|
|
342
342
|
}
|
|
343
343
|
) }),
|
|
344
344
|
/* @__PURE__ */ n(V, { dashed: !0 }),
|
|
345
345
|
/* @__PURE__ */ n(o, { direction: "column", children: e && /* @__PURE__ */ n(
|
|
346
|
-
|
|
346
|
+
te,
|
|
347
347
|
{
|
|
348
|
-
onHandleStartChange: (r) =>
|
|
348
|
+
onHandleStartChange: (r) => c(r.target.value),
|
|
349
349
|
onHandleEndChange: (r) => m(r.target.value),
|
|
350
|
-
labelStart:
|
|
351
|
-
labelEnd:
|
|
350
|
+
labelStart: d.termStart,
|
|
351
|
+
labelEnd: d.termEnd,
|
|
352
352
|
checkedClosed: !!e.endDate,
|
|
353
353
|
valueStart: e.startDate.toLocaleDateString("en-CA"),
|
|
354
|
-
valueEnd: ((
|
|
354
|
+
valueEnd: ((D = e.endDate) == null ? void 0 : D.toLocaleDateString("en-CA")) || ""
|
|
355
355
|
}
|
|
356
356
|
) }),
|
|
357
357
|
/* @__PURE__ */ n(V, { dashed: !0 }),
|
|
358
358
|
/* @__PURE__ */ h(o, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
359
|
-
/* @__PURE__ */ n(z, { appearance: "gray", onClick: b, children:
|
|
359
|
+
/* @__PURE__ */ n(z, { appearance: "gray", onClick: b, children: d.cancel }),
|
|
360
360
|
/* @__PURE__ */ n(
|
|
361
361
|
z,
|
|
362
362
|
{
|
|
363
363
|
onClick: C,
|
|
364
364
|
disabled: E || !a.isValid,
|
|
365
365
|
type: "submit",
|
|
366
|
-
children:
|
|
366
|
+
children: d.confirm
|
|
367
367
|
}
|
|
368
368
|
)
|
|
369
369
|
] })
|
|
370
370
|
] });
|
|
371
|
-
},
|
|
372
|
-
const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues:
|
|
373
|
-
|
|
374
|
-
}, C = (
|
|
375
|
-
const
|
|
376
|
-
|
|
371
|
+
}, ke = (t) => {
|
|
372
|
+
const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues: c } = t, [m, d] = x(a), b = (u, s) => {
|
|
373
|
+
k.setFieldValue(u, s), k.validateField(u);
|
|
374
|
+
}, C = (u, s) => {
|
|
375
|
+
const D = u instanceof Date ? u.toISOString() : u;
|
|
376
|
+
d((r) => {
|
|
377
377
|
if (!r.conditions)
|
|
378
378
|
return r;
|
|
379
|
-
const
|
|
379
|
+
const g = r.conditions.map((O) => O.name === s ? { ...O, value: D } : O);
|
|
380
380
|
return {
|
|
381
381
|
...r,
|
|
382
|
-
conditions:
|
|
382
|
+
conditions: g
|
|
383
383
|
};
|
|
384
|
-
}), b(
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
(
|
|
388
|
-
)
|
|
389
|
-
}, v = (
|
|
390
|
-
|
|
391
|
-
(
|
|
384
|
+
}), b(s, D);
|
|
385
|
+
}, p = (u) => {
|
|
386
|
+
d(
|
|
387
|
+
(s) => w(s, "value", u)
|
|
388
|
+
);
|
|
389
|
+
}, v = (u) => {
|
|
390
|
+
d(
|
|
391
|
+
(s) => w(s, "endDate", new Date(u))
|
|
392
392
|
);
|
|
393
|
-
}, E = (
|
|
394
|
-
|
|
395
|
-
(
|
|
393
|
+
}, E = (u) => {
|
|
394
|
+
d(
|
|
395
|
+
(s) => w(s, "startDate", new Date(u))
|
|
396
396
|
);
|
|
397
|
-
}, { validationSchema:
|
|
398
|
-
|
|
399
|
-
const
|
|
397
|
+
}, { validationSchema: S, initialValues: T } = ae(m);
|
|
398
|
+
S.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((u) => console.log("Validation failed:", u.errors));
|
|
399
|
+
const k = Q({
|
|
400
400
|
initialValues: T,
|
|
401
|
-
validationSchema:
|
|
401
|
+
validationSchema: S,
|
|
402
402
|
validateOnChange: !0,
|
|
403
403
|
validateOnBlur: !0,
|
|
404
404
|
onSubmit: () => {
|
|
405
405
|
l(m);
|
|
406
406
|
}
|
|
407
|
-
}),
|
|
408
|
-
...
|
|
409
|
-
...
|
|
410
|
-
[
|
|
407
|
+
}), w = (u, s, D) => ({
|
|
408
|
+
...u,
|
|
409
|
+
...u.decision,
|
|
410
|
+
[s]: D
|
|
411
411
|
});
|
|
412
412
|
return /* @__PURE__ */ n(
|
|
413
|
-
|
|
413
|
+
re,
|
|
414
414
|
{
|
|
415
415
|
id: e,
|
|
416
|
-
formik:
|
|
416
|
+
formik: k,
|
|
417
417
|
decision: m,
|
|
418
418
|
onCancel: i,
|
|
419
419
|
onSubmit: () => l(m),
|
|
420
420
|
onChangeCondition: C,
|
|
421
|
-
onChangeDecision:
|
|
421
|
+
onChangeDecision: p,
|
|
422
422
|
onStartChange: E,
|
|
423
423
|
onEndChange: v,
|
|
424
|
-
textValues:
|
|
424
|
+
textValues: c
|
|
425
425
|
}
|
|
426
426
|
);
|
|
427
427
|
}, q = (t) => {
|
|
@@ -446,7 +446,7 @@ const Y = (t) => {
|
|
|
446
446
|
}
|
|
447
447
|
return e;
|
|
448
448
|
}, we = (t) => {
|
|
449
|
-
const { decision: e, textValues: a } = t, i = (
|
|
449
|
+
const { decision: e, textValues: a } = t, i = (c) => c && Object.keys(c).length > 0, l = {
|
|
450
450
|
name: e.name,
|
|
451
451
|
dataType: e.dataType,
|
|
452
452
|
value: e.value,
|
|
@@ -465,18 +465,18 @@ const Y = (t) => {
|
|
|
465
465
|
] }),
|
|
466
466
|
/* @__PURE__ */ h(o, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
467
467
|
/* @__PURE__ */ n(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: a.factsThatConditionIt }),
|
|
468
|
-
e.conditions && e.conditions.map((
|
|
469
|
-
const m =
|
|
468
|
+
e.conditions && e.conditions.map((c) => {
|
|
469
|
+
const m = c.value;
|
|
470
470
|
return (typeof m == "object" && i(m) || m) && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
471
471
|
A,
|
|
472
472
|
{
|
|
473
473
|
element: {
|
|
474
|
-
...
|
|
474
|
+
...c,
|
|
475
475
|
value: m
|
|
476
476
|
},
|
|
477
|
-
valueData: q(
|
|
477
|
+
valueData: q(c)
|
|
478
478
|
}
|
|
479
|
-
) },
|
|
479
|
+
) }, c.name);
|
|
480
480
|
})
|
|
481
481
|
] }),
|
|
482
482
|
/* @__PURE__ */ h(o, { direction: "column", gap: "12px", children: [
|
|
@@ -489,7 +489,7 @@ const Y = (t) => {
|
|
|
489
489
|
name: "Fecha de inicio",
|
|
490
490
|
value: String(e.startDate),
|
|
491
491
|
valueUse: f.EQUAL,
|
|
492
|
-
dataType:
|
|
492
|
+
dataType: j.DATE
|
|
493
493
|
},
|
|
494
494
|
valueData: new Date(e.startDate).toLocaleDateString(
|
|
495
495
|
"en-CA"
|
|
@@ -504,7 +504,7 @@ const Y = (t) => {
|
|
|
504
504
|
name: "Fecha de final",
|
|
505
505
|
value: String(e.endDate),
|
|
506
506
|
valueUse: f.EQUAL,
|
|
507
|
-
dataType:
|
|
507
|
+
dataType: j.DATE
|
|
508
508
|
},
|
|
509
509
|
valueData: new Date(e.endDate).toLocaleDateString("en-CA")
|
|
510
510
|
},
|
|
@@ -513,16 +513,16 @@ const Y = (t) => {
|
|
|
513
513
|
] })
|
|
514
514
|
] })
|
|
515
515
|
] });
|
|
516
|
-
},
|
|
516
|
+
}, oe = G.div`
|
|
517
517
|
border-radius: 8px;
|
|
518
|
-
border: 1px solid ${
|
|
518
|
+
border: 1px solid ${Y.palette.neutral.N30};
|
|
519
519
|
box-sizing: border-box;
|
|
520
520
|
display: flex;
|
|
521
521
|
flex-direction: column;
|
|
522
522
|
height: 340px;
|
|
523
523
|
width: 332px;
|
|
524
524
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
525
|
-
`,
|
|
525
|
+
`, ie = G.div`
|
|
526
526
|
width: 100%;
|
|
527
527
|
height: 100%;
|
|
528
528
|
overflow-y: auto;
|
|
@@ -540,10 +540,10 @@ const Y = (t) => {
|
|
|
540
540
|
background-color: #ebecf0;
|
|
541
541
|
border-radius: 8px;
|
|
542
542
|
}
|
|
543
|
-
`,
|
|
543
|
+
`, Ee = (t) => {
|
|
544
544
|
const { children: e, handleDelete: a, handleView: i, id: l } = t;
|
|
545
|
-
return /* @__PURE__ */ h(
|
|
546
|
-
/* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(
|
|
545
|
+
return /* @__PURE__ */ h(oe, { children: [
|
|
546
|
+
/* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(o, { direction: "column", margin: "10px", children: e }) }) }),
|
|
547
547
|
/* @__PURE__ */ h(o, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
548
548
|
/* @__PURE__ */ n(V, {}),
|
|
549
549
|
/* @__PURE__ */ h(o, { gap: "16px", justifyContent: "end", children: [
|
|
@@ -553,7 +553,7 @@ const Y = (t) => {
|
|
|
553
553
|
appearance: "dark",
|
|
554
554
|
size: "24px",
|
|
555
555
|
cursorHover: !0,
|
|
556
|
-
icon: /* @__PURE__ */ n(
|
|
556
|
+
icon: /* @__PURE__ */ n(W, {}),
|
|
557
557
|
onClick: () => {
|
|
558
558
|
i(l);
|
|
559
559
|
}
|
|
@@ -565,7 +565,7 @@ const Y = (t) => {
|
|
|
565
565
|
cursorHover: !0,
|
|
566
566
|
appearance: "dark",
|
|
567
567
|
size: "24px",
|
|
568
|
-
icon: /* @__PURE__ */ n(
|
|
568
|
+
icon: /* @__PURE__ */ n(X, {}),
|
|
569
569
|
onClick: () => {
|
|
570
570
|
a(l);
|
|
571
571
|
}
|
|
@@ -576,7 +576,7 @@ const Y = (t) => {
|
|
|
576
576
|
] });
|
|
577
577
|
};
|
|
578
578
|
export {
|
|
579
|
-
|
|
579
|
+
Ee as BusinessRuleCard,
|
|
580
580
|
we as BusinessRuleView,
|
|
581
|
-
|
|
581
|
+
ke as RulesForm
|
|
582
582
|
};
|