@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,43 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormatter } from "@m4l/graphics";
|
|
3
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index-BHV-CsDU.js";
|
|
4
|
-
function getFormatDate(presentationType, value, format) {
|
|
5
|
-
const { dateFormatter } = useFormatter();
|
|
6
|
-
let finalFormat = format || dateFormatter.datetimeFormat;
|
|
7
|
-
let result;
|
|
8
|
-
let resultDate;
|
|
9
|
-
if (value === void 0 || value === null) {
|
|
10
|
-
return "-";
|
|
11
|
-
}
|
|
12
|
-
switch (presentationType) {
|
|
13
|
-
case "datetime":
|
|
14
|
-
finalFormat = format || dateFormatter.datetimeFormat;
|
|
15
|
-
break;
|
|
16
|
-
case "date":
|
|
17
|
-
finalFormat = format || dateFormatter.dateFormat;
|
|
18
|
-
break;
|
|
19
|
-
case "time":
|
|
20
|
-
finalFormat = format || dateFormatter.timeFormat;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
if (typeof value === "number" || typeof value === "string") {
|
|
25
|
-
resultDate = new Date(value);
|
|
26
|
-
} else {
|
|
27
|
-
resultDate = value;
|
|
28
|
-
}
|
|
29
|
-
result = dateFormatter.formatDate(resultDate, finalFormat);
|
|
30
|
-
return result;
|
|
31
|
-
} catch (e) {
|
|
32
|
-
result = "-";
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function DateFormatter(props) {
|
|
37
|
-
const { presentationType, value, format, Component = WrapperComponent } = props;
|
|
38
|
-
return /* @__PURE__ */ jsx(Component, { children: getFormatDate(presentationType, value, format) });
|
|
39
|
-
}
|
|
40
|
-
export {
|
|
41
|
-
DateFormatter as D,
|
|
42
|
-
getFormatDate as g
|
|
43
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getPropertyByString } from "@m4l/core";
|
|
3
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index-BHV-CsDU.js";
|
|
4
|
-
function getFormatPoints(obProps, fieldValue, fieldUnit, chainPoint) {
|
|
5
|
-
let result = "";
|
|
6
|
-
const points = getPropertyByString(obProps, fieldValue);
|
|
7
|
-
const unit = getPropertyByString(obProps, fieldUnit) || "";
|
|
8
|
-
if (points === void 0 || points === null || !Array.isArray(points)) {
|
|
9
|
-
return "[]";
|
|
10
|
-
}
|
|
11
|
-
points.map((point) => {
|
|
12
|
-
if (point) {
|
|
13
|
-
result = !chainPoint ? result.concat(`[${point}${unit}]`) : result.concat(`[${getPropertyByString(point, chainPoint)}${unit}]`);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
function PointsFormatter(props) {
|
|
19
|
-
const { obProps, fieldValue, fieldUnit, Component = WrapperComponent } = props;
|
|
20
|
-
return /* @__PURE__ */ jsx(Component, { children: getFormatPoints(obProps, fieldValue, fieldUnit) });
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
PointsFormatter as P,
|
|
24
|
-
getFormatPoints as g
|
|
25
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getPropertyByString } from "@m4l/core";
|
|
3
|
-
import { useFormatter } from "@m4l/graphics";
|
|
4
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index-BHV-CsDU.js";
|
|
5
|
-
function getFormatPrice(obProps, fieldValue, currency, decimalDigits) {
|
|
6
|
-
let result = "";
|
|
7
|
-
const value = getPropertyByString(obProps, fieldValue);
|
|
8
|
-
try {
|
|
9
|
-
result = Number(value).toLocaleString(navigator.language, {
|
|
10
|
-
currency,
|
|
11
|
-
style: "currency",
|
|
12
|
-
currencyDisplay: "symbol",
|
|
13
|
-
useGrouping: true,
|
|
14
|
-
maximumFractionDigits: decimalDigits
|
|
15
|
-
}) || "";
|
|
16
|
-
} catch (error) {
|
|
17
|
-
result = Number(value).toLocaleString("en-US", {
|
|
18
|
-
style: "currency",
|
|
19
|
-
currency: "USD",
|
|
20
|
-
currencyDisplay: "symbol",
|
|
21
|
-
useGrouping: true,
|
|
22
|
-
maximumFractionDigits: decimalDigits
|
|
23
|
-
}) || "";
|
|
24
|
-
}
|
|
25
|
-
return result;
|
|
26
|
-
}
|
|
27
|
-
function PriceFormatter(props) {
|
|
28
|
-
const { obProps, fieldValue, Component = WrapperComponent } = props;
|
|
29
|
-
const { currencyFormatter } = useFormatter();
|
|
30
|
-
return /* @__PURE__ */ jsx(Component, { children: getFormatPrice(obProps, fieldValue, currencyFormatter.code, currencyFormatter.decimalDigits) });
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
PriceFormatter as P,
|
|
34
|
-
getFormatPrice as g
|
|
35
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getPropertyByString } from "@m4l/core";
|
|
3
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index-BHV-CsDU.js";
|
|
4
|
-
function getUncertaintyFormat(obProps, fieldValue, fieldSymbol, fieldUnit) {
|
|
5
|
-
let result = "";
|
|
6
|
-
const ranges = getPropertyByString(obProps, fieldValue);
|
|
7
|
-
const symbol = getPropertyByString(obProps, fieldSymbol);
|
|
8
|
-
const unit = getPropertyByString(obProps, fieldUnit);
|
|
9
|
-
if (ranges === void 0 || ranges === null || !Array.isArray(ranges) || typeof symbol !== "string" || typeof unit !== "string") {
|
|
10
|
-
return "[]";
|
|
11
|
-
}
|
|
12
|
-
ranges.map((obj, idx) => {
|
|
13
|
-
const cmc_min_closed = obj.cmc_min_closed != true ? "<" : "≤";
|
|
14
|
-
const cmc_max_closed = obj.cmc_max_closed != true ? "<" : "≤";
|
|
15
|
-
result = result.concat(
|
|
16
|
-
`${idx > 0 ? " " : ""}`,
|
|
17
|
-
obj.cmc_min !== obj.cmc_max ? `[${obj.cmc_min}${unit} ${cmc_min_closed} ${symbol} ${cmc_max_closed} ${obj.cmc_max}${unit} ± ${obj.cmc_uncertainty}]` : `[${obj.cmc_min}${unit} ± ${obj.cmc_uncertainty}]`
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
function UncertaintyFormatter(props) {
|
|
23
|
-
const { obProps, fieldValue, fieldSymbol, fieldUnit, Component = WrapperComponent } = props;
|
|
24
|
-
return /* @__PURE__ */ jsx(Component, { children: getUncertaintyFormat(obProps, fieldValue, fieldSymbol, fieldUnit) });
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
UncertaintyFormatter as U,
|
|
28
|
-
getUncertaintyFormat as g
|
|
29
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { generateUtilityClasses } from "@mui/material";
|
|
3
|
-
import "@mui/base";
|
|
4
|
-
import { af as FormatterRootContainer } from "../../styles/index-DKj6m8SL.js";
|
|
5
|
-
import { W as WrapperComponent } from "../WrapperComponent/index-BHV-CsDU.js";
|
|
6
|
-
import { useModuleDictionary } from "@m4l/core";
|
|
7
|
-
import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY } from "./BooleanFormatter/index-DktIidqW.js";
|
|
8
|
-
const COMPONENT_CLASS_NAME = "M4LFormatter";
|
|
9
|
-
const formatterClasses = generateUtilityClasses(COMPONENT_CLASS_NAME, [
|
|
10
|
-
/* elements */
|
|
11
|
-
"root",
|
|
12
|
-
"booleanFormatterIcon",
|
|
13
|
-
"booleanFormatterCheck"
|
|
14
|
-
/* states or variants of elements */
|
|
15
|
-
]);
|
|
16
|
-
const FormatterRoot = (props) => {
|
|
17
|
-
const { children } = props;
|
|
18
|
-
return /* @__PURE__ */ jsx(FormatterRootContainer, { className: formatterClasses.root, children });
|
|
19
|
-
};
|
|
20
|
-
function getFormatConcatenated(values, separator) {
|
|
21
|
-
const returnSymbol = "";
|
|
22
|
-
if (values === null) return returnSymbol;
|
|
23
|
-
if (!Array.isArray(values)) {
|
|
24
|
-
return values.toString();
|
|
25
|
-
} else {
|
|
26
|
-
if (values.length == 0) return returnSymbol;
|
|
27
|
-
else {
|
|
28
|
-
const result = values.map((value) => {
|
|
29
|
-
if (value === null || value === void 0) return returnSymbol;
|
|
30
|
-
else {
|
|
31
|
-
if (typeof value === "string" || typeof value === "number") {
|
|
32
|
-
return value.toString();
|
|
33
|
-
} else {
|
|
34
|
-
return returnSymbol;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const output = result.join(separator.toString());
|
|
39
|
-
return output.trim();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function ConcatenatedFormatter(props) {
|
|
44
|
-
const { values = [], separator = " ", Component = WrapperComponent } = props;
|
|
45
|
-
return /* @__PURE__ */ jsx(Component, { children: getFormatConcatenated(values, separator) });
|
|
46
|
-
}
|
|
47
|
-
const PERIOD_FORMATTER_DICTIONARY_KEY = `period_formatter`;
|
|
48
|
-
const dictionary = {
|
|
49
|
-
LABEL_YEARS: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_years`,
|
|
50
|
-
LABEL_YEAR: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_year`,
|
|
51
|
-
LABEL_MONTHS: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_months`,
|
|
52
|
-
LABEL_MONTH: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_month`,
|
|
53
|
-
LABEL_DAYS: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_days`,
|
|
54
|
-
LABEL_DAY: `${PERIOD_FORMATTER_DICTIONARY_KEY}.label_day`
|
|
55
|
-
};
|
|
56
|
-
function getFormatPeriod(years, months, days) {
|
|
57
|
-
const { getLabel } = useModuleDictionary();
|
|
58
|
-
let period = "";
|
|
59
|
-
const separator = ", ";
|
|
60
|
-
switch (years) {
|
|
61
|
-
case 0:
|
|
62
|
-
break;
|
|
63
|
-
case 1:
|
|
64
|
-
period = "1 " + getLabel(dictionary.LABEL_YEAR);
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
period = years.toString() + " " + getLabel(dictionary.LABEL_YEARS);
|
|
68
|
-
}
|
|
69
|
-
switch (months) {
|
|
70
|
-
case 0:
|
|
71
|
-
break;
|
|
72
|
-
case 1:
|
|
73
|
-
if (years > 0) period += separator;
|
|
74
|
-
period += "1 " + getLabel(dictionary.LABEL_MONTH);
|
|
75
|
-
break;
|
|
76
|
-
default:
|
|
77
|
-
if (years > 0) period += separator;
|
|
78
|
-
period += months.toString() + " " + getLabel(dictionary.LABEL_MONTHS);
|
|
79
|
-
}
|
|
80
|
-
switch (days) {
|
|
81
|
-
case 0:
|
|
82
|
-
break;
|
|
83
|
-
case 1:
|
|
84
|
-
if (years > 0 || months > 0) period += separator;
|
|
85
|
-
period += "1 " + getLabel(dictionary.LABEL_DAY);
|
|
86
|
-
break;
|
|
87
|
-
default:
|
|
88
|
-
if (years > 0 || months > 0) period += separator;
|
|
89
|
-
period += days.toString() + " " + getLabel(dictionary.LABEL_DAYS);
|
|
90
|
-
}
|
|
91
|
-
if (period == "") period = "-";
|
|
92
|
-
return period;
|
|
93
|
-
}
|
|
94
|
-
function PeriodFormatter(props) {
|
|
95
|
-
const { years = 0, months = 0, days = 0, Component = WrapperComponent } = props;
|
|
96
|
-
return /* @__PURE__ */ jsx(Component, { children: getFormatPeriod(years, months, days) });
|
|
97
|
-
}
|
|
98
|
-
function getFormattersComponentsDictionary() {
|
|
99
|
-
return [BOOLEAN_FORMATTER_DICTIONARY_KEY, PERIOD_FORMATTER_DICTIONARY_KEY];
|
|
100
|
-
}
|
|
101
|
-
export {
|
|
102
|
-
ConcatenatedFormatter as C,
|
|
103
|
-
FormatterRoot as F,
|
|
104
|
-
PeriodFormatter as P,
|
|
105
|
-
getFormatPeriod as a,
|
|
106
|
-
getFormattersComponentsDictionary as b,
|
|
107
|
-
formatterClasses as f,
|
|
108
|
-
getFormatConcatenated as g
|
|
109
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFormContext, useController } from "react-hook-form";
|
|
3
|
-
import { H as HelperText } from "../../HelperText/index-Crn_XIPF.js";
|
|
4
|
-
function HelperError(props) {
|
|
5
|
-
const { name } = props;
|
|
6
|
-
const { control } = useFormContext();
|
|
7
|
-
const { fieldState } = useController({
|
|
8
|
-
name,
|
|
9
|
-
control,
|
|
10
|
-
rules: { required: true }
|
|
11
|
-
});
|
|
12
|
-
if (fieldState?.error?.message) {
|
|
13
|
-
return /* @__PURE__ */ jsx(HelperText, { variant: "error", message: fieldState?.error?.message });
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
HelperError as H
|
|
19
|
-
};
|