@isettingkit/business-rules 0.1.30 → 0.1.31
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 +291 -286
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { ValueDataType as
|
|
1
|
+
import { jsxs as u, Fragment as E, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ValueDataType as k, ValueHowToSetUp as b, DecisionConditionRender as $ } from "@isettingkit/input";
|
|
3
3
|
import { Stack as s } from "@inubekit/stack";
|
|
4
4
|
import { Divider as w } from "@inubekit/divider";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useState as
|
|
5
|
+
import { Button as z } from "@inubekit/button";
|
|
6
|
+
import { useState as _, useEffect as te } from "react";
|
|
7
7
|
import { Text as x } from "@inubekit/text";
|
|
8
|
-
import { Date as
|
|
9
|
-
import { Checkbox as
|
|
10
|
-
import { Toggle as
|
|
8
|
+
import { Date as q } from "@inubekit/date";
|
|
9
|
+
import { Checkbox as re } from "@inubekit/checkbox";
|
|
10
|
+
import { Toggle as B } from "@inubekit/toggle";
|
|
11
11
|
import { inube as v } from "@inubekit/foundations";
|
|
12
|
-
import g, { keyframes as
|
|
13
|
-
import { useFormik as
|
|
14
|
-
import { mixed as
|
|
15
|
-
import { DecisionViewConditionRenderer as
|
|
16
|
-
import { SkeletonLine as
|
|
17
|
-
import { MdOutlineDelete as
|
|
18
|
-
import { Icon as
|
|
19
|
-
import { createPortal as
|
|
20
|
-
import { Blanket as
|
|
21
|
-
import { Grid as
|
|
22
|
-
import { useMediaQuery as
|
|
23
|
-
const
|
|
12
|
+
import g, { keyframes as ae } from "styled-components";
|
|
13
|
+
import { useFormik as ne } from "formik";
|
|
14
|
+
import { mixed as P, object as L, number as R, string as I, date as O, lazy as j } from "yup";
|
|
15
|
+
import { DecisionViewConditionRenderer as N } from "@isettingkit/view";
|
|
16
|
+
import { SkeletonLine as T } from "@inubekit/skeleton";
|
|
17
|
+
import { MdOutlineDelete as oe, MdClear as ie, MdAdd as de } from "react-icons/md";
|
|
18
|
+
import { Icon as Q } from "@inubekit/icon";
|
|
19
|
+
import { createPortal as le } from "react-dom";
|
|
20
|
+
import { Blanket as se } from "@inubekit/blanket";
|
|
21
|
+
import { Grid as ce } from "@inubekit/grid";
|
|
22
|
+
import { useMediaQuery as ue } from "@inubekit/hooks";
|
|
23
|
+
const he = (e) => {
|
|
24
24
|
const {
|
|
25
25
|
onHandleStartChange: t,
|
|
26
26
|
onHandleEndChange: a,
|
|
27
|
-
onCheckClosedChange:
|
|
28
|
-
labelStart:
|
|
29
|
-
labelEnd:
|
|
27
|
+
onCheckClosedChange: n,
|
|
28
|
+
labelStart: c,
|
|
29
|
+
labelEnd: o,
|
|
30
30
|
checkedClosed: l = !1,
|
|
31
|
-
required:
|
|
32
|
-
valueStart:
|
|
31
|
+
required: i = !1,
|
|
32
|
+
valueStart: h = "",
|
|
33
33
|
valueEnd: d = "",
|
|
34
34
|
messageStart: m = "",
|
|
35
35
|
messageEnd: p = "",
|
|
36
36
|
statusStart: f = "pending",
|
|
37
|
-
statusEnd:
|
|
38
|
-
} = e, [
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
37
|
+
statusEnd: S = "pending"
|
|
38
|
+
} = e, [A, J] = _(l), [K, X] = _(h), [Z, ee] = _(d);
|
|
39
|
+
return /* @__PURE__ */ u(E, { children: [
|
|
40
|
+
/* @__PURE__ */ u(s, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
41
41
|
/* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(
|
|
42
42
|
x,
|
|
43
43
|
{
|
|
@@ -57,58 +57,58 @@ const ue = (e) => {
|
|
|
57
57
|
wrap: "wrap",
|
|
58
58
|
gap: "4px",
|
|
59
59
|
children: /* @__PURE__ */ r(
|
|
60
|
-
|
|
60
|
+
re,
|
|
61
61
|
{
|
|
62
62
|
label: "Cerrada",
|
|
63
63
|
onChange: ({ target: y }) => {
|
|
64
|
-
|
|
64
|
+
J(y.checked), n && n(y.checked);
|
|
65
65
|
},
|
|
66
|
-
checked:
|
|
66
|
+
checked: A,
|
|
67
67
|
value: ""
|
|
68
68
|
}
|
|
69
69
|
)
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] }),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ u(s, { justifyContent: "space-between", gap: "24px", children: [
|
|
74
74
|
/* @__PURE__ */ r(s, { width: "189px", children: /* @__PURE__ */ r(
|
|
75
|
-
|
|
75
|
+
q,
|
|
76
76
|
{
|
|
77
77
|
id: "dateStart",
|
|
78
|
-
label:
|
|
78
|
+
label: c,
|
|
79
79
|
onChange: (y) => {
|
|
80
|
-
|
|
80
|
+
X(y.target.value), t(y);
|
|
81
81
|
},
|
|
82
|
-
value:
|
|
83
|
-
required:
|
|
82
|
+
value: K,
|
|
83
|
+
required: i,
|
|
84
84
|
size: "compact",
|
|
85
85
|
status: f,
|
|
86
86
|
message: m
|
|
87
87
|
}
|
|
88
88
|
) }),
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
A && /* @__PURE__ */ r(s, { width: "189px", children: /* @__PURE__ */ r(
|
|
90
|
+
q,
|
|
91
91
|
{
|
|
92
92
|
id: "dateEnd",
|
|
93
|
-
label:
|
|
93
|
+
label: o,
|
|
94
94
|
onChange: (y) => {
|
|
95
|
-
|
|
95
|
+
ee(y.target.value), a(y);
|
|
96
96
|
},
|
|
97
|
-
value:
|
|
98
|
-
required:
|
|
97
|
+
value: Z,
|
|
98
|
+
required: i,
|
|
99
99
|
size: "compact",
|
|
100
|
-
status:
|
|
100
|
+
status: S,
|
|
101
101
|
message: p
|
|
102
102
|
}
|
|
103
103
|
) })
|
|
104
104
|
] })
|
|
105
105
|
] });
|
|
106
|
-
},
|
|
106
|
+
}, pe = g.div`
|
|
107
107
|
& > div {
|
|
108
108
|
border-radius: 8px;
|
|
109
109
|
border: 1px solid ${v.palette.neutral.N30};
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`, ge = g.div`
|
|
112
112
|
width: 100%;
|
|
113
113
|
height: 100%;
|
|
114
114
|
overflow-y: auto;
|
|
@@ -125,37 +125,37 @@ const ue = (e) => {
|
|
|
125
125
|
background-color: #ebecf0;
|
|
126
126
|
border-radius: 8px;
|
|
127
127
|
}
|
|
128
|
-
`,
|
|
128
|
+
`, me = (e) => {
|
|
129
129
|
const {
|
|
130
130
|
checked: t,
|
|
131
131
|
children: a,
|
|
132
|
-
handleToggleChange:
|
|
133
|
-
id:
|
|
134
|
-
labelToggle:
|
|
132
|
+
handleToggleChange: n,
|
|
133
|
+
id: c,
|
|
134
|
+
labelToggle: o,
|
|
135
135
|
name: l,
|
|
136
|
-
valueToggle:
|
|
137
|
-
} = e, [
|
|
138
|
-
d(p.target.checked),
|
|
136
|
+
valueToggle: i = ""
|
|
137
|
+
} = e, [h, d] = _(t), m = (p) => {
|
|
138
|
+
d(p.target.checked), n(p);
|
|
139
139
|
};
|
|
140
|
-
return
|
|
140
|
+
return te(() => {
|
|
141
141
|
d(t);
|
|
142
|
-
}, [t]), /* @__PURE__ */
|
|
142
|
+
}, [t]), /* @__PURE__ */ u(E, { children: [
|
|
143
143
|
/* @__PURE__ */ r(s, { children: /* @__PURE__ */ r(
|
|
144
|
-
|
|
144
|
+
B,
|
|
145
145
|
{
|
|
146
|
-
checked:
|
|
147
|
-
id:
|
|
146
|
+
checked: h,
|
|
147
|
+
id: c,
|
|
148
148
|
name: l,
|
|
149
149
|
onChange: m,
|
|
150
150
|
size: "small",
|
|
151
|
-
value:
|
|
152
|
-
children: /* @__PURE__ */ r(x, { size: "medium", type: "label", weight: "bold", children:
|
|
151
|
+
value: i,
|
|
152
|
+
children: /* @__PURE__ */ r(x, { size: "medium", type: "label", weight: "bold", children: o })
|
|
153
153
|
}
|
|
154
154
|
) }),
|
|
155
|
-
|
|
155
|
+
h && /* @__PURE__ */ r(E, { children: a })
|
|
156
156
|
] });
|
|
157
|
-
},
|
|
158
|
-
schema:
|
|
157
|
+
}, be = (e) => ({
|
|
158
|
+
schema: P().test(
|
|
159
159
|
"isArrayOrString",
|
|
160
160
|
"Must be an array of strings/numbers or a single string",
|
|
161
161
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -163,8 +163,8 @@ const ue = (e) => {
|
|
|
163
163
|
) : typeof t == "string"
|
|
164
164
|
),
|
|
165
165
|
value: e
|
|
166
|
-
}),
|
|
167
|
-
schema:
|
|
166
|
+
}), fe = (e) => ({
|
|
167
|
+
schema: P().test(
|
|
168
168
|
"isArrayOrString",
|
|
169
169
|
"Must be an array of strings/numbers or a single string",
|
|
170
170
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -172,77 +172,74 @@ const ue = (e) => {
|
|
|
172
172
|
) : typeof t == "string"
|
|
173
173
|
),
|
|
174
174
|
value: e
|
|
175
|
-
}),
|
|
175
|
+
}), xe = (e) => {
|
|
176
176
|
const t = (e == null ? void 0 : e.from) ?? 0, a = (e == null ? void 0 : e.to) ?? 0;
|
|
177
177
|
return {
|
|
178
|
-
schema:
|
|
179
|
-
from:
|
|
180
|
-
to:
|
|
178
|
+
schema: L({
|
|
179
|
+
from: R().required("Range From is required").max(a, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
180
|
+
to: R().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
181
|
+
"is-greater",
|
|
182
|
+
"To value must be greater than From value",
|
|
183
|
+
function(n) {
|
|
184
|
+
const { from: c } = this.parent;
|
|
185
|
+
return n > c;
|
|
186
|
+
}
|
|
187
|
+
)
|
|
181
188
|
}),
|
|
182
189
|
value: { from: t, to: a }
|
|
183
190
|
};
|
|
184
|
-
},
|
|
185
|
-
schema:
|
|
191
|
+
}, V = (e, t) => t === k.PERCENTAGE ? {
|
|
192
|
+
schema: R().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
186
193
|
value: e
|
|
187
194
|
} : {
|
|
188
|
-
schema:
|
|
195
|
+
schema: I().required("Required"),
|
|
189
196
|
value: e
|
|
190
|
-
},
|
|
191
|
-
schema:
|
|
197
|
+
}, ye = (e) => ({
|
|
198
|
+
schema: I().required("Required").test(
|
|
192
199
|
"non-empty",
|
|
193
200
|
"Value cannot be empty",
|
|
194
201
|
(t) => t != null && t.trim() !== ""
|
|
195
202
|
),
|
|
196
203
|
value: e
|
|
197
|
-
}),
|
|
198
|
-
[b.LIST_OF_VALUES]:
|
|
199
|
-
[b.LIST_OF_VALUES_MULTI]:
|
|
200
|
-
[b.RANGE]:
|
|
201
|
-
[b.GREATER_THAN]:
|
|
202
|
-
[b.LESS_THAN]:
|
|
203
|
-
[b.EQUAL]:
|
|
204
|
-
},
|
|
204
|
+
}), ve = {
|
|
205
|
+
[b.LIST_OF_VALUES]: be,
|
|
206
|
+
[b.LIST_OF_VALUES_MULTI]: fe,
|
|
207
|
+
[b.RANGE]: xe,
|
|
208
|
+
[b.GREATER_THAN]: V,
|
|
209
|
+
[b.LESS_THAN]: V,
|
|
210
|
+
[b.EQUAL]: V
|
|
211
|
+
}, M = (e) => ve[e] || ye;
|
|
205
212
|
function Ce({ decision: e, onSubmitEvent: t }) {
|
|
206
213
|
const a = {
|
|
207
214
|
name: e.name || "",
|
|
208
|
-
dataType: e.dataType ||
|
|
215
|
+
dataType: e.dataType || k.ALPHABETICAL,
|
|
209
216
|
valueUse: e.valueUse || "",
|
|
210
|
-
value: e.value ||
|
|
217
|
+
value: e.value || "",
|
|
211
218
|
startDate: e.startDate || "",
|
|
212
219
|
endDate: e.endDate || "",
|
|
213
220
|
toggleNone: !0,
|
|
214
221
|
conditions: {},
|
|
215
222
|
checkClosed: !1
|
|
216
|
-
},
|
|
217
|
-
name:
|
|
223
|
+
}, n = L({
|
|
224
|
+
name: I().required("Name is required"),
|
|
218
225
|
startDate: O().required("Start date is required"),
|
|
219
|
-
endDate: O().when("checkClosed", (l,
|
|
226
|
+
endDate: O().when("checkClosed", (l, i, { parent: h }) => (h == null ? void 0 : h.checkClosed) ? i.required("End date is required").test(
|
|
220
227
|
"is-after-startDate",
|
|
221
228
|
"End date must be greater than or equal to Start date",
|
|
222
229
|
function(m) {
|
|
223
230
|
const p = this.parent.startDate;
|
|
224
231
|
return !p || !m ? !0 : new Date(m) >= new Date(p);
|
|
225
232
|
}
|
|
226
|
-
) :
|
|
227
|
-
value:
|
|
228
|
-
|
|
229
|
-
to: N().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
230
|
-
"is-greater",
|
|
231
|
-
"To value must be greater than From value",
|
|
232
|
-
function(l) {
|
|
233
|
-
const { from: o } = this.parent;
|
|
234
|
-
return l > o;
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
}).required("Range value is required"),
|
|
238
|
-
conditions: ae((l, { parent: o }) => {
|
|
233
|
+
) : i.notRequired()),
|
|
234
|
+
value: j(() => M(c.values.valueUse)(c.values.value, c.values.dataType).schema),
|
|
235
|
+
conditions: j((l, { parent: i }) => {
|
|
239
236
|
var d, m;
|
|
240
|
-
return (
|
|
237
|
+
return (i == null ? void 0 : i.toggleNone) && ((d = i == null ? void 0 : i.conditions) == null ? void 0 : d.length) > 0 ? L().shape({}) : L(
|
|
241
238
|
(m = e.conditions) == null ? void 0 : m.reduce(
|
|
242
239
|
(p, f) => {
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
245
|
-
p[f.name] =
|
|
240
|
+
if (c.values.conditions[f.name] !== void 0) {
|
|
241
|
+
const S = M(f.valueUse);
|
|
242
|
+
p[f.name] = S(
|
|
246
243
|
f.value,
|
|
247
244
|
f.dataType
|
|
248
245
|
).schema;
|
|
@@ -253,13 +250,13 @@ function Ce({ decision: e, onSubmitEvent: t }) {
|
|
|
253
250
|
)
|
|
254
251
|
);
|
|
255
252
|
})
|
|
256
|
-
}),
|
|
253
|
+
}), c = ne({
|
|
257
254
|
initialValues: a,
|
|
258
|
-
validationSchema:
|
|
255
|
+
validationSchema: n,
|
|
259
256
|
validateOnBlur: !0,
|
|
260
257
|
onSubmit: (l) => {
|
|
261
|
-
var
|
|
262
|
-
const
|
|
258
|
+
var h;
|
|
259
|
+
const i = {
|
|
263
260
|
...e,
|
|
264
261
|
name: l.name,
|
|
265
262
|
dataType: l.dataType,
|
|
@@ -267,45 +264,45 @@ function Ce({ decision: e, onSubmitEvent: t }) {
|
|
|
267
264
|
value: l.value,
|
|
268
265
|
startDate: l.startDate,
|
|
269
266
|
endDate: l.endDate,
|
|
270
|
-
conditions: (
|
|
267
|
+
conditions: (h = e.conditions) == null ? void 0 : h.map((d) => ({
|
|
271
268
|
...d,
|
|
272
269
|
value: l.conditions[d.name]
|
|
273
270
|
}))
|
|
274
271
|
};
|
|
275
|
-
t(
|
|
272
|
+
t(i);
|
|
276
273
|
}
|
|
277
274
|
});
|
|
278
|
-
return { formik:
|
|
279
|
-
var
|
|
280
|
-
|
|
275
|
+
return { formik: c, handleToggleNoneChange: (l) => {
|
|
276
|
+
var i;
|
|
277
|
+
c.setFieldValue("toggleNone", l), (i = e.conditions) == null || i.forEach((h) => {
|
|
281
278
|
if (l)
|
|
282
|
-
|
|
279
|
+
c.setFieldValue(`conditions.${h.name}`, void 0);
|
|
283
280
|
else {
|
|
284
|
-
const d =
|
|
285
|
-
|
|
281
|
+
const d = h.valueUse === b.LIST_OF_VALUES_MULTI ? [] : "";
|
|
282
|
+
c.setFieldValue(`conditions.${h.name}`, d);
|
|
286
283
|
}
|
|
287
284
|
});
|
|
288
285
|
} };
|
|
289
286
|
}
|
|
290
287
|
const we = (e) => {
|
|
291
|
-
var
|
|
292
|
-
const { decision: t, onSubmitEvent: a, textValues:
|
|
288
|
+
var h;
|
|
289
|
+
const { decision: t, onSubmitEvent: a, textValues: n, onCancel: c } = e, { formik: o, handleToggleNoneChange: l } = Ce({
|
|
293
290
|
decision: t,
|
|
294
291
|
onSubmitEvent: a
|
|
295
|
-
}),
|
|
292
|
+
}), i = {
|
|
296
293
|
name: t.name,
|
|
297
294
|
valueUse: t.valueUse,
|
|
298
295
|
dataType: t.dataType,
|
|
299
296
|
possibleValue: t.possibleValue
|
|
300
297
|
};
|
|
301
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
302
|
-
|
|
303
|
-
condition:
|
|
304
|
-
formik:
|
|
298
|
+
return /* @__PURE__ */ r("form", { onSubmit: o.handleSubmit, children: /* @__PURE__ */ u(s, { direction: "column", gap: "24px", children: [
|
|
299
|
+
$({
|
|
300
|
+
condition: i,
|
|
301
|
+
formik: o,
|
|
305
302
|
isDecision: !0
|
|
306
303
|
}),
|
|
307
304
|
/* @__PURE__ */ r(w, { dashed: !0 }),
|
|
308
|
-
/* @__PURE__ */ r(
|
|
305
|
+
/* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(ge, { children: /* @__PURE__ */ u(
|
|
309
306
|
s,
|
|
310
307
|
{
|
|
311
308
|
direction: "column",
|
|
@@ -313,45 +310,53 @@ const we = (e) => {
|
|
|
313
310
|
gap: "16px",
|
|
314
311
|
height: "272px",
|
|
315
312
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
313
|
+
/* @__PURE__ */ u(
|
|
314
|
+
s,
|
|
315
|
+
{
|
|
316
|
+
justifyContent: "space-between",
|
|
317
|
+
alignItems: "center",
|
|
318
|
+
gap: "64px",
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ r(x, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
321
|
+
/* @__PURE__ */ r(
|
|
322
|
+
B,
|
|
323
|
+
{
|
|
324
|
+
id: "toggleNone",
|
|
325
|
+
onChange: () => l(!o.values.toggleNone),
|
|
326
|
+
checked: o.values.toggleNone,
|
|
327
|
+
size: "small",
|
|
328
|
+
children: /* @__PURE__ */ r(x, { size: "medium", type: "label", weight: "bold", children: n.none })
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ r(s, { direction: "column", gap: "20px", children: (h = t.conditions) == null ? void 0 : h.map((d) => /* @__PURE__ */ r(
|
|
335
|
+
me,
|
|
331
336
|
{
|
|
332
337
|
id: `toggle-${d.name}`,
|
|
333
338
|
name: `toggle.${d.name}`,
|
|
334
339
|
labelToggle: d.name,
|
|
335
|
-
checked: !
|
|
340
|
+
checked: !o.values.toggleNone && o.values.conditions[d.name] !== void 0,
|
|
336
341
|
handleToggleChange: (m) => {
|
|
337
342
|
if (!m.target.checked)
|
|
338
|
-
|
|
343
|
+
o.setFieldValue(
|
|
339
344
|
`conditions.${d.name}`,
|
|
340
345
|
void 0
|
|
341
|
-
),
|
|
346
|
+
), o.setFieldTouched(
|
|
342
347
|
`conditions.${d.name}`,
|
|
343
348
|
!1,
|
|
344
349
|
!1
|
|
345
350
|
);
|
|
346
351
|
else {
|
|
347
352
|
const f = d.valueUse === b.LIST_OF_VALUES_MULTI ? [] : "";
|
|
348
|
-
|
|
353
|
+
o.setFieldValue(
|
|
349
354
|
`conditions.${d.name}`,
|
|
350
355
|
f
|
|
351
356
|
);
|
|
352
357
|
}
|
|
353
358
|
},
|
|
354
|
-
children:
|
|
359
|
+
children: $({ condition: d, formik: o })
|
|
355
360
|
},
|
|
356
361
|
d.name
|
|
357
362
|
)) })
|
|
@@ -360,36 +365,36 @@ const we = (e) => {
|
|
|
360
365
|
) }) }),
|
|
361
366
|
/* @__PURE__ */ r(w, { dashed: !0 }),
|
|
362
367
|
/* @__PURE__ */ r(
|
|
363
|
-
|
|
368
|
+
he,
|
|
364
369
|
{
|
|
365
|
-
labelStart:
|
|
366
|
-
labelEnd:
|
|
367
|
-
valueStart:
|
|
368
|
-
valueEnd:
|
|
369
|
-
messageStart:
|
|
370
|
-
messageEnd:
|
|
371
|
-
statusStart:
|
|
372
|
-
statusEnd:
|
|
373
|
-
onHandleStartChange: (d) =>
|
|
374
|
-
onHandleEndChange: (d) =>
|
|
370
|
+
labelStart: n.termStart,
|
|
371
|
+
labelEnd: n.termEnd,
|
|
372
|
+
valueStart: o.values.startDate,
|
|
373
|
+
valueEnd: o.values.endDate,
|
|
374
|
+
messageStart: o.errors.startDate,
|
|
375
|
+
messageEnd: o.errors.endDate,
|
|
376
|
+
statusStart: o.touched.startDate ? o.errors.startDate ? "invalid" : "valid" : void 0,
|
|
377
|
+
statusEnd: o.touched.endDate ? o.errors.endDate ? "invalid" : "valid" : void 0,
|
|
378
|
+
onHandleStartChange: (d) => o.setFieldValue("startDate", d.target.value),
|
|
379
|
+
onHandleEndChange: (d) => o.setFieldValue("endDate", d.target.value),
|
|
375
380
|
onCheckClosedChange: (d) => {
|
|
376
|
-
|
|
381
|
+
o.setFieldValue("checkClosed", d), d && o.setFieldValue("endDate", "");
|
|
377
382
|
},
|
|
378
|
-
checkedClosed:
|
|
383
|
+
checkedClosed: o.values.checkClosed
|
|
379
384
|
}
|
|
380
385
|
),
|
|
381
386
|
/* @__PURE__ */ r(w, {}),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */ r(
|
|
384
|
-
/* @__PURE__ */ r(
|
|
387
|
+
/* @__PURE__ */ u(s, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
388
|
+
/* @__PURE__ */ r(z, { appearance: "gray", onClick: c, children: n.cancel }),
|
|
389
|
+
/* @__PURE__ */ r(z, { type: "submit", children: n.confirm })
|
|
385
390
|
] })
|
|
386
391
|
] }) });
|
|
387
|
-
},
|
|
392
|
+
}, H = g.div`
|
|
388
393
|
& > div {
|
|
389
394
|
border-radius: 8px;
|
|
390
395
|
border: 1px solid ${v.palette.neutral.N30};
|
|
391
396
|
}
|
|
392
|
-
`,
|
|
397
|
+
`, G = g.div`
|
|
393
398
|
width: 100%;
|
|
394
399
|
height: 100%;
|
|
395
400
|
overflow-y: auto;
|
|
@@ -412,7 +417,7 @@ const we = (e) => {
|
|
|
412
417
|
to: e.to ?? ""
|
|
413
418
|
}), De = (e) => e.value, Ee = (e) => e.value, Ae = (e) => e.value;
|
|
414
419
|
var C = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.GREATER_THAN = "greater_than", e.LESS_THAN = "less_than", e.LIST_OF_VALUES = "list_of_values", e.LIST_OF_VALUES_MULTI = "list_of_values_multi", e.RANGE = "range", e))(C || {});
|
|
415
|
-
const Ne = (e) => e.value,
|
|
420
|
+
const Ne = (e) => e.value, _e = {
|
|
416
421
|
[C.LIST_OF_VALUES]: ke,
|
|
417
422
|
[C.LIST_OF_VALUES_MULTI]: Se,
|
|
418
423
|
[C.RANGE]: Te,
|
|
@@ -420,28 +425,28 @@ const Ne = (e) => e.value, Re = {
|
|
|
420
425
|
[C.LESS_THAN]: Ee,
|
|
421
426
|
[C.EQUAL]: Ae
|
|
422
427
|
};
|
|
423
|
-
function
|
|
424
|
-
const t = e == null ? void 0 : e.value, a = typeof t == "object" && t !== null && !Array.isArray(t),
|
|
425
|
-
return a &&
|
|
428
|
+
function D(e) {
|
|
429
|
+
const t = e == null ? void 0 : e.value, a = typeof t == "object" && t !== null && !Array.isArray(t), n = _e[e == null ? void 0 : e.valueUse] || Ne;
|
|
430
|
+
return a && n(t) || t || void 0;
|
|
426
431
|
}
|
|
427
|
-
const
|
|
428
|
-
const { decision: t, loading: a = !1, textValues:
|
|
432
|
+
const Y = (e) => {
|
|
433
|
+
const { decision: t, loading: a = !1, textValues: n } = e, c = (l) => l && Object.keys(l).length > 0, o = {
|
|
429
434
|
name: (t == null ? void 0 : t.name) || "",
|
|
430
435
|
dataType: (t == null ? void 0 : t.dataType) || "alphabetical",
|
|
431
|
-
value:
|
|
436
|
+
value: D(t),
|
|
432
437
|
valueUse: (t == null ? void 0 : t.valueUse) || "equal"
|
|
433
438
|
};
|
|
434
|
-
return !a && t &&
|
|
439
|
+
return !a && t && n ? /* @__PURE__ */ u(s, { direction: "column", gap: "12px", children: [
|
|
435
440
|
t && /* @__PURE__ */ r(s, { direction: "column", alignItems: "center", children: /* @__PURE__ */ r(
|
|
436
|
-
|
|
441
|
+
N,
|
|
437
442
|
{
|
|
438
|
-
element:
|
|
439
|
-
valueData:
|
|
443
|
+
element: o,
|
|
444
|
+
valueData: D(o),
|
|
440
445
|
type: "decision"
|
|
441
446
|
}
|
|
442
447
|
) }, t.name),
|
|
443
448
|
/* @__PURE__ */ r(w, { dashed: !0 }),
|
|
444
|
-
/* @__PURE__ */ r(
|
|
449
|
+
/* @__PURE__ */ r(G, { children: /* @__PURE__ */ u(
|
|
445
450
|
s,
|
|
446
451
|
{
|
|
447
452
|
direction: "column",
|
|
@@ -457,87 +462,87 @@ const P = (e) => {
|
|
|
457
462
|
appearance: "dark",
|
|
458
463
|
weight: "bold",
|
|
459
464
|
textAlign: "center",
|
|
460
|
-
children:
|
|
465
|
+
children: n.factsThatConditionIt
|
|
461
466
|
}
|
|
462
467
|
),
|
|
463
468
|
t.conditions && t.conditions.map((l) => {
|
|
464
469
|
if (l.hidden) return null;
|
|
465
|
-
const
|
|
466
|
-
return (typeof
|
|
467
|
-
|
|
470
|
+
const i = l.value;
|
|
471
|
+
return (typeof i == "object" && c(i) || i !== void 0 && typeof i == "string" && i.length > 0) && /* @__PURE__ */ r(H, { children: /* @__PURE__ */ r(s, { direction: "column", padding: "8px", children: /* @__PURE__ */ r(
|
|
472
|
+
N,
|
|
468
473
|
{
|
|
469
474
|
element: {
|
|
470
475
|
...l,
|
|
471
|
-
value:
|
|
476
|
+
value: i
|
|
472
477
|
},
|
|
473
|
-
valueData:
|
|
478
|
+
valueData: D(l)
|
|
474
479
|
}
|
|
475
480
|
) }) }, l.name);
|
|
476
481
|
}),
|
|
477
482
|
/* @__PURE__ */ r(w, { dashed: !0 }),
|
|
478
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ u(s, { direction: "column", gap: "12px", children: [
|
|
479
484
|
(t == null ? void 0 : t.startDate) && (t == null ? void 0 : t.endDate) && /* @__PURE__ */ r(
|
|
480
|
-
|
|
485
|
+
N,
|
|
481
486
|
{
|
|
482
487
|
element: {
|
|
483
|
-
name:
|
|
488
|
+
name: n.terms,
|
|
484
489
|
value: String(t.startDate),
|
|
485
490
|
valueUse: b.RANGE,
|
|
486
|
-
dataType:
|
|
491
|
+
dataType: k.DATE
|
|
487
492
|
},
|
|
488
|
-
valueData:
|
|
489
|
-
name:
|
|
493
|
+
valueData: D({
|
|
494
|
+
name: n.terms,
|
|
490
495
|
value: {
|
|
491
496
|
from: String(t.startDate),
|
|
492
497
|
to: String(t.endDate)
|
|
493
498
|
},
|
|
494
499
|
valueUse: b.RANGE,
|
|
495
|
-
dataType:
|
|
500
|
+
dataType: k.DATE
|
|
496
501
|
}),
|
|
497
502
|
type: "decision"
|
|
498
503
|
},
|
|
499
|
-
|
|
504
|
+
n.terms
|
|
500
505
|
),
|
|
501
506
|
(t == null ? void 0 : t.startDate) && !(t != null && t.endDate) && /* @__PURE__ */ r(
|
|
502
|
-
|
|
507
|
+
N,
|
|
503
508
|
{
|
|
504
509
|
element: {
|
|
505
|
-
name:
|
|
510
|
+
name: n.terms,
|
|
506
511
|
value: String(t.startDate),
|
|
507
512
|
valueUse: b.EQUAL,
|
|
508
|
-
dataType:
|
|
513
|
+
dataType: k.DATE
|
|
509
514
|
},
|
|
510
|
-
valueData:
|
|
511
|
-
name:
|
|
515
|
+
valueData: D({
|
|
516
|
+
name: n.terms,
|
|
512
517
|
value: String(t.startDate),
|
|
513
518
|
valueUse: b.EQUAL,
|
|
514
|
-
dataType:
|
|
519
|
+
dataType: k.DATE
|
|
515
520
|
}),
|
|
516
521
|
type: "decision"
|
|
517
522
|
},
|
|
518
|
-
|
|
523
|
+
n.terms
|
|
519
524
|
)
|
|
520
525
|
] })
|
|
521
526
|
]
|
|
522
527
|
}
|
|
523
528
|
) })
|
|
524
|
-
] }) : /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */ r(
|
|
527
|
-
/* @__PURE__ */ r(
|
|
529
|
+
] }) : /* @__PURE__ */ u(s, { direction: "column", gap: "12px", children: [
|
|
530
|
+
/* @__PURE__ */ u(s, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
531
|
+
/* @__PURE__ */ r(T, { animated: !0, width: "180px" }),
|
|
532
|
+
/* @__PURE__ */ r(T, { animated: !0, width: "85px" })
|
|
528
533
|
] }, "loading"),
|
|
529
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ u(s, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
530
535
|
/* @__PURE__ */ r(w, { dashed: !0 }),
|
|
531
|
-
/* @__PURE__ */ r(
|
|
536
|
+
/* @__PURE__ */ r(T, { animated: !0, width: "150px" })
|
|
532
537
|
] }),
|
|
533
|
-
/* @__PURE__ */ r(
|
|
538
|
+
/* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(
|
|
534
539
|
s,
|
|
535
540
|
{
|
|
536
541
|
direction: "column",
|
|
537
542
|
gap: "12px",
|
|
538
543
|
justifyContent: "space-between",
|
|
539
544
|
height: "203px",
|
|
540
|
-
children: Array.from({ length: 5 }).map((l,
|
|
545
|
+
children: Array.from({ length: 5 }).map((l, i) => /* @__PURE__ */ r(H, { children: /* @__PURE__ */ u(
|
|
541
546
|
s,
|
|
542
547
|
{
|
|
543
548
|
direction: "column",
|
|
@@ -545,15 +550,15 @@ const P = (e) => {
|
|
|
545
550
|
alignItems: "start",
|
|
546
551
|
padding: "8px",
|
|
547
552
|
children: [
|
|
548
|
-
/* @__PURE__ */ r(
|
|
549
|
-
/* @__PURE__ */ r(
|
|
553
|
+
/* @__PURE__ */ r(T, { animated: !0, width: "180px" }),
|
|
554
|
+
/* @__PURE__ */ r(T, { animated: !0, width: "85px" })
|
|
550
555
|
]
|
|
551
556
|
}
|
|
552
|
-
) }, `condition-${
|
|
557
|
+
) }, `condition-${i}`))
|
|
553
558
|
}
|
|
554
559
|
) })
|
|
555
560
|
] });
|
|
556
|
-
},
|
|
561
|
+
}, Le = g.div`
|
|
557
562
|
border-radius: 8px;
|
|
558
563
|
border: 1px solid ${v.palette.neutral.N30};
|
|
559
564
|
box-sizing: border-box;
|
|
@@ -584,21 +589,21 @@ g.div`
|
|
|
584
589
|
border-radius: 8px;
|
|
585
590
|
}
|
|
586
591
|
`;
|
|
587
|
-
const
|
|
588
|
-
const { children: t, controls: a = !0, handleDelete:
|
|
589
|
-
return /* @__PURE__ */ r(
|
|
592
|
+
const F = (e) => {
|
|
593
|
+
const { children: t, controls: a = !0, handleDelete: n, id: c } = e;
|
|
594
|
+
return /* @__PURE__ */ r(Le, { children: /* @__PURE__ */ u(s, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
590
595
|
t,
|
|
591
|
-
a && /* @__PURE__ */
|
|
596
|
+
a && /* @__PURE__ */ u(E, { children: [
|
|
592
597
|
/* @__PURE__ */ r(w, {}),
|
|
593
598
|
/* @__PURE__ */ r(s, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ r(
|
|
594
|
-
|
|
599
|
+
Q,
|
|
595
600
|
{
|
|
596
601
|
cursorHover: !0,
|
|
597
602
|
appearance: "dark",
|
|
598
603
|
size: "24px",
|
|
599
|
-
icon: /* @__PURE__ */ r(
|
|
604
|
+
icon: /* @__PURE__ */ r(oe, {}),
|
|
600
605
|
onClick: () => {
|
|
601
|
-
|
|
606
|
+
n(c);
|
|
602
607
|
}
|
|
603
608
|
}
|
|
604
609
|
) })
|
|
@@ -609,7 +614,7 @@ const q = (e) => {
|
|
|
609
614
|
& > div {
|
|
610
615
|
padding: 24px 16px;
|
|
611
616
|
}
|
|
612
|
-
`,
|
|
617
|
+
`, Re = g.div`
|
|
613
618
|
background-color: ${({ theme: e }) => {
|
|
614
619
|
var t, a;
|
|
615
620
|
return ((a = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N0) || v.palette.neutral.N0;
|
|
@@ -640,23 +645,23 @@ const q = (e) => {
|
|
|
640
645
|
background-color: #ebecf0;
|
|
641
646
|
border-radius: 8px;
|
|
642
647
|
}
|
|
643
|
-
`,
|
|
644
|
-
const { children: t, portalId: a, onCloseModal:
|
|
645
|
-
if (!
|
|
648
|
+
`, Ue = (e) => {
|
|
649
|
+
const { children: t, portalId: a, onCloseModal: n, title: c } = e, o = document.getElementById(a);
|
|
650
|
+
if (!o)
|
|
646
651
|
throw new Error(
|
|
647
652
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
648
653
|
);
|
|
649
|
-
return
|
|
650
|
-
/* @__PURE__ */ r(Ve, { children: /* @__PURE__ */ r(
|
|
651
|
-
/* @__PURE__ */ r(s, { direction: "column", gap: "24px", children: /* @__PURE__ */
|
|
652
|
-
/* @__PURE__ */ r(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children:
|
|
653
|
-
/* @__PURE__ */ r(
|
|
654
|
+
return le(
|
|
655
|
+
/* @__PURE__ */ r(Ve, { children: /* @__PURE__ */ r(se, { children: /* @__PURE__ */ r(Re, { children: /* @__PURE__ */ u(s, { direction: "column", gap: "24px", children: [
|
|
656
|
+
/* @__PURE__ */ r(s, { direction: "column", gap: "24px", children: /* @__PURE__ */ u(s, { alignItems: "center", justifyContent: "space-between", children: [
|
|
657
|
+
/* @__PURE__ */ r(x, { type: "title", size: "large", appearance: "dark", weight: "bold", children: c }),
|
|
658
|
+
/* @__PURE__ */ r(ie, { size: "24px", cursor: "pointer", onClick: n })
|
|
654
659
|
] }) }),
|
|
655
660
|
t
|
|
656
661
|
] }) }) }) }),
|
|
657
|
-
|
|
662
|
+
o
|
|
658
663
|
);
|
|
659
|
-
},
|
|
664
|
+
}, Ie = ae`
|
|
660
665
|
from {
|
|
661
666
|
opacity: 0;
|
|
662
667
|
transform: translateY(20px);
|
|
@@ -665,11 +670,11 @@ const q = (e) => {
|
|
|
665
670
|
opacity: 1;
|
|
666
671
|
transform: translateY(0);
|
|
667
672
|
}
|
|
668
|
-
`,
|
|
673
|
+
`, W = g.div`
|
|
669
674
|
width: 100%;
|
|
670
675
|
height: 100%;
|
|
671
676
|
& > div {
|
|
672
|
-
animation: ${
|
|
677
|
+
animation: ${Ie} 600ms ease-out;
|
|
673
678
|
}
|
|
674
679
|
`;
|
|
675
680
|
g.div`
|
|
@@ -684,7 +689,7 @@ g.div`
|
|
|
684
689
|
height: 100%;
|
|
685
690
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
686
691
|
`;
|
|
687
|
-
const
|
|
692
|
+
const Fe = g.div`
|
|
688
693
|
& > div {
|
|
689
694
|
width: 100%;
|
|
690
695
|
height: 100%;
|
|
@@ -704,14 +709,14 @@ const qe = g.div`
|
|
|
704
709
|
border-radius: 8px;
|
|
705
710
|
}
|
|
706
711
|
}
|
|
707
|
-
`,
|
|
712
|
+
`, $e = g.div`
|
|
708
713
|
& > div > div {
|
|
709
714
|
border-radius: 8px;
|
|
710
715
|
border: 1px solid ${v.palette.neutral.N30};
|
|
711
716
|
box-sizing: border-box;
|
|
712
717
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
713
718
|
}
|
|
714
|
-
`,
|
|
719
|
+
`, ze = g.div`
|
|
715
720
|
& > div {
|
|
716
721
|
background-color: ${v.palette.neutral.N30};
|
|
717
722
|
justify-content: center;
|
|
@@ -727,19 +732,19 @@ g.div`
|
|
|
727
732
|
border: 1px solid ${v.palette.neutral.N30};
|
|
728
733
|
}
|
|
729
734
|
`;
|
|
730
|
-
function
|
|
735
|
+
function qe({
|
|
731
736
|
index: e,
|
|
732
737
|
handleOpenModal: t
|
|
733
738
|
}) {
|
|
734
739
|
return /* @__PURE__ */ r(
|
|
735
|
-
|
|
740
|
+
F,
|
|
736
741
|
{
|
|
737
742
|
id: `loading-card-${e}`,
|
|
738
743
|
handleDelete: () => {
|
|
739
744
|
},
|
|
740
745
|
handleView: () => t(),
|
|
741
746
|
controls: !1,
|
|
742
|
-
children: /* @__PURE__ */ r(
|
|
747
|
+
children: /* @__PURE__ */ r(Y, { loading: !0 })
|
|
743
748
|
},
|
|
744
749
|
`loading-card-${e}`
|
|
745
750
|
);
|
|
@@ -748,19 +753,19 @@ function Oe({
|
|
|
748
753
|
decision: e,
|
|
749
754
|
controls: t,
|
|
750
755
|
handleOpenModal: a,
|
|
751
|
-
handleDelete:
|
|
752
|
-
textValues:
|
|
756
|
+
handleDelete: n,
|
|
757
|
+
textValues: c
|
|
753
758
|
}) {
|
|
754
|
-
return e ? /* @__PURE__ */ r(
|
|
759
|
+
return e ? /* @__PURE__ */ r(W, { children: /* @__PURE__ */ u(s, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
755
760
|
/* @__PURE__ */ r(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: e.id }),
|
|
756
761
|
/* @__PURE__ */ r(
|
|
757
|
-
|
|
762
|
+
F,
|
|
758
763
|
{
|
|
759
764
|
id: e.id,
|
|
760
|
-
handleDelete: () =>
|
|
765
|
+
handleDelete: () => n(e.id),
|
|
761
766
|
handleView: () => a(e),
|
|
762
767
|
controls: t,
|
|
763
|
-
children: /* @__PURE__ */ r(
|
|
768
|
+
children: /* @__PURE__ */ r(Y, { decision: e, textValues: c })
|
|
764
769
|
}
|
|
765
770
|
)
|
|
766
771
|
] }) }, e.id) : null;
|
|
@@ -769,18 +774,18 @@ function je({
|
|
|
769
774
|
index: e,
|
|
770
775
|
handleOpenModal: t
|
|
771
776
|
}) {
|
|
772
|
-
return /* @__PURE__ */ r(
|
|
777
|
+
return /* @__PURE__ */ r(W, { children: /* @__PURE__ */ u(s, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
773
778
|
/* @__PURE__ */ r(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
774
|
-
/* @__PURE__ */ r(
|
|
775
|
-
|
|
779
|
+
/* @__PURE__ */ r(ze, { onClick: () => t(), children: /* @__PURE__ */ r(
|
|
780
|
+
F,
|
|
776
781
|
{
|
|
777
782
|
id: `add-decision-${e}`,
|
|
778
783
|
handleDelete: () => {
|
|
779
784
|
},
|
|
780
785
|
handleView: () => t(),
|
|
781
786
|
controls: !1,
|
|
782
|
-
children: /* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */ r(
|
|
787
|
+
children: /* @__PURE__ */ u(s, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
788
|
+
/* @__PURE__ */ r(Q, { appearance: "gray", icon: /* @__PURE__ */ r(de, {}), size: "35px" }),
|
|
784
789
|
/* @__PURE__ */ r(x, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
|
|
785
790
|
] })
|
|
786
791
|
}
|
|
@@ -788,11 +793,11 @@ function je({
|
|
|
788
793
|
] }) }, `add-decision-${e}`);
|
|
789
794
|
}
|
|
790
795
|
const Me = {
|
|
791
|
-
loading:
|
|
796
|
+
loading: qe,
|
|
792
797
|
decision: Oe,
|
|
793
798
|
add: je
|
|
794
799
|
};
|
|
795
|
-
function
|
|
800
|
+
function U(e) {
|
|
796
801
|
const { type: t } = e, a = Me[t];
|
|
797
802
|
return a ? a(e) : null;
|
|
798
803
|
}
|
|
@@ -800,57 +805,57 @@ function He({
|
|
|
800
805
|
controls: e,
|
|
801
806
|
decisions: t,
|
|
802
807
|
loading: a,
|
|
803
|
-
handleOpenModal:
|
|
804
|
-
handleDelete:
|
|
805
|
-
textValues:
|
|
808
|
+
handleOpenModal: n,
|
|
809
|
+
handleDelete: c,
|
|
810
|
+
textValues: o
|
|
806
811
|
}) {
|
|
807
812
|
const l = a ? Array.from({ length: 3 }).map(
|
|
808
|
-
(
|
|
813
|
+
(h, d) => U({
|
|
809
814
|
type: "loading",
|
|
810
815
|
index: d,
|
|
811
816
|
controls: e,
|
|
812
817
|
loading: a,
|
|
813
|
-
handleOpenModal:
|
|
814
|
-
handleDelete:
|
|
815
|
-
textValues:
|
|
818
|
+
handleOpenModal: n,
|
|
819
|
+
handleDelete: c,
|
|
820
|
+
textValues: o
|
|
816
821
|
})
|
|
817
822
|
) : t.map(
|
|
818
|
-
(
|
|
823
|
+
(h) => U({
|
|
819
824
|
type: "decision",
|
|
820
|
-
decision:
|
|
825
|
+
decision: h,
|
|
821
826
|
controls: e,
|
|
822
827
|
loading: a,
|
|
823
|
-
handleOpenModal:
|
|
824
|
-
handleDelete:
|
|
825
|
-
textValues:
|
|
828
|
+
handleOpenModal: n,
|
|
829
|
+
handleDelete: c,
|
|
830
|
+
textValues: o
|
|
826
831
|
})
|
|
827
|
-
),
|
|
828
|
-
return { renderedCards: l, shouldRenderAddCard:
|
|
832
|
+
), i = (t.length === 0 || t.length < Math.floor(window.innerWidth / 300)) && !a && e;
|
|
833
|
+
return { renderedCards: l, shouldRenderAddCard: i };
|
|
829
834
|
}
|
|
830
835
|
const mt = (e) => {
|
|
831
836
|
const {
|
|
832
837
|
controls: t = !0,
|
|
833
838
|
decisions: a,
|
|
834
|
-
textValues:
|
|
835
|
-
decisionTemplate:
|
|
836
|
-
isModalOpen:
|
|
839
|
+
textValues: n,
|
|
840
|
+
decisionTemplate: c,
|
|
841
|
+
isModalOpen: o,
|
|
837
842
|
selectedDecision: l,
|
|
838
|
-
loading:
|
|
839
|
-
handleOpenModal:
|
|
843
|
+
loading: i,
|
|
844
|
+
handleOpenModal: h,
|
|
840
845
|
handleCloseModal: d,
|
|
841
846
|
handleSubmitForm: m,
|
|
842
847
|
handleDelete: p
|
|
843
|
-
} = e, f =
|
|
848
|
+
} = e, f = ue("(max-width: 681px)"), { renderedCards: S, shouldRenderAddCard: A } = He({
|
|
844
849
|
controls: t,
|
|
845
850
|
decisions: a,
|
|
846
|
-
loading:
|
|
847
|
-
handleOpenModal:
|
|
851
|
+
loading: i,
|
|
852
|
+
handleOpenModal: h,
|
|
848
853
|
handleDelete: p,
|
|
849
|
-
textValues:
|
|
854
|
+
textValues: n
|
|
850
855
|
});
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */ r(
|
|
853
|
-
a.length === 0 && !
|
|
856
|
+
return /* @__PURE__ */ u(E, { children: [
|
|
857
|
+
/* @__PURE__ */ r($e, { children: /* @__PURE__ */ r(Fe, { children: /* @__PURE__ */ u(s, { direction: "column", gap: "16px", padding: "6px", children: [
|
|
858
|
+
a.length === 0 && !i && /* @__PURE__ */ u(x, { as: "span", type: "label", size: "large", appearance: "gray", children: [
|
|
854
859
|
"Aún no tienes definidas tasas de interés efectivas. Presiona",
|
|
855
860
|
/* @__PURE__ */ r(
|
|
856
861
|
x,
|
|
@@ -865,8 +870,8 @@ const mt = (e) => {
|
|
|
865
870
|
),
|
|
866
871
|
"para empezar."
|
|
867
872
|
] }),
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
|
|
873
|
+
/* @__PURE__ */ u(
|
|
874
|
+
ce,
|
|
870
875
|
{
|
|
871
876
|
templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
872
877
|
autoFlow: "row dense",
|
|
@@ -878,22 +883,22 @@ const mt = (e) => {
|
|
|
878
883
|
padding: "6px",
|
|
879
884
|
height: f ? "auto" : "484px",
|
|
880
885
|
children: [
|
|
881
|
-
|
|
882
|
-
|
|
886
|
+
S,
|
|
887
|
+
A && U({
|
|
883
888
|
type: "add",
|
|
884
889
|
index: a.length,
|
|
885
890
|
controls: t,
|
|
886
|
-
loading:
|
|
887
|
-
handleOpenModal:
|
|
891
|
+
loading: i,
|
|
892
|
+
handleOpenModal: h,
|
|
888
893
|
handleDelete: p,
|
|
889
|
-
textValues:
|
|
894
|
+
textValues: n
|
|
890
895
|
})
|
|
891
896
|
]
|
|
892
897
|
}
|
|
893
898
|
)
|
|
894
899
|
] }) }) }),
|
|
895
|
-
|
|
896
|
-
|
|
900
|
+
o && /* @__PURE__ */ r(
|
|
901
|
+
Ue,
|
|
897
902
|
{
|
|
898
903
|
portalId: "modal-portal",
|
|
899
904
|
onCloseModal: d,
|
|
@@ -901,9 +906,9 @@ const mt = (e) => {
|
|
|
901
906
|
children: /* @__PURE__ */ r(
|
|
902
907
|
we,
|
|
903
908
|
{
|
|
904
|
-
decision: l ||
|
|
909
|
+
decision: l || c,
|
|
905
910
|
onSubmitEvent: m,
|
|
906
|
-
textValues:
|
|
911
|
+
textValues: n,
|
|
907
912
|
onCancel: () => d()
|
|
908
913
|
}
|
|
909
914
|
)
|
|
@@ -912,9 +917,9 @@ const mt = (e) => {
|
|
|
912
917
|
] });
|
|
913
918
|
};
|
|
914
919
|
export {
|
|
915
|
-
|
|
916
|
-
|
|
920
|
+
F as BusinessRuleCard,
|
|
921
|
+
Y as BusinessRuleView,
|
|
917
922
|
mt as BusinessRules,
|
|
918
|
-
|
|
923
|
+
Ue as ModalRules,
|
|
919
924
|
we as RulesForm
|
|
920
925
|
};
|