@isettingkit/business-rules 2.2.1 → 2.2.2
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 +77 -76
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { MdOutlineDelete as ut, MdClear as
|
|
3
|
-
import { inube as I, Stack as y, Divider as q, Icon as G, Text as $, SkeletonLine as te, useMediaQuery as ae, Blanket as
|
|
2
|
+
import { MdOutlineDelete as ut, MdClear as Ut, MdAdd as Ge, MdOutlineCreate as Vn, MdExpandLess as Un, MdExpandMore as $t, MdInfo as jn, MdCached as zn, MdOutlineInfo as Hn, MdClose as Gn, MdOutlineFilterAltOff as Bn, MdOutlineFilterAlt as mn, MdChevronRight as Qt, MdArrowRight as qn, MdOutlineArrowCircleLeft as Yn, MdOutlineArrowCircleRight as Wn } from "react-icons/md";
|
|
3
|
+
import { inube as I, Stack as y, Divider as q, Icon as G, Text as $, SkeletonLine as te, useMediaQuery as ae, Blanket as jt, Button as Y, Grid as Be, Toggle as pt, Checkbox as zt, Date as Ee, Box as Xn, Tag as Oe, Tabs as bn, SkeletonIcon as Qn, Fieldset as Me, OptionList as Jn, Checkpicker as Zn } from "@inubekit/inubekit";
|
|
4
4
|
import S, { keyframes as Ht, ThemeContext as Kn } from "styled-components";
|
|
5
|
-
import { ValueDataType as
|
|
5
|
+
import { ValueDataType as U, ValueHowToSetUp as z, DecisionConditionRender as lt, DecisionConditionRenderNew as Jt } from "@isettingkit/input";
|
|
6
6
|
import { DecisionViewConditionRenderer as Ce, DecisionViewConditionRendererNew as Ke } from "@isettingkit/view";
|
|
7
7
|
import { createPortal as Gt } from "react-dom";
|
|
8
8
|
import { useFormik as Bt } from "formik";
|
|
9
|
-
import { string as ce, mixed as Ae, object as Z, number as ue, lazy as
|
|
9
|
+
import { string as ce, mixed as Ae, object as Z, number as ue, lazy as je, date as Ne } from "yup";
|
|
10
10
|
import _, { useState as B, useRef as Pe, useEffect as ze, useContext as eo } from "react";
|
|
11
11
|
import { Link as vn, useLocation as to } from "react-router-dom";
|
|
12
12
|
import no from "axios";
|
|
@@ -212,7 +212,7 @@ const go = {
|
|
|
212
212
|
labelName: o == null ? void 0 : o.terms,
|
|
213
213
|
value: String(t.effectiveFrom),
|
|
214
214
|
howToSetTheDecision: z.RANGE,
|
|
215
|
-
decisionDataType:
|
|
215
|
+
decisionDataType: U.DATE
|
|
216
216
|
},
|
|
217
217
|
valueData: _e({
|
|
218
218
|
labelName: o == null ? void 0 : o.terms,
|
|
@@ -221,20 +221,20 @@ const go = {
|
|
|
221
221
|
to: String(t.validUntil)
|
|
222
222
|
},
|
|
223
223
|
howToSetTheDecision: z.RANGE,
|
|
224
|
-
decisionDataType:
|
|
224
|
+
decisionDataType: U.DATE
|
|
225
225
|
})
|
|
226
226
|
} : r && !i ? {
|
|
227
227
|
element: {
|
|
228
228
|
labelName: o == null ? void 0 : o.terms,
|
|
229
229
|
value: String(t.effectiveFrom),
|
|
230
230
|
howToSetTheDecision: z.EQUAL,
|
|
231
|
-
decisionDataType:
|
|
231
|
+
decisionDataType: U.DATE
|
|
232
232
|
},
|
|
233
233
|
valueData: _e({
|
|
234
234
|
labelName: o == null ? void 0 : o.terms,
|
|
235
235
|
value: String(t.effectiveFrom),
|
|
236
236
|
howToSetTheDecision: z.EQUAL,
|
|
237
|
-
decisionDataType:
|
|
237
|
+
decisionDataType: U.DATE
|
|
238
238
|
})
|
|
239
239
|
} : null, d = t ? {
|
|
240
240
|
labelName: t.labelName || "",
|
|
@@ -302,10 +302,10 @@ const go = {
|
|
|
302
302
|
);
|
|
303
303
|
const s = ae("(max-width: 400px)");
|
|
304
304
|
return Gt(
|
|
305
|
-
/* @__PURE__ */ a(fo, { smallScreen: s, children: /* @__PURE__ */ a(
|
|
305
|
+
/* @__PURE__ */ a(fo, { smallScreen: s, children: /* @__PURE__ */ a(jt, { children: /* @__PURE__ */ a(mo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
306
306
|
/* @__PURE__ */ a(y, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
307
307
|
/* @__PURE__ */ a($, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
308
|
-
/* @__PURE__ */ a(
|
|
308
|
+
/* @__PURE__ */ a(Ut, { size: "24px", cursor: "pointer", onClick: o })
|
|
309
309
|
] }) }),
|
|
310
310
|
t
|
|
311
311
|
] }) }) }) }),
|
|
@@ -646,10 +646,10 @@ const Tn = S.div`
|
|
|
646
646
|
);
|
|
647
647
|
const s = ae("(max-width: 400px)");
|
|
648
648
|
return Gt(
|
|
649
|
-
/* @__PURE__ */ a(So, { $smallScreen: s, children: /* @__PURE__ */ a(
|
|
649
|
+
/* @__PURE__ */ a(So, { $smallScreen: s, children: /* @__PURE__ */ a(jt, { children: /* @__PURE__ */ a(Eo, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
650
650
|
/* @__PURE__ */ a(y, { direction: "column", gap: "24px", children: /* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
651
651
|
/* @__PURE__ */ a($, { type: "title", size: "large", appearance: "dark", weight: "bold", children: r }),
|
|
652
|
-
/* @__PURE__ */ a(
|
|
652
|
+
/* @__PURE__ */ a(Ut, { size: "24px", cursor: "pointer", onClick: o })
|
|
653
653
|
] }) }),
|
|
654
654
|
t
|
|
655
655
|
] }) }) }) }),
|
|
@@ -789,7 +789,7 @@ const Ao = S.div`
|
|
|
789
789
|
background-color: #ebecf0;
|
|
790
790
|
border-radius: 8px;
|
|
791
791
|
}
|
|
792
|
-
`,
|
|
792
|
+
`, Uo = (e) => {
|
|
793
793
|
const {
|
|
794
794
|
conditionsAlignment: t,
|
|
795
795
|
decision: n,
|
|
@@ -886,16 +886,16 @@ const Ao = S.div`
|
|
|
886
886
|
}
|
|
887
887
|
) })
|
|
888
888
|
] });
|
|
889
|
-
},
|
|
889
|
+
}, jo = (e) => Array.isArray(e) ? e[0] : e ?? null, zo = (e) => {
|
|
890
890
|
var t;
|
|
891
|
-
return ((t =
|
|
891
|
+
return ((t = jo(e == null ? void 0 : e.conditionGroups)) == null ? void 0 : t.conditionsThatEstablishesTheDecision) ?? [];
|
|
892
892
|
}, Ho = (e) => {
|
|
893
893
|
const { decision: t, loading: n = !1, textValues: o } = e, r = !!(t != null && t.effectiveFrom), i = !!(t != null && t.validUntil), s = r && i ? {
|
|
894
894
|
element: {
|
|
895
895
|
labelName: o == null ? void 0 : o.terms,
|
|
896
896
|
value: String(t.effectiveFrom),
|
|
897
897
|
howToSetTheDecision: z.RANGE,
|
|
898
|
-
decisionDataType:
|
|
898
|
+
decisionDataType: U.DATE
|
|
899
899
|
},
|
|
900
900
|
valueData: Ve({
|
|
901
901
|
labelName: o == null ? void 0 : o.terms,
|
|
@@ -904,20 +904,20 @@ const Ao = S.div`
|
|
|
904
904
|
to: String(t.validUntil)
|
|
905
905
|
},
|
|
906
906
|
howToSetTheDecision: z.RANGE,
|
|
907
|
-
decisionDataType:
|
|
907
|
+
decisionDataType: U.DATE
|
|
908
908
|
})
|
|
909
909
|
} : r && !i ? {
|
|
910
910
|
element: {
|
|
911
911
|
labelName: o == null ? void 0 : o.terms,
|
|
912
912
|
value: String(t.effectiveFrom),
|
|
913
913
|
howToSetTheDecision: z.EQUAL,
|
|
914
|
-
decisionDataType:
|
|
914
|
+
decisionDataType: U.DATE
|
|
915
915
|
},
|
|
916
916
|
valueData: Ve({
|
|
917
917
|
labelName: o == null ? void 0 : o.terms,
|
|
918
918
|
value: String(t.effectiveFrom),
|
|
919
919
|
howToSetTheDecision: z.EQUAL,
|
|
920
|
-
decisionDataType:
|
|
920
|
+
decisionDataType: U.DATE
|
|
921
921
|
})
|
|
922
922
|
} : null, d = t ? {
|
|
923
923
|
labelName: t.labelName || "",
|
|
@@ -926,7 +926,7 @@ const Ao = S.div`
|
|
|
926
926
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
927
927
|
} : null, l = zo(t).filter((g) => !(g != null && g.hidden)), u = Array.from({ length: 5 }), p = !!(!n && t && o && d), c = l.length < 2 ? "start" : "space-between";
|
|
928
928
|
return /* @__PURE__ */ a(
|
|
929
|
-
|
|
929
|
+
Uo,
|
|
930
930
|
{
|
|
931
931
|
conditionsAlignment: c,
|
|
932
932
|
decision: t,
|
|
@@ -1093,7 +1093,7 @@ const Bo = (e) => {
|
|
|
1093
1093
|
}),
|
|
1094
1094
|
value: { from: t, to: n }
|
|
1095
1095
|
};
|
|
1096
|
-
}, Et = (e, t) => t ===
|
|
1096
|
+
}, Et = (e, t) => t === U.PERCENTAGE ? {
|
|
1097
1097
|
schema: ue().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
1098
1098
|
value: e
|
|
1099
1099
|
} : {
|
|
@@ -1135,7 +1135,7 @@ function nr({
|
|
|
1135
1135
|
var c, g;
|
|
1136
1136
|
const o = ((c = e.conditionGroups[0]) == null ? void 0 : c.conditionsThatEstablishesTheDecision) ?? [], r = o.reduce((h, f) => (it(f.value) && (h[f.conditionName] = f.value), h), {}), i = Object.keys(r).length > 0, s = {
|
|
1137
1137
|
ruleName: e.ruleName || "",
|
|
1138
|
-
decisionDataType: e.decisionDataType ||
|
|
1138
|
+
decisionDataType: e.decisionDataType || U.ALPHABETICAL,
|
|
1139
1139
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
1140
1140
|
value: e.value ?? "",
|
|
1141
1141
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -1152,7 +1152,7 @@ function nr({
|
|
|
1152
1152
|
let d;
|
|
1153
1153
|
const l = {
|
|
1154
1154
|
ruleName: ce().required("El nombre de la regla es requerido"),
|
|
1155
|
-
value:
|
|
1155
|
+
value: je(() => er(
|
|
1156
1156
|
d.values.howToSetTheDecision
|
|
1157
1157
|
)(
|
|
1158
1158
|
d.values.value,
|
|
@@ -1661,7 +1661,7 @@ const or = S.div`
|
|
|
1661
1661
|
[N.GREATER_THAN]: hr,
|
|
1662
1662
|
[N.LESS_THAN]: fr,
|
|
1663
1663
|
[N.EQUAL]: mr
|
|
1664
|
-
},
|
|
1664
|
+
}, Ue = (e) => {
|
|
1665
1665
|
const t = e == null ? void 0 : e.value;
|
|
1666
1666
|
if (typeof t == "string" && t.includes(" a ")) {
|
|
1667
1667
|
const n = [
|
|
@@ -1833,7 +1833,7 @@ const Dr = (e) => {
|
|
|
1833
1833
|
Ke,
|
|
1834
1834
|
{
|
|
1835
1835
|
element: r,
|
|
1836
|
-
valueData:
|
|
1836
|
+
valueData: Ue(
|
|
1837
1837
|
r
|
|
1838
1838
|
),
|
|
1839
1839
|
type: "decision"
|
|
@@ -1871,7 +1871,7 @@ const Dr = (e) => {
|
|
|
1871
1871
|
G,
|
|
1872
1872
|
{
|
|
1873
1873
|
appearance: "dark",
|
|
1874
|
-
icon: l ? /* @__PURE__ */ a(
|
|
1874
|
+
icon: l ? /* @__PURE__ */ a(Un, {}) : /* @__PURE__ */ a($t, {}),
|
|
1875
1875
|
size: "24px",
|
|
1876
1876
|
cursorHover: !0
|
|
1877
1877
|
}
|
|
@@ -1924,7 +1924,7 @@ const Dr = (e) => {
|
|
|
1924
1924
|
value: x.value,
|
|
1925
1925
|
howToSetTheCondition: x.howToSetTheCondition === de.LIST_OF_VALUES ? de.LIST_OF_VALUES_MULTI : x.howToSetTheCondition
|
|
1926
1926
|
},
|
|
1927
|
-
valueData:
|
|
1927
|
+
valueData: Ue(
|
|
1928
1928
|
x
|
|
1929
1929
|
)
|
|
1930
1930
|
}
|
|
@@ -2087,32 +2087,33 @@ const Dr = (e) => {
|
|
|
2087
2087
|
labelName: r == null ? void 0 : r.effectiveFrom,
|
|
2088
2088
|
value: et(n.effectiveFrom),
|
|
2089
2089
|
howToSetTheDecision: z.EQUAL,
|
|
2090
|
-
decisionDataType:
|
|
2090
|
+
decisionDataType: U.DATE
|
|
2091
2091
|
},
|
|
2092
|
-
valueData:
|
|
2092
|
+
valueData: Ue({
|
|
2093
2093
|
labelName: r == null ? void 0 : r.effectiveFrom,
|
|
2094
2094
|
value: et(n.effectiveFrom),
|
|
2095
2095
|
howToSetTheDecision: z.EQUAL,
|
|
2096
|
-
decisionDataType:
|
|
2096
|
+
decisionDataType: U.DATE
|
|
2097
2097
|
})
|
|
2098
2098
|
} : null, f = g ? {
|
|
2099
2099
|
element: {
|
|
2100
2100
|
labelName: r == null ? void 0 : r.validUntil,
|
|
2101
2101
|
value: et(n.validUntil),
|
|
2102
2102
|
howToSetTheDecision: z.EQUAL,
|
|
2103
|
-
decisionDataType:
|
|
2103
|
+
decisionDataType: U.DATE
|
|
2104
2104
|
},
|
|
2105
|
-
valueData:
|
|
2105
|
+
valueData: Ue({
|
|
2106
2106
|
labelName: r == null ? void 0 : r.validUntil,
|
|
2107
2107
|
value: et(n.validUntil),
|
|
2108
2108
|
howToSetTheDecision: z.EQUAL,
|
|
2109
|
-
decisionDataType:
|
|
2109
|
+
decisionDataType: U.DATE
|
|
2110
2110
|
})
|
|
2111
2111
|
} : null, T = n ? {
|
|
2112
2112
|
labelName: t && n.labelName || "",
|
|
2113
|
-
decisionDataType: n.decisionDataType ||
|
|
2114
|
-
value:
|
|
2115
|
-
howToSetTheDecision: n.howToSetTheDecision || z.EQUAL
|
|
2113
|
+
decisionDataType: n.decisionDataType || U.ALPHABETICAL,
|
|
2114
|
+
value: Ue(n),
|
|
2115
|
+
howToSetTheDecision: n.howToSetTheDecision || z.EQUAL,
|
|
2116
|
+
validUntil: n.validUntil
|
|
2116
2117
|
} : null, v = _.useMemo(
|
|
2117
2118
|
() => n ? Te(n) : {},
|
|
2118
2119
|
[n]
|
|
@@ -2452,7 +2453,7 @@ const Nr = S.div`
|
|
|
2452
2453
|
);
|
|
2453
2454
|
const d = ae("(max-width: 400px)");
|
|
2454
2455
|
return Gt(
|
|
2455
|
-
/* @__PURE__ */ a(Mr, { smallScreen: d, children: /* @__PURE__ */ a(
|
|
2456
|
+
/* @__PURE__ */ a(Mr, { smallScreen: d, children: /* @__PURE__ */ a(jt, { children: /* @__PURE__ */ a(Pr, { children: /* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
2456
2457
|
/* @__PURE__ */ m(y, { direction: "column", gap: "24px", children: [
|
|
2457
2458
|
/* @__PURE__ */ m(y, { alignItems: "center", justifyContent: "space-between", children: [
|
|
2458
2459
|
/* @__PURE__ */ m(y, { direction: "column", gap: "8px", children: [
|
|
@@ -2468,7 +2469,7 @@ const Nr = S.div`
|
|
|
2468
2469
|
),
|
|
2469
2470
|
/* @__PURE__ */ a($, { size: "medium", appearance: "gray", children: n })
|
|
2470
2471
|
] }),
|
|
2471
|
-
/* @__PURE__ */ a(
|
|
2472
|
+
/* @__PURE__ */ a(Ut, { size: "24px", cursor: "pointer", onClick: r })
|
|
2472
2473
|
] }),
|
|
2473
2474
|
/* @__PURE__ */ a(q, { dashed: !0 })
|
|
2474
2475
|
] }),
|
|
@@ -2483,7 +2484,7 @@ const Nr = S.div`
|
|
|
2483
2484
|
(t) => t != null && t.trim() !== ""
|
|
2484
2485
|
),
|
|
2485
2486
|
value: e
|
|
2486
|
-
}),
|
|
2487
|
+
}), Ur = (e) => ({
|
|
2487
2488
|
schema: Ae().test(
|
|
2488
2489
|
"isArrayOrString",
|
|
2489
2490
|
"Por favor selecciona una opcion",
|
|
@@ -2492,7 +2493,7 @@ const Nr = S.div`
|
|
|
2492
2493
|
) : typeof t == "string"
|
|
2493
2494
|
),
|
|
2494
2495
|
value: e
|
|
2495
|
-
}),
|
|
2496
|
+
}), jr = (e) => ({
|
|
2496
2497
|
schema: Ae().test(
|
|
2497
2498
|
"isArrayOrString",
|
|
2498
2499
|
"Por favor selecciona al menos una opcion",
|
|
@@ -2520,7 +2521,7 @@ const Nr = S.div`
|
|
|
2520
2521
|
}, Nt = (e, t) => {
|
|
2521
2522
|
if (typeof e == "object" && e !== null && "from" in e && "to" in e) {
|
|
2522
2523
|
const n = e;
|
|
2523
|
-
return t ===
|
|
2524
|
+
return t === U.PERCENTAGE ? {
|
|
2524
2525
|
schema: Z({
|
|
2525
2526
|
from: ue().required("El campo desde es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2526
2527
|
to: ue().required("El campo hasta es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100")
|
|
@@ -2534,7 +2535,7 @@ const Nr = S.div`
|
|
|
2534
2535
|
value: n
|
|
2535
2536
|
};
|
|
2536
2537
|
}
|
|
2537
|
-
return t ===
|
|
2538
|
+
return t === U.PERCENTAGE ? {
|
|
2538
2539
|
schema: ue().required("El campo porcentaje es requerido").min(0, "El porcentaje no puede ser menor a 0").max(100, "El porcentaje no puede ser mayor a 100"),
|
|
2539
2540
|
value: e
|
|
2540
2541
|
} : {
|
|
@@ -2542,8 +2543,8 @@ const Nr = S.div`
|
|
|
2542
2543
|
value: e
|
|
2543
2544
|
};
|
|
2544
2545
|
}, Hr = {
|
|
2545
|
-
[N.LIST_OF_VALUES]:
|
|
2546
|
-
[N.LIST_OF_VALUES_MULTI]:
|
|
2546
|
+
[N.LIST_OF_VALUES]: Ur,
|
|
2547
|
+
[N.LIST_OF_VALUES_MULTI]: jr,
|
|
2547
2548
|
[N.RANGE]: zr,
|
|
2548
2549
|
[N.GREATER_THAN]: Nt,
|
|
2549
2550
|
[N.LESS_THAN]: Nt,
|
|
@@ -2560,7 +2561,7 @@ function Gr({
|
|
|
2560
2561
|
Object.keys(o).map((c) => [c, {}])
|
|
2561
2562
|
), s = {
|
|
2562
2563
|
ruleName: e.ruleName || "",
|
|
2563
|
-
decisionDataType: e.decisionDataType ||
|
|
2564
|
+
decisionDataType: e.decisionDataType || U.ALPHABETICAL,
|
|
2564
2565
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
2565
2566
|
value: e.value || "",
|
|
2566
2567
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -2573,13 +2574,13 @@ function Gr({
|
|
|
2573
2574
|
let d;
|
|
2574
2575
|
const l = {
|
|
2575
2576
|
ruleName: ce().required("El nombre de la decision es requerido"),
|
|
2576
|
-
value:
|
|
2577
|
+
value: je(() => on(
|
|
2577
2578
|
d.values.howToSetTheDecision
|
|
2578
2579
|
)(
|
|
2579
2580
|
d.values.value,
|
|
2580
2581
|
d.values.decisionDataType
|
|
2581
2582
|
).schema),
|
|
2582
|
-
conditionsThatEstablishesTheDecision:
|
|
2583
|
+
conditionsThatEstablishesTheDecision: je((c, { parent: g }) => {
|
|
2583
2584
|
const h = g && g.conditionsThatEstablishesTheDecision && typeof g.conditionsThatEstablishesTheDecision == "object" && Object.keys(g.conditionsThatEstablishesTheDecision).length > 0;
|
|
2584
2585
|
if ((g == null ? void 0 : g.toggleNone) && h) return Z().shape({});
|
|
2585
2586
|
const T = {};
|
|
@@ -2823,7 +2824,7 @@ const Br = S.div`
|
|
|
2823
2824
|
/* @__PURE__ */ a(
|
|
2824
2825
|
G,
|
|
2825
2826
|
{
|
|
2826
|
-
icon: /* @__PURE__ */ a(
|
|
2827
|
+
icon: /* @__PURE__ */ a(jn, {}),
|
|
2827
2828
|
appearance: "help",
|
|
2828
2829
|
onClick: v,
|
|
2829
2830
|
cursorHover: !0
|
|
@@ -3050,7 +3051,7 @@ const tt = (e) => {
|
|
|
3050
3051
|
var H;
|
|
3051
3052
|
const A = (H = l.values) == null ? void 0 : H.conditionsThatEstablishesTheDecision;
|
|
3052
3053
|
if (!A || typeof A != "object") return;
|
|
3053
|
-
const M = Te(p),
|
|
3054
|
+
const M = Te(p), j = Object.keys(M).map((re) => {
|
|
3054
3055
|
const se = M[re] || [], Re = A[re] || {}, Ct = se.map((ye) => {
|
|
3055
3056
|
const St = tt(ye.howToSetTheCondition), Ze = ye.value ?? nt(St);
|
|
3056
3057
|
return {
|
|
@@ -3063,8 +3064,8 @@ const tt = (e) => {
|
|
|
3063
3064
|
ConditionGroupId: re,
|
|
3064
3065
|
conditionsThatEstablishesTheDecision: Ct
|
|
3065
3066
|
};
|
|
3066
|
-
}), P = l.values.conditionGroups, K = JSON.stringify(
|
|
3067
|
-
K !== he && l.setFieldValue("conditionGroups",
|
|
3067
|
+
}), P = l.values.conditionGroups, K = JSON.stringify(j), he = JSON.stringify(P ?? []);
|
|
3068
|
+
K !== he && l.setFieldValue("conditionGroups", j, !1);
|
|
3068
3069
|
}, [
|
|
3069
3070
|
(Fe = l.values) == null ? void 0 : Fe.conditionsThatEstablishesTheDecision,
|
|
3070
3071
|
p
|
|
@@ -3075,7 +3076,7 @@ const tt = (e) => {
|
|
|
3075
3076
|
...Object.keys(h).filter((P) => P !== "group-primary")
|
|
3076
3077
|
];
|
|
3077
3078
|
let M = !1;
|
|
3078
|
-
const
|
|
3079
|
+
const j = A.map((P) => {
|
|
3079
3080
|
const he = (h[P] ?? []).map((H, re) => {
|
|
3080
3081
|
const se = !M && P === "group-primary" && re === 0;
|
|
3081
3082
|
se && (M = !0);
|
|
@@ -3097,7 +3098,7 @@ const tt = (e) => {
|
|
|
3097
3098
|
});
|
|
3098
3099
|
return [P, he];
|
|
3099
3100
|
});
|
|
3100
|
-
return Object.fromEntries(
|
|
3101
|
+
return Object.fromEntries(j);
|
|
3101
3102
|
}, [h, l.values]), R = L[k] ?? [], le = L["group-primary"] ?? [], ge = {
|
|
3102
3103
|
decisionDataType: t.decisionDataType,
|
|
3103
3104
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
@@ -3109,16 +3110,16 @@ const tt = (e) => {
|
|
|
3109
3110
|
const A = l.errors.conditionsThatEstablishesTheDecision;
|
|
3110
3111
|
if (!A) return;
|
|
3111
3112
|
if (typeof A == "string") return A;
|
|
3112
|
-
const M = (
|
|
3113
|
-
if (
|
|
3114
|
-
if (typeof
|
|
3115
|
-
if (Array.isArray(
|
|
3116
|
-
for (const P of
|
|
3113
|
+
const M = (j) => {
|
|
3114
|
+
if (j) {
|
|
3115
|
+
if (typeof j == "string") return j;
|
|
3116
|
+
if (Array.isArray(j))
|
|
3117
|
+
for (const P of j) {
|
|
3117
3118
|
const K = M(P);
|
|
3118
3119
|
if (K) return K;
|
|
3119
3120
|
}
|
|
3120
|
-
else if (typeof
|
|
3121
|
-
for (const P of Object.values(
|
|
3121
|
+
else if (typeof j == "object")
|
|
3122
|
+
for (const P of Object.values(j)) {
|
|
3122
3123
|
const K = M(P);
|
|
3123
3124
|
if (K) return K;
|
|
3124
3125
|
}
|
|
@@ -3128,11 +3129,11 @@ const tt = (e) => {
|
|
|
3128
3129
|
}, [l.errors.conditionsThatEstablishesTheDecision]), Tt = l.submitCount > 0 && !!$e, xt = (A) => {
|
|
3129
3130
|
const M = (A == null ? void 0 : A.__howToSet) ?? tt(A == null ? void 0 : A.howToSetTheCondition);
|
|
3130
3131
|
return nt(M);
|
|
3131
|
-
}, Xe = (A, M,
|
|
3132
|
+
}, Xe = (A, M, j) => {
|
|
3132
3133
|
var K, he;
|
|
3133
3134
|
l.setFieldValue(
|
|
3134
3135
|
`conditionsThatEstablishesTheDecision.${A}.${M}`,
|
|
3135
|
-
|
|
3136
|
+
j,
|
|
3136
3137
|
!1
|
|
3137
3138
|
);
|
|
3138
3139
|
const P = (K = l.values) == null ? void 0 : K.conditionGroups;
|
|
@@ -3144,12 +3145,12 @@ const tt = (e) => {
|
|
|
3144
3145
|
);
|
|
3145
3146
|
if (re >= 0) {
|
|
3146
3147
|
const se = JSON.parse(JSON.stringify(P));
|
|
3147
|
-
se[H].conditionsThatEstablishesTheDecision[re].value =
|
|
3148
|
+
se[H].conditionsThatEstablishesTheDecision[re].value = j, l.setFieldValue("conditionGroups", se, !1);
|
|
3148
3149
|
}
|
|
3149
3150
|
}
|
|
3150
3151
|
}
|
|
3151
3152
|
}, Dt = (A) => {
|
|
3152
|
-
const [M, ...
|
|
3153
|
+
const [M, ...j] = A.split("."), P = j.join("."), K = Object.values(c).flat().find((H) => H.conditionName === P), he = xt(K || {});
|
|
3153
3154
|
Xe(M, P, he), l.setFieldTouched(
|
|
3154
3155
|
`conditionsThatEstablishesTheDecision.${M}.${P}`,
|
|
3155
3156
|
!1,
|
|
@@ -3157,7 +3158,7 @@ const tt = (e) => {
|
|
|
3157
3158
|
);
|
|
3158
3159
|
}, Qe = () => {
|
|
3159
3160
|
(c[k] ?? []).forEach((M) => {
|
|
3160
|
-
const
|
|
3161
|
+
const j = tt(M == null ? void 0 : M.howToSetTheCondition), P = nt(j);
|
|
3161
3162
|
Xe(k, M.conditionName, P);
|
|
3162
3163
|
});
|
|
3163
3164
|
}, [Je, we] = _.useState(!1);
|
|
@@ -3803,7 +3804,7 @@ const ci = S.div`
|
|
|
3803
3804
|
}),
|
|
3804
3805
|
value: { from: t, to: n }
|
|
3805
3806
|
};
|
|
3806
|
-
}, kt = (e, t) => t ===
|
|
3807
|
+
}, kt = (e, t) => t === U.PERCENTAGE ? {
|
|
3807
3808
|
schema: ue().required("El campo tipo porcentaje es requerido").min(0, "El campo tipo porcentaje no puede ser menor que 0").max(100, "El campo tipo porcentaje no puede ser mayor que 100"),
|
|
3808
3809
|
value: e
|
|
3809
3810
|
} : {
|
|
@@ -3824,7 +3825,7 @@ function xi({
|
|
|
3824
3825
|
}) {
|
|
3825
3826
|
const o = {
|
|
3826
3827
|
ruleName: e.ruleName || "",
|
|
3827
|
-
decisionDataType: e.decisionDataType ||
|
|
3828
|
+
decisionDataType: e.decisionDataType || U.ALPHABETICAL,
|
|
3828
3829
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
3829
3830
|
value: e.value || "",
|
|
3830
3831
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -3837,7 +3838,7 @@ function xi({
|
|
|
3837
3838
|
let r;
|
|
3838
3839
|
const i = {
|
|
3839
3840
|
ruleName: ce().required("El nombre de la regla es requerido"),
|
|
3840
|
-
value:
|
|
3841
|
+
value: je(() => rn(
|
|
3841
3842
|
r.values.howToSetTheDecision
|
|
3842
3843
|
)(
|
|
3843
3844
|
r.values.value,
|
|
@@ -3880,7 +3881,7 @@ function xi({
|
|
|
3880
3881
|
// },
|
|
3881
3882
|
// );
|
|
3882
3883
|
// }),
|
|
3883
|
-
conditionsThatEstablishesTheDecision:
|
|
3884
|
+
conditionsThatEstablishesTheDecision: je((l, { parent: u }) => {
|
|
3884
3885
|
var g;
|
|
3885
3886
|
if ((u == null ? void 0 : u.toggleNone) && Object.keys(u.conditionsThatEstablishesTheDecision || {}).length > 0) return Z().shape({});
|
|
3886
3887
|
const c = ((g = e.conditionsThatEstablishesTheDecision) == null ? void 0 : g.reduce(
|
|
@@ -4669,10 +4670,10 @@ function Vi() {
|
|
|
4669
4670
|
function In(e) {
|
|
4670
4671
|
return Object.assign(b, e), e.initialParent.data.emit("dragStarted", b), be = !1, b.emit("dragStarted", b), b;
|
|
4671
4672
|
}
|
|
4672
|
-
function
|
|
4673
|
+
function Ui() {
|
|
4673
4674
|
b.activeState && De(b.activeState.parent, void 0, b), b.selectedState && xe(b.selectedState.nodes, b.selectedState.parent, b), b.selectedState = b.activeState = void 0;
|
|
4674
4675
|
}
|
|
4675
|
-
function
|
|
4676
|
+
function ji() {
|
|
4676
4677
|
if (b.pointerDown && (b.pointerDown.node.el.draggable = !0), b.pointerDown = void 0, !ne(b)) return;
|
|
4677
4678
|
const e = b.currentParent.data.config;
|
|
4678
4679
|
ne(b) && e.handleEnd(b);
|
|
@@ -4726,8 +4727,8 @@ function qi({
|
|
|
4726
4727
|
if (!Wt) return;
|
|
4727
4728
|
ln || (ln = dt(document, {
|
|
4728
4729
|
dragover: Gi,
|
|
4729
|
-
pointerdown:
|
|
4730
|
-
pointerup:
|
|
4730
|
+
pointerdown: Ui,
|
|
4731
|
+
pointerup: ji,
|
|
4731
4732
|
keydown: zi,
|
|
4732
4733
|
drop: Hi,
|
|
4733
4734
|
pointermove: Bi,
|
|
@@ -6101,7 +6102,7 @@ const pn = {
|
|
|
6101
6102
|
]
|
|
6102
6103
|
}
|
|
6103
6104
|
);
|
|
6104
|
-
},
|
|
6105
|
+
}, Ua = S.div`
|
|
6105
6106
|
& > button {
|
|
6106
6107
|
height: 66px;
|
|
6107
6108
|
min-width: 66px;
|
|
@@ -6119,7 +6120,7 @@ const pn = {
|
|
|
6119
6120
|
}
|
|
6120
6121
|
}
|
|
6121
6122
|
}
|
|
6122
|
-
`, Dl = (e) => /* @__PURE__ */ a(
|
|
6123
|
+
`, Dl = (e) => /* @__PURE__ */ a(Ua, { children: /* @__PURE__ */ a(Y, { ...e }) }), ja = S.div`
|
|
6123
6124
|
display: flex;
|
|
6124
6125
|
justify-content: space-between;
|
|
6125
6126
|
align-items: center;
|
|
@@ -6150,7 +6151,7 @@ const pn = {
|
|
|
6150
6151
|
}
|
|
6151
6152
|
`, wl = (e) => {
|
|
6152
6153
|
const { handleBack: t, handleNext: n, disabledBack: o, disabledNext: r, textValues: i } = e;
|
|
6153
|
-
return /* @__PURE__ */ m(
|
|
6154
|
+
return /* @__PURE__ */ m(ja, { children: [
|
|
6154
6155
|
/* @__PURE__ */ a(
|
|
6155
6156
|
Y,
|
|
6156
6157
|
{
|