@m4l/components 3.1.7 → 3.1.8
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/index.js +183 -340
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
- package/components/AppBar/index-i0rhG3J1.js +0 -93
- package/components/BaseModule/index-CiNNlxzS.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
- package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
- package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
- package/components/DataGrid/index-BZ-lbmuU.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
- package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
- package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
- package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
- package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
- package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
- package/components/FieldLabel/index-CI57EizR.js +0 -54
- package/components/GridLayout/index-C4HyxNYX.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
- package/components/HelperText/index-Crn_XIPF.js +0 -50
- package/components/Icon/index-C89MAkeH.js +0 -176
- package/components/Image/index-COp8vP0X.js +0 -175
- package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
- package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-Cf0oGUrL.js +0 -89
- package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
- package/components/MFLoader/index-BI8vQZSH.js +0 -299
- package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
- package/components/NavLink/index-D1S_vtFO.js +0 -55
- package/components/NoItemSelected/index-B9oM26AX.js +0 -54
- package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
- package/components/PDFViewer/index-GVN2rfd6.js +0 -51
- package/components/Page/index-DZMkYmr4.js +0 -117
- package/components/PaperForm/index-DwgAfjci.js +0 -59
- package/components/Period/index-2pJG3VmY.js +0 -238
- package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
- package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
- package/components/Resizeable/index-DdP1xfE9.js +0 -20
- package/components/ScrollBar/index-f2URPPE2.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-PUBBe0yH.js +0 -758
- package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
- package/components/ToastContainer/index-DK1d8NNd.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
- package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
- package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
- package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
- package/components/animate/features-BbnE33u3.js +0 -5
- package/components/animate/index-BsWiJfzp.js +0 -89
- package/components/animate/variants/bounce-DanQqHAX.js +0 -101
- package/components/animate/variants/container-Dmpr6tg5.js +0 -22
- package/components/animate/variants/fade-CAOJNn06.js +0 -65
- package/components/animate/variants/index-l0sNRNKZ.js +0 -1
- package/components/animate/variants/transition-B9W5SWTa.js +0 -20
- package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
- package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
- package/components/areas/components/index-l0sNRNKZ.js +0 -1
- package/components/areas/constants-rqODZNZe.js +0 -6
- package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
- package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
- package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
- package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
- package/components/areas/dictionary-YUsP9beq.js +0 -36
- package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
- package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
- package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
- package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
- package/components/areas/icons-CwFr-alN.js +0 -24
- package/components/areas/index-B_Odny9h.js +0 -22
- package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
- package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
- package/components/commercial/TopBar/index-F1repmti.js +0 -232
- package/components/commercial/index-CxDzs6Ax.js +0 -81
- package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
- package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
- package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
- package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
- package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
- package/components/formatters/index-pnJhDYKe.js +0 -109
- package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
- package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
- package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
- package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
- package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
- package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-Gd27v5FU.js +0 -44
- package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
- package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
- package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
- package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
- package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
- package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
- package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
- package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
- package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
- package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
- package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
- package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
- package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
- package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
- package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
- package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
- package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
- package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
- package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
- package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
- package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
- package/components/mui_extended/index-l0sNRNKZ.js +0 -1
- package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
- package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
- package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
- package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
- package/contexts/RHFormContext/index-D_nK759o.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-BJSQOX3U.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-B_GEQFOP.js +0 -12
- package/react-data-grid-BfYuZ6AK.js +0 -2606
- package/react-draggable-DsCPdgQP.js +0 -811
- package/react-json-view-bhqIAaNg.js +0 -2576
- package/react-resizable-eBbFl2dX.js +0 -618
- package/react-spinners-TpKN9lZg.js +0 -123
- package/react-splitter-layout-C-JTsNGs.js +0 -158
- package/styles/DynamicFilter-CJFsIegc.js +0 -319
- package/styles/MenuActions-lTi-ynPM.js +0 -42
- package/styles/index-DKj6m8SL.js +0 -1691
- package/test/constants_no_mock-CF-669v-.js +0 -4
- package/test/getNameDataTestId-BaBTWhBr.js +0 -10
- package/utils/index-DiMrtgIu.js +0 -502
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { DateTimePicker } from "@mui/x-date-pickers";
|
|
4
|
-
import { useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
5
|
-
import { Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
6
|
-
import { useFormatter, useResponsiveDesktop } from "@m4l/graphics";
|
|
7
|
-
import { useState, useEffect } from "react";
|
|
8
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
9
|
-
import clsx from "clsx";
|
|
10
|
-
import { am as RHFDateTimeRoot } from "../../../styles/index-DKj6m8SL.js";
|
|
11
|
-
import { H as HelperText } from "../../HelperText/index-Crn_XIPF.js";
|
|
12
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock-CF-669v-.js";
|
|
13
|
-
import { useFormFocus } from "../../../index.js";
|
|
14
|
-
import { F as FieldLabel } from "../../FieldLabel/index-CI57EizR.js";
|
|
15
|
-
import { I as Icon } from "../../Icon/index-C89MAkeH.js";
|
|
16
|
-
const SkeletonRHFDateTime = (props) => {
|
|
17
|
-
const { skeletonWidth, skeletonHeight, className, label } = props;
|
|
18
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
19
|
-
label && /* @__PURE__ */ jsx(Skeleton, { variant: "text", height: "14px", width: "30%" }),
|
|
20
|
-
/* @__PURE__ */ jsxs("div", { className: className.skeleton, children: [
|
|
21
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: skeletonWidth, height: skeletonHeight }),
|
|
22
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "circular" })
|
|
23
|
-
] })
|
|
24
|
-
] });
|
|
25
|
-
};
|
|
26
|
-
const componentName = "M4LRHFDateTime";
|
|
27
|
-
generateUtilityClasses(componentName, [
|
|
28
|
-
/* elements */
|
|
29
|
-
"root",
|
|
30
|
-
"skeleton",
|
|
31
|
-
/* states or variants of elements */
|
|
32
|
-
"small",
|
|
33
|
-
"medium",
|
|
34
|
-
"isFocus",
|
|
35
|
-
"isTabSelected",
|
|
36
|
-
"isDisabled",
|
|
37
|
-
"variantInfo",
|
|
38
|
-
"variantSuccess",
|
|
39
|
-
"variantWarning",
|
|
40
|
-
"variantError"
|
|
41
|
-
]);
|
|
42
|
-
function getRHFCheckboxUtilityClass(slot) {
|
|
43
|
-
return generateUtilityClass(componentName, slot);
|
|
44
|
-
}
|
|
45
|
-
const useUtilityClasses = (ownerState) => {
|
|
46
|
-
const slots = {
|
|
47
|
-
root: [
|
|
48
|
-
"root",
|
|
49
|
-
ownerState.size === "small" && "small",
|
|
50
|
-
ownerState.size === "medium" && "medium",
|
|
51
|
-
ownerState.isFocus && "isFocus",
|
|
52
|
-
ownerState.isTabSelected && "isTabSelected",
|
|
53
|
-
ownerState.disabled && "isDisabled",
|
|
54
|
-
ownerState.variant === "info" && "variantInfo",
|
|
55
|
-
ownerState.variant === "success" && "variantSuccess",
|
|
56
|
-
ownerState.variant === "warning" && "variantWarning",
|
|
57
|
-
ownerState.variant === "error" && "variantError"
|
|
58
|
-
],
|
|
59
|
-
skeleton: ["skeleton"]
|
|
60
|
-
};
|
|
61
|
-
const composedClasses = unstable_composeClasses(slots, getRHFCheckboxUtilityClass, {});
|
|
62
|
-
return {
|
|
63
|
-
...composedClasses
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
const RHFDATETIME_PREFIX = "RHFDateTime";
|
|
67
|
-
const getNameRHFDateTimeDataTestId = (KEY) => {
|
|
68
|
-
return `${RHFDATETIME_PREFIX}-${KEY}`;
|
|
69
|
-
};
|
|
70
|
-
function RHFDateTime(props) {
|
|
71
|
-
const {
|
|
72
|
-
name: nameRHF,
|
|
73
|
-
disabled,
|
|
74
|
-
size = "small",
|
|
75
|
-
variant,
|
|
76
|
-
skeletonWidth = "50%",
|
|
77
|
-
skeletonHeight = 14,
|
|
78
|
-
className,
|
|
79
|
-
label,
|
|
80
|
-
helperMessage,
|
|
81
|
-
mandatory,
|
|
82
|
-
mandatoryMessage
|
|
83
|
-
} = props;
|
|
84
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
85
|
-
const resourceIcon = () => {
|
|
86
|
-
return /* @__PURE__ */ jsx(
|
|
87
|
-
Icon,
|
|
88
|
-
{
|
|
89
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/rhfdate/ended_at.svg`
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
const [currentVariant, setCurrentVariant] = useState(void 0);
|
|
94
|
-
const { isFocus, isTabSelected, handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
|
|
95
|
-
const {
|
|
96
|
-
control,
|
|
97
|
-
formState: { errors }
|
|
98
|
-
} = useFormContext();
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (errors[nameRHF]) {
|
|
101
|
-
setCurrentVariant("error");
|
|
102
|
-
} else if (variant) {
|
|
103
|
-
setCurrentVariant(variant);
|
|
104
|
-
} else {
|
|
105
|
-
setCurrentVariant(void 0);
|
|
106
|
-
}
|
|
107
|
-
}, [errors[nameRHF], variant, control]);
|
|
108
|
-
const isSkeleton = useModuleSkeleton();
|
|
109
|
-
const {
|
|
110
|
-
dateFormatter: { datetimeFormat }
|
|
111
|
-
} = useFormatter();
|
|
112
|
-
const isDesktop = useResponsiveDesktop();
|
|
113
|
-
const ownerState = {
|
|
114
|
-
isFocus: !isSkeleton ? isFocus : false,
|
|
115
|
-
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
116
|
-
disabled,
|
|
117
|
-
size: isDesktop ? size : "medium",
|
|
118
|
-
variant: currentVariant
|
|
119
|
-
};
|
|
120
|
-
const classes = useUtilityClasses(ownerState);
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
-
RHFDateTimeRoot,
|
|
123
|
-
{
|
|
124
|
-
className: clsx(classes.root, className),
|
|
125
|
-
tabIndex: 0,
|
|
126
|
-
onFocus: handlerFocus,
|
|
127
|
-
onBlur: handlerOnBlur,
|
|
128
|
-
onKeyUp: handlerOnKeyUp,
|
|
129
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameRHFDateTimeDataTestId("root") } : {},
|
|
130
|
-
children: !isSkeleton ? /* @__PURE__ */ jsx(
|
|
131
|
-
Controller,
|
|
132
|
-
{
|
|
133
|
-
name: nameRHF,
|
|
134
|
-
control,
|
|
135
|
-
render: ({ field: { value, onChange, ref }, fieldState: { error } }) => {
|
|
136
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
-
label && /* @__PURE__ */ jsx(
|
|
138
|
-
FieldLabel,
|
|
139
|
-
{
|
|
140
|
-
label,
|
|
141
|
-
mandatory,
|
|
142
|
-
mandatoryMessage,
|
|
143
|
-
helperMessage
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
/* @__PURE__ */ jsx(
|
|
147
|
-
DateTimePicker,
|
|
148
|
-
{
|
|
149
|
-
sx: {
|
|
150
|
-
"& .MuiTouchRipple-root": {
|
|
151
|
-
display: "none"
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
inputRef: ref,
|
|
155
|
-
ampm: true,
|
|
156
|
-
value,
|
|
157
|
-
onChange: (newValue) => {
|
|
158
|
-
onChange(newValue);
|
|
159
|
-
},
|
|
160
|
-
slots: {
|
|
161
|
-
openPickerIcon: resourceIcon
|
|
162
|
-
},
|
|
163
|
-
slotProps: {
|
|
164
|
-
textField: {
|
|
165
|
-
onFocus: handlerFocus,
|
|
166
|
-
onBlur: handlerOnBlur
|
|
167
|
-
},
|
|
168
|
-
field: { format: datetimeFormat }
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
error?.message && /* @__PURE__ */ jsx(HelperText, { variant: "error", message: error?.message + "" })
|
|
173
|
-
] });
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
) : /* @__PURE__ */ jsx(
|
|
177
|
-
SkeletonRHFDateTime,
|
|
178
|
-
{
|
|
179
|
-
skeletonWidth,
|
|
180
|
-
skeletonHeight,
|
|
181
|
-
className: classes,
|
|
182
|
-
label
|
|
183
|
-
}
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
}
|
|
188
|
-
export {
|
|
189
|
-
RHFDateTime as R
|
|
190
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { FormGroup, FormControlLabel, Checkbox } from "@mui/material";
|
|
4
|
-
function RHFMultiCheckbox({ name, options, ...other }) {
|
|
5
|
-
const { control } = useFormContext();
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
7
|
-
Controller,
|
|
8
|
-
{
|
|
9
|
-
name,
|
|
10
|
-
control,
|
|
11
|
-
render: ({ field }) => {
|
|
12
|
-
const onSelected = (option) => field.value.includes(option) ? field.value.filter((value) => value !== option) : [...field.value, option];
|
|
13
|
-
return /* @__PURE__ */ jsx(FormGroup, { children: options.map((option) => /* @__PURE__ */ jsx(
|
|
14
|
-
FormControlLabel,
|
|
15
|
-
{
|
|
16
|
-
control: /* @__PURE__ */ jsx(
|
|
17
|
-
Checkbox,
|
|
18
|
-
{
|
|
19
|
-
checked: field.value.includes(option),
|
|
20
|
-
onChange: () => field.onChange(onSelected(option))
|
|
21
|
-
}
|
|
22
|
-
),
|
|
23
|
-
label: option,
|
|
24
|
-
...other
|
|
25
|
-
},
|
|
26
|
-
option
|
|
27
|
-
)) });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
RHFMultiCheckbox as R
|
|
34
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { an as RHFPeriodRoot } from "../../../styles/index-DKj6m8SL.js";
|
|
3
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
4
|
-
import { H as HelperText } from "../../HelperText/index-Crn_XIPF.js";
|
|
5
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
6
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
7
|
-
import { useModuleSkeleton } from "@m4l/core";
|
|
8
|
-
import { useFormFocus } from "../../../index.js";
|
|
9
|
-
import { F as FieldLabel } from "../../FieldLabel/index-CI57EizR.js";
|
|
10
|
-
import { P as Period } from "../../Period/index-2pJG3VmY.js";
|
|
11
|
-
const componentName = "M4LRHFPeriod";
|
|
12
|
-
generateUtilityClasses(componentName, [
|
|
13
|
-
/* elements */
|
|
14
|
-
"root",
|
|
15
|
-
/* states or variants of elements */
|
|
16
|
-
"isFocus",
|
|
17
|
-
"isTabSelected"
|
|
18
|
-
]);
|
|
19
|
-
function getRHFPeriodUtilityClass(slot) {
|
|
20
|
-
return generateUtilityClass(componentName, slot);
|
|
21
|
-
}
|
|
22
|
-
const RHFPeriodUtilityClasses = (ownerState) => {
|
|
23
|
-
const slots = {
|
|
24
|
-
root: ["root", ownerState.isFocus && "isFocus", ownerState.isTabSelected && "isTabSelected"]
|
|
25
|
-
};
|
|
26
|
-
const composedClasses = unstable_composeClasses(slots, getRHFPeriodUtilityClass, {});
|
|
27
|
-
return {
|
|
28
|
-
...composedClasses
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const RHFPeriod = (props) => {
|
|
32
|
-
const {
|
|
33
|
-
name,
|
|
34
|
-
readOnly,
|
|
35
|
-
skeletonWidth,
|
|
36
|
-
skeletonHeight,
|
|
37
|
-
state,
|
|
38
|
-
label,
|
|
39
|
-
mandatory,
|
|
40
|
-
mandatoryMessage,
|
|
41
|
-
helperMessage,
|
|
42
|
-
size
|
|
43
|
-
} = props;
|
|
44
|
-
const { control } = useFormContext();
|
|
45
|
-
const isSkeleton = useModuleSkeleton();
|
|
46
|
-
const { isFocus, isTabSelected, handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
|
|
47
|
-
const ownerState = {
|
|
48
|
-
isFocus: !isSkeleton ? isFocus : false,
|
|
49
|
-
isTabSelected: !isSkeleton ? isTabSelected : false
|
|
50
|
-
};
|
|
51
|
-
const classes = RHFPeriodUtilityClasses(ownerState);
|
|
52
|
-
return /* @__PURE__ */ jsx(
|
|
53
|
-
RHFPeriodRoot,
|
|
54
|
-
{
|
|
55
|
-
className: classes.root,
|
|
56
|
-
tabIndex: 0,
|
|
57
|
-
onFocus: handlerFocus,
|
|
58
|
-
onBlur: handlerOnBlur,
|
|
59
|
-
onKeyUp: handlerOnKeyUp,
|
|
60
|
-
children: /* @__PURE__ */ jsx(
|
|
61
|
-
Controller,
|
|
62
|
-
{
|
|
63
|
-
name,
|
|
64
|
-
control,
|
|
65
|
-
render: ({ field: { onChange, value }, fieldState: { error } }) => {
|
|
66
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
-
label && /* @__PURE__ */ jsx(
|
|
68
|
-
FieldLabel,
|
|
69
|
-
{
|
|
70
|
-
label,
|
|
71
|
-
mandatory,
|
|
72
|
-
mandatoryMessage,
|
|
73
|
-
helperMessage
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
/* @__PURE__ */ jsx(
|
|
77
|
-
Period,
|
|
78
|
-
{
|
|
79
|
-
value,
|
|
80
|
-
onChange,
|
|
81
|
-
state: !!error === true ? "error" : state,
|
|
82
|
-
readOnly,
|
|
83
|
-
skeletonWidth,
|
|
84
|
-
skeletonHeight,
|
|
85
|
-
size
|
|
86
|
-
}
|
|
87
|
-
),
|
|
88
|
-
error && /* @__PURE__ */ jsx(HelperText, { variant: "error", message: error.message || "" })
|
|
89
|
-
] });
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
};
|
|
96
|
-
export {
|
|
97
|
-
RHFPeriod as R
|
|
98
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { RadioGroup, FormControlLabel, FormHelperText, Radio } from "@mui/material";
|
|
4
|
-
import { I as Icon } from "../../Icon/index-C89MAkeH.js";
|
|
5
|
-
function OptionIconLabelFormatter(option, getOptionLabel, getOptionIconUrl) {
|
|
6
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
7
|
-
/* @__PURE__ */ jsx(
|
|
8
|
-
Icon,
|
|
9
|
-
{
|
|
10
|
-
src: `${getOptionIconUrl(option)}`
|
|
11
|
-
}
|
|
12
|
-
),
|
|
13
|
-
/* @__PURE__ */ jsx("span", { children: getOptionLabel(option) })
|
|
14
|
-
] });
|
|
15
|
-
}
|
|
16
|
-
function RHFRadioGroup({
|
|
17
|
-
name,
|
|
18
|
-
options,
|
|
19
|
-
getOptionLabel,
|
|
20
|
-
getOptionValue,
|
|
21
|
-
getOptionIconUrl,
|
|
22
|
-
renderOptionLabel = OptionIconLabelFormatter,
|
|
23
|
-
ControlLabel = Radio,
|
|
24
|
-
...other
|
|
25
|
-
}) {
|
|
26
|
-
const { control } = useFormContext();
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
28
|
-
Controller,
|
|
29
|
-
{
|
|
30
|
-
name,
|
|
31
|
-
control,
|
|
32
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsxs("div", { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(RadioGroup, { ...field, row: true, ...other, children: options.map((option) => {
|
|
34
|
-
return /* @__PURE__ */ jsx(
|
|
35
|
-
FormControlLabel,
|
|
36
|
-
{
|
|
37
|
-
defaultValue: field.value,
|
|
38
|
-
value: getOptionValue(option),
|
|
39
|
-
control: /* @__PURE__ */ jsx(ControlLabel, { ...option }),
|
|
40
|
-
label: renderOptionLabel(option, getOptionLabel, getOptionIconUrl)
|
|
41
|
-
},
|
|
42
|
-
getOptionValue(option)
|
|
43
|
-
);
|
|
44
|
-
}) }),
|
|
45
|
-
!!error && /* @__PURE__ */ jsx(FormHelperText, { error: true, sx: { px: 2 }, children: error.message })
|
|
46
|
-
] })
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
RHFRadioGroup as R
|
|
52
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { TextField } from "@mui/material";
|
|
4
|
-
function RHFSelect({ name, children, ...other }) {
|
|
5
|
-
const { control } = useFormContext();
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
7
|
-
Controller,
|
|
8
|
-
{
|
|
9
|
-
name,
|
|
10
|
-
control,
|
|
11
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
12
|
-
TextField,
|
|
13
|
-
{
|
|
14
|
-
...field,
|
|
15
|
-
select: true,
|
|
16
|
-
fullWidth: true,
|
|
17
|
-
SelectProps: { native: true },
|
|
18
|
-
error: !!error,
|
|
19
|
-
helperText: error?.message,
|
|
20
|
-
...other,
|
|
21
|
-
children
|
|
22
|
-
}
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
RHFSelect as R
|
|
29
|
-
};
|