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