lawgic-dev-kit 0.16.0 → 0.16.2

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.
@@ -1,90 +1,93 @@
1
1
  import { j as m } from "../../../_virtual/jsx-runtime.js";
2
- import { useState as d, useEffect as y } from "react";
3
- import { faX as I } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
4
- import { FontAwesomeIcon as b } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
5
- import w from "../CalendarSelector/CalendarSelector.js";
6
- import M from "../FloatingMenu/FloatingMenu.js";
2
+ import { useState as d, useEffect as b } from "react";
3
+ import { faX as M } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
4
+ import { FontAwesomeIcon as S } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
5
+ import k from "../CalendarSelector/CalendarSelector.js";
6
+ import v from "../FloatingMenu/FloatingMenu.js";
7
7
  import "../../../_virtual/lodash.js";
8
8
  import "../../../contexts/themeContext.js";
9
9
  import "react-hook-form";
10
- import S from "../../atoms/UncontrolledTextInput/UncontrolledTextInput.js";
10
+ import w from "../../atoms/UncontrolledTextInput/UncontrolledTextInput.js";
11
11
  import "../InformationContainer/InformationContainer.js";
12
12
  import "../../../constants/countries.js";
13
13
  import "../../atoms/ImageProfileInput/ImageProfileInput.validators.js";
14
14
  import "fuse.js";
15
- import { formatDate as k } from "../../../node_modules/date-fns/format.js";
16
- const c = (e) => k(e, "dd/MM/yyyy"), v = (e) => {
15
+ import { formatDate as E } from "../../../node_modules/date-fns/format.js";
16
+ const c = (e) => E(e, "dd/MM/yyyy"), F = (e) => {
17
17
  const [t, n, s] = e.split("/");
18
18
  if ((t == null ? void 0 : t.length) === 2 && (n == null ? void 0 : n.length) === 2 && (s == null ? void 0 : s.length) === 4) {
19
- const a = new Date(Number(s), Number(n) - 1, Number(t));
20
- return isNaN(a.getTime()) ? null : a;
19
+ const i = new Date(Number(s), Number(n) - 1, Number(t));
20
+ return isNaN(i.getTime()) ? null : i;
21
21
  }
22
22
  return null;
23
23
  };
24
- function J({
24
+ function L({
25
25
  currentDate: e,
26
26
  onDateChange: t,
27
27
  label: n,
28
28
  placeholder: s = "dd/mm/yyyy",
29
- error: a,
29
+ error: i,
30
30
  translatedKey: g,
31
- showTimeSelector: h = !1
31
+ showTimeSelector: h = !1,
32
+ futureDates: x = !1,
33
+ pastDates: C = !0
32
34
  }) {
33
- const [x, i] = d(!1), [C, r] = d(
35
+ const [j, a] = d(!1), [N, r] = d(
34
36
  e ? c(e) : ""
35
37
  );
36
- y(() => {
38
+ b(() => {
37
39
  r(e ? c(e) : "");
38
40
  }, [e]);
39
- const j = (o) => {
41
+ const y = (o) => {
40
42
  const l = o.replace(/\D/g, "").slice(0, 8), p = [];
41
43
  l.length > 0 && p.push(l.slice(0, 2)), l.length > 2 && p.push(l.slice(2, 4)), l.length > 4 && p.push(l.slice(4, 8));
42
44
  const f = p.join("/");
43
- if (r(f), i(!1), f.length === 10) {
44
- const u = v(f);
45
+ if (r(f), a(!1), f.length === 10) {
46
+ const u = F(f);
45
47
  u && t(u);
46
48
  }
47
- }, N = () => {
49
+ }, I = () => {
48
50
  t(null), r("");
49
51
  };
50
52
  return /* @__PURE__ */ m.jsx(
51
- M,
53
+ v,
52
54
  {
53
- open: x,
55
+ open: j,
54
56
  strategy: "fixed",
55
57
  padding: 0,
56
58
  offset: 0,
57
- onClose: () => i(!1),
59
+ onClose: () => a(!1),
58
60
  className: "p-0!",
59
61
  component: /* @__PURE__ */ m.jsx(
60
- w,
62
+ k,
61
63
  {
62
64
  date: e || /* @__PURE__ */ new Date(),
63
65
  onDateChange: (o) => {
64
- t(o), r(c(o)), i(!1);
66
+ t(o), r(c(o)), a(!1);
65
67
  },
66
68
  showTimeSelector: h,
67
- maxDate: /* @__PURE__ */ new Date()
69
+ futureDates: x,
70
+ pastDates: C
68
71
  }
69
72
  ),
70
73
  children: /* @__PURE__ */ m.jsx(
71
- S,
74
+ w,
72
75
  {
73
76
  name: g,
74
77
  label: n,
75
- value: C,
78
+ value: N,
76
79
  onClick: (o) => {
77
- o.preventDefault(), i(!0);
80
+ o.preventDefault(), a(!0);
78
81
  },
79
- onChange: (o) => j(o),
82
+ onChange: (o) => y(o),
80
83
  placeholder: s,
81
- error: a,
84
+ error: i,
82
85
  rightSide: e && /* @__PURE__ */ m.jsx(
83
- b,
86
+ S,
84
87
  {
85
- icon: I,
88
+ icon: M,
86
89
  className: "text-gray-500 cursor-pointer",
87
- onClick: N
90
+ onClick: I
88
91
  }
89
92
  )
90
93
  }
@@ -93,5 +96,5 @@ function J({
93
96
  );
94
97
  }
95
98
  export {
96
- J as default
99
+ L as default
97
100
  };