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