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