@isettingkit/business-rules 0.1.14 → 0.1.16

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.
Files changed (2) hide show
  1. package/dist/index.es.js +187 -188
  2. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -1,91 +1,91 @@
1
- import { jsxs as h, jsx as n, Fragment as F } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as n, Fragment as F } from "react/jsx-runtime";
2
2
  import { useFormik as Q } from "formik";
3
- import { useState as x, useEffect as P } from "react";
4
- import { Divider as V } from "@inubekit/divider";
3
+ import { useState as x, useEffect as q } from "react";
4
+ import { Divider as E } from "@inubekit/divider";
5
5
  import { Stack as o } from "@inubekit/stack";
6
6
  import { Text as y } from "@inubekit/text";
7
- import { Toggle as $ } from "@inubekit/toggle";
8
- import { ValueHowToSetUp as f, ValueDataType as R, DecisionConditionRenderer as L } from "@isettingkit/input";
9
- import { Textarea as Z } from "@inubekit/textarea";
10
- import { Date as M } from "@inubekit/date";
11
- import { Checkbox as J } from "@inubekit/checkbox";
12
- import { Button as z } from "@inubekit/button";
13
- import { object as B, string as I, number as j, mixed as H } from "yup";
14
- import { DecisionViewConditionRenderer as A } from "@isettingkit/view";
15
- import { MdOutlineRemoveRedEye as K, MdOutlineDelete as W } from "react-icons/md";
16
- import { Icon as N } from "@inubekit/icon";
17
- import { inube as X } from "@inubekit/foundations";
18
- import G from "styled-components";
19
- const Y = (t) => {
7
+ import { Toggle as P } from "@inubekit/toggle";
8
+ import { ValueHowToSetUp as f, ValueDataType as R, parsePercentageString as Z, DecisionConditionRenderer as U } from "@isettingkit/input";
9
+ import { Textarea as J } from "@inubekit/textarea";
10
+ import { Date as L } from "@inubekit/date";
11
+ import { Checkbox as K } from "@inubekit/checkbox";
12
+ import { Button as M } from "@inubekit/button";
13
+ import { object as $, string as z, number as O, mixed as H } from "yup";
14
+ import { DecisionViewConditionRenderer as V } from "@isettingkit/view";
15
+ import { MdOutlineRemoveRedEye as W, MdOutlineDelete as X } from "react-icons/md";
16
+ import { Icon as I } from "@inubekit/icon";
17
+ import { inube as Y } from "@inubekit/foundations";
18
+ import B from "styled-components";
19
+ const ee = (t) => {
20
20
  const {
21
21
  label: e,
22
22
  labelText: a,
23
23
  onHandleChange: i,
24
24
  placeholder: l,
25
- required: s,
25
+ required: c,
26
26
  value: m = ""
27
- } = t, [u, b] = x(m);
28
- return /* @__PURE__ */ h(o, { direction: "column", margin: "10px 4px", children: [
27
+ } = t, [d, b] = x(m);
28
+ return /* @__PURE__ */ g(o, { direction: "column", margin: "10px 4px", children: [
29
29
  /* @__PURE__ */ n(y, { size: "large", appearance: "gray", weight: "bold", margin: "10px 0", children: a }),
30
30
  /* @__PURE__ */ n(o, { margin: "10px 0", children: /* @__PURE__ */ n(
31
- Z,
31
+ J,
32
32
  {
33
33
  id: "reasonChange",
34
34
  label: e,
35
- onChange: (g) => {
36
- b(g.target.value), i(g);
35
+ onChange: (p) => {
36
+ b(p.target.value), i(p);
37
37
  },
38
38
  placeholder: l,
39
- required: s,
40
- value: u,
39
+ required: c,
40
+ value: d,
41
41
  maxLength: 120,
42
42
  fullwidth: !0
43
43
  }
44
44
  ) })
45
45
  ] });
46
- }, ee = (t) => {
46
+ }, ne = (t) => {
47
47
  const {
48
48
  checked: e,
49
49
  children: a,
50
50
  handleToggleChange: i,
51
51
  id: l,
52
- labelToggle: s,
52
+ labelToggle: c,
53
53
  name: m,
54
- valueToggle: u = ""
55
- } = t, [b, C] = x(e), g = (v) => {
54
+ valueToggle: d = ""
55
+ } = t, [b, C] = x(e), p = (v) => {
56
56
  C(v.target.checked), i(v);
57
57
  };
58
- return P(() => {
58
+ return q(() => {
59
59
  C(e);
60
- }, [e]), /* @__PURE__ */ h(F, { children: [
60
+ }, [e]), /* @__PURE__ */ g(F, { children: [
61
61
  /* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
62
- $,
62
+ P,
63
63
  {
64
64
  checked: b,
65
65
  id: l,
66
66
  margin: "10px",
67
67
  name: m,
68
- onChange: g,
68
+ onChange: p,
69
69
  size: "small",
70
- value: u,
71
- children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: s })
70
+ value: d,
71
+ children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: c })
72
72
  }
73
73
  ) }),
74
74
  b && /* @__PURE__ */ n(F, { children: a })
75
75
  ] });
76
- }, ne = (t) => {
76
+ }, te = (t) => {
77
77
  const {
78
78
  onHandleStartChange: e,
79
79
  onHandleEndChange: a,
80
80
  labelStart: i,
81
81
  labelEnd: l,
82
- checkedClosed: s = !1,
82
+ checkedClosed: c = !1,
83
83
  required: m = !1,
84
- valueStart: u = "",
84
+ valueStart: d = "",
85
85
  valueEnd: b = ""
86
- } = t, [C, g] = x(s), [v, E] = x(u), [D, T] = x(b);
87
- return /* @__PURE__ */ h(F, { children: [
88
- /* @__PURE__ */ h(o, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
86
+ } = t, [C, p] = x(c), [v, w] = x(d), [S, T] = x(b);
87
+ return /* @__PURE__ */ g(F, { children: [
88
+ /* @__PURE__ */ g(o, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
89
89
  /* @__PURE__ */ n(o, { children: /* @__PURE__ */ n(
90
90
  y,
91
91
  {
@@ -105,11 +105,11 @@ const Y = (t) => {
105
105
  wrap: "wrap",
106
106
  gap: "4px",
107
107
  children: /* @__PURE__ */ n(
108
- J,
108
+ K,
109
109
  {
110
110
  label: "Cerrada",
111
- onChange: ({ target: d }) => {
112
- g(d.checked);
111
+ onChange: ({ target: s }) => {
112
+ p(s.checked);
113
113
  },
114
114
  checked: C,
115
115
  value: ""
@@ -118,14 +118,14 @@ const Y = (t) => {
118
118
  }
119
119
  )
120
120
  ] }),
121
- /* @__PURE__ */ h(o, { justifyContent: "space-between", gap: "24px", children: [
121
+ /* @__PURE__ */ g(o, { justifyContent: "space-between", gap: "24px", children: [
122
122
  /* @__PURE__ */ n(o, { width: "189px", children: /* @__PURE__ */ n(
123
- M,
123
+ L,
124
124
  {
125
125
  id: "dateStart",
126
126
  label: i,
127
- onChange: (d) => {
128
- E(d.target.value), e(d);
127
+ onChange: (s) => {
128
+ w(s.target.value), e(s);
129
129
  },
130
130
  value: v,
131
131
  required: m,
@@ -133,21 +133,21 @@ const Y = (t) => {
133
133
  }
134
134
  ) }),
135
135
  C && /* @__PURE__ */ n(o, { width: "189px", children: /* @__PURE__ */ n(
136
- M,
136
+ L,
137
137
  {
138
138
  id: "dateEnd",
139
139
  label: l,
140
- onChange: (d) => {
141
- T(d.target.value), a(d);
140
+ onChange: (s) => {
141
+ T(s.target.value), a(s);
142
142
  },
143
- value: D,
143
+ value: S,
144
144
  required: m,
145
145
  size: "compact"
146
146
  }
147
147
  ) })
148
148
  ] })
149
149
  ] });
150
- }, _ = (t) => {
150
+ }, N = (t) => {
151
151
  if ("value" in t && "valueUse" in t && t.value !== void 0) {
152
152
  const e = t.value, a = typeof e == "object" && "from" in e && typeof e.from == "number" ? e.from : 0, i = typeof e == "object" && "to" in e && typeof e.to == "number" ? e.to : 1 / 0;
153
153
  switch (t.valueUse) {
@@ -157,7 +157,7 @@ const Y = (t) => {
157
157
  "isArrayOrString",
158
158
  "Must be an array of strings/numbers or a single string",
159
159
  (l) => Array.isArray(l) ? l.every(
160
- (s) => typeof s == "string" || typeof s == "number"
160
+ (c) => typeof c == "string" || typeof c == "number"
161
161
  ) : typeof l == "string"
162
162
  ),
163
163
  value: e
@@ -168,16 +168,16 @@ const Y = (t) => {
168
168
  "isArrayOrString",
169
169
  "Must be an array of strings/numbers or a single string",
170
170
  (l) => Array.isArray(l) ? l.every(
171
- (s) => typeof s == "string" || typeof s == "number"
171
+ (c) => typeof c == "string" || typeof c == "number"
172
172
  ) : typeof l == "string"
173
173
  ),
174
174
  value: e
175
175
  };
176
176
  case f.RANGE:
177
177
  return {
178
- schema: B({
179
- from: j().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
- to: j().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
178
+ schema: $({
179
+ from: O().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
180
+ to: O().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
181
181
  }),
182
182
  value: {
183
183
  from: a,
@@ -188,30 +188,30 @@ const Y = (t) => {
188
188
  case f.LESS_THAN:
189
189
  case f.EQUAL:
190
190
  return t.dataType === R.PERCENTAGE ? {
191
- schema: j().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
191
+ schema: O().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
192
192
  value: e
193
193
  } : {
194
- schema: I().required("Required"),
194
+ schema: z().required("Required"),
195
195
  value: e
196
196
  };
197
197
  default:
198
198
  return {
199
- schema: I(),
199
+ schema: z(),
200
200
  value: void 0
201
201
  };
202
202
  }
203
203
  }
204
- }, te = (t) => {
204
+ }, ae = (t) => {
205
205
  const e = {}, a = {};
206
206
  if (t) {
207
- const i = _(t);
207
+ const i = N(t);
208
208
  i && (e[t.name] = i.schema, a[t.name] = i.value);
209
209
  }
210
210
  return t.conditions && t.conditions.forEach((i) => {
211
- const l = _(i);
211
+ const l = N(i);
212
212
  l && (e[i.name] = l.schema, a[i.name] = l.value);
213
- }), { validationSchema: B().shape(e), initialValues: a };
214
- }, U = (t) => {
213
+ }), { validationSchema: $().shape(e), initialValues: a };
214
+ }, j = (t) => {
215
215
  if (typeof t == "string")
216
216
  return t;
217
217
  if (typeof t == "object" && ("from" in t || "to" in t))
@@ -221,54 +221,53 @@ const Y = (t) => {
221
221
  };
222
222
  for (const e in t)
223
223
  if (Object.prototype.hasOwnProperty.call(t, e)) {
224
- const a = U(t[e]);
224
+ const a = j(t[e]);
225
225
  if (a) return a;
226
226
  }
227
227
  return "";
228
- }, ae = (t) => {
229
- var S;
228
+ }, re = (t) => {
230
229
  const {
231
230
  decision: e,
232
231
  formik: a,
233
232
  onChangeCondition: i,
234
233
  onChangeDecision: l,
235
- onStartChange: s,
234
+ onStartChange: c,
236
235
  onEndChange: m,
237
- textValues: u,
236
+ textValues: d,
238
237
  onCancel: b,
239
238
  onSubmit: C
240
- } = t, [g, v] = x(!1), [E, D] = x(!0), T = {
239
+ } = t, [p, v] = x(!1), [w, S] = x(!0), T = {
241
240
  name: e.name,
242
241
  dataType: e.dataType,
243
- value: e.value,
242
+ value: e.dataType === "percentage" ? Z(e.value) : e.value,
244
243
  valueUse: e.valueUse,
245
244
  possibleValue: e.possibleValue
246
245
  };
247
- P(() => {
246
+ q(() => {
248
247
  console.log("Updated formik.errors in RulesFormUI:", a.errors);
249
248
  }, [a.errors]);
250
- const w = (r) => {
249
+ const D = (r) => {
251
250
  v(r.target.checked);
252
251
  }, k = (r) => {
253
- r.target.value ? D(!1) : D(!0);
254
- }, c = (r) => {
255
- const p = U(a.errors[r] || {});
256
- return typeof p == "string" ? p ? "invalid" : "pending" : p;
257
- }, d = (r) => {
258
- const p = U(a.errors[r] || {});
259
- return p;
252
+ r.target.value ? S(!1) : S(!0);
253
+ }, u = (r) => {
254
+ const h = j(a.errors[r] || {});
255
+ return typeof h == "string" ? h ? "invalid" : "pending" : h;
256
+ }, s = (r) => {
257
+ const h = j(a.errors[r] || {});
258
+ return h;
260
259
  };
261
- return /* @__PURE__ */ h(o, { direction: "column", gap: "24px", children: [
262
- /* @__PURE__ */ h(o, { direction: "column", gap: "16", children: [
263
- /* @__PURE__ */ n(y, { weight: "bold", size: "medium", children: u.criteria }),
260
+ return /* @__PURE__ */ g(o, { direction: "column", gap: "24px", children: [
261
+ /* @__PURE__ */ g(o, { direction: "column", gap: "16", children: [
262
+ /* @__PURE__ */ n(y, { weight: "bold", size: "medium", children: d.criteria }),
264
263
  e && /* @__PURE__ */ n(
265
- L,
264
+ U,
266
265
  {
267
266
  element: T,
268
267
  onDecision: l,
269
268
  valueData: a.values[e.name],
270
269
  message: a.errors[e.name],
271
- status: c(e.name),
270
+ status: u(e.name),
272
271
  textValues: {
273
272
  selectOptions: "Select an option",
274
273
  selectOption: "Option selected",
@@ -278,27 +277,27 @@ const Y = (t) => {
278
277
  }
279
278
  )
280
279
  ] }),
281
- /* @__PURE__ */ n(V, { dashed: !0 }),
282
- /* @__PURE__ */ h(o, { direction: "column", children: [
283
- /* @__PURE__ */ h(o, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
284
- /* @__PURE__ */ n(y, { children: u.factsThatConditionIt }),
280
+ /* @__PURE__ */ n(E, { dashed: !0 }),
281
+ /* @__PURE__ */ g(o, { direction: "column", children: [
282
+ /* @__PURE__ */ g(o, { direction: "row", gap: "16px", justifyContent: "space-between", children: [
283
+ /* @__PURE__ */ n(y, { children: d.factsThatConditionIt }),
285
284
  /* @__PURE__ */ n(
286
- $,
285
+ P,
287
286
  {
288
287
  id: "toogleNone",
289
- onChange: w,
290
- checked: g,
288
+ onChange: D,
289
+ checked: p,
291
290
  size: "small",
292
- children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: u.none })
291
+ children: /* @__PURE__ */ n(y, { size: "medium", type: "label", weight: "bold", children: d.none })
293
292
  }
294
293
  )
295
294
  ] }),
296
295
  e.conditions && e.conditions.map((r) => /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
297
- ee,
296
+ ne,
298
297
  {
299
- checked: !g,
300
- handleToggleChange: (p) => {
301
- p.target.checked || i(
298
+ checked: !p,
299
+ handleToggleChange: (h) => {
300
+ h.target.checked || i(
302
301
  {
303
302
  value: "",
304
303
  to: 0,
@@ -312,119 +311,119 @@ const Y = (t) => {
312
311
  labelToggle: r.name.split(/(?=[A-Z])/).join(" "),
313
312
  name: r.name.replace(" ", ""),
314
313
  children: /* @__PURE__ */ n(
315
- L,
314
+ U,
316
315
  {
317
316
  element: r,
318
317
  onDecision: i,
319
318
  valueData: a.values[r.name],
320
- message: d(r.name),
321
- status: c(r.name),
319
+ message: s(r.name),
320
+ status: u(r.name),
322
321
  textValues: {
323
322
  selectOptions: "Select an option",
324
323
  selectOption: "Option selected",
325
- rangeMin: (p) => `Minimum ${p}`,
326
- rangeMax: (p) => `Maximum ${p}`
324
+ rangeMin: (h) => `Minimum ${h}`,
325
+ rangeMax: (h) => `Maximum ${h}`
327
326
  }
328
327
  }
329
328
  )
330
329
  }
331
330
  ) }, r.name))
332
331
  ] }),
333
- /* @__PURE__ */ n(V, { dashed: !0 }),
332
+ /* @__PURE__ */ n(E, { dashed: !0 }),
334
333
  /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
335
- Y,
334
+ ee,
336
335
  {
337
- label: u.reasonForChange,
338
- labelText: u.change,
336
+ label: d.reasonForChange,
337
+ labelText: d.change,
339
338
  onHandleChange: k,
340
- placeholder: u.changePlaceholder,
339
+ placeholder: d.changePlaceholder,
341
340
  required: !0
342
341
  }
343
342
  ) }),
344
- /* @__PURE__ */ n(V, { dashed: !0 }),
343
+ /* @__PURE__ */ n(E, { dashed: !0 }),
345
344
  /* @__PURE__ */ n(o, { direction: "column", children: e && /* @__PURE__ */ n(
346
- ne,
345
+ te,
347
346
  {
348
- onHandleStartChange: (r) => s(r.target.value),
347
+ onHandleStartChange: (r) => c(r.target.value),
349
348
  onHandleEndChange: (r) => m(r.target.value),
350
- labelStart: u.termStart,
351
- labelEnd: u.termEnd,
349
+ labelStart: d.termStart,
350
+ labelEnd: d.termEnd,
352
351
  checkedClosed: !!e.endDate,
353
- valueStart: e.startDate.toLocaleDateString("en-CA"),
354
- valueEnd: ((S = e.endDate) == null ? void 0 : S.toLocaleDateString("en-CA")) || ""
352
+ valueStart: String(e.startDate),
353
+ valueEnd: String(e.endDate) || ""
355
354
  }
356
355
  ) }),
357
- /* @__PURE__ */ n(V, { dashed: !0 }),
358
- /* @__PURE__ */ h(o, { direction: "row", justifyContent: "end", gap: "16px", children: [
359
- /* @__PURE__ */ n(z, { appearance: "gray", onClick: b, children: u.cancel }),
356
+ /* @__PURE__ */ n(E, { dashed: !0 }),
357
+ /* @__PURE__ */ g(o, { direction: "row", justifyContent: "end", gap: "16px", children: [
358
+ /* @__PURE__ */ n(M, { appearance: "gray", onClick: b, children: d.cancel }),
360
359
  /* @__PURE__ */ n(
361
- z,
360
+ M,
362
361
  {
363
362
  onClick: C,
364
- disabled: E || !a.isValid,
363
+ disabled: w || !a.isValid,
365
364
  type: "submit",
366
- children: u.confirm
365
+ children: d.confirm
367
366
  }
368
367
  )
369
368
  ] })
370
369
  ] });
371
- }, Te = (t) => {
372
- const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues: s } = t, [m, u] = x(a), b = (c, d) => {
373
- w.setFieldValue(c, d), w.validateField(c);
374
- }, C = (c, d) => {
375
- const S = c instanceof Date ? c.toISOString() : c;
376
- u((r) => {
377
- if (!r.conditions)
378
- return r;
379
- const p = r.conditions.map((O) => O.name === d ? { ...O, value: S } : O);
370
+ }, ke = (t) => {
371
+ const { id: e, decision: a, onCancel: i, onSubmitEvent: l, textValues: c } = t, [m, d] = x(a), b = (u, s) => {
372
+ D.setFieldValue(u, s), D.validateField(u);
373
+ }, C = (u, s) => {
374
+ const r = u instanceof Date ? u.toISOString() : u;
375
+ d((h) => {
376
+ if (!h.conditions)
377
+ return h;
378
+ const G = h.conditions.map((A) => A.name === s ? { ...A, value: r } : A);
380
379
  return {
381
- ...r,
382
- conditions: p
380
+ ...h,
381
+ conditions: G
383
382
  };
384
- }), b(d, S);
385
- }, g = (c) => {
386
- typeof c == "object" && (c instanceof Date || "someProperty" in c) ? u(
387
- (d) => k(d, "value", c)
388
- ) : console.warn("Invalid type for value:", c);
389
- }, v = (c) => {
390
- u(
391
- (d) => k(d, "endDate", new Date(c))
383
+ }), b(s, r);
384
+ }, p = (u) => {
385
+ d(
386
+ (s) => k(s, "value", u)
392
387
  );
393
- }, E = (c) => {
394
- u(
395
- (d) => k(d, "startDate", new Date(c))
388
+ }, v = (u) => {
389
+ d(
390
+ (s) => k(s, "endDate", u)
396
391
  );
397
- }, { validationSchema: D, initialValues: T } = te(m);
398
- D.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((c) => console.log("Validation failed:", c.errors));
399
- const w = Q({
392
+ }, w = (u) => {
393
+ d(
394
+ (s) => k(s, "startDate", u)
395
+ );
396
+ }, { validationSchema: S, initialValues: T } = ae(m);
397
+ S.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((u) => console.log("Validation failed:", u.errors));
398
+ const D = Q({
400
399
  initialValues: T,
401
- validationSchema: D,
400
+ validationSchema: S,
402
401
  validateOnChange: !0,
403
402
  validateOnBlur: !0,
404
403
  onSubmit: () => {
405
404
  l(m);
406
405
  }
407
- }), k = (c, d, S) => ({
408
- ...c,
409
- ...c.decision,
410
- [d]: S
406
+ }), k = (u, s, r) => ({
407
+ ...u,
408
+ ...u.decision,
409
+ [s]: r
411
410
  });
412
411
  return /* @__PURE__ */ n(
413
- ae,
412
+ re,
414
413
  {
415
414
  id: e,
416
- formik: w,
415
+ formik: D,
417
416
  decision: m,
418
417
  onCancel: i,
419
418
  onSubmit: () => l(m),
420
419
  onChangeCondition: C,
421
- onChangeDecision: g,
422
- onStartChange: E,
420
+ onChangeDecision: p,
421
+ onStartChange: w,
423
422
  onEndChange: v,
424
- textValues: s
423
+ textValues: c
425
424
  }
426
425
  );
427
- }, q = (t) => {
426
+ }, _ = (t) => {
428
427
  if (!t)
429
428
  return;
430
429
  const e = t.value;
@@ -446,44 +445,44 @@ const Y = (t) => {
446
445
  }
447
446
  return e;
448
447
  }, we = (t) => {
449
- const { decision: e, textValues: a } = t, i = (s) => s && Object.keys(s).length > 0, l = {
448
+ const { decision: e, textValues: a } = t, i = (c) => c && Object.keys(c).length > 0, l = {
450
449
  name: e.name,
451
450
  dataType: e.dataType,
452
451
  value: e.value,
453
452
  valueUse: e.valueUse
454
453
  };
455
- return /* @__PURE__ */ h(o, { direction: "column", gap: "24px", children: [
456
- /* @__PURE__ */ h(o, { direction: "column", gap: "16px", children: [
454
+ return /* @__PURE__ */ g(o, { direction: "column", gap: "24px", children: [
455
+ /* @__PURE__ */ g(o, { direction: "column", gap: "16px", children: [
457
456
  /* @__PURE__ */ n(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: a.criteria }),
458
457
  /* @__PURE__ */ n(o, { justifyContent: "space-between", children: e && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
459
- A,
458
+ V,
460
459
  {
461
460
  element: l,
462
- valueData: q(l)
461
+ valueData: _(l)
463
462
  }
464
463
  ) }, e.name) })
465
464
  ] }),
466
- /* @__PURE__ */ h(o, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
465
+ /* @__PURE__ */ g(o, { direction: "column", gap: "16px", justifyContent: "space-between", children: [
467
466
  /* @__PURE__ */ n(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: a.factsThatConditionIt }),
468
- e.conditions && e.conditions.map((s) => {
469
- const m = s.value;
467
+ e.conditions && e.conditions.map((c) => {
468
+ const m = c.value;
470
469
  return (typeof m == "object" && i(m) || m) && /* @__PURE__ */ n(o, { direction: "column", children: /* @__PURE__ */ n(
471
- A,
470
+ V,
472
471
  {
473
472
  element: {
474
- ...s,
473
+ ...c,
475
474
  value: m
476
475
  },
477
- valueData: q(s)
476
+ valueData: _(c)
478
477
  }
479
- ) }, s.name);
478
+ ) }, c.name);
480
479
  })
481
480
  ] }),
482
- /* @__PURE__ */ h(o, { direction: "column", gap: "12px", children: [
481
+ /* @__PURE__ */ g(o, { direction: "column", gap: "12px", children: [
483
482
  /* @__PURE__ */ n(y, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: a.terms }),
484
- /* @__PURE__ */ h(o, { justifyContent: "space-between", children: [
483
+ /* @__PURE__ */ g(o, { justifyContent: "space-between", children: [
485
484
  (e == null ? void 0 : e.startDate) && /* @__PURE__ */ n(
486
- A,
485
+ V,
487
486
  {
488
487
  element: {
489
488
  name: "Fecha de inicio",
@@ -498,7 +497,7 @@ const Y = (t) => {
498
497
  "startDate"
499
498
  ),
500
499
  (e == null ? void 0 : e.endDate) && /* @__PURE__ */ n(
501
- A,
500
+ V,
502
501
  {
503
502
  element: {
504
503
  name: "Fecha de final",
@@ -513,16 +512,16 @@ const Y = (t) => {
513
512
  ] })
514
513
  ] })
515
514
  ] });
516
- }, re = G.div`
515
+ }, oe = B.div`
517
516
  border-radius: 8px;
518
- border: 1px solid ${X.palette.neutral.N30};
517
+ border: 1px solid ${Y.palette.neutral.N30};
519
518
  box-sizing: border-box;
520
519
  display: flex;
521
520
  flex-direction: column;
522
521
  height: 340px;
523
522
  width: 332px;
524
523
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
525
- `, oe = G.div`
524
+ `, ie = B.div`
526
525
  width: 100%;
527
526
  height: 100%;
528
527
  overflow-y: auto;
@@ -540,32 +539,32 @@ const Y = (t) => {
540
539
  background-color: #ebecf0;
541
540
  border-radius: 8px;
542
541
  }
543
- `, ke = (t) => {
542
+ `, Ee = (t) => {
544
543
  const { children: e, handleDelete: a, handleView: i, id: l } = t;
545
- return /* @__PURE__ */ h(re, { children: [
546
- /* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(oe, { children: /* @__PURE__ */ n(o, { direction: "column", margin: "10px", children: e }) }) }),
547
- /* @__PURE__ */ h(o, { gap: "16px", direction: "column", margin: "2px 12px", children: [
548
- /* @__PURE__ */ n(V, {}),
549
- /* @__PURE__ */ h(o, { gap: "16px", justifyContent: "end", children: [
544
+ return /* @__PURE__ */ g(oe, { children: [
545
+ /* @__PURE__ */ n(o, { height: "282px", gap: "24px", direction: "column", children: /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(o, { direction: "column", margin: "10px", children: e }) }) }),
546
+ /* @__PURE__ */ g(o, { gap: "16px", direction: "column", margin: "2px 12px", children: [
547
+ /* @__PURE__ */ n(E, {}),
548
+ /* @__PURE__ */ g(o, { gap: "16px", justifyContent: "end", children: [
550
549
  /* @__PURE__ */ n(
551
- N,
550
+ I,
552
551
  {
553
552
  appearance: "dark",
554
553
  size: "24px",
555
554
  cursorHover: !0,
556
- icon: /* @__PURE__ */ n(K, {}),
555
+ icon: /* @__PURE__ */ n(W, {}),
557
556
  onClick: () => {
558
557
  i(l);
559
558
  }
560
559
  }
561
560
  ),
562
561
  /* @__PURE__ */ n(
563
- N,
562
+ I,
564
563
  {
565
564
  cursorHover: !0,
566
565
  appearance: "dark",
567
566
  size: "24px",
568
- icon: /* @__PURE__ */ n(W, {}),
567
+ icon: /* @__PURE__ */ n(X, {}),
569
568
  onClick: () => {
570
569
  a(l);
571
570
  }
@@ -576,7 +575,7 @@ const Y = (t) => {
576
575
  ] });
577
576
  };
578
577
  export {
579
- ke as BusinessRuleCard,
578
+ Ee as BusinessRuleCard,
580
579
  we as BusinessRuleView,
581
- Te as RulesForm
580
+ ke as RulesForm
582
581
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "0.1.14",
13
+ "version": "0.1.16",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
@@ -48,7 +48,7 @@
48
48
  "@inubekit/text": "^2.17.0",
49
49
  "@inubekit/textarea": "^2.45.0",
50
50
  "@inubekit/toggle": "^3.8.2",
51
- "@isettingkit/input": "^0.1.23",
51
+ "@isettingkit/input": "^0.1.24",
52
52
  "@isettingkit/view": "^0.1.13"
53
53
  },
54
54
  "peerDependencies": {