@m4l/components 0.1.24 → 0.1.25

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 (40) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.465be070.js → index.9cfffe65.js} +1 -1
  2. package/components/CommonActions/components/ActionFormCancel/{index.0deaba48.js → index.ef60c2ee.js} +2 -2
  3. package/components/CommonActions/components/ActionIntro/{index.235ecbe2.js → index.f8403e8e.js} +1 -1
  4. package/components/CommonActions/components/Actions/{index.798c6aee.js → index.309d3b6f.js} +7 -7
  5. package/components/DataGrid/{index.cb62609c.js → index.fe073438.js} +3 -3
  6. package/components/DynamicFilter/{index.549adc46.js → index.d0753667.js} +13 -13
  7. package/components/ModalDialog/{index.0340fb86.js → index.a24ca508.js} +2 -2
  8. package/components/ObjectLogs/{index.b1dcc4db.js → index.a7d36267.js} +3 -3
  9. package/components/Period/index.080a987d.js +175 -0
  10. package/components/Period/styles.d.ts +2 -2
  11. package/components/Period/types.d.ts +4 -1
  12. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +58 -0
  13. package/components/hook-form/RHFDateTime/index.9231a7c7.js +81 -0
  14. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +3 -0
  15. package/components/hook-form/RHFDateTime/{styles.d.ts → subcomponents/Skeleton/styles.d.ts} +0 -0
  16. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +2 -0
  17. package/components/hook-form/RHFPeriod/index.067790c9.js +51 -0
  18. package/components/hook-form/RHFPeriod/types.d.ts +3 -3
  19. package/components/hook-form/RHFTextField/index.ba2a8f67.js +129 -0
  20. package/components/hook-form/RHFTextField/index.d.ts +1 -1
  21. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +1 -1
  22. package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +2 -4
  23. package/components/hook-form/RHFTextField/types.d.ts +1 -0
  24. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts +1 -1
  25. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/index.d.ts +2 -0
  26. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/styles.d.ts +2 -0
  27. package/components/hook-form/RHFUpload/index.6347159a.js +258 -0
  28. package/components/mui_extended/Button/{index.ae47764f.js → index.2afaa420.js} +1 -1
  29. package/components/mui_extended/Pager/{index.298730a1.js → index.a23cf8de.js} +1 -1
  30. package/components/mui_extended/Popover/{index.b6e4392a.js → index.12b0ab55.js} +3 -3
  31. package/contexts/ModalContext/{index.73ab6934.js → index.f17b3653.js} +3 -3
  32. package/hooks/useModal/{index.f2492b34.js → index.b1f96279.js} +1 -1
  33. package/index.js +19 -19
  34. package/package.json +1 -1
  35. package/components/Period/index.05c1c5e0.js +0 -159
  36. package/components/hook-form/RHFCheckbox/index.6a40e25f.js +0 -55
  37. package/components/hook-form/RHFDateTime/index.5ed774e3.js +0 -66
  38. package/components/hook-form/RHFPeriod/index.6c6733eb.js +0 -45
  39. package/components/hook-form/RHFTextField/index.bab2a2cf.js +0 -113
  40. package/components/hook-form/RHFUpload/index.56e2e277.js +0 -239
@@ -1,5 +1,5 @@
1
1
  import { useModuleDictionary as n } from "@m4l/core";
