lawgic-dev-kit 0.12.6 → 0.12.9
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 +3 -2
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/components/atoms/Avatar/Avatar.js +4 -5
- package/dist/components/atoms/UploadContainer/UploadContainer.js +2 -3
- package/dist/components/molecules/AlertModal/AlertModal.js +6 -7
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +2 -3
- package/dist/components/molecules/DialogModal/DialogModal.js +2 -3
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +6 -7
- package/dist/components/molecules/Tabs/Tabs.js +2 -3
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +61 -61
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/scheduler/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/utils/modal.js +20 -21
- package/dist/utils/toast.d.ts +1 -1
- package/dist/utils/toast.js +75 -94
- package/package.json +1 -1
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../_virtual/
|
|
1
|
+
import { __module as r } from "../../_virtual/index5.js";
|
|
2
2
|
import { __require as s } from "./node_modules/react-is/index.js";
|
|
3
3
|
import { __require as t } from "./factoryWithTypeCheckers.js";
|
|
4
4
|
import { __require as p } from "./factoryWithThrowingShims.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as v } from "../../_virtual/
|
|
2
|
-
import { t as U } from "../../_virtual/
|
|
3
|
-
import oe from "../../_virtual/
|
|
1
|
+
import { p as v } from "../../_virtual/index2.js";
|
|
2
|
+
import { t as U } from "../../_virtual/index3.js";
|
|
3
|
+
import oe from "../../_virtual/index4.js";
|
|
4
4
|
const ce = Object.prototype.toString, he = Error.prototype.toString, fe = RegExp.prototype.toString, de = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", pe = /^Symbol\((.*)\)(.*)$/;
|
|
5
5
|
function me(n) {
|
|
6
6
|
return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
|
package/dist/utils/modal.js
CHANGED
|
@@ -3,15 +3,14 @@ import { l as u } from "../_virtual/lodash.js";
|
|
|
3
3
|
import { useState as l, useRef as a, useCallback as d, useEffect as f } from "react";
|
|
4
4
|
import M from "../components/molecules/AlertModal/AlertModal.js";
|
|
5
5
|
import "../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
6
|
-
import "react-dom";
|
|
7
6
|
import "../contexts/themeContext.js";
|
|
8
|
-
import
|
|
7
|
+
import w from "../components/atoms/CenterModal/CenterModal.js";
|
|
9
8
|
import "react-hook-form";
|
|
10
9
|
import "../constants/countries.js";
|
|
11
10
|
import "../components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const [p,
|
|
11
|
+
import m from "../components/molecules/DialogModal/DialogModal.js";
|
|
12
|
+
const b = () => {
|
|
13
|
+
const [p, n] = l([]), t = a([]), s = d((e) => {
|
|
15
14
|
const r = {
|
|
16
15
|
...e,
|
|
17
16
|
id: (e == null ? void 0 : e.id) || u.uniqueId(),
|
|
@@ -23,14 +22,14 @@ const k = () => {
|
|
|
23
22
|
onClose: () => o(e.id || u.uniqueId())
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
|
|
25
|
+
t.current = [...t.current, r], n(t.current);
|
|
27
26
|
}, []), o = d((e) => {
|
|
28
|
-
|
|
27
|
+
t.current = t.current.map(
|
|
29
28
|
(r) => r.id === e ? { ...r, open: !1 } : r
|
|
30
|
-
), t
|
|
31
|
-
|
|
29
|
+
), n(t.current), setTimeout(() => {
|
|
30
|
+
t.current = t.current.filter(
|
|
32
31
|
(r) => r.id !== e
|
|
33
|
-
), t
|
|
32
|
+
), n(t.current);
|
|
34
33
|
}, 150);
|
|
35
34
|
}, []);
|
|
36
35
|
return f(() => {
|
|
@@ -39,7 +38,7 @@ const k = () => {
|
|
|
39
38
|
if (e.type === "dialog") {
|
|
40
39
|
const { props: c } = e;
|
|
41
40
|
return /* @__PURE__ */ i.jsx(
|
|
42
|
-
|
|
41
|
+
m,
|
|
43
42
|
{
|
|
44
43
|
...c,
|
|
45
44
|
open: e.open,
|
|
@@ -62,7 +61,7 @@ const k = () => {
|
|
|
62
61
|
}
|
|
63
62
|
const { props: r } = e;
|
|
64
63
|
return /* @__PURE__ */ i.jsx(
|
|
65
|
-
|
|
64
|
+
w,
|
|
66
65
|
{
|
|
67
66
|
...r,
|
|
68
67
|
open: e.open,
|
|
@@ -73,16 +72,16 @@ const k = () => {
|
|
|
73
72
|
);
|
|
74
73
|
}) });
|
|
75
74
|
};
|
|
76
|
-
function
|
|
77
|
-
var
|
|
78
|
-
(
|
|
75
|
+
function k(p) {
|
|
76
|
+
var n;
|
|
77
|
+
(n = window == null ? void 0 : window.openModal) == null || n.call(window, p);
|
|
79
78
|
}
|
|
80
|
-
function
|
|
81
|
-
var
|
|
82
|
-
(
|
|
79
|
+
function A(p) {
|
|
80
|
+
var n;
|
|
81
|
+
(n = window == null ? void 0 : window.closeModal) == null || n.call(window, p);
|
|
83
82
|
}
|
|
84
83
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
b as ModalContainer,
|
|
85
|
+
A as closeModal,
|
|
86
|
+
k as openModal
|
|
88
87
|
};
|
package/dist/utils/toast.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToastContent, ToastMethods, ToastOptions } from '../types';
|
|
1
|
+
import { ToastContent, ToastMethods, ToastOptions } from '../types/toast';
|
|
2
2
|
export declare const showToastAsync: (promise: Promise<unknown>, messages: {
|
|
3
3
|
loading: ToastContent;
|
|
4
4
|
success: ToastContent;
|
package/dist/utils/toast.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createPortal as C } from "react-dom";
|
|
1
|
+
import { j as d } from "../_virtual/jsx-runtime.js";
|
|
3
2
|
import "../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
4
|
-
import { AsyncToast as
|
|
5
|
-
import
|
|
3
|
+
import { AsyncToast as u } from "../components/atoms/AsyncToast/index.js";
|
|
4
|
+
import "react";
|
|
6
5
|
import "../_virtual/lodash.js";
|
|
7
6
|
import "../contexts/themeContext.js";
|
|
8
7
|
import "react-hook-form";
|
|
9
8
|
import "../constants/countries.js";
|
|
10
9
|
import "../components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
switch (
|
|
10
|
+
import h from "../components/atoms/Toast/Toast.js";
|
|
11
|
+
const m = [];
|
|
12
|
+
function l(e = "bottom-center") {
|
|
13
|
+
var o;
|
|
14
|
+
if (!m.find((t) => t.id === e)) {
|
|
15
|
+
const t = document.createElement("div");
|
|
16
|
+
switch (t.classList.add(
|
|
18
17
|
"fixed",
|
|
19
18
|
"z-50",
|
|
20
19
|
"flex",
|
|
@@ -22,116 +21,98 @@ function u(t = "bottom-center") {
|
|
|
22
21
|
"items-center",
|
|
23
22
|
"w-fit",
|
|
24
23
|
"min-w-[18rem]"
|
|
25
|
-
),
|
|
24
|
+
), e) {
|
|
26
25
|
case "top-left":
|
|
27
|
-
|
|
26
|
+
t.classList.add("top-8", "left-8");
|
|
28
27
|
break;
|
|
29
28
|
case "top-right":
|
|
30
|
-
|
|
29
|
+
t.classList.add("top-8", "right-8");
|
|
31
30
|
break;
|
|
32
31
|
case "bottom-left":
|
|
33
|
-
|
|
32
|
+
t.classList.add("bottom-8", "left-8");
|
|
34
33
|
break;
|
|
35
34
|
case "bottom-right":
|
|
36
|
-
|
|
35
|
+
t.classList.add("bottom-8", "right-8");
|
|
37
36
|
break;
|
|
38
37
|
case "top-center":
|
|
39
|
-
|
|
38
|
+
t.classList.add("top-8", "left-1/2", "-translate-x-1/2");
|
|
40
39
|
break;
|
|
41
40
|
case "bottom-center":
|
|
42
41
|
default:
|
|
43
|
-
|
|
42
|
+
t.classList.add(
|
|
44
43
|
"bottom-8",
|
|
45
44
|
"left-1/2",
|
|
46
45
|
"-translate-x-1/2"
|
|
47
46
|
);
|
|
48
47
|
}
|
|
49
|
-
|
|
48
|
+
m.push({ id: e, element: t }), document.body.appendChild(t);
|
|
50
49
|
}
|
|
51
|
-
return (
|
|
50
|
+
return (o = m.find((t) => t.id === e)) == null ? void 0 : o.element;
|
|
52
51
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const n = setTimeout(() => {
|
|
60
|
-
t.firstChild instanceof HTMLElement && t.firstChild.classList.add("mt-[0.5rem]");
|
|
61
|
-
}, 10);
|
|
62
|
-
return e && e(), () => clearTimeout(n);
|
|
63
|
-
}, [t, e]), C(s, t);
|
|
64
|
-
}
|
|
65
|
-
function d(t, s = "success", { position: e = "top-right", duration: n = 3e3 } = {}) {
|
|
66
|
-
const o = u(e);
|
|
67
|
-
if (!o) return;
|
|
68
|
-
const r = document.createElement("div");
|
|
69
|
-
o.prepend(r);
|
|
70
|
-
const c = () => {
|
|
71
|
-
const [a, m] = p(!0), x = () => {
|
|
72
|
-
m(!1), setTimeout(() => {
|
|
73
|
-
r.parentNode === o && o.removeChild(r);
|
|
74
|
-
}, 300);
|
|
52
|
+
function i(e, o = "success", { position: t = "top-right", duration: a = 3e3 } = {}) {
|
|
53
|
+
import("../_virtual/client.js").then((n) => n.c).then(({ createRoot: n }) => {
|
|
54
|
+
const s = l(t);
|
|
55
|
+
if (!s) return;
|
|
56
|
+
const r = document.createElement("div"), c = n(r), f = () => {
|
|
57
|
+
c.unmount(), s.removeChild(r);
|
|
75
58
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
59
|
+
c.render(
|
|
60
|
+
/* @__PURE__ */ d.jsx(
|
|
61
|
+
h,
|
|
62
|
+
{
|
|
63
|
+
content: e,
|
|
64
|
+
type: o,
|
|
65
|
+
duration: a,
|
|
66
|
+
onClose: f
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
), s.prepend(r), setTimeout(() => {
|
|
70
|
+
r.classList.add("mt-[0.5rem]");
|
|
71
|
+
}, 10);
|
|
88
72
|
});
|
|
89
73
|
}
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const [i, a] = p(!0), m = () => {
|
|
97
|
-
a(!1), setTimeout(() => {
|
|
98
|
-
o.parentNode === n && n.removeChild(o);
|
|
99
|
-
}, 300);
|
|
74
|
+
const p = (e, o, t = {}) => {
|
|
75
|
+
import("../_virtual/client.js").then((a) => a.c).then(({ createRoot: a }) => {
|
|
76
|
+
const n = l(t.position);
|
|
77
|
+
if (!n) return;
|
|
78
|
+
const s = document.createElement("div"), r = a(s), c = () => {
|
|
79
|
+
r.unmount(), n.removeChild(s);
|
|
100
80
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
81
|
+
r.render(
|
|
82
|
+
/* @__PURE__ */ d.jsx(
|
|
83
|
+
u,
|
|
84
|
+
{
|
|
85
|
+
promise: e,
|
|
86
|
+
messages: o,
|
|
87
|
+
options: t,
|
|
88
|
+
onClose: c
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
), n.prepend(s), setTimeout(() => {
|
|
92
|
+
s.classList.add("mt-[0.5rem]");
|
|
93
|
+
}, 10);
|
|
113
94
|
});
|
|
114
|
-
},
|
|
115
|
-
let
|
|
116
|
-
},
|
|
95
|
+
}, b = (e, o = {}) => {
|
|
96
|
+
let t = () => {
|
|
97
|
+
}, a = () => {
|
|
117
98
|
};
|
|
118
|
-
const
|
|
119
|
-
|
|
99
|
+
const n = new Promise((s, r) => {
|
|
100
|
+
t = s, a = r;
|
|
120
101
|
});
|
|
121
|
-
return
|
|
122
|
-
resolve:
|
|
123
|
-
reject:
|
|
102
|
+
return p(n, e, o), {
|
|
103
|
+
resolve: t,
|
|
104
|
+
reject: a
|
|
124
105
|
};
|
|
125
|
-
},
|
|
126
|
-
success: (
|
|
127
|
-
error: (
|
|
128
|
-
warning: (
|
|
129
|
-
info: (
|
|
130
|
-
async: (
|
|
131
|
-
loading: (
|
|
106
|
+
}, y = {
|
|
107
|
+
success: (e, o = {}) => i(e, "success", o),
|
|
108
|
+
error: (e, o = {}) => i(e, "error", o),
|
|
109
|
+
warning: (e, o = {}) => i(e, "warning", o),
|
|
110
|
+
info: (e, o = {}) => i(e, "info", o),
|
|
111
|
+
async: (e, o, t = {}) => p(e, o, t),
|
|
112
|
+
loading: (e, o = {}) => b(e, o)
|
|
132
113
|
};
|
|
133
114
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
115
|
+
p as showToastAsync,
|
|
116
|
+
b as showToastLoading,
|
|
117
|
+
y as toast
|
|
137
118
|
};
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
|
-
export type DateInputProps<T extends FieldValues = FieldValues> = {
|
|
3
|
-
control: Control<T>;
|
|
4
|
-
name: Path<T>;
|
|
5
|
-
label?: string;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
showTimeSelector?: boolean;
|
|
8
|
-
translateKey?: string;
|
|
9
|
-
};
|
|
10
|
-
declare const DateInput: <T extends FieldValues = FieldValues>({ control, name, showTimeSelector, label, translateKey, placeholder }: DateInputProps<T>) => React.ReactElement;
|
|
11
|
-
export default DateInput;
|