@isettingkit/business-rules 0.1.4 → 0.1.6
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 +1 -1
- package/dist/index.es.js +250 -228
- package/package.json +3 -3
package/dist/index.es.d.ts
CHANGED
|
@@ -34,11 +34,11 @@ export declare interface IBusinessRuleView {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export declare interface IRulesForm {
|
|
37
|
+
id: string;
|
|
37
38
|
decision: IRuleDecision;
|
|
38
39
|
onCloseModal: () => void;
|
|
39
40
|
onCancel: () => void;
|
|
40
41
|
onSubmitEvent: (dataDecision: IRuleDecision) => void;
|
|
41
|
-
portalId: string;
|
|
42
42
|
textValues: {
|
|
43
43
|
selectOptions: string;
|
|
44
44
|
selectOption: string;
|
package/dist/index.es.js
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useFormik as
|
|
4
|
-
import { Divider as
|
|
1
|
+
import { jsxs as c, jsx as n, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useEffect as N } from "react";
|
|
3
|
+
import { useFormik as R } from "formik";
|
|
4
|
+
import { Divider as T } from "@inubekit/divider";
|
|
5
5
|
import { Stack as a } from "@inubekit/stack";
|
|
6
|
-
import { Text as
|
|
7
|
-
import { Toggle as
|
|
8
|
-
import { Textarea as
|
|
9
|
-
import { Date as
|
|
10
|
-
import { Checkbox as
|
|
11
|
-
import { DecisionConditionRenderer as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { DecisionViewConditionRenderer as
|
|
14
|
-
import { MdOutlineRemoveRedEye as
|
|
15
|
-
import { Icon as
|
|
16
|
-
import { inube as
|
|
17
|
-
import
|
|
18
|
-
const P = (
|
|
6
|
+
import { Text as x } from "@inubekit/text";
|
|
7
|
+
import { Toggle as U } from "@inubekit/toggle";
|
|
8
|
+
import { Textarea as $ } from "@inubekit/textarea";
|
|
9
|
+
import { Date as F } from "@inubekit/date";
|
|
10
|
+
import { Checkbox as _ } from "@inubekit/checkbox";
|
|
11
|
+
import { DecisionConditionRenderer as O, ValueValidationSchema as q, ValueHowToSetUp as y, ValueDataType as A } from "@isettingkit/input";
|
|
12
|
+
import { Button as L } from "@inubekit/button";
|
|
13
|
+
import { DecisionViewConditionRenderer as E } from "@isettingkit/view";
|
|
14
|
+
import { MdOutlineRemoveRedEye as B, MdOutlineDelete as Q } from "react-icons/md";
|
|
15
|
+
import { Icon as H } from "@inubekit/icon";
|
|
16
|
+
import { inube as G } from "@inubekit/foundations";
|
|
17
|
+
import I from "styled-components";
|
|
18
|
+
const P = (r) => {
|
|
19
19
|
const {
|
|
20
|
-
label:
|
|
20
|
+
label: e,
|
|
21
21
|
labelText: i,
|
|
22
|
-
onHandleChange:
|
|
23
|
-
placeholder:
|
|
24
|
-
required:
|
|
25
|
-
value:
|
|
26
|
-
} =
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
22
|
+
onHandleChange: l,
|
|
23
|
+
placeholder: d,
|
|
24
|
+
required: s,
|
|
25
|
+
value: h = ""
|
|
26
|
+
} = r, [o, p] = S(h);
|
|
27
|
+
return /* @__PURE__ */ c(a, { direction: "column", margin: "10px 4px", children: [
|
|
28
|
+
/* @__PURE__ */ n(x, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: i }),
|
|
29
|
+
/* @__PURE__ */ n(a, { margin: "10px 0", children: /* @__PURE__ */ n(
|
|
30
|
+
$,
|
|
31
31
|
{
|
|
32
32
|
id: "reasonChange",
|
|
33
|
-
label:
|
|
34
|
-
onChange: (
|
|
35
|
-
|
|
33
|
+
label: e,
|
|
34
|
+
onChange: (u) => {
|
|
35
|
+
p(u.target.value), l(u);
|
|
36
36
|
},
|
|
37
|
-
placeholder:
|
|
38
|
-
required:
|
|
37
|
+
placeholder: d,
|
|
38
|
+
required: s,
|
|
39
39
|
value: o,
|
|
40
40
|
maxLength: 120,
|
|
41
41
|
fullwidth: !0
|
|
42
42
|
}
|
|
43
43
|
) })
|
|
44
44
|
] });
|
|
45
|
-
}, Z = (
|
|
45
|
+
}, Z = (r) => {
|
|
46
46
|
const {
|
|
47
|
-
checked:
|
|
47
|
+
checked: e,
|
|
48
48
|
children: i,
|
|
49
|
-
handleToggleChange:
|
|
50
|
-
id:
|
|
51
|
-
labelToggle:
|
|
52
|
-
name:
|
|
49
|
+
handleToggleChange: l,
|
|
50
|
+
id: d,
|
|
51
|
+
labelToggle: s,
|
|
52
|
+
name: h,
|
|
53
53
|
valueToggle: o = ""
|
|
54
|
-
} =
|
|
55
|
-
|
|
54
|
+
} = r, [p, g] = S(e), u = (f) => {
|
|
55
|
+
g(f.target.checked), l(f);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
57
|
+
return N(() => {
|
|
58
|
+
g(e);
|
|
59
|
+
}, [e]), /* @__PURE__ */ c(z, { children: [
|
|
60
|
+
/* @__PURE__ */ n(
|
|
61
|
+
U,
|
|
62
62
|
{
|
|
63
|
-
checked:
|
|
64
|
-
id:
|
|
63
|
+
checked: p,
|
|
64
|
+
id: d,
|
|
65
65
|
margin: "10px",
|
|
66
|
-
name:
|
|
67
|
-
onChange:
|
|
66
|
+
name: h,
|
|
67
|
+
onChange: u,
|
|
68
68
|
size: "small",
|
|
69
69
|
value: o,
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children: s })
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
|
|
73
|
+
p && /* @__PURE__ */ n(z, { children: i })
|
|
74
74
|
] });
|
|
75
|
-
},
|
|
75
|
+
}, J = (r) => {
|
|
76
76
|
const {
|
|
77
|
-
onHandleStartChange:
|
|
77
|
+
onHandleStartChange: e,
|
|
78
78
|
onHandleEndChange: i,
|
|
79
|
-
labelStart:
|
|
80
|
-
labelEnd:
|
|
81
|
-
checkedClosed:
|
|
82
|
-
required:
|
|
79
|
+
labelStart: l,
|
|
80
|
+
labelEnd: d,
|
|
81
|
+
checkedClosed: s = !1,
|
|
82
|
+
required: h = !1,
|
|
83
83
|
valueStart: o = "",
|
|
84
|
-
valueEnd:
|
|
85
|
-
} =
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
84
|
+
valueEnd: p = ""
|
|
85
|
+
} = r, [g, u] = S(s), [f, w] = S(o), [v, k] = S(p);
|
|
86
|
+
return /* @__PURE__ */ c(z, { children: [
|
|
87
|
+
/* @__PURE__ */ c(a, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
88
|
+
/* @__PURE__ */ n(a, { children: /* @__PURE__ */ n(
|
|
89
|
+
x,
|
|
90
90
|
{
|
|
91
91
|
appearance: "gray",
|
|
92
92
|
margin: "10px 0",
|
|
@@ -96,84 +96,84 @@ const P = (c) => {
|
|
|
96
96
|
children: "Vigencia"
|
|
97
97
|
}
|
|
98
98
|
) }),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ n(
|
|
100
100
|
a,
|
|
101
101
|
{
|
|
102
102
|
alignContent: "center",
|
|
103
103
|
justifyContent: "center",
|
|
104
104
|
wrap: "wrap",
|
|
105
105
|
gap: "4px",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
-
|
|
106
|
+
children: /* @__PURE__ */ n(
|
|
107
|
+
_,
|
|
108
108
|
{
|
|
109
109
|
label: "Cerrada",
|
|
110
110
|
onChange: ({ target: t }) => {
|
|
111
|
-
|
|
111
|
+
u(t.checked);
|
|
112
112
|
},
|
|
113
|
-
checked:
|
|
113
|
+
checked: g,
|
|
114
114
|
value: ""
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
}
|
|
118
118
|
)
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
120
|
+
/* @__PURE__ */ c(a, { justifyContent: "space-between", gap: "24px", children: [
|
|
121
|
+
/* @__PURE__ */ n(a, { width: "189px", children: /* @__PURE__ */ n(
|
|
122
|
+
F,
|
|
123
123
|
{
|
|
124
124
|
id: "dateStart",
|
|
125
|
-
label:
|
|
125
|
+
label: l,
|
|
126
126
|
onChange: (t) => {
|
|
127
|
-
|
|
127
|
+
w(t.target.value), e(t);
|
|
128
128
|
},
|
|
129
129
|
value: f,
|
|
130
|
-
required:
|
|
130
|
+
required: h,
|
|
131
131
|
size: "compact"
|
|
132
132
|
}
|
|
133
133
|
) }),
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
g && /* @__PURE__ */ n(a, { width: "189px", children: /* @__PURE__ */ n(
|
|
135
|
+
F,
|
|
136
136
|
{
|
|
137
137
|
id: "dateEnd",
|
|
138
|
-
label:
|
|
138
|
+
label: d,
|
|
139
139
|
onChange: (t) => {
|
|
140
|
-
|
|
140
|
+
k(t.target.value), i(t);
|
|
141
141
|
},
|
|
142
142
|
value: v,
|
|
143
|
-
required:
|
|
143
|
+
required: h,
|
|
144
144
|
size: "compact"
|
|
145
145
|
}
|
|
146
146
|
) })
|
|
147
147
|
] })
|
|
148
148
|
] });
|
|
149
|
-
},
|
|
150
|
-
var
|
|
149
|
+
}, K = (r) => {
|
|
150
|
+
var D;
|
|
151
151
|
const {
|
|
152
|
-
decision:
|
|
152
|
+
decision: e,
|
|
153
153
|
formik: i,
|
|
154
|
-
onChangeCondition:
|
|
155
|
-
onChangeDecision:
|
|
156
|
-
onStartChange:
|
|
157
|
-
onEndChange:
|
|
154
|
+
onChangeCondition: l,
|
|
155
|
+
onChangeDecision: d,
|
|
156
|
+
onStartChange: s,
|
|
157
|
+
onEndChange: h,
|
|
158
158
|
textValues: o,
|
|
159
|
-
onCancel:
|
|
160
|
-
onSubmit:
|
|
161
|
-
} =
|
|
159
|
+
onCancel: p,
|
|
160
|
+
onSubmit: g
|
|
161
|
+
} = r, [u, f] = S(!1), [w, v] = S(!0), k = (t) => {
|
|
162
162
|
f(t.target.checked);
|
|
163
|
-
},
|
|
163
|
+
}, C = (t) => {
|
|
164
164
|
t.target.value ? v(!1) : v(!0);
|
|
165
|
-
},
|
|
166
|
-
return /* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
}, m = (t, b) => t.errors[b] ? "invalid" : "pending";
|
|
166
|
+
return /* @__PURE__ */ c(a, { direction: "column", gap: "24px", children: [
|
|
167
|
+
/* @__PURE__ */ c(a, { direction: "column", gap: "16", children: [
|
|
168
|
+
/* @__PURE__ */ n(x, { weight: "bold", size: "medium", children: o.criteria }),
|
|
169
|
+
e.decision && /* @__PURE__ */ n(
|
|
170
|
+
O,
|
|
171
171
|
{
|
|
172
|
-
element:
|
|
173
|
-
onDecision:
|
|
174
|
-
valueData: i.values[
|
|
175
|
-
message: i.errors[
|
|
176
|
-
status:
|
|
172
|
+
element: e.decision,
|
|
173
|
+
onDecision: d,
|
|
174
|
+
valueData: i.values[e.decision.name],
|
|
175
|
+
message: i.errors[e.decision.name],
|
|
176
|
+
status: m(i, e.decision.name),
|
|
177
177
|
textValues: {
|
|
178
178
|
selectOptions: "Select an option",
|
|
179
179
|
selectOption: "Option selected",
|
|
@@ -183,27 +183,27 @@ const P = (c) => {
|
|
|
183
183
|
}
|
|
184
184
|
)
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
186
|
+
/* @__PURE__ */ n(T, { dashed: !0 }),
|
|
187
|
+
/* @__PURE__ */ c(a, { direction: "column", children: [
|
|
188
|
+
/* @__PURE__ */ c(a, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
189
|
+
/* @__PURE__ */ n(x, { children: o.FactsThatConditionIt }),
|
|
190
|
+
/* @__PURE__ */ n(
|
|
191
|
+
U,
|
|
192
192
|
{
|
|
193
193
|
id: "toogleNone",
|
|
194
|
-
onChange:
|
|
195
|
-
checked:
|
|
194
|
+
onChange: k,
|
|
195
|
+
checked: u,
|
|
196
196
|
size: "small",
|
|
197
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ n(x, { size: "medium", type: "label", weight: "bold", children: o.none })
|
|
198
198
|
}
|
|
199
199
|
)
|
|
200
200
|
] }),
|
|
201
|
-
|
|
201
|
+
e.conditions && e.conditions.map((t) => /* @__PURE__ */ n(a, { direction: "column", children: /* @__PURE__ */ n(
|
|
202
202
|
Z,
|
|
203
203
|
{
|
|
204
|
-
checked: !
|
|
205
|
-
handleToggleChange: (
|
|
206
|
-
|
|
204
|
+
checked: !u,
|
|
205
|
+
handleToggleChange: (b) => {
|
|
206
|
+
b.target.checked || l(
|
|
207
207
|
{
|
|
208
208
|
value: "",
|
|
209
209
|
rangeTo: 0,
|
|
@@ -216,181 +216,203 @@ const P = (c) => {
|
|
|
216
216
|
id: t.name.replace(" ", ""),
|
|
217
217
|
labelToggle: t.name.split(/(?=[A-Z])/).join(" "),
|
|
218
218
|
name: t.name.replace(" ", ""),
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
|
|
219
|
+
children: /* @__PURE__ */ n(
|
|
220
|
+
O,
|
|
221
221
|
{
|
|
222
222
|
element: t,
|
|
223
|
-
onDecision:
|
|
223
|
+
onDecision: l,
|
|
224
224
|
valueData: i.values[t.name],
|
|
225
225
|
message: i.errors[t.name],
|
|
226
|
-
status:
|
|
226
|
+
status: m(i, t.name),
|
|
227
227
|
textValues: {
|
|
228
228
|
selectOptions: "Select an option",
|
|
229
229
|
selectOption: "Option selected",
|
|
230
|
-
rangeMin: (
|
|
231
|
-
rangeMax: (
|
|
230
|
+
rangeMin: (b) => `Minimum ${b}`,
|
|
231
|
+
rangeMax: (b) => `Maximum ${b}`
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
)
|
|
235
235
|
}
|
|
236
236
|
) }, t.name))
|
|
237
237
|
] }),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ n(T, { dashed: !0 }),
|
|
239
|
+
/* @__PURE__ */ n(a, { direction: "column", children: /* @__PURE__ */ n(
|
|
240
240
|
P,
|
|
241
241
|
{
|
|
242
242
|
label: o.reasonForChange,
|
|
243
243
|
labelText: o.change,
|
|
244
|
-
onHandleChange:
|
|
244
|
+
onHandleChange: C,
|
|
245
245
|
placeholder: o.changePlaceholder,
|
|
246
246
|
required: !0
|
|
247
247
|
}
|
|
248
248
|
) }),
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
249
|
+
/* @__PURE__ */ n(T, { dashed: !0 }),
|
|
250
|
+
/* @__PURE__ */ n(a, { direction: "column", children: e.decision && /* @__PURE__ */ n(
|
|
251
|
+
J,
|
|
252
252
|
{
|
|
253
|
-
onHandleStartChange: (t) =>
|
|
254
|
-
onHandleEndChange: (t) =>
|
|
253
|
+
onHandleStartChange: (t) => s(t.target.value),
|
|
254
|
+
onHandleEndChange: (t) => h(t.target.value),
|
|
255
255
|
labelStart: o.termStart,
|
|
256
256
|
labelEnd: o.termEnd,
|
|
257
|
-
checkedClosed: !!
|
|
258
|
-
valueStart:
|
|
257
|
+
checkedClosed: !!e.decision.endDate,
|
|
258
|
+
valueStart: e.decision.startDate.toLocaleDateString(
|
|
259
259
|
"en-CA"
|
|
260
260
|
),
|
|
261
|
-
valueEnd: ((
|
|
261
|
+
valueEnd: ((D = e.decision.endDate) == null ? void 0 : D.toLocaleDateString("en-CA")) || ""
|
|
262
262
|
}
|
|
263
263
|
) }),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
|
|
264
|
+
/* @__PURE__ */ n(T, { dashed: !0 }),
|
|
265
|
+
/* @__PURE__ */ c(a, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
266
|
+
/* @__PURE__ */ n(L, { appearance: "gray", onClick: p, children: o.cancel }),
|
|
267
|
+
/* @__PURE__ */ n(
|
|
268
|
+
L,
|
|
269
269
|
{
|
|
270
|
-
onClick:
|
|
271
|
-
disabled:
|
|
270
|
+
onClick: g,
|
|
271
|
+
disabled: w || !i.isValid,
|
|
272
272
|
type: "submit",
|
|
273
273
|
children: o.confirm
|
|
274
274
|
}
|
|
275
275
|
)
|
|
276
276
|
] })
|
|
277
277
|
] });
|
|
278
|
-
},
|
|
279
|
-
...
|
|
280
|
-
decision: { ...
|
|
281
|
-
}),
|
|
282
|
-
const { decision:
|
|
283
|
-
|
|
284
|
-
var
|
|
285
|
-
const
|
|
286
|
-
return { ...D, conditions:
|
|
278
|
+
}, j = (r, e, i) => ({
|
|
279
|
+
...r,
|
|
280
|
+
decision: { ...r.decision, [e]: i }
|
|
281
|
+
}), Ce = (r) => {
|
|
282
|
+
const { id: e, decision: i, onCancel: l, onSubmitEvent: d, textValues: s } = r, [h, o] = S(i), p = (C, m) => {
|
|
283
|
+
o((D) => {
|
|
284
|
+
var b;
|
|
285
|
+
const t = (b = D == null ? void 0 : D.conditions) == null ? void 0 : b.map((V) => V.name === m ? { ...V, value: C } : V);
|
|
286
|
+
return { ...D, conditions: t };
|
|
287
287
|
});
|
|
288
|
-
}, g = (
|
|
289
|
-
|
|
290
|
-
(
|
|
288
|
+
}, g = (C) => {
|
|
289
|
+
o(
|
|
290
|
+
(m) => j(m, "value", C)
|
|
291
291
|
);
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
(
|
|
292
|
+
}, u = (C) => {
|
|
293
|
+
o(
|
|
294
|
+
(m) => j(m, "startDate", new Date(C))
|
|
295
295
|
);
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
(
|
|
296
|
+
}, f = (C) => {
|
|
297
|
+
o(
|
|
298
|
+
(m) => j(m, "endDate", new Date(C))
|
|
299
299
|
);
|
|
300
|
-
}, { validationSchema:
|
|
301
|
-
initialValues:
|
|
302
|
-
validationSchema:
|
|
300
|
+
}, { validationSchema: w, initialValues: v } = q(h), k = R({
|
|
301
|
+
initialValues: v,
|
|
302
|
+
validationSchema: w,
|
|
303
303
|
validateOnChange: !1,
|
|
304
304
|
onSubmit: () => {
|
|
305
|
-
|
|
305
|
+
d(h);
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
|
|
308
|
+
return /* @__PURE__ */ n(
|
|
309
|
+
K,
|
|
310
310
|
{
|
|
311
|
-
|
|
311
|
+
id: e,
|
|
312
|
+
formik: k,
|
|
312
313
|
decision: h,
|
|
313
|
-
onCancel:
|
|
314
|
-
onSubmit: () =>
|
|
315
|
-
onChangeCondition:
|
|
314
|
+
onCancel: l,
|
|
315
|
+
onSubmit: () => d(h),
|
|
316
|
+
onChangeCondition: p,
|
|
316
317
|
onChangeDecision: g,
|
|
317
|
-
onStartChange:
|
|
318
|
-
onEndChange:
|
|
318
|
+
onStartChange: u,
|
|
319
|
+
onEndChange: f,
|
|
319
320
|
textValues: s
|
|
320
321
|
}
|
|
321
322
|
);
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
323
|
+
}, M = (r) => {
|
|
324
|
+
if (!r)
|
|
325
|
+
return;
|
|
326
|
+
const e = r.value || r.possibleValue;
|
|
327
|
+
if (!e)
|
|
328
|
+
return;
|
|
329
|
+
if (((l) => typeof l == "object" && l !== null)(e))
|
|
330
|
+
switch (r.howToSetUp) {
|
|
331
|
+
case y.LIST_OF_VALUES_MULTI:
|
|
332
|
+
return e.listSelected;
|
|
333
|
+
case y.LIST_OF_VALUES:
|
|
334
|
+
return e.listSelected ?? e.list;
|
|
335
|
+
case y.RANGE:
|
|
336
|
+
return {
|
|
337
|
+
rangeFrom: e.rangeFrom,
|
|
338
|
+
rangeTo: e.rangeTo
|
|
339
|
+
};
|
|
340
|
+
default:
|
|
341
|
+
return e.value;
|
|
342
|
+
}
|
|
343
|
+
return e;
|
|
344
|
+
}, be = (r) => {
|
|
345
|
+
var l, d;
|
|
346
|
+
const { decision: e, textValues: i } = r;
|
|
347
|
+
return /* @__PURE__ */ c(a, { direction: "column", gap: "24px", children: [
|
|
348
|
+
/* @__PURE__ */ c(a, { direction: "column", gap: "16px", children: [
|
|
349
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.criteria }),
|
|
350
|
+
/* @__PURE__ */ n(a, { justifyContent: "space-between", children: e.decision && /* @__PURE__ */ n(a, { direction: "column", children: /* @__PURE__ */ n(
|
|
351
|
+
E,
|
|
329
352
|
{
|
|
330
|
-
element:
|
|
331
|
-
valueData:
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
)) })
|
|
353
|
+
element: e.decision,
|
|
354
|
+
valueData: M(e.decision)
|
|
355
|
+
}
|
|
356
|
+
) }, e.decision.name) })
|
|
335
357
|
] }),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
|
|
339
|
-
|
|
358
|
+
/* @__PURE__ */ c(a, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
359
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.FactsThatConditionIt }),
|
|
360
|
+
e.conditions && e.conditions.map((s) => /* @__PURE__ */ n(a, { direction: "column", children: /* @__PURE__ */ n(
|
|
361
|
+
E,
|
|
340
362
|
{
|
|
341
|
-
element:
|
|
342
|
-
valueData:
|
|
363
|
+
element: s,
|
|
364
|
+
valueData: M(s)
|
|
343
365
|
}
|
|
344
|
-
) },
|
|
345
|
-
] })
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
350
|
-
|
|
366
|
+
) }, s.name))
|
|
367
|
+
] }),
|
|
368
|
+
/* @__PURE__ */ c(a, { direction: "column", gap: "12px", children: [
|
|
369
|
+
/* @__PURE__ */ n(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.Terms }),
|
|
370
|
+
/* @__PURE__ */ c(a, { justifyContent: "space-between", children: [
|
|
371
|
+
((l = e == null ? void 0 : e.decision) == null ? void 0 : l.startDate) && /* @__PURE__ */ n(
|
|
372
|
+
E,
|
|
351
373
|
{
|
|
352
374
|
element: {
|
|
353
375
|
name: "startDate",
|
|
354
|
-
label: i.termStart,
|
|
355
376
|
description: i.termStart,
|
|
356
|
-
value: String(
|
|
357
|
-
howToSetUp:
|
|
358
|
-
typeData:
|
|
377
|
+
value: String(e.startDate),
|
|
378
|
+
howToSetUp: y.EQUAL,
|
|
379
|
+
typeData: A.DATE
|
|
359
380
|
},
|
|
360
|
-
valueData: new Date(
|
|
361
|
-
|
|
362
|
-
)
|
|
381
|
+
valueData: new Date(
|
|
382
|
+
e.decision.startDate
|
|
383
|
+
).toLocaleDateString("en-CA")
|
|
363
384
|
},
|
|
364
385
|
"startDate"
|
|
365
386
|
),
|
|
366
|
-
|
|
367
|
-
|
|
387
|
+
((d = e == null ? void 0 : e.decision) == null ? void 0 : d.endDate) && /* @__PURE__ */ n(
|
|
388
|
+
E,
|
|
368
389
|
{
|
|
369
390
|
element: {
|
|
370
391
|
name: "endDate",
|
|
371
|
-
label: i.termEnd,
|
|
372
392
|
description: i.termEnd,
|
|
373
|
-
value: String(
|
|
374
|
-
howToSetUp:
|
|
375
|
-
typeData:
|
|
393
|
+
value: String(e.endDate),
|
|
394
|
+
howToSetUp: y.EQUAL,
|
|
395
|
+
typeData: A.DATE
|
|
376
396
|
},
|
|
377
|
-
valueData: new Date(
|
|
397
|
+
valueData: new Date(e.decision.endDate).toLocaleDateString(
|
|
398
|
+
"en-CA"
|
|
399
|
+
)
|
|
378
400
|
},
|
|
379
401
|
"endDate"
|
|
380
402
|
)
|
|
381
403
|
] })
|
|
382
404
|
] })
|
|
383
405
|
] });
|
|
384
|
-
},
|
|
406
|
+
}, W = I.div`
|
|
385
407
|
border-radius: 8px;
|
|
386
|
-
border: 1px solid ${
|
|
408
|
+
border: 1px solid ${G.palette.neutral.N30};
|
|
387
409
|
box-sizing: border-box;
|
|
388
410
|
display: flex;
|
|
389
411
|
flex-direction: column;
|
|
390
412
|
height: 340px;
|
|
391
413
|
width: 332px;
|
|
392
414
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
393
|
-
`,
|
|
415
|
+
`, X = I.div`
|
|
394
416
|
width: 100%;
|
|
395
417
|
height: 100%;
|
|
396
418
|
overflow-y: auto;
|
|
@@ -408,34 +430,34 @@ const P = (c) => {
|
|
|
408
430
|
background-color: #ebecf0;
|
|
409
431
|
border-radius: 8px;
|
|
410
432
|
}
|
|
411
|
-
`,
|
|
412
|
-
const { children:
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
433
|
+
`, xe = (r) => {
|
|
434
|
+
const { children: e, handleDelete: i, handleView: l, id: d } = r;
|
|
435
|
+
return /* @__PURE__ */ c(W, { children: [
|
|
436
|
+
/* @__PURE__ */ n(a, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(X, { children: /* @__PURE__ */ n(a, { direction: "column", margin: "10px", children: e }) }) }),
|
|
437
|
+
/* @__PURE__ */ c(a, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
438
|
+
/* @__PURE__ */ n(T, {}),
|
|
439
|
+
/* @__PURE__ */ c(a, { gap: "16px", justifyContent: "end", children: [
|
|
440
|
+
/* @__PURE__ */ n(
|
|
441
|
+
H,
|
|
420
442
|
{
|
|
421
443
|
appearance: "dark",
|
|
422
444
|
size: "24px",
|
|
423
445
|
cursorHover: !0,
|
|
424
|
-
icon: /* @__PURE__ */
|
|
446
|
+
icon: /* @__PURE__ */ n(B, {}),
|
|
425
447
|
onClick: () => {
|
|
426
|
-
|
|
448
|
+
l(d);
|
|
427
449
|
}
|
|
428
450
|
}
|
|
429
451
|
),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
|
|
452
|
+
/* @__PURE__ */ n(
|
|
453
|
+
H,
|
|
432
454
|
{
|
|
433
455
|
cursorHover: !0,
|
|
434
456
|
appearance: "dark",
|
|
435
457
|
size: "24px",
|
|
436
|
-
icon: /* @__PURE__ */
|
|
458
|
+
icon: /* @__PURE__ */ n(Q, {}),
|
|
437
459
|
onClick: () => {
|
|
438
|
-
i(
|
|
460
|
+
i(d);
|
|
439
461
|
}
|
|
440
462
|
}
|
|
441
463
|
)
|
|
@@ -444,7 +466,7 @@ const P = (c) => {
|
|
|
444
466
|
] });
|
|
445
467
|
};
|
|
446
468
|
export {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
469
|
+
xe as BusinessRuleCard,
|
|
470
|
+
be as BusinessRuleView,
|
|
471
|
+
Ce as RulesForm
|
|
450
472
|
};
|
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.6",
|
|
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.1",
|
|
51
|
-
"@isettingkit/input": "^0.1.
|
|
52
|
-
"@isettingkit/view": "^0.1.
|
|
51
|
+
"@isettingkit/input": "^0.1.16",
|
|
52
|
+
"@isettingkit/view": "^0.1.7"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "^18.2.0",
|