@isettingkit/business-rules 0.1.16 → 0.1.17
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 +117 -119
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as g, jsx as n, Fragment as
|
|
1
|
+
import { jsxs as g, jsx as n, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { useFormik as Q } from "formik";
|
|
3
3
|
import { useState as x, useEffect as q } from "react";
|
|
4
|
-
import { Divider as
|
|
4
|
+
import { Divider as w } from "@inubekit/divider";
|
|
5
5
|
import { Stack as o } from "@inubekit/stack";
|
|
6
6
|
import { Text as y } from "@inubekit/text";
|
|
7
7
|
import { Toggle as P } from "@inubekit/toggle";
|
|
8
|
-
import { ValueHowToSetUp as f, ValueDataType as
|
|
9
|
-
import { Textarea as
|
|
10
|
-
import { Date as
|
|
11
|
-
import { Checkbox as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { object as $, string as
|
|
8
|
+
import { ValueHowToSetUp as f, ValueDataType as A, DecisionConditionRenderer as M } from "@isettingkit/input";
|
|
9
|
+
import { Textarea as Z } from "@inubekit/textarea";
|
|
10
|
+
import { Date as z } from "@inubekit/date";
|
|
11
|
+
import { Checkbox as J } from "@inubekit/checkbox";
|
|
12
|
+
import { Button as L } from "@inubekit/button";
|
|
13
|
+
import { object as $, string as H, number as F, mixed as I } from "yup";
|
|
14
14
|
import { DecisionViewConditionRenderer as V } from "@isettingkit/view";
|
|
15
|
-
import { MdOutlineRemoveRedEye as
|
|
16
|
-
import { Icon as
|
|
17
|
-
import { inube as
|
|
15
|
+
import { MdOutlineRemoveRedEye as K, MdOutlineDelete as W } from "react-icons/md";
|
|
16
|
+
import { Icon as N } from "@inubekit/icon";
|
|
17
|
+
import { inube as X } from "@inubekit/foundations";
|
|
18
18
|
import B from "styled-components";
|
|
19
|
-
const
|
|
19
|
+
const Y = (t) => {
|
|
20
20
|
const {
|
|
21
21
|
label: e,
|
|
22
22
|
labelText: a,
|
|
23
23
|
onHandleChange: i,
|
|
24
24
|
placeholder: l,
|
|
25
|
-
required:
|
|
25
|
+
required: s,
|
|
26
26
|
value: m = ""
|
|
27
27
|
} = t, [d, b] = x(m);
|
|
28
28
|
return /* @__PURE__ */ g(o, { direction: "column", margin: "10px 4px", children: [
|
|
29
29
|
/* @__PURE__ */ n(y, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: a }),
|
|
30
30
|
/* @__PURE__ */ n(o, { margin: "10px 0", children: /* @__PURE__ */ n(
|
|
31
|
-
|
|
31
|
+
Z,
|
|
32
32
|
{
|
|
33
33
|
id: "reasonChange",
|
|
34
34
|
label: e,
|
|
@@ -36,20 +36,20 @@ const ee = (t) => {
|
|
|
36
36
|
b(p.target.value), i(p);
|
|
37
37
|
},
|
|
38
38
|
placeholder: l,
|
|
39
|
-
required:
|
|
39
|
+
required: s,
|
|
40
40
|
value: d,
|
|
41
41
|
maxLength: 120,
|
|
42
42
|
fullwidth: !0
|
|
43
43
|
}
|
|
44
44
|
) })
|
|
45
45
|
] });
|
|
46
|
-
},
|
|
46
|
+
}, ee = (t) => {
|
|
47
47
|
const {
|
|
48
48
|
checked: e,
|
|
49
49
|
children: a,
|
|
50
50
|
handleToggleChange: i,
|
|
51
51
|
id: l,
|
|
52
|
-
labelToggle:
|
|
52
|
+
labelToggle: s,
|
|
53
53
|
name: m,
|
|
54
54
|
valueToggle: d = ""
|
|
55
55
|
} = t, [b, C] = x(e), p = (v) => {
|
|
@@ -57,7 +57,7 @@ const ee = (t) => {
|
|
|
57
57
|
};
|
|
58
58
|
return q(() => {
|
|
59
59
|
C(e);
|
|
60
|
-
}, [e]), /* @__PURE__ */ g(
|
|
60
|
+
}, [e]), /* @__PURE__ */ g(j, { children: [
|
|
61
61
|
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
62
62
|
P,
|
|
63
63
|
{
|
|
@@ -68,23 +68,23 @@ const ee = (t) => {
|
|
|
68
68
|
onChange: p,
|
|
69
69
|
size: "small",
|
|
70
70
|
value: d,
|
|
71
|
-
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children:
|
|
71
|
+
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: s })
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
74
|
-
b && /* @__PURE__ */ n(
|
|
74
|
+
b && /* @__PURE__ */ n(j, { children: a })
|
|
75
75
|
] });
|
|
76
|
-
},
|
|
76
|
+
}, ne = (t) => {
|
|
77
77
|
const {
|
|
78
78
|
onHandleStartChange: e,
|
|
79
79
|
onHandleEndChange: a,
|
|
80
80
|
labelStart: i,
|
|
81
81
|
labelEnd: l,
|
|
82
|
-
checkedClosed:
|
|
82
|
+
checkedClosed: s = !1,
|
|
83
83
|
required: m = !1,
|
|
84
84
|
valueStart: d = "",
|
|
85
85
|
valueEnd: b = ""
|
|
86
|
-
} = t, [C, p] = x(
|
|
87
|
-
return /* @__PURE__ */ g(
|
|
86
|
+
} = t, [C, p] = x(s), [v, E] = x(d), [S, T] = x(b);
|
|
87
|
+
return /* @__PURE__ */ g(j, { children: [
|
|
88
88
|
/* @__PURE__ */ g(o, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
89
89
|
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
90
90
|
y,
|
|
@@ -105,11 +105,11 @@ const ee = (t) => {
|
|
|
105
105
|
wrap: "wrap",
|
|
106
106
|
gap: "4px",
|
|
107
107
|
children: /* @__PURE__ */ n(
|
|
108
|
-
|
|
108
|
+
J,
|
|
109
109
|
{
|
|
110
110
|
label: "Cerrada",
|
|
111
|
-
onChange: ({ target:
|
|
112
|
-
p(
|
|
111
|
+
onChange: ({ target: c }) => {
|
|
112
|
+
p(c.checked);
|
|
113
113
|
},
|
|
114
114
|
checked: C,
|
|
115
115
|
value: ""
|
|
@@ -120,12 +120,12 @@ const ee = (t) => {
|
|
|
120
120
|
] }),
|
|
121
121
|
/* @__PURE__ */ g(o, { justifyContent: "space-between", gap: "24px", children: [
|
|
122
122
|
/* @__PURE__ */ n(o, { width: "189px", children: /* @__PURE__ */ n(
|
|
123
|
-
|
|
123
|
+
z,
|
|
124
124
|
{
|
|
125
125
|
id: "dateStart",
|
|
126
126
|
label: i,
|
|
127
|
-
onChange: (
|
|
128
|
-
|
|
127
|
+
onChange: (c) => {
|
|
128
|
+
E(c.target.value), e(c);
|
|
129
129
|
},
|
|
130
130
|
value: v,
|
|
131
131
|
required: m,
|
|
@@ -133,12 +133,12 @@ const ee = (t) => {
|
|
|
133
133
|
}
|
|
134
134
|
) }),
|
|
135
135
|
C && /* @__PURE__ */ n(o, { width: "189px", children: /* @__PURE__ */ n(
|
|
136
|
-
|
|
136
|
+
z,
|
|
137
137
|
{
|
|
138
138
|
id: "dateEnd",
|
|
139
139
|
label: l,
|
|
140
|
-
onChange: (
|
|
141
|
-
T(
|
|
140
|
+
onChange: (c) => {
|
|
141
|
+
T(c.target.value), a(c);
|
|
142
142
|
},
|
|
143
143
|
value: S,
|
|
144
144
|
required: m,
|
|
@@ -147,28 +147,28 @@ const ee = (t) => {
|
|
|
147
147
|
) })
|
|
148
148
|
] })
|
|
149
149
|
] });
|
|
150
|
-
},
|
|
150
|
+
}, _ = (t) => {
|
|
151
151
|
if ("value" in t && "valueUse" in t && t.value !== void 0) {
|
|
152
152
|
const e = t.value, a = 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 : 1 / 0;
|
|
153
153
|
switch (t.valueUse) {
|
|
154
154
|
case f.LIST_OF_VALUES:
|
|
155
155
|
return {
|
|
156
|
-
schema:
|
|
156
|
+
schema: I().test(
|
|
157
157
|
"isArrayOrString",
|
|
158
158
|
"Must be an array of strings/numbers or a single string",
|
|
159
159
|
(l) => Array.isArray(l) ? l.every(
|
|
160
|
-
(
|
|
160
|
+
(s) => typeof s == "string" || typeof s == "number"
|
|
161
161
|
) : typeof l == "string"
|
|
162
162
|
),
|
|
163
163
|
value: e
|
|
164
164
|
};
|
|
165
165
|
case f.LIST_OF_VALUES_MULTI:
|
|
166
166
|
return {
|
|
167
|
-
schema:
|
|
167
|
+
schema: I().test(
|
|
168
168
|
"isArrayOrString",
|
|
169
169
|
"Must be an array of strings/numbers or a single string",
|
|
170
170
|
(l) => Array.isArray(l) ? l.every(
|
|
171
|
-
(
|
|
171
|
+
(s) => typeof s == "string" || typeof s == "number"
|
|
172
172
|
) : typeof l == "string"
|
|
173
173
|
),
|
|
174
174
|
value: e
|
|
@@ -176,8 +176,8 @@ const ee = (t) => {
|
|
|
176
176
|
case f.RANGE:
|
|
177
177
|
return {
|
|
178
178
|
schema: $({
|
|
179
|
-
from:
|
|
180
|
-
to:
|
|
179
|
+
from: F().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
180
|
+
to: F().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
|
|
181
181
|
}),
|
|
182
182
|
value: {
|
|
183
183
|
from: a,
|
|
@@ -187,31 +187,31 @@ const ee = (t) => {
|
|
|
187
187
|
case f.GREATER_THAN:
|
|
188
188
|
case f.LESS_THAN:
|
|
189
189
|
case f.EQUAL:
|
|
190
|
-
return t.dataType ===
|
|
191
|
-
schema:
|
|
190
|
+
return t.dataType === A.PERCENTAGE ? {
|
|
191
|
+
schema: F().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
192
192
|
value: e
|
|
193
193
|
} : {
|
|
194
|
-
schema:
|
|
194
|
+
schema: H().required("Required"),
|
|
195
195
|
value: e
|
|
196
196
|
};
|
|
197
197
|
default:
|
|
198
198
|
return {
|
|
199
|
-
schema:
|
|
199
|
+
schema: H(),
|
|
200
200
|
value: void 0
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, te = (t) => {
|
|
205
205
|
const e = {}, a = {};
|
|
206
206
|
if (t) {
|
|
207
|
-
const i =
|
|
207
|
+
const i = _(t);
|
|
208
208
|
i && (e[t.name] = i.schema, a[t.name] = i.value);
|
|
209
209
|
}
|
|
210
210
|
return t.conditions && t.conditions.forEach((i) => {
|
|
211
|
-
const l =
|
|
211
|
+
const l = _(i);
|
|
212
212
|
l && (e[i.name] = l.schema, a[i.name] = l.value);
|
|
213
213
|
}), { validationSchema: $().shape(e), initialValues: a };
|
|
214
|
-
},
|
|
214
|
+
}, U = (t) => {
|
|
215
215
|
if (typeof t == "string")
|
|
216
216
|
return t;
|
|
217
217
|
if (typeof t == "object" && ("from" in t || "to" in t))
|
|
@@ -221,47 +221,47 @@ const ee = (t) => {
|
|
|
221
221
|
};
|
|
222
222
|
for (const e in t)
|
|
223
223
|
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
224
|
-
const a =
|
|
224
|
+
const a = U(t[e]);
|
|
225
225
|
if (a) return a;
|
|
226
226
|
}
|
|
227
227
|
return "";
|
|
228
|
-
},
|
|
228
|
+
}, ae = (t) => {
|
|
229
229
|
const {
|
|
230
230
|
decision: e,
|
|
231
231
|
formik: a,
|
|
232
232
|
onChangeCondition: i,
|
|
233
233
|
onChangeDecision: l,
|
|
234
|
-
onStartChange:
|
|
234
|
+
onStartChange: s,
|
|
235
235
|
onEndChange: m,
|
|
236
236
|
textValues: d,
|
|
237
237
|
onCancel: b,
|
|
238
238
|
onSubmit: C
|
|
239
|
-
} = t, [p, v] = x(!1), [
|
|
239
|
+
} = t, [p, v] = x(!1), [E, S] = x(!0), T = {
|
|
240
240
|
name: e.name,
|
|
241
241
|
dataType: e.dataType,
|
|
242
|
-
value: e.
|
|
242
|
+
value: e.value,
|
|
243
243
|
valueUse: e.valueUse,
|
|
244
244
|
possibleValue: e.possibleValue
|
|
245
245
|
};
|
|
246
246
|
q(() => {
|
|
247
247
|
console.log("Updated formik.errors in RulesFormUI:", a.errors);
|
|
248
248
|
}, [a.errors]);
|
|
249
|
-
const
|
|
249
|
+
const k = (r) => {
|
|
250
250
|
v(r.target.checked);
|
|
251
|
-
},
|
|
251
|
+
}, D = (r) => {
|
|
252
252
|
r.target.value ? S(!1) : S(!0);
|
|
253
253
|
}, u = (r) => {
|
|
254
|
-
const h =
|
|
254
|
+
const h = U(a.errors[r] || {});
|
|
255
255
|
return typeof h == "string" ? h ? "invalid" : "pending" : h;
|
|
256
|
-
},
|
|
257
|
-
const h =
|
|
256
|
+
}, c = (r) => {
|
|
257
|
+
const h = U(a.errors[r] || {});
|
|
258
258
|
return h;
|
|
259
259
|
};
|
|
260
260
|
return /* @__PURE__ */ g(o, { direction: "column", gap: "24px", children: [
|
|
261
|
-
/* @__PURE__ */ g(o, { direction: "column", gap: "
|
|
261
|
+
/* @__PURE__ */ g(o, { direction: "column", gap: "16px", children: [
|
|
262
262
|
/* @__PURE__ */ n(y, { weight: "bold", size: "medium", children: d.criteria }),
|
|
263
263
|
e && /* @__PURE__ */ n(
|
|
264
|
-
|
|
264
|
+
M,
|
|
265
265
|
{
|
|
266
266
|
element: T,
|
|
267
267
|
onDecision: l,
|
|
@@ -277,7 +277,7 @@ const ee = (t) => {
|
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
] }),
|
|
280
|
-
/* @__PURE__ */ n(
|
|
280
|
+
/* @__PURE__ */ n(w, { dashed: !0 }),
|
|
281
281
|
/* @__PURE__ */ g(o, { direction: "column", children: [
|
|
282
282
|
/* @__PURE__ */ g(o, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
283
283
|
/* @__PURE__ */ n(y, { children: d.factsThatConditionIt }),
|
|
@@ -285,7 +285,7 @@ const ee = (t) => {
|
|
|
285
285
|
P,
|
|
286
286
|
{
|
|
287
287
|
id: "toogleNone",
|
|
288
|
-
onChange:
|
|
288
|
+
onChange: k,
|
|
289
289
|
checked: p,
|
|
290
290
|
size: "small",
|
|
291
291
|
children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: d.none })
|
|
@@ -293,7 +293,7 @@ const ee = (t) => {
|
|
|
293
293
|
)
|
|
294
294
|
] }),
|
|
295
295
|
e.conditions && e.conditions.map((r) => /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
296
|
-
|
|
296
|
+
ee,
|
|
297
297
|
{
|
|
298
298
|
checked: !p,
|
|
299
299
|
handleToggleChange: (h) => {
|
|
@@ -311,12 +311,12 @@ const ee = (t) => {
|
|
|
311
311
|
labelToggle: r.name.split(/(?=[A-Z])/).join(" "),
|
|
312
312
|
name: r.name.replace(" ", ""),
|
|
313
313
|
children: /* @__PURE__ */ n(
|
|
314
|
-
|
|
314
|
+
M,
|
|
315
315
|
{
|
|
316
316
|
element: r,
|
|
317
317
|
onDecision: i,
|
|
318
318
|
valueData: a.values[r.name],
|
|
319
|
-
message:
|
|
319
|
+
message: c(r.name),
|
|
320
320
|
status: u(r.name),
|
|
321
321
|
textValues: {
|
|
322
322
|
selectOptions: "Select an option",
|
|
@@ -329,22 +329,22 @@ const ee = (t) => {
|
|
|
329
329
|
}
|
|
330
330
|
) }, r.name))
|
|
331
331
|
] }),
|
|
332
|
-
/* @__PURE__ */ n(
|
|
332
|
+
/* @__PURE__ */ n(w, { dashed: !0 }),
|
|
333
333
|
/* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
334
|
-
|
|
334
|
+
Y,
|
|
335
335
|
{
|
|
336
336
|
label: d.reasonForChange,
|
|
337
337
|
labelText: d.change,
|
|
338
|
-
onHandleChange:
|
|
338
|
+
onHandleChange: D,
|
|
339
339
|
placeholder: d.changePlaceholder,
|
|
340
340
|
required: !0
|
|
341
341
|
}
|
|
342
342
|
) }),
|
|
343
|
-
/* @__PURE__ */ n(
|
|
343
|
+
/* @__PURE__ */ n(w, { dashed: !0 }),
|
|
344
344
|
/* @__PURE__ */ n(o, { direction: "column", children: e && /* @__PURE__ */ n(
|
|
345
|
-
|
|
345
|
+
ne,
|
|
346
346
|
{
|
|
347
|
-
onHandleStartChange: (r) =>
|
|
347
|
+
onHandleStartChange: (r) => s(r.target.value),
|
|
348
348
|
onHandleEndChange: (r) => m(r.target.value),
|
|
349
349
|
labelStart: d.termStart,
|
|
350
350
|
labelEnd: d.termEnd,
|
|
@@ -353,14 +353,14 @@ const ee = (t) => {
|
|
|
353
353
|
valueEnd: String(e.endDate) || ""
|
|
354
354
|
}
|
|
355
355
|
) }),
|
|
356
|
-
/* @__PURE__ */ n(
|
|
356
|
+
/* @__PURE__ */ n(w, { dashed: !0 }),
|
|
357
357
|
/* @__PURE__ */ g(o, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
358
|
-
/* @__PURE__ */ n(
|
|
358
|
+
/* @__PURE__ */ n(L, { appearance: "gray", onClick: b, children: d.cancel }),
|
|
359
359
|
/* @__PURE__ */ n(
|
|
360
|
-
|
|
360
|
+
L,
|
|
361
361
|
{
|
|
362
362
|
onClick: C,
|
|
363
|
-
disabled:
|
|
363
|
+
disabled: E || !a.isValid,
|
|
364
364
|
type: "submit",
|
|
365
365
|
children: d.confirm
|
|
366
366
|
}
|
|
@@ -368,34 +368,34 @@ const ee = (t) => {
|
|
|
368
368
|
] })
|
|
369
369
|
] });
|
|
370
370
|
}, ke = (t) => {
|
|
371
|
-
const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues:
|
|
372
|
-
|
|
373
|
-
}, C = (u,
|
|
371
|
+
const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues: s } = t, [m, d] = x(a), b = (u, c) => {
|
|
372
|
+
k.setFieldValue(u, c), k.validateField(u);
|
|
373
|
+
}, C = (u, c) => {
|
|
374
374
|
const r = u instanceof Date ? u.toISOString() : u;
|
|
375
375
|
d((h) => {
|
|
376
376
|
if (!h.conditions)
|
|
377
377
|
return h;
|
|
378
|
-
const G = h.conditions.map((
|
|
378
|
+
const G = h.conditions.map((O) => O.name === c ? { ...O, value: r } : O);
|
|
379
379
|
return {
|
|
380
380
|
...h,
|
|
381
381
|
conditions: G
|
|
382
382
|
};
|
|
383
|
-
}), b(
|
|
383
|
+
}), b(c, r);
|
|
384
384
|
}, p = (u) => {
|
|
385
385
|
d(
|
|
386
|
-
(
|
|
386
|
+
(c) => D(c, "value", u)
|
|
387
387
|
);
|
|
388
388
|
}, v = (u) => {
|
|
389
389
|
d(
|
|
390
|
-
(
|
|
390
|
+
(c) => D(c, "endDate", u)
|
|
391
391
|
);
|
|
392
|
-
},
|
|
392
|
+
}, E = (u) => {
|
|
393
393
|
d(
|
|
394
|
-
(
|
|
394
|
+
(c) => D(c, "startDate", u)
|
|
395
395
|
);
|
|
396
|
-
}, { validationSchema: S, initialValues: T } =
|
|
396
|
+
}, { validationSchema: S, initialValues: T } = te(m);
|
|
397
397
|
S.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((u) => console.log("Validation failed:", u.errors));
|
|
398
|
-
const
|
|
398
|
+
const k = Q({
|
|
399
399
|
initialValues: T,
|
|
400
400
|
validationSchema: S,
|
|
401
401
|
validateOnChange: !0,
|
|
@@ -403,27 +403,27 @@ const ee = (t) => {
|
|
|
403
403
|
onSubmit: () => {
|
|
404
404
|
l(m);
|
|
405
405
|
}
|
|
406
|
-
}),
|
|
406
|
+
}), D = (u, c, r) => ({
|
|
407
407
|
...u,
|
|
408
408
|
...u.decision,
|
|
409
|
-
[
|
|
409
|
+
[c]: r
|
|
410
410
|
});
|
|
411
411
|
return /* @__PURE__ */ n(
|
|
412
|
-
|
|
412
|
+
ae,
|
|
413
413
|
{
|
|
414
414
|
id: e,
|
|
415
|
-
formik:
|
|
415
|
+
formik: k,
|
|
416
416
|
decision: m,
|
|
417
417
|
onCancel: i,
|
|
418
418
|
onSubmit: () => l(m),
|
|
419
419
|
onChangeCondition: C,
|
|
420
420
|
onChangeDecision: p,
|
|
421
|
-
onStartChange:
|
|
421
|
+
onStartChange: E,
|
|
422
422
|
onEndChange: v,
|
|
423
|
-
textValues:
|
|
423
|
+
textValues: s
|
|
424
424
|
}
|
|
425
425
|
);
|
|
426
|
-
},
|
|
426
|
+
}, R = (t) => {
|
|
427
427
|
if (!t)
|
|
428
428
|
return;
|
|
429
429
|
const e = t.value;
|
|
@@ -444,11 +444,11 @@ const ee = (t) => {
|
|
|
444
444
|
return e.value;
|
|
445
445
|
}
|
|
446
446
|
return e;
|
|
447
|
-
},
|
|
448
|
-
const { decision: e, textValues: a } = t, i = (
|
|
447
|
+
}, De = (t) => {
|
|
448
|
+
const { decision: e, textValues: a } = t, i = (s) => s && Object.keys(s).length > 0, l = {
|
|
449
449
|
name: e.name,
|
|
450
450
|
dataType: e.dataType,
|
|
451
|
-
value: e
|
|
451
|
+
value: R(e),
|
|
452
452
|
valueUse: e.valueUse
|
|
453
453
|
};
|
|
454
454
|
return /* @__PURE__ */ g(o, { direction: "column", gap: "24px", children: [
|
|
@@ -458,24 +458,24 @@ const ee = (t) => {
|
|
|
458
458
|
V,
|
|
459
459
|
{
|
|
460
460
|
element: l,
|
|
461
|
-
valueData:
|
|
461
|
+
valueData: R(l)
|
|
462
462
|
}
|
|
463
463
|
) }, e.name) })
|
|
464
464
|
] }),
|
|
465
465
|
/* @__PURE__ */ g(o, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
466
466
|
/* @__PURE__ */ n(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: a.factsThatConditionIt }),
|
|
467
|
-
e.conditions && e.conditions.map((
|
|
468
|
-
const m =
|
|
467
|
+
e.conditions && e.conditions.map((s) => {
|
|
468
|
+
const m = s.value;
|
|
469
469
|
return (typeof m == "object" && i(m) || m) && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
470
470
|
V,
|
|
471
471
|
{
|
|
472
472
|
element: {
|
|
473
|
-
...
|
|
473
|
+
...s,
|
|
474
474
|
value: m
|
|
475
475
|
},
|
|
476
|
-
valueData:
|
|
476
|
+
valueData: R(s)
|
|
477
477
|
}
|
|
478
|
-
) },
|
|
478
|
+
) }, s.name);
|
|
479
479
|
})
|
|
480
480
|
] }),
|
|
481
481
|
/* @__PURE__ */ g(o, { direction: "column", gap: "12px", children: [
|
|
@@ -488,11 +488,9 @@ const ee = (t) => {
|
|
|
488
488
|
name: "Fecha de inicio",
|
|
489
489
|
value: String(e.startDate),
|
|
490
490
|
valueUse: f.EQUAL,
|
|
491
|
-
dataType:
|
|
491
|
+
dataType: A.DATE
|
|
492
492
|
},
|
|
493
|
-
valueData:
|
|
494
|
-
"en-CA"
|
|
495
|
-
)
|
|
493
|
+
valueData: String(e.startDate)
|
|
496
494
|
},
|
|
497
495
|
"startDate"
|
|
498
496
|
),
|
|
@@ -503,25 +501,25 @@ const ee = (t) => {
|
|
|
503
501
|
name: "Fecha de final",
|
|
504
502
|
value: String(e.endDate),
|
|
505
503
|
valueUse: f.EQUAL,
|
|
506
|
-
dataType:
|
|
504
|
+
dataType: A.DATE
|
|
507
505
|
},
|
|
508
|
-
valueData:
|
|
506
|
+
valueData: String(e.endDate)
|
|
509
507
|
},
|
|
510
508
|
"endDate"
|
|
511
509
|
)
|
|
512
510
|
] })
|
|
513
511
|
] })
|
|
514
512
|
] });
|
|
515
|
-
},
|
|
513
|
+
}, re = B.div`
|
|
516
514
|
border-radius: 8px;
|
|
517
|
-
border: 1px solid ${
|
|
515
|
+
border: 1px solid ${X.palette.neutral.N30};
|
|
518
516
|
box-sizing: border-box;
|
|
519
517
|
display: flex;
|
|
520
518
|
flex-direction: column;
|
|
521
519
|
height: 340px;
|
|
522
520
|
width: 332px;
|
|
523
521
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
524
|
-
`,
|
|
522
|
+
`, oe = B.div`
|
|
525
523
|
width: 100%;
|
|
526
524
|
height: 100%;
|
|
527
525
|
overflow-y: auto;
|
|
@@ -541,30 +539,30 @@ const ee = (t) => {
|
|
|
541
539
|
}
|
|
542
540
|
`, Ee = (t) => {
|
|
543
541
|
const { children: e, handleDelete: a, handleView: i, id: l } = t;
|
|
544
|
-
return /* @__PURE__ */ g(
|
|
545
|
-
/* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(
|
|
542
|
+
return /* @__PURE__ */ g(re, { children: [
|
|
543
|
+
/* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(oe, { children: /* @__PURE__ */ n(o, { direction: "column", margin: "10px", children: e }) }) }),
|
|
546
544
|
/* @__PURE__ */ g(o, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
547
|
-
/* @__PURE__ */ n(
|
|
545
|
+
/* @__PURE__ */ n(w, {}),
|
|
548
546
|
/* @__PURE__ */ g(o, { gap: "16px", justifyContent: "end", children: [
|
|
549
547
|
/* @__PURE__ */ n(
|
|
550
|
-
|
|
548
|
+
N,
|
|
551
549
|
{
|
|
552
550
|
appearance: "dark",
|
|
553
551
|
size: "24px",
|
|
554
552
|
cursorHover: !0,
|
|
555
|
-
icon: /* @__PURE__ */ n(
|
|
553
|
+
icon: /* @__PURE__ */ n(K, {}),
|
|
556
554
|
onClick: () => {
|
|
557
555
|
i(l);
|
|
558
556
|
}
|
|
559
557
|
}
|
|
560
558
|
),
|
|
561
559
|
/* @__PURE__ */ n(
|
|
562
|
-
|
|
560
|
+
N,
|
|
563
561
|
{
|
|
564
562
|
cursorHover: !0,
|
|
565
563
|
appearance: "dark",
|
|
566
564
|
size: "24px",
|
|
567
|
-
icon: /* @__PURE__ */ n(
|
|
565
|
+
icon: /* @__PURE__ */ n(W, {}),
|
|
568
566
|
onClick: () => {
|
|
569
567
|
a(l);
|
|
570
568
|
}
|
|
@@ -576,6 +574,6 @@ const ee = (t) => {
|
|
|
576
574
|
};
|
|
577
575
|
export {
|
|
578
576
|
Ee as BusinessRuleCard,
|
|
579
|
-
|
|
577
|
+
De as BusinessRuleView,
|
|
580
578
|
ke as RulesForm
|
|
581
579
|
};
|
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.17",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@inubekit/text": "^2.17.0",
|
|
49
49
|
"@inubekit/textarea": "^2.45.0",
|
|
50
50
|
"@inubekit/toggle": "^3.8.2",
|
|
51
|
-
"@isettingkit/input": "^0.1.
|
|
52
|
-
"@isettingkit/view": "^0.1.
|
|
51
|
+
"@isettingkit/input": "^0.1.26",
|
|
52
|
+
"@isettingkit/view": "^0.1.14"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"formik": "^2.4.6",
|