2
- import { B as r } from "../../../mui_extended/Button/index.ae47764f.js";
2
+ import { B as r } from "../../../mui_extended/Button/index.2afaa420.js";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  const m = (o) => {
5
5
  const {
@@ -2,9 +2,9 @@ import { useFormContext as f, useFormState as p } from "react-hook-form";
2
2
  import { useNavigate as C } from "react-router-dom";
3
3
  import { useModuleDictionary as g, useModuleSkeleton as d } from "@m4l/core";
4
4
  import { Skeleton as k } from "@mui/material";
5
- import { B as _ } from "../../../mui_extended/Button/index.ae47764f.js";
5
+ import { B as _ } from "../../../mui_extended/Button/index.2afaa420.js";
6
6
  import { useCallback as v } from "react";
7
- import { u as h } from "../../../../hooks/useModal/index.f2492b34.js";
7
+ import { u as h } from "../../../../hooks/useModal/index.b1f96279.js";
8
8
  import { jsx as r } from "react/jsx-runtime";
9
9
  function A(n) {
10
10
  const {
@@ -1,5 +1,5 @@
1
1
  import { useModuleDictionary as r } from "@m4l/core";
2
- import { B as n } from "../../../mui_extended/Button/index.ae47764f.js";
2
+ import { B as n } from "../../../mui_extended/Button/index.2afaa420.js";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  const e = (o) => {
5
5
  const {
@@ -6,16 +6,16 @@ import "@mui/material/Button";
6
6
  import "react-hook-form";
7
7
  import "react-router-dom";
8
8
  import { useState as W, useMemo as w, forwardRef as st, useRef as B, useImperativeHandle as rt, useEffect as at, useCallback as j } from "react";
9
- import "../../../../contexts/ModalContext/index.73ab6934.js";
9
+ import "../../../../contexts/ModalContext/index.f17b3653.js";
10
10
  import "@mui/lab";
11
11
  import { I as y } from "../../../mui_extended/IconButton/index.4b5ce8b5.js";
12
- import { u as I, a as lt, O as ct } from "../../../DataGrid/index.cb62609c.js";
13
- import { P as dt } from "../../../mui_extended/Pager/index.298730a1.js";
12
+ import { u as I, a as lt, O as ct } from "../../../DataGrid/index.fe073438.js";
13
+ import { P as dt } from "../../../mui_extended/Pager/index.a23cf8de.js";
14
14
  import { D as pt } from "../../../../react-data-grid.d46d625e.js";
15
- import { u as gt } from "../../../../hooks/useModal/index.f2492b34.js";
16
- import { A as ft } from "../ActionCancel/index.465be070.js";
17
- import { A as ut } from "../ActionIntro/index.235ecbe2.js";
18
- import { P as mt } from "../../../mui_extended/Popover/index.b6e4392a.js";
15
+ import { u as gt } from "../../../../hooks/useModal/index.b1f96279.js";
16
+ import { A as ft } from "../ActionCancel/index.9cfffe65.js";
17
+ import { A as ut } from "../ActionIntro/index.f8403e8e.js";
18
+ import { P as mt } from "../../../mui_extended/Popover/index.12b0ab55.js";
19
19
  import { I as N } from "../../../Icon/index.f569765b.js";
20
20
  import { useResponsiveDesktop as ht } from "@m4l/graphics";
21
21
  const _t = p("div")(({
@@ -6,9 +6,9 @@ import { HTML5Backend as ge } from "react-dnd-html5-backend";
6
6
  import { SvgIcon as B, Checkbox as fe, InputBase as he, Skeleton as pe } from "@mui/material";
7
7
  import { jsx as d, jsxs as Q } from "react/jsx-runtime";
8
8
  import { voidFunction as I, useModuleDictionary as we, useModuleSkeleton as me } from "@m4l/core";
9
- import { A as ye, a as Ce } from "../CommonActions/components/Actions/index.798c6aee.js";
10
- import { g as be, d as ve } from "../ModalDialog/index.0340fb86.js";
11
- import { g as xe, d as Re } from "../mui_extended/Pager/index.298730a1.js";
9
+ import { A as ye, a as Ce } from "../CommonActions/components/Actions/index.309d3b6f.js";
10
+ import { g as be, d as ve } from "../ModalDialog/index.a24ca508.js";
11
+ import { g as xe, d as Re } from "../mui_extended/Pager/index.a23cf8de.js";
12
12
  const Se = A("div")(() => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
@@ -7,31 +7,31 @@ import { useFormContext as B, useWatch as ge } from "react-hook-form";
7
7
  import { R } from "../hook-form/RHFAutocomplete/index.5eee9d7c.js";
8
8
  import "lodash/debounce";
9
9
  import { jsx as r, jsxs as w, Fragment as A } from "react/jsx-runtime";
10
- import "../hook-form/RHFCheckbox/index.6a40e25f.js";
10
+ import "../hook-form/RHFCheckbox/index.6dcec9e2.js";
11
11
  import { alpha as Ke, styled as be, Skeleton as Fe, MenuItem as ze, useTheme as Ye, Popper as Ge } from "@mui/material";
12
- import { R as ee } from "../hook-form/RHFDateTime/index.5ed774e3.js";
13
12
  import "@mui/x-date-pickers";
14
- import { R as Y } from "../hook-form/RHFTextField/index.bab2a2cf.js";
13
+ import { R as ee } from "../hook-form/RHFDateTime/index.9231a7c7.js";
14
+ import { R as Y } from "../hook-form/RHFTextField/index.ba2a8f67.js";
15
15
  import { I as he } from "../Icon/index.f569765b.js";
16
- import "../hook-form/RHFPeriod/index.6c6733eb.js";
16
+ import "../hook-form/RHFPeriod/index.067790c9.js";
17
17
  import "../ErrorLabel/index.c8615f16.js";
18
- import "../Period/index.05c1c5e0.js";
19
- import { L as Ue, b as Je, g as Qe } from "../CommonActions/components/Actions/index.798c6aee.js";
18
+ import "../Period/index.080a987d.js";
19
+ import { L as Ue, b as Je, g as Qe } from "../CommonActions/components/Actions/index.309d3b6f.js";
20
20
  import "@mui/material/Button";
21
21
  import "react-router-dom";
22
- import "../../contexts/ModalContext/index.73ab6934.js";
22
+ import "../../contexts/ModalContext/index.f17b3653.js";
23
23
  import "@mui/lab";
24
24
  import "lodash/isString";
25
25
  import "react-dropzone";
26
26
  import "../Image/index.c9da2d5a.js";
27
- import "../hook-form/RHFUpload/index.56e2e277.js";
27
+ import "../hook-form/RHFUpload/index.6347159a.js";
28
28
  import { I as G } from "../mui_extended/IconButton/index.4b5ce8b5.js";
29
29
  import "simplebar/dist/simplebar.min.css";
30
- import { F as te } from "../mui_extended/Button/index.ae47764f.js";
31
- import { P as Xe } from "../mui_extended/Popover/index.b6e4392a.js";
30
+ import { F as te } from "../mui_extended/Button/index.2afaa420.js";
31
+ import { P as Xe } from "../mui_extended/Popover/index.12b0ab55.js";
32
32
  import { R as Ze } from "../contexts/RHFormContext/index.33dba822.js";
33
- import { A as et } from "../CommonActions/components/ActionCancel/index.465be070.js";
34
- import { A as tt } from "../CommonActions/components/ActionIntro/index.235ecbe2.js";
33
+ import { A as et } from "../CommonActions/components/ActionCancel/index.9cfffe65.js";
34
+ import { A as tt } from "../CommonActions/components/ActionIntro/index.f8403e8e.js";
35
35
  import { useResponsiveDesktop as rt } from "@m4l/graphics";
36
36
  const re = h("div")(({
37
37
  theme: e
@@ -60,7 +60,7 @@ const re = h("div")(({
60
60
  ], xe = {
61
61
  name: "all",
62
62
  label: "dynamic_filter.all_fields",
63
- urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg",
63
+ urlIcon: "",
64
64
  type: "string",
65
65
  multiple: !0,
66
66
  presence: "optional"
@@ -1,6 +1,6 @@
1
1
  import { Dialog as b, IconButton as w, Paper as v } from "@mui/material";
2
2
  import { c as D } from "../../react-draggable.20e95c61.js";
3
- import { u as $ } from "../../hooks/useModal/index.f2492b34.js";
3
+ import { u as $ } from "../../hooks/useModal/index.b1f96279.js";
4
4
  import { styled as s } from "@mui/material/styles";
5
5
  import { a as x } from "../../utils/index.214d9542.js";
6
6
  import { R as M } from "../Resizeable/index.45995d2b.js";
@@ -8,7 +8,7 @@ import { useResponsiveDesktop as H } from "@m4l/graphics";
8
8
  import { useEnvironment as I } from "@m4l/core";
9
9
  import { I as C } from "../Icon/index.f569765b.js";
10
10
  import { jsxs as h, jsx as n } from "react/jsx-runtime";
11
- import { b as W, g as _ } from "../CommonActions/components/Actions/index.798c6aee.js";
11
+ import { b as W, g as _ } from "../CommonActions/components/Actions/index.309d3b6f.js";
12
12
  const j = s(b)(() => ({})), k = s("div")(({ theme: o }) => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
@@ -1,14 +1,14 @@
1
1
  import { useState as _, useEffect as f, useCallback as d, useMemo as $ } from "react";
2
2
  import { useNetwork as k, useModuleDictionary as y, useEnvironment as h, usePaginate as O } from "@m4l/core";
3
3
  import { styled as g } from "@mui/material/styles";
4
- import { D as R, g as I } from "../DataGrid/index.cb62609c.js";
4
+ import { D as R, g as I } from "../DataGrid/index.fe073438.js";
5
5
  import { D as L } from "../formatters/DateFormatter/index.08d8823b.js";
6
6
  import { Tooltip as G, IconButton as M } from "@mui/material";
7
7
  import { R as S } from "../../react-json-view.f56a7f8e.js";
8
8
  import { jsx as t, jsxs as A } from "react/jsx-runtime";
9
- import { u as T } from "../../hooks/useModal/index.f2492b34.js";
9
+ import { u as T } from "../../hooks/useModal/index.b1f96279.js";
10
10
  import { I as u } from "../Icon/index.f569765b.js";
11
- import { D as E, g as K } from "../DynamicFilter/index.549adc46.js";
11
+ import { D as E, g as K } from "../DynamicFilter/index.d0753667.js";
12
12
  const q = g("div")(() => ({
13
13
  height: "100%",
14
14
  width: "100%",
@@ -0,0 +1,175 @@
1
+ import { useModuleDictionary as O, useModuleSkeleton as P, useEnvironment as R } from "@m4l/core";
2
+ import { styled as a, Skeleton as u, Autocomplete as T, TextField as b } from "@mui/material";
3
+ import { useMemo as $ } from "react";
4
+ import { I as A } from "../Icon/index.f569765b.js";
5
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
6
+ import { g as w } from "../CommonActions/components/Actions/index.309d3b6f.js";
7
+ import "@mui/material/Button";
8
+ import "react-hook-form";
9
+ import "react-router-dom";
10
+ import "../../contexts/ModalContext/index.f17b3653.js";
11
+ import "@mui/lab";
12
+ const M = a("div")(({
13
+ theme: t,
14
+ error: i,
15
+ readOnly: p
16
+ }) => ({
17
+ display: "flex",
18
+ width: "100%",
19
+ height: "auto",
20
+ alignItems: "center",
21
+ gap: t.spacing(1),
22
+ border: i ? `1px solid ${t.palette.error.main}` : `1px solid ${t.palette.divider}`,
23
+ padding: t.spacing(0.5, 1),
24
+ borderRadius: "4px",
25
+ ...p && {
26
+ border: "0px"
27
+ },
28
+ "& .MuiAutocomplete-root, & .MuiTextField-root": {
29
+ width: "100%"
30
+ },
31
+ "& .MuiAutocomplete-root .MuiTextField-root": {
32
+ width: "100%"
33
+ },
34
+ "& .MuiTextField-root .MuiInput-input": {
35
+ padding: "5px!important"
36
+ }
37
+ })), g = a("div")(({
38
+ theme: t
39
+ }) => ({
40
+ width: "1px",
41
+ height: "20px",
42
+ backgroundColor: t.palette.divider
43
+ })), D = a("div", {
44
+ shouldForwardProp: (t) => t !== "readOnly"
45
+ })(({
46
+ theme: t,
47
+ readOnly: i
48
+ }) => ({
49
+ display: "flex",
50
+ width: "100%",
51
+ height: "37.5px",
52
+ alignItems: "center",
53
+ gap: t.spacing(1),
54
+ border: `1px solid ${t.palette.divider}`,
55
+ ...i && {
56
+ border: "0px"
57
+ },
58
+ padding: t.spacing(0.5, 1),
59
+ borderRadius: "4px"
60
+ })), F = a("div")(({
61
+ theme: t
62
+ }) => ({
63
+ ...t.typography.body2,
64
+ width: "100%",
65
+ display: "flex",
66
+ textOverflow: "elipsis",
67
+ overflow: "hidden",
68
+ padding: "5px",
69
+ textAlign: "left"
70
+ })), H = a("div")(({
71
+ theme: t
72
+ }) => ({
73
+ ...t.typography.body2,
74
+ width: "70px",
75
+ display: "flex",
76
+ textOverflow: "elipsis",
77
+ overflow: "hidden",
78
+ padding: "5px",
79
+ textAlign: "left"
80
+ }));
81
+ var r = /* @__PURE__ */ ((t) => (t[t.YEARS = 0] = "YEARS", t[t.MONTHS = 1] = "MONTHS", t[t.DAYS = 2] = "DAYS", t))(r || {});
82
+ const _ = (t) => t ? t.selPeriodTime ? t.selPeriodTime : t.years && t.years > 0 ? r.YEARS : t.months && t.months > 0 ? r.MONTHS : t.days && t.days > 0 ? r.DAYS : r.YEARS : r.YEARS, N = (t) => t ? t.singleValue !== void 0 ? t.singleValue : t.years && t.years > 0 ? t.years : t.months && t.months > 0 ? t.months : t.days && t.days > 0 ? t.days : "" : "", J = (t) => {
83
+ const {
84
+ value: i,
85
+ onChange: p,
86
+ error: C = !1,
87
+ readOnly: l = !1,
88
+ skeletonWidth: I = "100%",
89
+ skeletonHeight: h = "18px"
90
+ } = t, {
91
+ getLabel: d
92
+ } = O(), Y = P(), f = _(i), x = N(i), m = (e, o) => {
93
+ const s = {
94
+ selPeriodTime: e,
95
+ singleValue: o
96
+ };
97
+ o !== "" && o > 0 && (s.years = 0, s.months = 0, s.days = 0, e === r.YEARS && (s.years = o), e === r.MONTHS && (s.months = o), e === r.DAYS && (s.days = o)), p(s);
98
+ }, k = (e) => {
99
+ e && m(e.id, x);
100
+ }, {
101
+ host_static_assets: y,
102
+ environment_assets: v
103
+ } = R(), S = $(() => [{
104
+ id: 0,
105
+ label: d("period.years")
106
+ }, {
107
+ id: 1,
108
+ label: d("period.months")
109
+ }, {
110
+ id: 2,
111
+ label: d("period.days")
112
+ }], [d]);
113
+ return Y ? /* @__PURE__ */ c(D, {
114
+ readOnly: l,
115
+ children: [/* @__PURE__ */ n(u, {
116
+ variant: "text",
117
+ width: "50%",
118
+ height: h
119
+ }), /* @__PURE__ */ n(g, {}), /* @__PURE__ */ n(u, {
120
+ variant: "text",
121
+ width: I,
122
+ height: h
123
+ }), /* @__PURE__ */ n(u, {
124
+ variant: "circular",
125
+ width: 20,
126
+ sx: {
127
+ minWidth: "20px",
128
+ minHeight: "20px"
129
+ }
130
+ })]
131
+ }) : (l && (i.selPeriodTime, i.singleValue, A, `${y}${v}`), /* @__PURE__ */ c(M, {
132
+ error: C,
133
+ readOnly: l,
134
+ children: [/* @__PURE__ */ n(T, {
135
+ options: S,
136
+ value: S[f],
137
+ disableClearable: !0,
138
+ onChange: (e, o) => {
139
+ k(o);
140
+ },
141
+ renderInput: (e) => /* @__PURE__ */ n(b, {
142
+ ...e,
143
+ fullWidth: !0,
144
+ variant: "standard",
145
+ SelectProps: {
146
+ native: !0
147
+ },
148
+ InputProps: {
149
+ disableUnderline: !0,
150
+ ...e.InputProps
151
+ },
152
+ autoComplete: "off"
153
+ }, `tx_async_${e.id}`)
154
+ }), /* @__PURE__ */ n(g, {}), /* @__PURE__ */ n(b, {
155
+ type: "number",
156
+ variant: "standard",
157
+ value: x,
158
+ InputProps: {
159
+ disableUnderline: !0
160
+ },
161
+ onChange: (e) => {
162
+ m(f, e.target.value === "" ? "" : parseInt(e.target.value));
163
+ }
164
+ }), /* @__PURE__ */ n(A, {
165
+ src: `${y}/${v}/frontend/components/period/assets/icons/clock.svg`
166
+ })]
167
+ }));
168
+ };
169
+ function Q() {
170
+ return ["period"].concat(w());
171
+ }
172
+ export {
173
+ J as P,
174
+ Q as g
175
+ };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { WrapperProps } from './types';
2
+ import { SKTWrapperProps, WrapperProps } from './types';
3
3
  export declare const ContainerPeriod: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & WrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
4
  export declare const Gap: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
- export declare const SKTWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const SKTWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & SKTWrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
6
  export declare const FieldPeriod: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
7
  export declare const FieldValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -8,9 +8,10 @@ export declare type PeriodTime = {
8
8
  id: number;
9
9
  label: string;
10
10
  };
11
- export interface WrapperProps {
11
+ export interface WrapperProps extends Pick<PeriodProps, 'readOnly'> {
12
12
  error: boolean;
13
13
  }
14
+ export declare type SKTWrapperProps = Pick<PeriodProps, 'readOnly'>;
14
15
  export declare type PeriodType = {
15
16
  selPeriodTime: ETimePeriods;
16
17
  singleValue: number | '';
@@ -24,6 +25,8 @@ export interface PeriodProps {
24
25
  error?: boolean;
25
26
  readOnly?: boolean;
26
27
  variant?: PeriodVariant;
28
+ skeletonWidth?: string | number;
29
+ skeletonHeight?: string | number;
27
30
  }
28
31
  export interface WrapperProps {
29
32
  error: boolean;
@@ -0,0 +1,58 @@
1
+ import { useFormContext as a, Controller as c } from "react-hook-form";
2
+ import { styled as m } from "@mui/material/styles";
3
+ import { styled as p, Skeleton as d, FormControlLabel as h, Checkbox as x } from "@mui/material";
4
+ import { useModuleSkeleton as u } from "@m4l/core";
5
+ import { jsx as e, jsxs as f, Fragment as g } from "react/jsx-runtime";
6
+ const k = p("div")(() => ({
7
+ display: "flex",
8
+ justifyContent: "center",
9
+ alignItems: "center",
10
+ width: "36px",
11
+ height: "36px"
12
+ })), C = () => /* @__PURE__ */ e(k, {
13
+ children: /* @__PURE__ */ e(d, {
14
+ variant: "rounded",
15
+ width: "18px",
16
+ height: "18px"
17
+ })
18
+ }), y = m("p")(({
19
+ theme: t
20
+ }) => ({
21
+ ...t.typography.caption,
22
+ color: t.palette.error.main,
23
+ marginRight: 14,
24
+ marginLeft: 14
25
+ }));
26
+ function L({
27
+ name: t,
28
+ sizeCheck: n = "small",
29
+ ...l
30
+ }) {
31
+ const {
32
+ control: i
33
+ } = a(), s = u();
34
+ return /* @__PURE__ */ e(h, {
35
+ control: /* @__PURE__ */ e(c, {
36
+ name: t,
37
+ control: i,
38
+ render: ({
39
+ field: o,
40
+ fieldState: {
41
+ error: r
42
+ }
43
+ }) => s ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ f(g, {
44
+ children: [/* @__PURE__ */ e(x, {
45
+ size: n,
46
+ ...o,
47
+ checked: o.value
48
+ }), r?.message && /* @__PURE__ */ e(y, {
49
+ children: r?.message + ""
50
+ })]
51
+ })
52
+ }),
53
+ ...l
54
+ });
55
+ }
56
+ export {
57
+ L as R
58
+ };
@@ -0,0 +1,81 @@
1
+ import { useFormContext as c, Controller as f } from "react-hook-form";
2
+ import { Skeleton as s, TextField as x } from "@mui/material";
3
+ import { DateTimePicker as g } from "@mui/x-date-pickers";
4
+ import { useModuleSkeleton as k, useEnvironment as F } from "@m4l/core";
5
+ import { styled as v } from "@mui/material/styles";
6
+ import { jsxs as C, jsx as t } from "react/jsx-runtime";
7
+ const T = v("div")(({
8
+ theme: e
9
+ }) => ({
10
+ display: "flex",
11
+ width: "100%",
12
+ height: "42.25px",
13
+ alignItems: "center",
14
+ justifyContent: "space-between",
15
+ border: `1px solid ${e.palette.divider}`,
16
+ padding: "0 14px",
17
+ borderRadius: e.spacing(0.5)
18
+ })), S = (e) => {
19
+ const {
20
+ skeletonWidth: n,
21
+ skeletonHeight: r
22
+ } = e;
23
+ return /* @__PURE__ */ C(T, {
24
+ children: [/* @__PURE__ */ t(s, {
25
+ variant: "text",
26
+ width: n,
27
+ height: r
28
+ }), /* @__PURE__ */ t(s, {
29
+ variant: "circular",
30
+ width: "20px",
31
+ height: "20px"
32
+ })]
33
+ });
34
+ };
35
+ function y(e) {
36
+ const {
37
+ name: n,
38
+ autoComplete: r = "off",
39
+ skeletonWidth: l = "50%",
40
+ skeletonHeight: m = 14
41
+ } = e, d = k(), {
42
+ control: p
43
+ } = c(), {
44
+ dfnsFormat: {
45
+ datetime_format: h,
46
+ datetime_mask: u
47
+ }
48
+ } = F();
49
+ return d ? /* @__PURE__ */ t(S, {
50
+ skeletonWidth: l,
51
+ skeletonHeight: m
52
+ }) : /* @__PURE__ */ t(f, {
53
+ name: n,
54
+ control: p,
55
+ render: ({
56
+ field: i,
57
+ fieldState: {
58
+ error: a
59
+ }
60
+ }) => /* @__PURE__ */ t(g, {
61
+ ampm: !1,
62
+ inputFormat: h,
63
+ mask: u,
64
+ label: "",
65
+ value: i.value,
66
+ onChange: (o) => {
67
+ isNaN(o) ? i.onChange(void 0) : i.onChange(o);
68
+ },
69
+ renderInput: (o) => /* @__PURE__ */ t(x, {
70
+ autoComplete: r,
71
+ fullWidth: !0,
72
+ error: !!a,
73
+ helperText: a?.message,
74
+ ...o
75
+ })
76
+ })
77
+ });
78
+ }
79
+ export {
80
+ y as R
81
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { SkeletonRHFDateTimeProps } from './types';
3
+ export declare const SkeletonRHFDateTime: (props: SkeletonRHFDateTimeProps) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RHFDateTimeProps } from '../../types';
2
+ export declare type SkeletonRHFDateTimeProps = Pick<RHFDateTimeProps, 'skeletonWidth' | 'skeletonHeight'>;
@@ -0,0 +1,51 @@
1
+ import { styled as d } from "@mui/material";
2
+ import { useFormContext as f, Controller as p } from "react-hook-form";
3
+ import { E as c } from "../../ErrorLabel/index.c8615f16.js";
4
+ import { P as x } from "../../Period/index.080a987d.js";
5
+ import { jsx as r, jsxs as g } from "react/jsx-runtime";
6
+ const u = d("div")(({
7
+ theme: e
8
+ }) => ({
9
+ width: "100%",
10
+ display: "flex",
11
+ flexDirection: "column",
12
+ justifyContent: "center",
13
+ alignItems: "flex-start",
14
+ gap: e.spacing(1)
15
+ })), k = (e) => {
16
+ const {
17
+ name: o,
18
+ readOnly: s,
19
+ skeletonWidth: n,
20
+ skeletonHeight: i
21
+ } = e, {
22
+ control: l
23
+ } = f();
24
+ return /* @__PURE__ */ r(p, {
25
+ name: o,
26
+ control: l,
27
+ render: ({
28
+ field: {
29
+ onChange: m,
30
+ value: a
31
+ },
32
+ fieldState: {
33
+ error: t
34
+ }
35
+ }) => /* @__PURE__ */ g(u, {
36
+ children: [/* @__PURE__ */ r(x, {
37
+ value: a,
38
+ onChange: m,
39
+ error: !!t,
40
+ readOnly: s,
41
+ skeletonWidth: n,
42
+ skeletonHeight: i
43
+ }), t && /* @__PURE__ */ r(c, {
44
+ message: t.message || ""
45
+ })]
46
+ })
47
+ });
48
+ };
49
+ export {
50
+ k as R
51
+ };
@@ -1,5 +1,5 @@
1
- import { PeriodVariant } from '../../../components/Period/types';
2
- export declare type RHFPeriodProps = {
1
+ import { PeriodProps, PeriodVariant } from '../../../components/Period/types';
2
+ export interface RHFPeriodProps extends Pick<PeriodProps, 'readOnly' | 'skeletonWidth' | 'skeletonHeight'> {
3
3
  name: string;
4
4
  variant?: PeriodVariant;
5
- };
5
+ }