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.
- package/dist/_virtual/index2.js +2 -3
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +3 -5
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/molecules/CalendarSelector/CalendarSelector.d.ts +2 -0
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +120 -118
- package/dist/components/molecules/DateInput/DateInput.d.ts +3 -1
- package/dist/components/molecules/DateInput/DateInput.js +47 -46
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +3 -1
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.js +37 -34
- package/dist/lawgic-dev-kit.umd.js +60 -60
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/toposort/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/src/components/molecules/CalendarSelector/CalendarSelector.d.ts +11 -0
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +13 -0
- package/dist/src/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,90 +1,93 @@
|
|
|
1
1
|
import { j as m } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as d, useEffect as
|
|
3
|
-
import { faX as
|
|
4
|
-
import { FontAwesomeIcon as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
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
|
|
16
|
-
const c = (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
|
|
20
|
-
return isNaN(
|
|
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
|
|
24
|
+
function L({
|
|
25
25
|
currentDate: e,
|
|
26
26
|
onDateChange: t,
|
|
27
27
|
label: n,
|
|
28
28
|
placeholder: s = "dd/mm/yyyy",
|
|
29
|
-
error:
|
|
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 [
|
|
35
|
+
const [j, a] = d(!1), [N, r] = d(
|
|
34
36
|
e ? c(e) : ""
|
|
35
37
|
);
|
|
36
|
-
|
|
38
|
+
b(() => {
|
|
37
39
|
r(e ? c(e) : "");
|
|
38
40
|
}, [e]);
|
|
39
|
-
const
|
|
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),
|
|
44
|
-
const u =
|
|
45
|
+
if (r(f), a(!1), f.length === 10) {
|
|
46
|
+
const u = F(f);
|
|
45
47
|
u && t(u);
|
|
46
48
|
}
|
|
47
|
-
},
|
|
49
|
+
}, I = () => {
|
|
48
50
|
t(null), r("");
|
|
49
51
|
};
|
|
50
52
|
return /* @__PURE__ */ m.jsx(
|
|
51
|
-
|
|
53
|
+
v,
|
|
52
54
|
{
|
|
53
|
-
open:
|
|
55
|
+
open: j,
|
|
54
56
|
strategy: "fixed",
|
|
55
57
|
padding: 0,
|
|
56
58
|
offset: 0,
|
|
57
|
-
onClose: () =>
|
|
59
|
+
onClose: () => a(!1),
|
|
58
60
|
className: "p-0!",
|
|
59
61
|
component: /* @__PURE__ */ m.jsx(
|
|
60
|
-
|
|
62
|
+
k,
|
|
61
63
|
{
|
|
62
64
|
date: e || /* @__PURE__ */ new Date(),
|
|
63
65
|
onDateChange: (o) => {
|
|
64
|
-
t(o), r(c(o)),
|
|
66
|
+
t(o), r(c(o)), a(!1);
|
|
65
67
|
},
|
|
66
68
|
showTimeSelector: h,
|
|
67
|
-
|
|
69
|
+
futureDates: x,
|
|
70
|
+
pastDates: C
|
|
68
71
|
}
|
|
69
72
|
),
|
|
70
73
|
children: /* @__PURE__ */ m.jsx(
|
|
71
|
-
|
|
74
|
+
w,
|
|
72
75
|
{
|
|
73
76
|
name: g,
|
|
74
77
|
label: n,
|
|
75
|
-
value:
|
|
78
|
+
value: N,
|
|
76
79
|
onClick: (o) => {
|
|
77
|
-
o.preventDefault(),
|
|
80
|
+
o.preventDefault(), a(!0);
|
|
78
81
|
},
|
|
79
|
-
onChange: (o) =>
|
|
82
|
+
onChange: (o) => y(o),
|
|
80
83
|
placeholder: s,
|
|
81
|
-
error:
|
|
84
|
+
error: i,
|
|
82
85
|
rightSide: e && /* @__PURE__ */ m.jsx(
|
|
83
|
-
|
|
86
|
+
S,
|
|
84
87
|
{
|
|
85
|
-
icon:
|
|
88
|
+
icon: M,
|
|
86
89
|
className: "text-gray-500 cursor-pointer",
|
|
87
|
-
onClick:
|
|
90
|
+
onClick: I
|
|
88
91
|
}
|
|
89
92
|
)
|
|
90
93
|
}
|
|
@@ -93,5 +96,5 @@ function J({
|
|
|
93
96
|
);
|
|
94
97
|
}
|
|
95
98
|
export {
|
|
96
|
-
|
|
99
|
+
L as default
|
|
97
100
|
};
|