@isettingkit/business-rules 0.1.12 → 0.1.13
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.d.ts +6 -4
- package/dist/index.es.js +149 -149
- package/package.json +2 -2
package/dist/index.es.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare interface IBusinessRuleView {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
declare interface ICondition {
|
|
24
|
-
description: string;
|
|
25
24
|
valueUse: (typeof ValueHowToSetUp)[keyof typeof ValueHowToSetUp];
|
|
26
25
|
name: string;
|
|
27
26
|
value?: string | string[] | number | IValue | undefined;
|
|
@@ -29,7 +28,6 @@ declare interface ICondition {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
declare interface IDecision {
|
|
32
|
-
description: string;
|
|
33
31
|
endDate?: Date;
|
|
34
32
|
valueUse: (typeof ValueHowToSetUp)[keyof typeof ValueHowToSetUp];
|
|
35
33
|
name: string;
|
|
@@ -40,11 +38,15 @@ declare interface IDecision {
|
|
|
40
38
|
|
|
41
39
|
declare interface IRuleDecision_2 {
|
|
42
40
|
id?: string;
|
|
41
|
+
endDate?: Date;
|
|
42
|
+
valueUse: (typeof ValueHowToSetUp)[keyof typeof ValueHowToSetUp];
|
|
43
|
+
name: string;
|
|
44
|
+
value?: string | string[] | number | IValue | undefined;
|
|
45
|
+
startDate?: Date;
|
|
46
|
+
dataType: (typeof ValueDataType)[keyof typeof ValueDataType];
|
|
43
47
|
conditions?: ICondition[];
|
|
44
48
|
decision?: IDecision;
|
|
45
49
|
decisions?: IDecision[];
|
|
46
|
-
startDate?: Date;
|
|
47
|
-
endDate?: Date;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
export declare interface IRulesForm {
|
package/dist/index.es.js
CHANGED
|
@@ -16,17 +16,17 @@ import { MdOutlineRemoveRedEye as J, MdOutlineDelete as K } from "react-icons/md
|
|
|
16
16
|
import { Icon as I } from "@inubekit/icon";
|
|
17
17
|
import { inube as W } from "@inubekit/foundations";
|
|
18
18
|
import G from "styled-components";
|
|
19
|
-
const X = (
|
|
19
|
+
const X = (a) => {
|
|
20
20
|
const {
|
|
21
21
|
label: e,
|
|
22
|
-
labelText:
|
|
22
|
+
labelText: t,
|
|
23
23
|
onHandleChange: i,
|
|
24
|
-
placeholder:
|
|
25
|
-
required:
|
|
26
|
-
value:
|
|
27
|
-
} =
|
|
24
|
+
placeholder: l,
|
|
25
|
+
required: d,
|
|
26
|
+
value: g = ""
|
|
27
|
+
} = a, [s, b] = y(g);
|
|
28
28
|
return /* @__PURE__ */ m(o, { direction: "column", margin: "10px 4px", children: [
|
|
29
|
-
/* @__PURE__ */ n(x, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children:
|
|
29
|
+
/* @__PURE__ */ n(x, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: t }),
|
|
30
30
|
/* @__PURE__ */ n(o, { margin: "10px 0", children: /* @__PURE__ */ n(
|
|
31
31
|
P,
|
|
32
32
|
{
|
|
@@ -35,24 +35,24 @@ const X = (t) => {
|
|
|
35
35
|
onChange: (p) => {
|
|
36
36
|
b(p.target.value), i(p);
|
|
37
37
|
},
|
|
38
|
-
placeholder:
|
|
39
|
-
required:
|
|
40
|
-
value:
|
|
38
|
+
placeholder: l,
|
|
39
|
+
required: d,
|
|
40
|
+
value: s,
|
|
41
41
|
maxLength: 120,
|
|
42
42
|
fullwidth: !0
|
|
43
43
|
}
|
|
44
44
|
) })
|
|
45
45
|
] });
|
|
46
|
-
}, Y = (
|
|
46
|
+
}, Y = (a) => {
|
|
47
47
|
const {
|
|
48
48
|
checked: e,
|
|
49
|
-
children:
|
|
49
|
+
children: t,
|
|
50
50
|
handleToggleChange: i,
|
|
51
|
-
id:
|
|
52
|
-
labelToggle:
|
|
53
|
-
name:
|
|
54
|
-
valueToggle:
|
|
55
|
-
} =
|
|
51
|
+
id: l,
|
|
52
|
+
labelToggle: d,
|
|
53
|
+
name: g,
|
|
54
|
+
valueToggle: s = ""
|
|
55
|
+
} = a, [b, C] = y(e), p = (v) => {
|
|
56
56
|
C(v.target.checked), i(v);
|
|
57
57
|
};
|
|
58
58
|
return q(() => {
|
|
@@ -62,28 +62,28 @@ const X = (t) => {
|
|
|
62
62
|
$,
|
|
63
63
|
{
|
|
64
64
|
checked: b,
|
|
65
|
-
id:
|
|
65
|
+
id: l,
|
|
66
66
|
margin: "10px",
|
|
67
|
-
name:
|
|
67
|
+
name: g,
|
|
68
68
|
onChange: p,
|
|
69
69
|
size: "small",
|
|
70
|
-
value:
|
|
71
|
-
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children:
|
|
70
|
+
value: s,
|
|
71
|
+
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children: d })
|
|
72
72
|
}
|
|
73
73
|
) }),
|
|
74
|
-
b && /* @__PURE__ */ n(j, { children:
|
|
74
|
+
b && /* @__PURE__ */ n(j, { children: t })
|
|
75
75
|
] });
|
|
76
|
-
}, ee = (
|
|
76
|
+
}, ee = (a) => {
|
|
77
77
|
const {
|
|
78
78
|
onHandleStartChange: e,
|
|
79
|
-
onHandleEndChange:
|
|
79
|
+
onHandleEndChange: t,
|
|
80
80
|
labelStart: i,
|
|
81
|
-
labelEnd:
|
|
82
|
-
checkedClosed:
|
|
83
|
-
required:
|
|
84
|
-
valueStart:
|
|
81
|
+
labelEnd: l,
|
|
82
|
+
checkedClosed: d = !1,
|
|
83
|
+
required: g = !1,
|
|
84
|
+
valueStart: s = "",
|
|
85
85
|
valueEnd: b = ""
|
|
86
|
-
} =
|
|
86
|
+
} = a, [C, p] = y(d), [v, k] = y(s), [T, D] = y(b);
|
|
87
87
|
return /* @__PURE__ */ m(j, { children: [
|
|
88
88
|
/* @__PURE__ */ m(o, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
89
89
|
/* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
|
|
@@ -108,8 +108,8 @@ const X = (t) => {
|
|
|
108
108
|
Z,
|
|
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: ""
|
|
@@ -124,11 +124,11 @@ const X = (t) => {
|
|
|
124
124
|
{
|
|
125
125
|
id: "dateStart",
|
|
126
126
|
label: i,
|
|
127
|
-
onChange: (
|
|
128
|
-
k(
|
|
127
|
+
onChange: (c) => {
|
|
128
|
+
k(c.target.value), e(c);
|
|
129
129
|
},
|
|
130
130
|
value: v,
|
|
131
|
-
required:
|
|
131
|
+
required: g,
|
|
132
132
|
size: "compact"
|
|
133
133
|
}
|
|
134
134
|
) }),
|
|
@@ -136,25 +136,25 @@ const X = (t) => {
|
|
|
136
136
|
z,
|
|
137
137
|
{
|
|
138
138
|
id: "dateEnd",
|
|
139
|
-
label:
|
|
140
|
-
onChange: (
|
|
141
|
-
D(
|
|
139
|
+
label: l,
|
|
140
|
+
onChange: (c) => {
|
|
141
|
+
D(c.target.value), t(c);
|
|
142
142
|
},
|
|
143
143
|
value: T,
|
|
144
|
-
required:
|
|
144
|
+
required: g,
|
|
145
145
|
size: "compact"
|
|
146
146
|
}
|
|
147
147
|
) })
|
|
148
148
|
] })
|
|
149
149
|
] });
|
|
150
|
-
}, N = (
|
|
151
|
-
var
|
|
152
|
-
const e =
|
|
153
|
-
switch (
|
|
150
|
+
}, N = (a) => {
|
|
151
|
+
var l;
|
|
152
|
+
const e = a.possibleValue, t = typeof (e == null ? void 0 : e.rangeFrom) == "number" ? e.rangeFrom : 0, i = typeof (e == null ? void 0 : e.rangeTo) == "number" ? e.rangeTo : 1 / 0;
|
|
153
|
+
switch (a.howToSetUp) {
|
|
154
154
|
case f.LIST_OF_VALUES:
|
|
155
155
|
return {
|
|
156
156
|
schema: F(),
|
|
157
|
-
value: (
|
|
157
|
+
value: (l = e.listSelected) == null ? void 0 : l[0]
|
|
158
158
|
};
|
|
159
159
|
case f.LIST_OF_VALUES_MULTI:
|
|
160
160
|
return {
|
|
@@ -168,10 +168,10 @@ const X = (t) => {
|
|
|
168
168
|
i,
|
|
169
169
|
"'Range From' cannot be greater than 'Range To'"
|
|
170
170
|
).min(0, "'Range From' cannot be less than 0"),
|
|
171
|
-
rangeTo: H().required("Range To is required").min(
|
|
171
|
+
rangeTo: H().required("Range To is required").min(t, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
|
|
172
172
|
}),
|
|
173
173
|
value: {
|
|
174
|
-
rangeFrom:
|
|
174
|
+
rangeFrom: t,
|
|
175
175
|
rangeTo: i
|
|
176
176
|
}
|
|
177
177
|
};
|
|
@@ -188,67 +188,67 @@ const X = (t) => {
|
|
|
188
188
|
value: void 0
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
}, ne = (
|
|
192
|
-
const e = {},
|
|
193
|
-
if (
|
|
194
|
-
const i = N(
|
|
195
|
-
i && (e[
|
|
191
|
+
}, ne = (a) => {
|
|
192
|
+
const e = {}, t = {};
|
|
193
|
+
if (a.decision) {
|
|
194
|
+
const i = N(a.decision);
|
|
195
|
+
i && (e[a.decision.name] = i.schema, t[a.decision.name] = i.value);
|
|
196
196
|
}
|
|
197
|
-
return
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
}), { validationSchema: B().shape(e), initialValues:
|
|
201
|
-
}, R = (
|
|
202
|
-
if (typeof
|
|
203
|
-
return
|
|
204
|
-
if (typeof
|
|
197
|
+
return a.conditions && a.conditions.forEach((i) => {
|
|
198
|
+
const l = N(i);
|
|
199
|
+
l && (e[i.name] = l.schema, t[i.name] = l.value);
|
|
200
|
+
}), { validationSchema: B().shape(e), initialValues: t };
|
|
201
|
+
}, R = (a) => {
|
|
202
|
+
if (typeof a == "string")
|
|
203
|
+
return a;
|
|
204
|
+
if (typeof a == "object" && ("rangeFrom" in a || "rangeTo" in a))
|
|
205
205
|
return {
|
|
206
|
-
rangeFrom:
|
|
207
|
-
rangeTo:
|
|
206
|
+
rangeFrom: a.rangeFrom || "",
|
|
207
|
+
rangeTo: a.rangeTo || ""
|
|
208
208
|
};
|
|
209
|
-
for (const e in
|
|
210
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
209
|
+
for (const e in a)
|
|
210
|
+
if (Object.prototype.hasOwnProperty.call(a, e)) {
|
|
211
|
+
const t = R(a[e]);
|
|
212
|
+
if (t) return t;
|
|
213
213
|
}
|
|
214
214
|
return "";
|
|
215
|
-
},
|
|
216
|
-
var
|
|
215
|
+
}, ae = (a) => {
|
|
216
|
+
var c;
|
|
217
217
|
const {
|
|
218
218
|
decision: e,
|
|
219
|
-
formik:
|
|
219
|
+
formik: t,
|
|
220
220
|
onChangeCondition: i,
|
|
221
|
-
onChangeDecision:
|
|
222
|
-
onStartChange:
|
|
223
|
-
onEndChange:
|
|
224
|
-
textValues:
|
|
221
|
+
onChangeDecision: l,
|
|
222
|
+
onStartChange: d,
|
|
223
|
+
onEndChange: g,
|
|
224
|
+
textValues: s,
|
|
225
225
|
onCancel: b,
|
|
226
226
|
onSubmit: C
|
|
227
|
-
} =
|
|
227
|
+
} = a, [p, v] = y(!1), [k, T] = y(!0);
|
|
228
228
|
q(() => {
|
|
229
|
-
console.log("Updated formik.errors in RulesFormUI:",
|
|
230
|
-
}, [
|
|
229
|
+
console.log("Updated formik.errors in RulesFormUI:", t.errors);
|
|
230
|
+
}, [t.errors]);
|
|
231
231
|
const D = (r) => {
|
|
232
232
|
v(r.target.checked);
|
|
233
233
|
}, w = (r) => {
|
|
234
234
|
r.target.value ? T(!1) : T(!0);
|
|
235
235
|
}, S = (r) => {
|
|
236
|
-
const h = R(
|
|
236
|
+
const h = R(t.errors[r] || {});
|
|
237
237
|
return typeof h == "string" ? h ? "invalid" : "pending" : h;
|
|
238
238
|
}, u = (r) => {
|
|
239
|
-
const h = R(
|
|
239
|
+
const h = R(t.errors[r] || {});
|
|
240
240
|
return h;
|
|
241
241
|
};
|
|
242
242
|
return /* @__PURE__ */ m(o, { direction: "column", gap: "24px", children: [
|
|
243
243
|
/* @__PURE__ */ m(o, { direction: "column", gap: "16", children: [
|
|
244
|
-
/* @__PURE__ */ n(x, { weight: "bold", size: "medium", children:
|
|
244
|
+
/* @__PURE__ */ n(x, { weight: "bold", size: "medium", children: s.criteria }),
|
|
245
245
|
e.decision && /* @__PURE__ */ n(
|
|
246
246
|
L,
|
|
247
247
|
{
|
|
248
248
|
element: e.decision,
|
|
249
|
-
onDecision:
|
|
250
|
-
valueData:
|
|
251
|
-
message:
|
|
249
|
+
onDecision: l,
|
|
250
|
+
valueData: t.values[e.decision.name],
|
|
251
|
+
message: t.errors[e.decision.name],
|
|
252
252
|
status: S(e.decision.name),
|
|
253
253
|
textValues: {
|
|
254
254
|
selectOptions: "Select an option",
|
|
@@ -262,7 +262,7 @@ const X = (t) => {
|
|
|
262
262
|
/* @__PURE__ */ n(E, { dashed: !0 }),
|
|
263
263
|
/* @__PURE__ */ m(o, { direction: "column", children: [
|
|
264
264
|
/* @__PURE__ */ m(o, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
265
|
-
/* @__PURE__ */ n(x, { children:
|
|
265
|
+
/* @__PURE__ */ n(x, { children: s.factsThatConditionIt }),
|
|
266
266
|
/* @__PURE__ */ n(
|
|
267
267
|
$,
|
|
268
268
|
{
|
|
@@ -270,7 +270,7 @@ const X = (t) => {
|
|
|
270
270
|
onChange: D,
|
|
271
271
|
checked: p,
|
|
272
272
|
size: "small",
|
|
273
|
-
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children:
|
|
273
|
+
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children: s.none })
|
|
274
274
|
}
|
|
275
275
|
)
|
|
276
276
|
] }),
|
|
@@ -297,7 +297,7 @@ const X = (t) => {
|
|
|
297
297
|
{
|
|
298
298
|
element: r,
|
|
299
299
|
onDecision: i,
|
|
300
|
-
valueData:
|
|
300
|
+
valueData: t.values[r.name],
|
|
301
301
|
message: u(r.name),
|
|
302
302
|
status: S(r.name),
|
|
303
303
|
textValues: {
|
|
@@ -315,10 +315,10 @@ const X = (t) => {
|
|
|
315
315
|
/* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
316
316
|
X,
|
|
317
317
|
{
|
|
318
|
-
label:
|
|
319
|
-
labelText:
|
|
318
|
+
label: s.reasonForChange,
|
|
319
|
+
labelText: s.change,
|
|
320
320
|
onHandleChange: w,
|
|
321
|
-
placeholder:
|
|
321
|
+
placeholder: s.changePlaceholder,
|
|
322
322
|
required: !0
|
|
323
323
|
}
|
|
324
324
|
) }),
|
|
@@ -326,53 +326,53 @@ const X = (t) => {
|
|
|
326
326
|
/* @__PURE__ */ n(o, { direction: "column", children: e.decision && /* @__PURE__ */ n(
|
|
327
327
|
ee,
|
|
328
328
|
{
|
|
329
|
-
onHandleStartChange: (r) =>
|
|
330
|
-
onHandleEndChange: (r) =>
|
|
331
|
-
labelStart:
|
|
332
|
-
labelEnd:
|
|
329
|
+
onHandleStartChange: (r) => d(r.target.value),
|
|
330
|
+
onHandleEndChange: (r) => g(r.target.value),
|
|
331
|
+
labelStart: s.termStart,
|
|
332
|
+
labelEnd: s.termEnd,
|
|
333
333
|
checkedClosed: !!e.decision.endDate,
|
|
334
334
|
valueStart: e.decision.startDate.toLocaleDateString(
|
|
335
335
|
"en-CA"
|
|
336
336
|
),
|
|
337
|
-
valueEnd: ((
|
|
337
|
+
valueEnd: ((c = e.decision.endDate) == null ? void 0 : c.toLocaleDateString("en-CA")) || ""
|
|
338
338
|
}
|
|
339
339
|
) }),
|
|
340
340
|
/* @__PURE__ */ n(E, { dashed: !0 }),
|
|
341
341
|
/* @__PURE__ */ m(o, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
342
|
-
/* @__PURE__ */ n(M, { appearance: "gray", onClick: b, children:
|
|
342
|
+
/* @__PURE__ */ n(M, { appearance: "gray", onClick: b, children: s.cancel }),
|
|
343
343
|
/* @__PURE__ */ n(
|
|
344
344
|
M,
|
|
345
345
|
{
|
|
346
346
|
onClick: C,
|
|
347
|
-
disabled: k || !
|
|
347
|
+
disabled: k || !t.isValid,
|
|
348
348
|
type: "submit",
|
|
349
|
-
children:
|
|
349
|
+
children: s.confirm
|
|
350
350
|
}
|
|
351
351
|
)
|
|
352
352
|
] })
|
|
353
353
|
] });
|
|
354
|
-
}, Se = (
|
|
355
|
-
const { id: e, decision:
|
|
356
|
-
w.setFieldValue(u,
|
|
357
|
-
}, C = (u,
|
|
358
|
-
|
|
354
|
+
}, Se = (a) => {
|
|
355
|
+
const { id: e, decision: t, onCancel: i, onSubmitEvent: l, textValues: d } = a, [g, s] = y(t), b = (u, c) => {
|
|
356
|
+
w.setFieldValue(u, c), w.validateField(u);
|
|
357
|
+
}, C = (u, c) => {
|
|
358
|
+
s((r) => {
|
|
359
359
|
var A;
|
|
360
|
-
const h = (A = r == null ? void 0 : r.conditions) == null ? void 0 : A.map((O) => O.name ===
|
|
361
|
-
return b(
|
|
360
|
+
const h = (A = r == null ? void 0 : r.conditions) == null ? void 0 : A.map((O) => O.name === c ? { ...O, value: u } : O);
|
|
361
|
+
return b(c, u), { ...r, conditions: h };
|
|
362
362
|
});
|
|
363
363
|
}, p = (u) => {
|
|
364
|
-
|
|
365
|
-
(
|
|
364
|
+
s(
|
|
365
|
+
(c) => S(c, "value", u)
|
|
366
366
|
);
|
|
367
367
|
}, v = (u) => {
|
|
368
|
-
|
|
369
|
-
(
|
|
368
|
+
s(
|
|
369
|
+
(c) => S(c, "endDate", new Date(u))
|
|
370
370
|
);
|
|
371
371
|
}, k = (u) => {
|
|
372
|
-
|
|
373
|
-
(
|
|
372
|
+
s(
|
|
373
|
+
(c) => S(c, "startDate", new Date(u))
|
|
374
374
|
);
|
|
375
|
-
}, { validationSchema: T, initialValues: D } = ne(
|
|
375
|
+
}, { validationSchema: T, initialValues: D } = ne(g);
|
|
376
376
|
T.validate(D, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((u) => console.log("Validation failed:", u.errors));
|
|
377
377
|
const w = Q({
|
|
378
378
|
initialValues: D,
|
|
@@ -380,35 +380,35 @@ const X = (t) => {
|
|
|
380
380
|
validateOnChange: !0,
|
|
381
381
|
validateOnBlur: !0,
|
|
382
382
|
onSubmit: () => {
|
|
383
|
-
|
|
383
|
+
l(g);
|
|
384
384
|
}
|
|
385
|
-
}), S = (u,
|
|
385
|
+
}), S = (u, c, r) => ({
|
|
386
386
|
...u,
|
|
387
|
-
decision: { ...u.decision, [
|
|
387
|
+
decision: { ...u.decision, [c]: r }
|
|
388
388
|
});
|
|
389
389
|
return /* @__PURE__ */ n(
|
|
390
|
-
|
|
390
|
+
ae,
|
|
391
391
|
{
|
|
392
392
|
id: e,
|
|
393
393
|
formik: w,
|
|
394
|
-
decision:
|
|
394
|
+
decision: g,
|
|
395
395
|
onCancel: i,
|
|
396
|
-
onSubmit: () =>
|
|
396
|
+
onSubmit: () => l(g),
|
|
397
397
|
onChangeCondition: C,
|
|
398
398
|
onChangeDecision: p,
|
|
399
399
|
onStartChange: k,
|
|
400
400
|
onEndChange: v,
|
|
401
|
-
textValues:
|
|
401
|
+
textValues: d
|
|
402
402
|
}
|
|
403
403
|
);
|
|
404
|
-
}, _ = (
|
|
405
|
-
if (!
|
|
404
|
+
}, _ = (a) => {
|
|
405
|
+
if (!a)
|
|
406
406
|
return;
|
|
407
|
-
const e =
|
|
407
|
+
const e = a.value;
|
|
408
408
|
if (!e)
|
|
409
409
|
return;
|
|
410
410
|
if (((i) => typeof i == "object" && i !== null)(e))
|
|
411
|
-
switch (
|
|
411
|
+
switch (a.valueUse) {
|
|
412
412
|
case f.LIST_OF_VALUES_MULTI:
|
|
413
413
|
return e;
|
|
414
414
|
case f.LIST_OF_VALUES:
|
|
@@ -422,71 +422,71 @@ const X = (t) => {
|
|
|
422
422
|
return e.value;
|
|
423
423
|
}
|
|
424
424
|
return e;
|
|
425
|
-
}, De = (
|
|
426
|
-
|
|
427
|
-
|
|
425
|
+
}, De = (a) => {
|
|
426
|
+
const { decision: e, textValues: t } = a, i = (d) => d && Object.keys(d).length > 0, l = {
|
|
427
|
+
name: e.name,
|
|
428
|
+
dataType: e.dataType,
|
|
429
|
+
value: e.value,
|
|
430
|
+
valueUse: e.valueUse
|
|
431
|
+
};
|
|
428
432
|
return /* @__PURE__ */ m(o, { direction: "column", gap: "24px", children: [
|
|
429
433
|
/* @__PURE__ */ m(o, { direction: "column", gap: "16px", children: [
|
|
430
|
-
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children:
|
|
431
|
-
/* @__PURE__ */ n(o, { justifyContent: "space-between", children: e
|
|
434
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.criteria }),
|
|
435
|
+
/* @__PURE__ */ n(o, { justifyContent: "space-between", children: e && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
432
436
|
V,
|
|
433
437
|
{
|
|
434
|
-
element:
|
|
435
|
-
valueData: _(
|
|
438
|
+
element: l,
|
|
439
|
+
valueData: _(l)
|
|
436
440
|
}
|
|
437
|
-
) }, e.
|
|
441
|
+
) }, e.name) })
|
|
438
442
|
] }),
|
|
439
443
|
/* @__PURE__ */ m(o, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
440
|
-
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children:
|
|
444
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.factsThatConditionIt }),
|
|
441
445
|
e.conditions && e.conditions.map(
|
|
442
|
-
(
|
|
446
|
+
(d) => (typeof d.value == "object" && i(d.value) || d.value) && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
|
|
443
447
|
V,
|
|
444
448
|
{
|
|
445
|
-
element:
|
|
446
|
-
valueData: _(
|
|
449
|
+
element: d,
|
|
450
|
+
valueData: _(d)
|
|
447
451
|
}
|
|
448
|
-
) },
|
|
452
|
+
) }, d.name)
|
|
449
453
|
)
|
|
450
454
|
] }),
|
|
451
455
|
/* @__PURE__ */ m(o, { direction: "column", gap: "12px", children: [
|
|
452
|
-
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children:
|
|
456
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.terms }),
|
|
453
457
|
/* @__PURE__ */ m(o, { justifyContent: "space-between", children: [
|
|
454
|
-
(
|
|
458
|
+
(e == null ? void 0 : e.startDate) && /* @__PURE__ */ n(
|
|
455
459
|
V,
|
|
456
460
|
{
|
|
457
461
|
element: {
|
|
458
462
|
name: "Fecha de inicio",
|
|
459
|
-
description: a.termStart,
|
|
460
463
|
value: String(e.startDate),
|
|
461
464
|
valueUse: f.EQUAL,
|
|
462
465
|
dataType: U.DATE
|
|
463
466
|
},
|
|
464
|
-
valueData: new Date(
|
|
465
|
-
|
|
466
|
-
)
|
|
467
|
+
valueData: new Date(e.startDate).toLocaleDateString(
|
|
468
|
+
"en-CA"
|
|
469
|
+
)
|
|
467
470
|
},
|
|
468
471
|
"startDate"
|
|
469
472
|
),
|
|
470
|
-
(
|
|
473
|
+
(e == null ? void 0 : e.endDate) && /* @__PURE__ */ n(
|
|
471
474
|
V,
|
|
472
475
|
{
|
|
473
476
|
element: {
|
|
474
477
|
name: "Fecha de final",
|
|
475
|
-
description: a.termEnd,
|
|
476
478
|
value: String(e.endDate),
|
|
477
479
|
valueUse: f.EQUAL,
|
|
478
480
|
dataType: U.DATE
|
|
479
481
|
},
|
|
480
|
-
valueData: new Date(e.
|
|
481
|
-
"en-CA"
|
|
482
|
-
)
|
|
482
|
+
valueData: new Date(e.endDate).toLocaleDateString("en-CA")
|
|
483
483
|
},
|
|
484
484
|
"endDate"
|
|
485
485
|
)
|
|
486
486
|
] })
|
|
487
487
|
] })
|
|
488
488
|
] });
|
|
489
|
-
},
|
|
489
|
+
}, te = G.div`
|
|
490
490
|
border-radius: 8px;
|
|
491
491
|
border: 1px solid ${W.palette.neutral.N30};
|
|
492
492
|
box-sizing: border-box;
|
|
@@ -513,9 +513,9 @@ const X = (t) => {
|
|
|
513
513
|
background-color: #ebecf0;
|
|
514
514
|
border-radius: 8px;
|
|
515
515
|
}
|
|
516
|
-
`, we = (
|
|
517
|
-
const { children: e, handleDelete:
|
|
518
|
-
return /* @__PURE__ */ m(
|
|
516
|
+
`, we = (a) => {
|
|
517
|
+
const { children: e, handleDelete: t, handleView: i, id: l } = a;
|
|
518
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
519
519
|
/* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(re, { children: /* @__PURE__ */ n(o, { direction: "column", margin: "10px", children: e }) }) }),
|
|
520
520
|
/* @__PURE__ */ m(o, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
521
521
|
/* @__PURE__ */ n(E, {}),
|
|
@@ -528,7 +528,7 @@ const X = (t) => {
|
|
|
528
528
|
cursorHover: !0,
|
|
529
529
|
icon: /* @__PURE__ */ n(J, {}),
|
|
530
530
|
onClick: () => {
|
|
531
|
-
i(
|
|
531
|
+
i(l);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
),
|
|
@@ -540,7 +540,7 @@ const X = (t) => {
|
|
|
540
540
|
size: "24px",
|
|
541
541
|
icon: /* @__PURE__ */ n(K, {}),
|
|
542
542
|
onClick: () => {
|
|
543
|
-
|
|
543
|
+
t(l);
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
)
|
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.13",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@inubekit/textarea": "^2.45.0",
|
|
50
50
|
"@inubekit/toggle": "^3.8.2",
|
|
51
51
|
"@isettingkit/input": "^0.1.21",
|
|
52
|
-
"@isettingkit/view": "^0.1.
|
|
52
|
+
"@isettingkit/view": "^0.1.13"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^18.2.0",
|