lawgic-dev-kit 0.19.0 → 0.19.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/atoms/Button/Button.js +9 -8
- package/dist/components/atoms/FilterPill/FilterPill.d.ts +8 -0
- package/dist/components/atoms/FilterPill/index.d.ts +1 -0
- package/dist/components/atoms/IconButton/IconButton.js +11 -10
- package/dist/components/atoms/ProgressBar/ProgressBar.js +3 -2
- package/dist/components/atoms/SectionButton/desktop/SectionButton.js +11 -10
- package/dist/components/atoms/SectionButton/mobile/SectionButton.js +13 -12
- package/dist/components/atoms/SidebarButton/SidebarButton.js +3 -2
- package/dist/components/atoms/Switch/Switch.js +3 -2
- package/dist/components/atoms/TextButton/TextButton.js +1 -0
- package/dist/components/atoms/TextInput/TextInput.js +3 -2
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +9 -8
- package/dist/components/molecules/AutocompleteInput/AutocompleteInput.js +1 -1
- package/dist/components/molecules/AutocompleteInput/AutocompleteInput.types.d.ts +1 -1
- package/dist/components/molecules/DateInput/DateInput.d.ts +2 -1
- package/dist/components/molecules/DateInput/DateInput.js +40 -29
- package/dist/components/molecules/FiltersMenu/FiltersMenu.d.ts +13 -0
- package/dist/components/molecules/FiltersMenu/index.d.ts +1 -0
- package/dist/components/molecules/PillsContainer/PillsContainer.d.ts +5 -2
- package/dist/components/molecules/PillsContainer/PillsContainer.js +29 -23
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +2 -1
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.js +27 -25
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useFilterToggler.d.ts +5 -0
- package/dist/hooks/useFilterToggler.js +56 -0
- package/dist/index.js +17 -15
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +40 -40
- 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/types/cycles.d.ts +103 -0
- package/dist/types/filters.d.ts +22 -0
- package/dist/utils/cycles.d.ts +2 -0
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var t = r();
|
|
4
|
-
const s = /* @__PURE__ */ o(t);
|
|
1
|
+
import { __require as r } from "../node_modules/tiny-case/index.js";
|
|
2
|
+
var a = r();
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
a as t
|
|
7
5
|
};
|
package/dist/_virtual/index5.js
CHANGED
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { resolveButtonClasses as
|
|
3
|
-
import { useTheme as
|
|
2
|
+
import { resolveButtonClasses as i } from "./Button.styles.js";
|
|
3
|
+
import { useTheme as d } from "../../../hooks/useTheme.js";
|
|
4
|
+
import "react";
|
|
4
5
|
import { FontAwesomeIcon as r } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
5
6
|
import { resolveIconClasses as m } from "../IconButton/IconButton.styles.js";
|
|
6
|
-
const
|
|
7
|
+
const v = ({
|
|
7
8
|
icon: e,
|
|
8
9
|
rightIcon: t,
|
|
9
10
|
color: l,
|
|
@@ -11,15 +12,15 @@ const h = ({
|
|
|
11
12
|
size: o = "base",
|
|
12
13
|
children: n,
|
|
13
14
|
className: c,
|
|
14
|
-
...
|
|
15
|
+
...p
|
|
15
16
|
}) => {
|
|
16
|
-
const { defaultColorScheme:
|
|
17
|
+
const { defaultColorScheme: u } = d(), f = l || u;
|
|
17
18
|
return /* @__PURE__ */ s.jsxs(
|
|
18
19
|
"button",
|
|
19
20
|
{
|
|
20
21
|
type: "button",
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
22
|
+
className: i(a, f, o) + " " + c,
|
|
23
|
+
...p,
|
|
23
24
|
children: [
|
|
24
25
|
e && /* @__PURE__ */ s.jsx(r, { icon: e, className: m(o) }),
|
|
25
26
|
n,
|
|
@@ -35,5 +36,5 @@ const h = ({
|
|
|
35
36
|
);
|
|
36
37
|
};
|
|
37
38
|
export {
|
|
38
|
-
|
|
39
|
+
v as default
|
|
39
40
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Filter, FilterControl } from '../../../types/filters';
|
|
2
|
+
interface FilterPillProps<T> {
|
|
3
|
+
filter: Omit<Filter<T>, "fn">;
|
|
4
|
+
filterControl: FilterControl<T>;
|
|
5
|
+
translations?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
declare const FilterPill: <T>({ filter, filterControl, translations, }: FilterPillProps<T>) => React.ReactElement;
|
|
8
|
+
export default FilterPill;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FilterPill } from './FilterPill';
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { FontAwesomeIcon as
|
|
3
|
-
import { resolveIconButtonClasses as
|
|
2
|
+
import { FontAwesomeIcon as i } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
3
|
+
import { resolveIconButtonClasses as p, resolveIconClasses as d } from "./IconButton.styles.js";
|
|
4
4
|
import { useTheme as x } from "../../../hooks/useTheme.js";
|
|
5
|
-
|
|
5
|
+
import "react";
|
|
6
|
+
const v = ({
|
|
6
7
|
variant: t = "filled",
|
|
7
8
|
color: r,
|
|
8
9
|
size: o = "base",
|
|
9
|
-
shadow:
|
|
10
|
+
shadow: m = "none",
|
|
10
11
|
icon: e,
|
|
11
|
-
iconProps:
|
|
12
|
+
iconProps: n = {},
|
|
12
13
|
children: l,
|
|
13
14
|
className: a,
|
|
14
15
|
...c
|
|
@@ -18,12 +19,12 @@ const b = ({
|
|
|
18
19
|
"button",
|
|
19
20
|
{
|
|
20
21
|
...c,
|
|
21
|
-
className: `${
|
|
22
|
+
className: `${p(t, f, o, m)} ${a}`,
|
|
22
23
|
children: e ? /* @__PURE__ */ s.jsx(
|
|
23
|
-
|
|
24
|
+
i,
|
|
24
25
|
{
|
|
25
|
-
...
|
|
26
|
-
className:
|
|
26
|
+
...n,
|
|
27
|
+
className: d(o),
|
|
27
28
|
icon: e
|
|
28
29
|
}
|
|
29
30
|
) : l
|
|
@@ -31,5 +32,5 @@ const b = ({
|
|
|
31
32
|
);
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
v as default
|
|
35
36
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { resolveProgressBarColors as c } from "./ProgressBar.styles.js";
|
|
3
3
|
import { useTheme as f } from "../../../hooks/useTheme.js";
|
|
4
|
-
|
|
4
|
+
import "react";
|
|
5
|
+
const g = ({
|
|
5
6
|
progress: r,
|
|
6
7
|
showPercentage: o = !1,
|
|
7
8
|
color: l,
|
|
@@ -24,5 +25,5 @@ const p = ({
|
|
|
24
25
|
] });
|
|
25
26
|
};
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
g as default
|
|
28
29
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as e } from "../../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { FontAwesomeIcon as u } from "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
3
3
|
import { resolveSectionButtonClasses as $ } from "./SectionButton.styles.js";
|
|
4
4
|
import { resolveIconClasses as f } from "../../IconButton/IconButton.styles.js";
|
|
5
5
|
import { useTheme as d } from "../../../../hooks/useTheme.js";
|
|
6
|
-
|
|
6
|
+
import "react";
|
|
7
|
+
const w = ({
|
|
7
8
|
label: r,
|
|
8
9
|
href: a,
|
|
9
10
|
onClick: o,
|
|
10
11
|
active: p = !1,
|
|
11
12
|
disabled: s = !1,
|
|
12
13
|
className: m,
|
|
13
|
-
icon:
|
|
14
|
+
icon: t,
|
|
14
15
|
color: i
|
|
15
16
|
}) => {
|
|
16
17
|
const { defaultColorScheme: x } = d(), j = i || x, n = (c) => {
|
|
@@ -20,7 +21,7 @@ const g = ({
|
|
|
20
21
|
}
|
|
21
22
|
o == null || o(c);
|
|
22
23
|
}, l = `${$(p, j)} ${s ? "!text-gray-300 cursor-not-allowed !bg-transparent" : ""}`;
|
|
23
|
-
return a ? /* @__PURE__ */
|
|
24
|
+
return a ? /* @__PURE__ */ e.jsxs(
|
|
24
25
|
"a",
|
|
25
26
|
{
|
|
26
27
|
href: a,
|
|
@@ -28,27 +29,27 @@ const g = ({
|
|
|
28
29
|
onClick: n,
|
|
29
30
|
"aria-disabled": s,
|
|
30
31
|
children: [
|
|
31
|
-
|
|
32
|
+
t && /* @__PURE__ */ e.jsx(
|
|
32
33
|
u,
|
|
33
34
|
{
|
|
34
|
-
icon:
|
|
35
|
+
icon: t,
|
|
35
36
|
className: f()
|
|
36
37
|
}
|
|
37
38
|
),
|
|
38
39
|
r
|
|
39
40
|
]
|
|
40
41
|
}
|
|
41
|
-
) : /* @__PURE__ */
|
|
42
|
+
) : /* @__PURE__ */ e.jsxs(
|
|
42
43
|
"button",
|
|
43
44
|
{
|
|
44
45
|
className: `${l} ${m || ""}`,
|
|
45
46
|
onClick: n,
|
|
46
47
|
disabled: s,
|
|
47
48
|
children: [
|
|
48
|
-
|
|
49
|
+
t && /* @__PURE__ */ e.jsx(
|
|
49
50
|
u,
|
|
50
51
|
{
|
|
51
|
-
icon:
|
|
52
|
+
icon: t,
|
|
52
53
|
className: f()
|
|
53
54
|
}
|
|
54
55
|
),
|
|
@@ -58,5 +59,5 @@ const g = ({
|
|
|
58
59
|
);
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
w as default
|
|
62
63
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { j as s } from "../../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { FontAwesomeIcon as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import { FontAwesomeIcon as u } from "../../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
3
|
+
import { useTheme as h } from "../../../../hooks/useTheme.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { resolveSectionButtonClasses as j, resolveSectionButtonIconClasses as f } from "./MobileSectionButton.styles.js";
|
|
6
|
+
const v = ({
|
|
6
7
|
label: m,
|
|
7
8
|
href: n,
|
|
8
9
|
onClick: o,
|
|
@@ -10,15 +11,15 @@ const S = ({
|
|
|
10
11
|
disabled: e = !1,
|
|
11
12
|
className: l,
|
|
12
13
|
icon: t,
|
|
13
|
-
color:
|
|
14
|
+
color: p
|
|
14
15
|
}) => {
|
|
15
|
-
const { defaultColorScheme:
|
|
16
|
+
const { defaultColorScheme: d } = h(), a = p || d, c = (i) => {
|
|
16
17
|
if (e) {
|
|
17
|
-
|
|
18
|
+
i.preventDefault();
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
o == null || o(
|
|
21
|
-
}, x = `${
|
|
21
|
+
o == null || o(i);
|
|
22
|
+
}, x = `${j(r, a)} ${e ? "!text-gray-300 cursor-not-allowed !bg-transparent" : ""}`;
|
|
22
23
|
return n ? /* @__PURE__ */ s.jsxs(
|
|
23
24
|
"a",
|
|
24
25
|
{
|
|
@@ -28,7 +29,7 @@ const S = ({
|
|
|
28
29
|
"aria-disabled": e,
|
|
29
30
|
children: [
|
|
30
31
|
t && /* @__PURE__ */ s.jsx("div", { className: f(r, a), children: /* @__PURE__ */ s.jsx(
|
|
31
|
-
|
|
32
|
+
u,
|
|
32
33
|
{
|
|
33
34
|
icon: t,
|
|
34
35
|
className: "size-16 max-h-16 max-w-16"
|
|
@@ -45,7 +46,7 @@ const S = ({
|
|
|
45
46
|
disabled: e,
|
|
46
47
|
children: [
|
|
47
48
|
t && /* @__PURE__ */ s.jsx("div", { className: f(r, a), children: /* @__PURE__ */ s.jsx(
|
|
48
|
-
|
|
49
|
+
u,
|
|
49
50
|
{
|
|
50
51
|
icon: t,
|
|
51
52
|
className: "size-16 max-h-16 max-w-16"
|
|
@@ -57,5 +58,5 @@ const S = ({
|
|
|
57
58
|
);
|
|
58
59
|
};
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
v as default
|
|
61
62
|
};
|
|
@@ -2,7 +2,8 @@ import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
|
2
2
|
import { FontAwesomeIcon as f } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
3
3
|
import { resolveSidebarButtonColors as d } from "./SidebarButton.styles.js";
|
|
4
4
|
import { useTheme as h } from "../../../hooks/useTheme.js";
|
|
5
|
-
|
|
5
|
+
import "react";
|
|
6
|
+
const j = ({
|
|
6
7
|
active: o,
|
|
7
8
|
icon: l,
|
|
8
9
|
label: n,
|
|
@@ -58,5 +59,5 @@ const y = ({
|
|
|
58
59
|
);
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
j as default
|
|
62
63
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { j as s } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useTheme as t } from "../../../hooks/useTheme.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const i = ({ active: n, onClick: e }) => {
|
|
4
5
|
const { defaultColorScheme: o } = t();
|
|
5
6
|
return /* @__PURE__ */ s.jsxs(
|
|
6
7
|
"button",
|
|
@@ -29,5 +30,5 @@ const l = ({ active: n, onClick: e }) => {
|
|
|
29
30
|
);
|
|
30
31
|
};
|
|
31
32
|
export {
|
|
32
|
-
|
|
33
|
+
i as default
|
|
33
34
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useController as w } from "react-hook-form";
|
|
3
3
|
import { useTheme as v } from "../../../hooks/useTheme.js";
|
|
4
|
-
|
|
4
|
+
import "react";
|
|
5
|
+
const S = ({
|
|
5
6
|
label: c,
|
|
6
7
|
control: x,
|
|
7
8
|
name: e,
|
|
@@ -94,5 +95,5 @@ const I = ({
|
|
|
94
95
|
);
|
|
95
96
|
};
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
+
S as default
|
|
98
99
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { j as o } from "../../../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useTheme as h } from "../../../hooks/useTheme.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const w = ({
|
|
4
5
|
label: x,
|
|
5
6
|
onChange: p,
|
|
6
7
|
value: s,
|
|
7
8
|
name: t,
|
|
8
9
|
error: l,
|
|
9
|
-
placeholder:
|
|
10
|
-
className:
|
|
10
|
+
placeholder: i,
|
|
11
|
+
className: b = "",
|
|
11
12
|
disabled: e = !1,
|
|
12
13
|
disabledInput: n = !1,
|
|
13
|
-
size:
|
|
14
|
+
size: g = "base",
|
|
14
15
|
leftSide: a,
|
|
15
16
|
rightSide: c,
|
|
16
17
|
...d
|
|
@@ -30,11 +31,11 @@ const j = ({
|
|
|
30
31
|
error: "text-label",
|
|
31
32
|
gap: "gap-8"
|
|
32
33
|
}
|
|
33
|
-
}[
|
|
34
|
+
}[g];
|
|
34
35
|
return /* @__PURE__ */ o.jsxs(
|
|
35
36
|
"label",
|
|
36
37
|
{
|
|
37
|
-
className: `flex flex-col group select-none ${r.gap} ${e && "cursor-not-allowed"} ${
|
|
38
|
+
className: `flex flex-col group select-none ${r.gap} ${e && "cursor-not-allowed"} ${b}`,
|
|
38
39
|
htmlFor: t,
|
|
39
40
|
children: [
|
|
40
41
|
/* @__PURE__ */ o.jsx(
|
|
@@ -74,7 +75,7 @@ const j = ({
|
|
|
74
75
|
id: t,
|
|
75
76
|
name: t,
|
|
76
77
|
disabled: e,
|
|
77
|
-
placeholder:
|
|
78
|
+
placeholder: i,
|
|
78
79
|
value: s,
|
|
79
80
|
onChange: (f) => {
|
|
80
81
|
p(f.target.value);
|
|
@@ -92,5 +93,5 @@ const j = ({
|
|
|
92
93
|
);
|
|
93
94
|
};
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
w as default
|
|
96
97
|
};
|
|
@@ -5,7 +5,7 @@ export interface AutocompleteInputProps {
|
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
onSelect?: (value: unknown) => void;
|
|
7
7
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
8
|
-
onOptionClick?: (
|
|
8
|
+
onOptionClick?: ({ label, value }: {
|
|
9
9
|
label: string;
|
|
10
10
|
value: unknown;
|
|
11
11
|
}) => void;
|
|
@@ -8,6 +8,7 @@ export type DateInputProps<T extends FieldValues = FieldValues> = {
|
|
|
8
8
|
translateKey?: string;
|
|
9
9
|
futureDates?: boolean;
|
|
10
10
|
pastDates?: boolean;
|
|
11
|
+
size?: "sm" | "base";
|
|
11
12
|
};
|
|
12
|
-
declare const DateInput: <T extends FieldValues = FieldValues>({ control, name, showTimeSelector, label, translateKey, placeholder, futureDates, pastDates }: DateInputProps<T>) => React.ReactElement;
|
|
13
|
+
declare const DateInput: <T extends FieldValues = FieldValues>({ control, name, showTimeSelector, label, translateKey, placeholder, futureDates, pastDates, size, }: DateInputProps<T>) => React.ReactElement;
|
|
13
14
|
export default DateInput;
|
|
@@ -1,50 +1,60 @@
|
|
|
1
1
|
import { j as c } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as x, useEffect as
|
|
3
|
-
import { useController as
|
|
4
|
-
import { faX as
|
|
5
|
-
import { FontAwesomeIcon as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useTheme as
|
|
10
|
-
import { formatDate as
|
|
11
|
-
const N = (a) =>
|
|
2
|
+
import { useState as x, useEffect as V } from "react";
|
|
3
|
+
import { useController as k } from "react-hook-form";
|
|
4
|
+
import { faX as A } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
5
|
+
import { FontAwesomeIcon as B } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
6
|
+
import K from "../FloatingMenu/FloatingMenu.js";
|
|
7
|
+
import O from "../CalendarSelector/CalendarSelector.js";
|
|
8
|
+
import R from "../../atoms/UncontrolledTextInput/UncontrolledTextInput.js";
|
|
9
|
+
import { useTheme as U } from "../../../hooks/useTheme.js";
|
|
10
|
+
import { formatDate as X } from "../../../node_modules/date-fns/format.js";
|
|
11
|
+
const N = (a) => X(a, "dd/MM/yyyy"), D = (a) => {
|
|
12
12
|
const [t, n, o] = a.split("/");
|
|
13
13
|
if ((t == null ? void 0 : t.length) === 2 && (n == null ? void 0 : n.length) === 2 && (o == null ? void 0 : o.length) === 4) {
|
|
14
14
|
const l = new Date(Number(o), Number(n) - 1, Number(t));
|
|
15
15
|
return isNaN(l.getTime()) ? null : l;
|
|
16
16
|
}
|
|
17
17
|
return null;
|
|
18
|
-
},
|
|
18
|
+
}, Z = ({
|
|
19
|
+
control: a,
|
|
20
|
+
name: t,
|
|
21
|
+
showTimeSelector: n = !1,
|
|
22
|
+
label: o,
|
|
23
|
+
translateKey: l = "",
|
|
24
|
+
placeholder: j,
|
|
25
|
+
futureDates: I = !1,
|
|
26
|
+
pastDates: b = !0,
|
|
27
|
+
size: S
|
|
28
|
+
}) => {
|
|
19
29
|
const {
|
|
20
|
-
field: { value: i, onChange: p, onBlur:
|
|
30
|
+
field: { value: i, onChange: p, onBlur: T },
|
|
21
31
|
fieldState: { error: m }
|
|
22
|
-
} =
|
|
23
|
-
|
|
32
|
+
} = k({ name: t, control: a }), { t: g } = U(), v = g(t), y = g(l), [F, f] = x(!1), [h, r] = x("");
|
|
33
|
+
V(() => {
|
|
24
34
|
i instanceof Date && !isNaN(i.getTime()) ? r(N(i)) : r("");
|
|
25
35
|
}, [i]);
|
|
26
|
-
const C = D(h),
|
|
36
|
+
const C = D(h), M = (e) => {
|
|
27
37
|
const s = e.replace(/\D/g, "").slice(0, 8), u = [];
|
|
28
38
|
s.length > 0 && u.push(s.slice(0, 2)), s.length > 2 && u.push(s.slice(2, 4)), s.length > 4 && u.push(s.slice(4, 8));
|
|
29
39
|
const d = u.join("/");
|
|
30
40
|
if (r(d), f(!1), d.length === 10) {
|
|
31
|
-
const
|
|
32
|
-
p(
|
|
41
|
+
const E = D(d);
|
|
42
|
+
p(E);
|
|
33
43
|
}
|
|
34
|
-
},
|
|
44
|
+
}, w = () => {
|
|
35
45
|
p(null), r("");
|
|
36
46
|
};
|
|
37
47
|
return /* @__PURE__ */ c.jsx(
|
|
38
|
-
|
|
48
|
+
K,
|
|
39
49
|
{
|
|
40
|
-
open:
|
|
50
|
+
open: F,
|
|
41
51
|
strategy: "fixed",
|
|
42
52
|
padding: 0,
|
|
43
53
|
offset: 0,
|
|
44
54
|
onClose: () => f(!1),
|
|
45
55
|
className: "p-0!",
|
|
46
56
|
component: /* @__PURE__ */ c.jsx(
|
|
47
|
-
|
|
57
|
+
O,
|
|
48
58
|
{
|
|
49
59
|
date: C || /* @__PURE__ */ new Date(),
|
|
50
60
|
onDateChange: (e) => {
|
|
@@ -56,25 +66,26 @@ const N = (a) => U(a, "dd/MM/yyyy"), D = (a) => {
|
|
|
56
66
|
}
|
|
57
67
|
),
|
|
58
68
|
children: /* @__PURE__ */ c.jsx(
|
|
59
|
-
|
|
69
|
+
R,
|
|
60
70
|
{
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
size: S,
|
|
72
|
+
onBlur: T,
|
|
73
|
+
name: y || v,
|
|
63
74
|
label: o,
|
|
64
75
|
value: h,
|
|
65
76
|
onFocus: (e) => {
|
|
66
77
|
e.preventDefault(), f(!0);
|
|
67
78
|
},
|
|
68
79
|
disabledInput: !0,
|
|
69
|
-
onChange: (e) =>
|
|
80
|
+
onChange: (e) => M(e),
|
|
70
81
|
placeholder: j,
|
|
71
82
|
error: m == null ? void 0 : m.message,
|
|
72
83
|
rightSide: !!C && /* @__PURE__ */ c.jsx(
|
|
73
|
-
|
|
84
|
+
B,
|
|
74
85
|
{
|
|
75
|
-
icon:
|
|
86
|
+
icon: A,
|
|
76
87
|
className: "text-gray-500 cursor-pointer",
|
|
77
|
-
onClick:
|
|
88
|
+
onClick: w
|
|
78
89
|
}
|
|
79
90
|
)
|
|
80
91
|
}
|
|
@@ -83,5 +94,5 @@ const N = (a) => U(a, "dd/MM/yyyy"), D = (a) => {
|
|
|
83
94
|
);
|
|
84
95
|
};
|
|
85
96
|
export {
|
|
86
|
-
|
|
97
|
+
Z as default
|
|
87
98
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { FilterControl } from '../../../types/filters';
|
|
3
|
+
import { Cycle } from 'motion/react';
|
|
4
|
+
interface FiltersMenuProps {
|
|
5
|
+
filters: {
|
|
6
|
+
icon: IconProp;
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}[];
|
|
10
|
+
filterControl: FilterControl<Cycle>;
|
|
11
|
+
}
|
|
12
|
+
declare const FiltersMenu: React.FC<FiltersMenuProps>;
|
|
13
|
+
export default FiltersMenu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FiltersMenu } from './FiltersMenu';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
interface PillsContainerProps {
|
|
2
|
-
values:
|
|
3
|
-
|
|
2
|
+
values: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
onPillRemove: (id: string) => void;
|
|
4
7
|
}
|
|
5
8
|
declare const PillsContainer: ({ values, onPillRemove, }: PillsContainerProps) => React.ReactElement;
|
|
6
9
|
export default PillsContainer;
|