@isettingkit/business-rules 1.0.7 → 1.0.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.js +104 -111
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as i, jsxs as p, Fragment as
|
|
1
|
+
import { jsx as i, jsxs as p, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { MdOutlineDelete as ge, MdClear as ne, MdAdd as ae, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
|
|
3
|
-
import { inube as v, Stack as u, Divider as D, Icon as
|
|
3
|
+
import { inube as v, Stack as u, Divider as D, Icon as U, Text as x, SkeletonLine as F, useMediaQuery as R, Blanket as ie, Button as N, Grid as oe, Box as Te, Tag as fe, Checkpicker as ye, Toggle as re, Checkbox as xe, Date as Q } from "@inubekit/inubekit";
|
|
4
4
|
import f, { keyframes as ve } from "styled-components";
|
|
5
|
-
import { ValueDataType as k, ValueHowToSetUp as L, DecisionConditionRender as
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
5
|
+
import { ValueDataType as k, ValueHowToSetUp as L, DecisionConditionRender as Y } from "@isettingkit/input";
|
|
6
|
+
import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as le } from "react-dom";
|
|
8
8
|
import { useFormik as we } from "formik";
|
|
9
|
-
import { string as H, mixed as se, object as O, number as q, lazy as
|
|
9
|
+
import { string as H, mixed as se, object as O, number as q, lazy as K, date as W } from "yup";
|
|
10
10
|
import { useState as V, useEffect as Ce } from "react";
|
|
11
11
|
import Se from "axios";
|
|
12
12
|
import { franc as De } from "franc-min";
|
|
13
|
-
const
|
|
13
|
+
const Ee = f.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid ${v.palette.neutral.N30};
|
|
16
16
|
box-sizing: border-box;
|
|
@@ -43,12 +43,12 @@ f.div`
|
|
|
43
43
|
`;
|
|
44
44
|
const P = (e) => {
|
|
45
45
|
const { children: t, controls: n = !0, handleDelete: a, id: o } = e;
|
|
46
|
-
return /* @__PURE__ */ i(
|
|
46
|
+
return /* @__PURE__ */ i(Ee, { children: /* @__PURE__ */ p(u, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
47
47
|
t,
|
|
48
|
-
n && /* @__PURE__ */ p(
|
|
48
|
+
n && /* @__PURE__ */ p(E, { children: [
|
|
49
49
|
/* @__PURE__ */ i(D, {}),
|
|
50
50
|
/* @__PURE__ */ i(u, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ i(
|
|
51
|
-
|
|
51
|
+
U,
|
|
52
52
|
{
|
|
53
53
|
cursorHover: !0,
|
|
54
54
|
appearance: "danger",
|
|
@@ -61,7 +61,7 @@ const P = (e) => {
|
|
|
61
61
|
) })
|
|
62
62
|
] })
|
|
63
63
|
] }) });
|
|
64
|
-
},
|
|
64
|
+
}, J = f.div`
|
|
65
65
|
& > div {
|
|
66
66
|
border-radius: 8px;
|
|
67
67
|
border: 1px solid
|
|
@@ -70,7 +70,7 @@ const P = (e) => {
|
|
|
70
70
|
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || v.palette.neutral.N30;
|
|
71
71
|
}};
|
|
72
72
|
}
|
|
73
|
-
`,
|
|
73
|
+
`, X = f.div`
|
|
74
74
|
width: 100%;
|
|
75
75
|
height: 100%;
|
|
76
76
|
overflow-y: auto;
|
|
@@ -88,20 +88,20 @@ const P = (e) => {
|
|
|
88
88
|
background-color: #ebecf0;
|
|
89
89
|
border-radius: 8px;
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`, Ne = (e) => e.value, ke = (e) => e.value, Ae = (e) => e.value, Fe = (e) => ({
|
|
92
92
|
from: e.from ?? "",
|
|
93
93
|
to: e.to ?? ""
|
|
94
|
-
}), $e = (e) => e.value,
|
|
94
|
+
}), $e = (e) => e.value, Ie = (e) => e.value, Re = (e) => e.value;
|
|
95
95
|
var y = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(y || {});
|
|
96
96
|
const Me = {
|
|
97
97
|
[y.LIST_OF_VALUES]: ke,
|
|
98
98
|
[y.LIST_OF_VALUES_MULTI]: Ae,
|
|
99
99
|
[y.RANGE]: Fe,
|
|
100
100
|
[y.GREATER_THAN]: $e,
|
|
101
|
-
[y.LESS_THAN]:
|
|
102
|
-
[y.EQUAL]:
|
|
103
|
-
},
|
|
104
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Me[e == null ? void 0 : e.howToSetTheDecision] ||
|
|
101
|
+
[y.LESS_THAN]: Ie,
|
|
102
|
+
[y.EQUAL]: Re
|
|
103
|
+
}, I = (e) => {
|
|
104
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Me[e == null ? void 0 : e.howToSetTheDecision] || Ne;
|
|
105
105
|
return n && a(t) || t || void 0;
|
|
106
106
|
}, Le = (e) => {
|
|
107
107
|
const {
|
|
@@ -117,17 +117,17 @@ const Me = {
|
|
|
117
117
|
} = e;
|
|
118
118
|
return r ? /* @__PURE__ */ p(u, { direction: "column", gap: "12px", children: [
|
|
119
119
|
/* @__PURE__ */ i(u, { direction: "column", alignItems: "center", children: /* @__PURE__ */ i(
|
|
120
|
-
|
|
120
|
+
z,
|
|
121
121
|
{
|
|
122
122
|
element: o,
|
|
123
|
-
valueData:
|
|
123
|
+
valueData: I(
|
|
124
124
|
o
|
|
125
125
|
),
|
|
126
126
|
type: "decision"
|
|
127
127
|
}
|
|
128
128
|
) }, n.ruleName),
|
|
129
129
|
/* @__PURE__ */ i(D, { dashed: !0 }),
|
|
130
|
-
/* @__PURE__ */ i(
|
|
130
|
+
/* @__PURE__ */ i(X, { children: /* @__PURE__ */ p(
|
|
131
131
|
u,
|
|
132
132
|
{
|
|
133
133
|
direction: "column",
|
|
@@ -146,19 +146,19 @@ const Me = {
|
|
|
146
146
|
children: d.factsThatConditionIt
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
h.map((s) => /* @__PURE__ */ i(
|
|
150
|
-
|
|
149
|
+
h.map((s) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ i(u, { direction: "column", padding: "8px", children: /* @__PURE__ */ i(
|
|
150
|
+
z,
|
|
151
151
|
{
|
|
152
152
|
element: { ...s, value: s.value },
|
|
153
|
-
valueData:
|
|
153
|
+
valueData: I(
|
|
154
154
|
s
|
|
155
155
|
)
|
|
156
156
|
}
|
|
157
157
|
) }) }, s.conditionName)),
|
|
158
|
-
g && /* @__PURE__ */ p(
|
|
158
|
+
g && /* @__PURE__ */ p(E, { children: [
|
|
159
159
|
/* @__PURE__ */ i(D, { dashed: !0 }),
|
|
160
160
|
a && /* @__PURE__ */ i(
|
|
161
|
-
|
|
161
|
+
z,
|
|
162
162
|
{
|
|
163
163
|
element: a.element,
|
|
164
164
|
valueData: a.valueData,
|
|
@@ -179,14 +179,14 @@ const Me = {
|
|
|
179
179
|
/* @__PURE__ */ i(D, { dashed: !0 }),
|
|
180
180
|
/* @__PURE__ */ i(F, { animated: !0, width: "150px" })
|
|
181
181
|
] }),
|
|
182
|
-
/* @__PURE__ */ i(
|
|
182
|
+
/* @__PURE__ */ i(X, { children: /* @__PURE__ */ i(
|
|
183
183
|
u,
|
|
184
184
|
{
|
|
185
185
|
direction: "column",
|
|
186
186
|
gap: "12px",
|
|
187
187
|
justifyContent: "space-between",
|
|
188
188
|
height: "203px",
|
|
189
|
-
children: c.map((s, l) => /* @__PURE__ */ i(
|
|
189
|
+
children: c.map((s, l) => /* @__PURE__ */ i(J, { children: /* @__PURE__ */ p(
|
|
190
190
|
u,
|
|
191
191
|
{
|
|
192
192
|
direction: "column",
|
|
@@ -211,7 +211,7 @@ const Me = {
|
|
|
211
211
|
howToSetTheDecision: L.RANGE,
|
|
212
212
|
decisionDataType: k.DATE
|
|
213
213
|
},
|
|
214
|
-
valueData:
|
|
214
|
+
valueData: I({
|
|
215
215
|
labelName: a == null ? void 0 : a.terms,
|
|
216
216
|
value: {
|
|
217
217
|
from: String(t.effectiveFrom),
|
|
@@ -227,7 +227,7 @@ const Me = {
|
|
|
227
227
|
howToSetTheDecision: L.EQUAL,
|
|
228
228
|
decisionDataType: k.DATE
|
|
229
229
|
},
|
|
230
|
-
valueData:
|
|
230
|
+
valueData: I({
|
|
231
231
|
labelName: a == null ? void 0 : a.terms,
|
|
232
232
|
value: String(t.effectiveFrom),
|
|
233
233
|
howToSetTheDecision: L.EQUAL,
|
|
@@ -236,7 +236,7 @@ const Me = {
|
|
|
236
236
|
} : null, g = t ? {
|
|
237
237
|
labelName: t.labelName || "",
|
|
238
238
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
239
|
-
value:
|
|
239
|
+
value: I(t),
|
|
240
240
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
241
241
|
} : null, d = ((b = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
|
|
242
242
|
(T) => !T.hidden
|
|
@@ -291,13 +291,13 @@ const Me = {
|
|
|
291
291
|
background-color: #ebecf0;
|
|
292
292
|
border-radius: 8px;
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
294
|
+
`, Ue = (e) => {
|
|
295
295
|
const { children: t, portalId: n, onCloseModal: a, title: o } = e, r = document.getElementById(n);
|
|
296
296
|
if (!r)
|
|
297
297
|
throw new Error(
|
|
298
298
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
299
299
|
);
|
|
300
|
-
const c =
|
|
300
|
+
const c = R("(max-width: 400px)");
|
|
301
301
|
return le(
|
|
302
302
|
/* @__PURE__ */ i(Oe, { smallScreen: c, children: /* @__PURE__ */ i(ie, { children: /* @__PURE__ */ i(Ve, { children: /* @__PURE__ */ p(u, { direction: "column", gap: "24px", children: [
|
|
303
303
|
/* @__PURE__ */ i(u, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(u, { alignItems: "center", justifyContent: "space-between", children: [
|
|
@@ -308,7 +308,7 @@ const Me = {
|
|
|
308
308
|
] }) }) }) }),
|
|
309
309
|
r
|
|
310
310
|
);
|
|
311
|
-
},
|
|
311
|
+
}, _e = ve`
|
|
312
312
|
from {
|
|
313
313
|
opacity: 0;
|
|
314
314
|
transform: translateY(20px);
|
|
@@ -342,7 +342,7 @@ f.div`
|
|
|
342
342
|
}};
|
|
343
343
|
}
|
|
344
344
|
`;
|
|
345
|
-
const
|
|
345
|
+
const ze = f.div`
|
|
346
346
|
& > div {
|
|
347
347
|
background-color: ${({ theme: e }) => {
|
|
348
348
|
var t, n;
|
|
@@ -358,7 +358,7 @@ const _e = f.div`
|
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
& > div {
|
|
361
|
-
animation: ${
|
|
361
|
+
animation: ${_e} 600ms ease-out;
|
|
362
362
|
}
|
|
363
363
|
`, je = f.div`
|
|
364
364
|
& > div > div {
|
|
@@ -427,7 +427,7 @@ function Pe(e) {
|
|
|
427
427
|
return /* @__PURE__ */ i(ce, { children: o ? null : /* @__PURE__ */ p(u, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
428
428
|
/* @__PURE__ */ i(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
429
429
|
/* @__PURE__ */ i(
|
|
430
|
-
|
|
430
|
+
ze,
|
|
431
431
|
{
|
|
432
432
|
onClick: () => a ? a() : null,
|
|
433
433
|
children: /* @__PURE__ */ i(
|
|
@@ -439,7 +439,7 @@ function Pe(e) {
|
|
|
439
439
|
handleView: () => a ? a() : null,
|
|
440
440
|
controls: !1,
|
|
441
441
|
children: /* @__PURE__ */ p(u, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
442
|
-
/* @__PURE__ */ i(
|
|
442
|
+
/* @__PURE__ */ i(U, { appearance: "gray", icon: /* @__PURE__ */ i(ae, {}), size: "35px" }),
|
|
443
443
|
/* @__PURE__ */ i(x, { appearance: "gray", type: "body", size: "large", children: r })
|
|
444
444
|
] })
|
|
445
445
|
}
|
|
@@ -488,7 +488,7 @@ const Ge = {
|
|
|
488
488
|
})
|
|
489
489
|
), h = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !o && t;
|
|
490
490
|
return { renderedCards: d, shouldRenderAddCard: h };
|
|
491
|
-
},
|
|
491
|
+
}, At = (e) => {
|
|
492
492
|
const {
|
|
493
493
|
controls: t = !0,
|
|
494
494
|
customTitleContentAddCard: n,
|
|
@@ -504,7 +504,7 @@ const Ge = {
|
|
|
504
504
|
handleSubmitForm: b,
|
|
505
505
|
handleDelete: T,
|
|
506
506
|
terms: m = !0
|
|
507
|
-
} = e, w =
|
|
507
|
+
} = e, w = R("(max-width: 681px)"), C = R("(max-width: 400px)"), { renderedCards: A, shouldRenderAddCard: _ } = Qe({
|
|
508
508
|
controls: t,
|
|
509
509
|
customTitleContentAddCard: n,
|
|
510
510
|
decisions: o,
|
|
@@ -513,7 +513,7 @@ const Ge = {
|
|
|
513
513
|
handleDelete: T,
|
|
514
514
|
textValues: r
|
|
515
515
|
}), M = (o == null ? void 0 : o.length) === 0 && !h;
|
|
516
|
-
return /* @__PURE__ */ p(
|
|
516
|
+
return /* @__PURE__ */ p(E, { children: [
|
|
517
517
|
/* @__PURE__ */ i(je, { children: /* @__PURE__ */ i(qe, { children: /* @__PURE__ */ i(u, { direction: "column", gap: "16px", padding: "6px", children: M ? /* @__PURE__ */ p(
|
|
518
518
|
u,
|
|
519
519
|
{
|
|
@@ -524,7 +524,7 @@ const Ge = {
|
|
|
524
524
|
justifyContent: "center",
|
|
525
525
|
alignItems: "center",
|
|
526
526
|
children: [
|
|
527
|
-
/* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(
|
|
527
|
+
/* @__PURE__ */ i(x, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(E, { children: [
|
|
528
528
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
529
529
|
/* @__PURE__ */ p(
|
|
530
530
|
x,
|
|
@@ -544,7 +544,7 @@ const Ge = {
|
|
|
544
544
|
"para empezar."
|
|
545
545
|
] }) }),
|
|
546
546
|
/* @__PURE__ */ i(
|
|
547
|
-
|
|
547
|
+
N,
|
|
548
548
|
{
|
|
549
549
|
iconBefore: /* @__PURE__ */ i(ae, {}),
|
|
550
550
|
onClick: () => s ? s() : null,
|
|
@@ -567,7 +567,7 @@ const Ge = {
|
|
|
567
567
|
height: w ? "auto" : "484px",
|
|
568
568
|
children: [
|
|
569
569
|
A,
|
|
570
|
-
|
|
570
|
+
_ && B({
|
|
571
571
|
type: "add",
|
|
572
572
|
index: o == null ? void 0 : o.length,
|
|
573
573
|
controls: t,
|
|
@@ -584,7 +584,7 @@ const Ge = {
|
|
|
584
584
|
}
|
|
585
585
|
) }) }) }),
|
|
586
586
|
g && /* @__PURE__ */ i(
|
|
587
|
-
|
|
587
|
+
Ue,
|
|
588
588
|
{
|
|
589
589
|
portalId: "modal-portal",
|
|
590
590
|
onCloseModal: l,
|
|
@@ -602,7 +602,7 @@ const Ge = {
|
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
] });
|
|
605
|
-
},
|
|
605
|
+
}, Ye = f.div`
|
|
606
606
|
display: flex;
|
|
607
607
|
justify-content: ${({ justifyContent: e }) => e};
|
|
608
608
|
align-items: ${({ alignItems: e }) => e};
|
|
@@ -625,7 +625,7 @@ const Ge = {
|
|
|
625
625
|
border-radius: ${({ borderRadius: e }) => e};
|
|
626
626
|
box-sizing: ${({ boxSizing: e }) => e};
|
|
627
627
|
overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
|
|
628
|
-
`,
|
|
628
|
+
`, Ke = (e) => {
|
|
629
629
|
const {
|
|
630
630
|
children: t,
|
|
631
631
|
wrap: n,
|
|
@@ -645,7 +645,7 @@ const Ge = {
|
|
|
645
645
|
scroll: C = !1
|
|
646
646
|
} = e;
|
|
647
647
|
return /* @__PURE__ */ i(
|
|
648
|
-
|
|
648
|
+
Ye,
|
|
649
649
|
{
|
|
650
650
|
direction: a,
|
|
651
651
|
justifyContent: o,
|
|
@@ -665,11 +665,11 @@ const Ge = {
|
|
|
665
665
|
children: t
|
|
666
666
|
}
|
|
667
667
|
);
|
|
668
|
-
},
|
|
668
|
+
}, Ft = (e) => {
|
|
669
669
|
const { appliedFilters: t, onClear: n, onClick: a, titleClearFilter: o, titleFilter: r } = e, c = !t || t.length === 0;
|
|
670
670
|
return /* @__PURE__ */ i(Te, { borderRadius: "8px", children: /* @__PURE__ */ p(oe, { gap: "12px", templateColumns: "1fr auto auto", children: [
|
|
671
671
|
/* @__PURE__ */ i(
|
|
672
|
-
|
|
672
|
+
Ke,
|
|
673
673
|
{
|
|
674
674
|
background: !0,
|
|
675
675
|
borderRadius: "8px",
|
|
@@ -691,7 +691,7 @@ const Ge = {
|
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
693
|
/* @__PURE__ */ i(
|
|
694
|
-
|
|
694
|
+
N,
|
|
695
695
|
{
|
|
696
696
|
cursorHover: !0,
|
|
697
697
|
disabled: c,
|
|
@@ -702,7 +702,7 @@ const Ge = {
|
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
704
|
/* @__PURE__ */ i(
|
|
705
|
-
|
|
705
|
+
N,
|
|
706
706
|
{
|
|
707
707
|
cursorHover: !0,
|
|
708
708
|
iconBefore: /* @__PURE__ */ i(be, {}),
|
|
@@ -712,7 +712,7 @@ const Ge = {
|
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] }) });
|
|
715
|
-
},
|
|
715
|
+
}, We = f.div`
|
|
716
716
|
display: flex;
|
|
717
717
|
flex-direction: column;
|
|
718
718
|
background-color: ${({ theme: e }) => {
|
|
@@ -725,7 +725,7 @@ const Ge = {
|
|
|
725
725
|
padding: 24px;
|
|
726
726
|
gap: 24px;
|
|
727
727
|
box-sizing: border-box;
|
|
728
|
-
`,
|
|
728
|
+
`, $t = (e) => {
|
|
729
729
|
const {
|
|
730
730
|
actionButtonLabel: t,
|
|
731
731
|
cancelButtonLabel: n,
|
|
@@ -735,20 +735,20 @@ const Ge = {
|
|
|
735
735
|
onCloseModal: c,
|
|
736
736
|
portalId: g,
|
|
737
737
|
title: d
|
|
738
|
-
} = e, h =
|
|
738
|
+
} = e, h = R("(max-width: 768px)"), s = document.getElementById(g);
|
|
739
739
|
if (!s)
|
|
740
740
|
throw new Error(
|
|
741
741
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
742
742
|
);
|
|
743
743
|
return le(
|
|
744
|
-
/* @__PURE__ */ i(ie, { children: /* @__PURE__ */ p(
|
|
744
|
+
/* @__PURE__ */ i(ie, { children: /* @__PURE__ */ p(We, { $smallScreen: h, children: [
|
|
745
745
|
/* @__PURE__ */ p(u, { direction: "column", gap: "16px", children: [
|
|
746
746
|
/* @__PURE__ */ p(u, { alignContent: "center", justifyContent: "space-between", children: [
|
|
747
747
|
/* @__PURE__ */ i(x, { appearance: "dark", size: "small", type: "headline", children: d }),
|
|
748
748
|
/* @__PURE__ */ p(u, { alignItems: "center", children: [
|
|
749
749
|
/* @__PURE__ */ i(x, { children: "Cerrar" }),
|
|
750
750
|
/* @__PURE__ */ i(
|
|
751
|
-
|
|
751
|
+
U,
|
|
752
752
|
{
|
|
753
753
|
appearance: "dark",
|
|
754
754
|
icon: /* @__PURE__ */ i(ne, {}),
|
|
@@ -763,7 +763,7 @@ const Ge = {
|
|
|
763
763
|
a,
|
|
764
764
|
/* @__PURE__ */ p(u, { gap: "20px", justifyContent: "flex-end", children: [
|
|
765
765
|
/* @__PURE__ */ i(
|
|
766
|
-
|
|
766
|
+
N,
|
|
767
767
|
{
|
|
768
768
|
appearance: "gray",
|
|
769
769
|
onClick: c,
|
|
@@ -773,7 +773,7 @@ const Ge = {
|
|
|
773
773
|
}
|
|
774
774
|
),
|
|
775
775
|
/* @__PURE__ */ i(
|
|
776
|
-
|
|
776
|
+
N,
|
|
777
777
|
{
|
|
778
778
|
appearance: "primary",
|
|
779
779
|
loading: o,
|
|
@@ -790,7 +790,7 @@ const Ge = {
|
|
|
790
790
|
}, It = (e) => {
|
|
791
791
|
const { fields: t, onChange: n } = e;
|
|
792
792
|
return /* @__PURE__ */ i(u, { direction: "column", gap: "16px", children: t.map((a) => /* @__PURE__ */ p(u, { gap: "6px", alignItems: "center", children: [
|
|
793
|
-
/* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(
|
|
793
|
+
/* @__PURE__ */ i(u, { padding: "22px 0 0 0", children: /* @__PURE__ */ i(U, { appearance: "primary", icon: a.icon }) }),
|
|
794
794
|
/* @__PURE__ */ i(
|
|
795
795
|
ye,
|
|
796
796
|
{
|
|
@@ -809,7 +809,7 @@ const Ge = {
|
|
|
809
809
|
a.name
|
|
810
810
|
)
|
|
811
811
|
] }, a.name)) });
|
|
812
|
-
},
|
|
812
|
+
}, Rt = (e) => {
|
|
813
813
|
console.log(e);
|
|
814
814
|
const { dataDecision: t, originalDecision: n } = e, a = {
|
|
815
815
|
conditionName: t.ruleName || "",
|
|
@@ -826,7 +826,7 @@ const Ge = {
|
|
|
826
826
|
(o) => o.hidden ? { ...a } : o
|
|
827
827
|
)
|
|
828
828
|
};
|
|
829
|
-
},
|
|
829
|
+
}, Mt = (e) => {
|
|
830
830
|
const { decisions: t } = e;
|
|
831
831
|
return t == null ? void 0 : t.map((n) => {
|
|
832
832
|
var o;
|
|
@@ -845,14 +845,14 @@ const Ge = {
|
|
|
845
845
|
)
|
|
846
846
|
} : n;
|
|
847
847
|
});
|
|
848
|
-
},
|
|
848
|
+
}, Je = (e) => ({
|
|
849
849
|
schema: H().required("Required").test(
|
|
850
850
|
"non-empty",
|
|
851
851
|
"Value cannot be empty",
|
|
852
852
|
(t) => t != null && t.trim() !== ""
|
|
853
853
|
),
|
|
854
854
|
value: e
|
|
855
|
-
}),
|
|
855
|
+
}), Xe = (e) => ({
|
|
856
856
|
schema: se().test(
|
|
857
857
|
"isArrayOrString",
|
|
858
858
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -861,7 +861,7 @@ const Ge = {
|
|
|
861
861
|
) : typeof t == "string"
|
|
862
862
|
),
|
|
863
863
|
value: e
|
|
864
|
-
}),
|
|
864
|
+
}), Ze = (e) => ({
|
|
865
865
|
schema: se().test(
|
|
866
866
|
"isArrayOrString",
|
|
867
867
|
"Must be an array of strings/numbers or a single string",
|
|
@@ -893,13 +893,13 @@ const Ge = {
|
|
|
893
893
|
schema: H().required("Required"),
|
|
894
894
|
value: e
|
|
895
895
|
}, tt = {
|
|
896
|
-
[y.LIST_OF_VALUES]:
|
|
897
|
-
[y.LIST_OF_VALUES_MULTI]:
|
|
896
|
+
[y.LIST_OF_VALUES]: Xe,
|
|
897
|
+
[y.LIST_OF_VALUES_MULTI]: Ze,
|
|
898
898
|
[y.RANGE]: et,
|
|
899
899
|
[y.GREATER_THAN]: j,
|
|
900
900
|
[y.LESS_THAN]: j,
|
|
901
901
|
[y.EQUAL]: j
|
|
902
|
-
},
|
|
902
|
+
}, Z = (e) => tt[e] || Je;
|
|
903
903
|
function nt({
|
|
904
904
|
decision: e,
|
|
905
905
|
onSubmitEvent: t,
|
|
@@ -920,19 +920,19 @@ function nt({
|
|
|
920
920
|
let o;
|
|
921
921
|
const r = {
|
|
922
922
|
ruleName: H().required("Name is required"),
|
|
923
|
-
value:
|
|
923
|
+
value: K(() => Z(
|
|
924
924
|
o.values.howToSetTheDecision
|
|
925
925
|
)(
|
|
926
926
|
o.values.value,
|
|
927
927
|
o.values.decisionDataType
|
|
928
928
|
).schema),
|
|
929
|
-
conditionsThatEstablishesTheDecision:
|
|
929
|
+
conditionsThatEstablishesTheDecision: K((d, { parent: h }) => {
|
|
930
930
|
var b;
|
|
931
931
|
if ((h == null ? void 0 : h.toggleNone) && Object.keys(h.conditionsThatEstablishesTheDecision || {}).length > 0) return O().shape({});
|
|
932
932
|
const l = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
|
|
933
933
|
(T, m) => {
|
|
934
934
|
if (o.values.conditionsThatEstablishesTheDecision[m.conditionName] !== void 0) {
|
|
935
|
-
const C =
|
|
935
|
+
const C = Z(
|
|
936
936
|
m.howToSetTheCondition
|
|
937
937
|
);
|
|
938
938
|
T[m.conditionName] = C(
|
|
@@ -953,9 +953,9 @@ function nt({
|
|
|
953
953
|
);
|
|
954
954
|
})
|
|
955
955
|
};
|
|
956
|
-
n.terms && (r.effectiveFrom =
|
|
956
|
+
n.terms && (r.effectiveFrom = W().required(
|
|
957
957
|
"effective From date is required"
|
|
958
|
-
), r.validUntil =
|
|
958
|
+
), r.validUntil = W().when(
|
|
959
959
|
"checkClosed",
|
|
960
960
|
(d, h, { parent: s }) => (s == null ? void 0 : s.checkClosed) ? h.required("valid Until date is required").test(
|
|
961
961
|
"is-after-startDate",
|
|
@@ -1049,7 +1049,7 @@ const at = f.div`
|
|
|
1049
1049
|
};
|
|
1050
1050
|
return Ce(() => {
|
|
1051
1051
|
h(t);
|
|
1052
|
-
}, [t]), /* @__PURE__ */ p(
|
|
1052
|
+
}, [t]), /* @__PURE__ */ p(E, { children: [
|
|
1053
1053
|
/* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(
|
|
1054
1054
|
re,
|
|
1055
1055
|
{
|
|
@@ -1062,7 +1062,7 @@ const at = f.div`
|
|
|
1062
1062
|
children: /* @__PURE__ */ i(x, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1063
1063
|
}
|
|
1064
1064
|
) }),
|
|
1065
|
-
d && /* @__PURE__ */ i(
|
|
1065
|
+
d && /* @__PURE__ */ i(E, { children: n })
|
|
1066
1066
|
] });
|
|
1067
1067
|
}, rt = (e) => {
|
|
1068
1068
|
const {
|
|
@@ -1079,14 +1079,14 @@ const at = f.div`
|
|
|
1079
1079
|
messageEnd: l = "",
|
|
1080
1080
|
statusStart: b = "pending",
|
|
1081
1081
|
statusEnd: T = "pending"
|
|
1082
|
-
} = e, [m, w] = V(c), [C, A] = V(d), [
|
|
1082
|
+
} = e, [m, w] = V(c), [C, A] = V(d), [_, M] = V(h), G = ({ target: S }) => {
|
|
1083
1083
|
w(S.checked), a && a(S.checked);
|
|
1084
1084
|
}, he = (S) => {
|
|
1085
1085
|
A(S.target.value), t(S);
|
|
1086
1086
|
}, ue = (S) => {
|
|
1087
1087
|
M(S.target.value), n(S);
|
|
1088
|
-
}, pe =
|
|
1089
|
-
return /* @__PURE__ */ p(
|
|
1088
|
+
}, pe = R("(max-width: 400px)");
|
|
1089
|
+
return /* @__PURE__ */ p(E, { children: [
|
|
1090
1090
|
/* @__PURE__ */ p(u, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1091
1091
|
/* @__PURE__ */ i(
|
|
1092
1092
|
x,
|
|
@@ -1144,7 +1144,7 @@ const at = f.div`
|
|
|
1144
1144
|
id: "dateEnd",
|
|
1145
1145
|
label: r,
|
|
1146
1146
|
onChange: ue,
|
|
1147
|
-
value:
|
|
1147
|
+
value: _,
|
|
1148
1148
|
required: g,
|
|
1149
1149
|
size: "compact",
|
|
1150
1150
|
status: T,
|
|
@@ -1169,7 +1169,7 @@ const at = f.div`
|
|
|
1169
1169
|
termEndStatus: s
|
|
1170
1170
|
} = e;
|
|
1171
1171
|
return /* @__PURE__ */ i("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(u, { direction: "column", gap: "24px", children: [
|
|
1172
|
-
|
|
1172
|
+
Y({
|
|
1173
1173
|
condition: r,
|
|
1174
1174
|
formik: t,
|
|
1175
1175
|
isDecision: !0
|
|
@@ -1215,14 +1215,14 @@ const at = f.div`
|
|
|
1215
1215
|
l.conditionName,
|
|
1216
1216
|
l.howToSetTheCondition === y.LIST_OF_VALUES_MULTI
|
|
1217
1217
|
)(b.target.checked),
|
|
1218
|
-
children:
|
|
1218
|
+
children: Y({ condition: l, formik: t })
|
|
1219
1219
|
},
|
|
1220
1220
|
l.conditionName
|
|
1221
1221
|
)) })
|
|
1222
1222
|
]
|
|
1223
1223
|
}
|
|
1224
1224
|
) }) }),
|
|
1225
|
-
n.terms && /* @__PURE__ */ p(
|
|
1225
|
+
n.terms && /* @__PURE__ */ p(E, { children: [
|
|
1226
1226
|
/* @__PURE__ */ i(D, { dashed: !0 }),
|
|
1227
1227
|
/* @__PURE__ */ i(
|
|
1228
1228
|
rt,
|
|
@@ -1247,8 +1247,8 @@ const at = f.div`
|
|
|
1247
1247
|
/* @__PURE__ */ i(D, {}),
|
|
1248
1248
|
d && /* @__PURE__ */ i(x, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1249
1249
|
/* @__PURE__ */ p(u, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1250
|
-
/* @__PURE__ */ i(
|
|
1251
|
-
/* @__PURE__ */ i(
|
|
1250
|
+
/* @__PURE__ */ i(N, { appearance: "gray", onClick: a, children: n.cancel }),
|
|
1251
|
+
/* @__PURE__ */ i(N, { type: "submit", children: n.confirm })
|
|
1252
1252
|
] })
|
|
1253
1253
|
] }) });
|
|
1254
1254
|
}, st = (e) => {
|
|
@@ -1299,7 +1299,7 @@ const at = f.div`
|
|
|
1299
1299
|
termEndStatus: l
|
|
1300
1300
|
}
|
|
1301
1301
|
);
|
|
1302
|
-
},
|
|
1302
|
+
}, Lt = (e) => {
|
|
1303
1303
|
var o;
|
|
1304
1304
|
const { decisionTemplate: t } = e, n = { ...t }, a = (o = n.conditionsThatEstablishesTheDecision) == null ? void 0 : o.find(
|
|
1305
1305
|
(r) => r.switchPlaces
|
|
@@ -1315,7 +1315,7 @@ const at = f.div`
|
|
|
1315
1315
|
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1316
1316
|
)
|
|
1317
1317
|
} : n;
|
|
1318
|
-
},
|
|
1318
|
+
}, Ot = (e) => {
|
|
1319
1319
|
const { decisions: t } = e;
|
|
1320
1320
|
return t == null ? void 0 : t.map((n) => {
|
|
1321
1321
|
var o;
|
|
@@ -1340,16 +1340,10 @@ const at = f.div`
|
|
|
1340
1340
|
const o = $.keys().next().value;
|
|
1341
1341
|
o !== void 0 && $.delete(o);
|
|
1342
1342
|
}
|
|
1343
|
-
}, ht = (e) => {
|
|
1344
|
-
const t = e.trim();
|
|
1345
|
-
if (t.length < 3) return !1;
|
|
1346
|
-
if (/^(Mr|Mrs|Ms|Dr|Sr|Sra)\.?\s+[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+)?$/.test(t)) return !0;
|
|
1347
|
-
const a = /^[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+(?:\s[A-ZÁÉÍÓÚÑ][a-záéíóúñ]+){1,2}$/;
|
|
1348
|
-
return t === t.toUpperCase() ? !1 : a.test(t);
|
|
1349
|
-
}, ee = /* @__PURE__ */ new Map(), ut = 1e3, pt = (e) => {
|
|
1343
|
+
}, ee = /* @__PURE__ */ new Map(), ht = 1e3, ut = (e) => {
|
|
1350
1344
|
const t = Date.now(), n = ee.get(e) || 0;
|
|
1351
|
-
return t - n <
|
|
1352
|
-
},
|
|
1345
|
+
return t - n < ht ? !0 : (ee.set(e, t), !1);
|
|
1346
|
+
}, pt = (e) => {
|
|
1353
1347
|
const t = De(e);
|
|
1354
1348
|
return {
|
|
1355
1349
|
spa: "es",
|
|
@@ -1359,16 +1353,15 @@ const at = f.div`
|
|
|
1359
1353
|
ita: "it",
|
|
1360
1354
|
por: "pt"
|
|
1361
1355
|
}[t] || "en";
|
|
1362
|
-
},
|
|
1356
|
+
}, gt = "https://api.mymemory.translated.net/get", mt = async (e, t) => {
|
|
1363
1357
|
var r;
|
|
1364
|
-
if (ht(e)) return e;
|
|
1365
1358
|
const n = `${t}:${e}`, a = dt(e, t);
|
|
1366
1359
|
if (a) return a;
|
|
1367
|
-
if (
|
|
1360
|
+
if (ut(n))
|
|
1368
1361
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1369
|
-
const o =
|
|
1362
|
+
const o = pt(e);
|
|
1370
1363
|
try {
|
|
1371
|
-
const { data: c } = await Se.get(
|
|
1364
|
+
const { data: c } = await Se.get(gt, {
|
|
1372
1365
|
params: {
|
|
1373
1366
|
q: e,
|
|
1374
1367
|
langpair: `${o}|${t}`
|
|
@@ -1378,11 +1371,11 @@ const at = f.div`
|
|
|
1378
1371
|
} catch (c) {
|
|
1379
1372
|
return console.warn(`[Translation] Failed for: "${e}"`, c), e;
|
|
1380
1373
|
}
|
|
1381
|
-
},
|
|
1374
|
+
}, bt = (e) => typeof e == "string" && e.trim().length > 0, te = async (e, t) => {
|
|
1382
1375
|
const n = await Promise.all(
|
|
1383
1376
|
Object.entries(e).map(async ([a, o]) => {
|
|
1384
|
-
if (
|
|
1385
|
-
const r = await
|
|
1377
|
+
if (bt(o)) {
|
|
1378
|
+
const r = await mt(o, t);
|
|
1386
1379
|
return [a, r];
|
|
1387
1380
|
} else if (Array.isArray(o)) {
|
|
1388
1381
|
const r = await Promise.all(
|
|
@@ -1403,16 +1396,16 @@ const at = f.div`
|
|
|
1403
1396
|
export {
|
|
1404
1397
|
P as BusinessRuleCard,
|
|
1405
1398
|
de as BusinessRuleView,
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1399
|
+
At as BusinessRules,
|
|
1400
|
+
Ft as Filter,
|
|
1401
|
+
$t as FilterModal,
|
|
1409
1402
|
It as FormFilter,
|
|
1410
|
-
|
|
1403
|
+
Ue as ModalRules,
|
|
1411
1404
|
st as RulesForm,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1405
|
+
Rt as revertSortedDataSampleSwitchPlaces,
|
|
1406
|
+
Mt as revertSortedDataSwitchPlaces,
|
|
1407
|
+
Lt as sortDisplayDataSampleSwitchPlaces,
|
|
1408
|
+
Ot as sortDisplayDataSwitchPlaces,
|
|
1416
1409
|
te as translateObject,
|
|
1417
|
-
|
|
1410
|
+
mt as translateText
|
|
1418
1411
|
};
|