@isettingkit/business-rules 0.1.7 → 0.1.8
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 +20 -34
- package/dist/index.es.js +18 -18
- package/package.json +1 -1
package/dist/index.es.d.ts
CHANGED
|
@@ -14,23 +14,7 @@ export declare interface IBusinessRuleCard {
|
|
|
14
14
|
|
|
15
15
|
export declare interface IBusinessRuleView {
|
|
16
16
|
decision: IRuleDecision;
|
|
17
|
-
textValues:
|
|
18
|
-
selectOptions: string;
|
|
19
|
-
selectOption: string;
|
|
20
|
-
rangeMin: (label: string) => string;
|
|
21
|
-
rangeMax: (label: string) => string;
|
|
22
|
-
reasonForChange: string;
|
|
23
|
-
change: string;
|
|
24
|
-
changePlaceholder: string;
|
|
25
|
-
termStart: string;
|
|
26
|
-
termEnd: string;
|
|
27
|
-
cancel: string;
|
|
28
|
-
confirm: string;
|
|
29
|
-
none: string;
|
|
30
|
-
FactsThatConditionIt: string;
|
|
31
|
-
criteria: string;
|
|
32
|
-
Terms: string;
|
|
33
|
-
};
|
|
17
|
+
textValues: IRulesFormTextValues;
|
|
34
18
|
}
|
|
35
19
|
|
|
36
20
|
export declare interface IRulesForm {
|
|
@@ -39,23 +23,25 @@ export declare interface IRulesForm {
|
|
|
39
23
|
onCloseModal: () => void;
|
|
40
24
|
onCancel: () => void;
|
|
41
25
|
onSubmitEvent: (dataDecision: IRuleDecision) => void;
|
|
42
|
-
textValues:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
26
|
+
textValues: IRulesFormTextValues;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare interface IRulesFormTextValues {
|
|
30
|
+
cancel: string;
|
|
31
|
+
change: string;
|
|
32
|
+
changePlaceholder: string;
|
|
33
|
+
confirm: string;
|
|
34
|
+
criteria: string;
|
|
35
|
+
factsThatConditionIt: string;
|
|
36
|
+
none: string;
|
|
37
|
+
rangeMax: (label: string) => string;
|
|
38
|
+
rangeMin: (label: string) => string;
|
|
39
|
+
reasonForChange: string;
|
|
40
|
+
selectOption: string;
|
|
41
|
+
selectOptions: string;
|
|
42
|
+
termEnd: string;
|
|
43
|
+
terms: string;
|
|
44
|
+
termStart: string;
|
|
59
45
|
}
|
|
60
46
|
|
|
61
47
|
export declare const RulesForm: (prop: IRulesForm) => JSX_2.Element;
|
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
2
|
import { useFormik as N } from "formik";
|
|
3
3
|
import { useState as D, useEffect as R } from "react";
|
|
4
|
-
import { DecisionConditionRenderer as
|
|
5
|
-
import { Divider as
|
|
4
|
+
import { DecisionConditionRenderer as O, ValueValidationSchema as $, ValueHowToSetUp as T, ValueDataType as F } from "@isettingkit/input";
|
|
5
|
+
import { Divider as y } from "@inubekit/divider";
|
|
6
6
|
import { Stack as a } from "@inubekit/stack";
|
|
7
7
|
import { Text as x } from "@inubekit/text";
|
|
8
8
|
import { Toggle as U } from "@inubekit/toggle";
|
|
@@ -167,7 +167,7 @@ const P = (o) => {
|
|
|
167
167
|
/* @__PURE__ */ c(a, { direction: "column", gap: "16", children: [
|
|
168
168
|
/* @__PURE__ */ e(x, { weight: "bold", size: "medium", children: r.criteria }),
|
|
169
169
|
n.decision && /* @__PURE__ */ e(
|
|
170
|
-
|
|
170
|
+
O,
|
|
171
171
|
{
|
|
172
172
|
element: n.decision,
|
|
173
173
|
onDecision: d,
|
|
@@ -183,7 +183,7 @@ const P = (o) => {
|
|
|
183
183
|
}
|
|
184
184
|
)
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */ e(
|
|
186
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
187
187
|
/* @__PURE__ */ c(a, { direction: "column", children: [
|
|
188
188
|
/* @__PURE__ */ c(a, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
|
|
189
189
|
/* @__PURE__ */ e(x, { children: r.factsThatConditionIt }),
|
|
@@ -217,7 +217,7 @@ const P = (o) => {
|
|
|
217
217
|
labelToggle: t.name.split(/(?=[A-Z])/).join(" "),
|
|
218
218
|
name: t.name.replace(" ", ""),
|
|
219
219
|
children: /* @__PURE__ */ e(
|
|
220
|
-
|
|
220
|
+
O,
|
|
221
221
|
{
|
|
222
222
|
element: t,
|
|
223
223
|
onDecision: l,
|
|
@@ -235,7 +235,7 @@ const P = (o) => {
|
|
|
235
235
|
}
|
|
236
236
|
) }, t.name))
|
|
237
237
|
] }),
|
|
238
|
-
/* @__PURE__ */ e(
|
|
238
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
239
239
|
/* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
240
240
|
P,
|
|
241
241
|
{
|
|
@@ -246,7 +246,7 @@ const P = (o) => {
|
|
|
246
246
|
required: !0
|
|
247
247
|
}
|
|
248
248
|
) }),
|
|
249
|
-
/* @__PURE__ */ e(
|
|
249
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
250
250
|
/* @__PURE__ */ e(a, { direction: "column", children: n.decision && /* @__PURE__ */ e(
|
|
251
251
|
J,
|
|
252
252
|
{
|
|
@@ -261,7 +261,7 @@ const P = (o) => {
|
|
|
261
261
|
valueEnd: ((m = n.decision.endDate) == null ? void 0 : m.toLocaleDateString("en-CA")) || ""
|
|
262
262
|
}
|
|
263
263
|
) }),
|
|
264
|
-
/* @__PURE__ */ e(
|
|
264
|
+
/* @__PURE__ */ e(y, { dashed: !0 }),
|
|
265
265
|
/* @__PURE__ */ c(a, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
266
266
|
/* @__PURE__ */ e(L, { appearance: "gray", onClick: g, children: r.cancel }),
|
|
267
267
|
/* @__PURE__ */ e(
|
|
@@ -328,11 +328,11 @@ const P = (o) => {
|
|
|
328
328
|
return;
|
|
329
329
|
if (((l) => typeof l == "object" && l !== null)(n))
|
|
330
330
|
switch (o.howToSetUp) {
|
|
331
|
-
case
|
|
331
|
+
case T.LIST_OF_VALUES_MULTI:
|
|
332
332
|
return n.listSelected;
|
|
333
|
-
case
|
|
333
|
+
case T.LIST_OF_VALUES:
|
|
334
334
|
return n.listSelected ?? n.list;
|
|
335
|
-
case
|
|
335
|
+
case T.RANGE:
|
|
336
336
|
return {
|
|
337
337
|
rangeFrom: n.rangeFrom,
|
|
338
338
|
rangeTo: n.rangeTo
|
|
@@ -356,7 +356,7 @@ const P = (o) => {
|
|
|
356
356
|
) }, n.decision.name) })
|
|
357
357
|
] }),
|
|
358
358
|
/* @__PURE__ */ c(a, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
|
|
359
|
-
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.
|
|
359
|
+
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.factsThatConditionIt }),
|
|
360
360
|
n.conditions && n.conditions.map((h) => /* @__PURE__ */ e(a, { direction: "column", children: /* @__PURE__ */ e(
|
|
361
361
|
E,
|
|
362
362
|
{
|
|
@@ -366,7 +366,7 @@ const P = (o) => {
|
|
|
366
366
|
) }, h.name))
|
|
367
367
|
] }),
|
|
368
368
|
/* @__PURE__ */ c(a, { direction: "column", gap: "12px", children: [
|
|
369
|
-
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.
|
|
369
|
+
/* @__PURE__ */ e(x, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: i.terms }),
|
|
370
370
|
/* @__PURE__ */ c(a, { justifyContent: "space-between", children: [
|
|
371
371
|
((l = n == null ? void 0 : n.decision) == null ? void 0 : l.startDate) && /* @__PURE__ */ e(
|
|
372
372
|
E,
|
|
@@ -375,8 +375,8 @@ const P = (o) => {
|
|
|
375
375
|
name: "startDate",
|
|
376
376
|
description: i.termStart,
|
|
377
377
|
value: String(n.startDate),
|
|
378
|
-
howToSetUp:
|
|
379
|
-
typeData:
|
|
378
|
+
howToSetUp: T.EQUAL,
|
|
379
|
+
typeData: F.DATE
|
|
380
380
|
},
|
|
381
381
|
valueData: new Date(
|
|
382
382
|
n.decision.startDate
|
|
@@ -391,8 +391,8 @@ const P = (o) => {
|
|
|
391
391
|
name: "endDate",
|
|
392
392
|
description: i.termEnd,
|
|
393
393
|
value: String(n.endDate),
|
|
394
|
-
howToSetUp:
|
|
395
|
-
typeData:
|
|
394
|
+
howToSetUp: T.EQUAL,
|
|
395
|
+
typeData: F.DATE
|
|
396
396
|
},
|
|
397
397
|
valueData: new Date(n.decision.endDate).toLocaleDateString(
|
|
398
398
|
"en-CA"
|
|
@@ -435,7 +435,7 @@ const P = (o) => {
|
|
|
435
435
|
return /* @__PURE__ */ c(W, { children: [
|
|
436
436
|
/* @__PURE__ */ e(a, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(a, { direction: "column", margin: "10px", children: n }) }) }),
|
|
437
437
|
/* @__PURE__ */ c(a, { gap: "16px", direction: "column", margin: "2px 12px", children: [
|
|
438
|
-
/* @__PURE__ */ e(
|
|
438
|
+
/* @__PURE__ */ e(y, {}),
|
|
439
439
|
/* @__PURE__ */ c(a, { gap: "16px", justifyContent: "end", children: [
|
|
440
440
|
/* @__PURE__ */ e(
|
|
441
441
|
H,
|