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