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