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