@envisiongroup/porygon 1.0.0-rc.38 → 1.0.0-rc.40

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 (21) hide show
  1. package/dist/react-components/fields/Input/EFWInput.utils.js +23 -19
  2. package/dist/react-components/forms/EFWForm/EFWForm.hooks.js +2 -2
  3. package/dist/react-components/forms/EFWForm/EFWForm.js +436 -357
  4. package/dist/react-components/forms/EFWForm/EFWForm.types.d.ts +17 -3
  5. package/dist/react-components/forms/EFWForm/EFWForm.utils.js +34 -34
  6. package/dist/react-components/forms/EFWForm/index.d.ts +1 -1
  7. package/dist/react-components/tables/EFWTable/EFWTable.d.ts +1 -1
  8. package/dist/react-components/tables/EFWTable/EFWTable.js +746 -683
  9. package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +43 -4
  10. package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.js +79 -75
  11. package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.types.d.ts +2 -1
  12. package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +34 -26
  13. package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.js +69 -42
  14. package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.types.d.ts +2 -1
  15. package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +4 -1
  16. package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +88 -86
  17. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.d.ts +1 -1
  18. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.js +100 -53
  19. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.types.d.ts +5 -1
  20. package/dist/react-components/tables/EFWTable/index.d.ts +1 -1
  21. package/package.json +1 -1
@@ -2,26 +2,30 @@ const d = (t) => {
2
2
  const e = (t || "").toString(), r = e.replace(/^0+/, "");
3
3
  let n = "";
4
4
  if (r != "" && r.length > 1) {
5
- const c = r.replace(/\./g, "").replace(/-/g, ""), o = c.substring(0, c.length - 1);
6
- let s = 0, a = 1;
7
- for (s = o.length - 1; s >= 0; s--)
8
- n = o.charAt(s) + n, a % 3 == 0 && a <= o.length - 1 && (n = "." + n), a++;
9
- const h = c.substring(c.length - 1);
10
- return n = n + "-" + h, n;
5
+ const o = r.replace(/\./g, "").replace(/-/g, ""), c = o.substring(0, o.length - 1);
6
+ let l = 0, s = 1;
7
+ for (l = c.length - 1; l >= 0; l--)
8
+ n = c.charAt(l) + n, s % 3 == 0 && s <= c.length - 1 && (n = "." + n), s++;
9
+ const u = o.substring(o.length - 1);
10
+ return n = n + "-" + u, n;
11
11
  } else
12
12
  return e;
13
13
  }, F = (t) => {
14
- if (t = t || "", t = t.replace(/\./g, ""), !/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test(t))
14
+ const e = (t || "").replace(/\./g, "").replace(/‐/g, "-");
15
+ if (!/^[0-9]+-?[0-9kK]{1}$/.test(e))
15
16
  return !1;
16
- const e = t.split("-");
17
- let r = e[1];
18
- const n = e[0], i = function(c) {
19
- let o = 0, s = 1;
17
+ const r = e.includes("-") ? e.split("-") : [e.slice(0, -1), e.slice(-1)];
18
+ let n = r[1];
19
+ const i = r[0];
20
+ if (!i || !n)
21
+ return !1;
22
+ const o = function(c) {
23
+ let l = 0, s = 1;
20
24
  for (; c; c = Math.floor(c / 10))
21
- s = (s + c % 10 * (9 - o++ % 6)) % 11;
25
+ s = (s + c % 10 * (9 - l++ % 6)) % 11;
22
26
  return s ? s - 1 : "k";
23
27
  };
24
- return r == "K" && (r = "k"), i(n) == r;
28
+ return n == "K" && (n = "k"), o(i) == n;
25
29
  }, P = (t) => /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t), R = (t) => /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/.test(t), f = {
26
30
  none: /^.*$/,
27
31
  email: /^.*$/,
@@ -31,7 +35,7 @@ const d = (t) => {
31
35
  date: /^\d*$/,
32
36
  time: /^\d*$/,
33
37
  custom: /^\d*$/
34
- }, u = (t, e) => f[e].test(t), l = {
38
+ }, h = (t, e) => f[e].test(t), a = {
35
39
  none: (t) => t,
36
40
  email: (t) => t,
37
41
  phone: (t) => t.replace(/[() -]/g, ""),
@@ -74,14 +78,14 @@ const d = (t) => {
74
78
  }
75
79
  return t;
76
80
  }
77
- }, p = (t, e) => t ? (l[e] || l.none)(t) : "", $ = (t, e, r = {}) => t ? u(t, e) ? (g[e] || g.none)(t, r) : t : "", b = (t, e = "none", r) => {
81
+ }, p = (t, e) => t ? (a[e] || a.none)(t) : "", m = (t, e, r = {}) => t ? h(t, e) ? (g[e] || g.none)(t, r) : t : "", C = (t, e = "none", r) => {
78
82
  const n = p(t ?? "", e);
79
- return $(n, e, r ?? {});
83
+ return m(n, e, r ?? {});
80
84
  };
81
85
  export {
82
- $ as applyFormatting,
83
- b as getInputFormattedValue,
84
- u as isFormattableValue,
86
+ m as applyFormatting,
87
+ C as getInputFormattedValue,
88
+ h as isFormattableValue,
85
89
  p as stripFormatting,
86
90
  F as validateChileanRut,
87
91
  P as validateEmail,
@@ -8,8 +8,8 @@ const C = () => {
8
8
  overwriteAll: !1
9
9
  }) => {
10
10
  r.current?.setValues(e, s);
11
- }, []), o = t((e = !0) => r.current?.validateForm(e) ?? !1, []), i = t(() => {
12
- r.current?.resetValues();
11
+ }, []), o = t((e = !0) => r.current?.validateForm(e) ?? !1, []), i = t((e) => {
12
+ r.current?.resetValues(e);
13
13
  }, []), d = t((e, s) => r.current?.setDisabled(e, s) ?? [], []), g = t((e, s) => r.current?.setEditable(e, s) ?? [], []), m = t(() => r.current?.isDisabled() ?? !1, []), b = t(() => r.current?.isEditable() ?? !0, []), f = t((e, s = "internal") => {
14
14
  r.current?.addMessageBar(e, s);
15
15
  }, []), v = t((e) => {