@m4l/components 3.1.6 → 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/components/mui_extended/IconButton/index.d.ts +1 -1
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +2 -4
- package/index.js +183 -339
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-BdnzI23R.js +0 -334
- package/components/AppBar/index-Dvrx1jsr.js +0 -93
- package/components/BaseModule/index-BQ2UIUCy.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-DSVEMl41.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-DMsGH0wx.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-C8zb7R3W.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-BNIG3KAH.js +0 -25
- package/components/CommonActions/components/Actions/index-90JsZTzb.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-ZsSxUL_T.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-D-gZpvcm.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-kZGiDU5k.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-iKq2iRoa.js +0 -13
- package/components/DataGrid/index-DGHnRo8z.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-BhBvobKS.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-D9Z9YGDb.js +0 -51
- package/components/DynamicFilter/index-CRmtRWlr.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-CQiB8TmY.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-DoIifWTk.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-DQESCg04.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-CGmflaoY.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BfH6YHNi.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-Dv3KjuYK.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BnhNICK4.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-CNN6DeHY.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-C2dNPFtM.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-B03ahaU6.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-EF7A6WnZ.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-CQtA2ELu.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-EXbXDSZA.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-BX8YCh9v.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DvAYf5-a.js +0 -63
- package/components/FieldLabel/index-C8od8D0w.js +0 -54
- package/components/GridLayout/index-EPw3AYiQ.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-B8Q7iMhr.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-D6BbBdVx.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-OhbtnEN4.js +0 -71
- package/components/HelperText/index-sLK3dYG0.js +0 -50
- package/components/Icon/index-BJF_0F6d.js +0 -176
- package/components/Image/index-BxphCFC7.js +0 -175
- package/components/LanguagePopover/index-CkKie1Ph.js +0 -179
- package/components/LinearProgressIndeterminate/index-CTvXOPRx.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-BaaPhmyF.js +0 -89
- package/components/MFIsolationApp/index-BfHLGDcN.js +0 -169
- package/components/MFLoader/index-B8FmSpE7.js +0 -299
- package/components/ModalDialog/index-WSVr5sZr.js +0 -77
- package/components/NavLink/index-CKgi5l5M.js +0 -55
- package/components/NoItemSelected/index-BKsZKc_f.js +0 -54
- package/components/ObjectLogs/index-BJkjYQaa.js +0 -233
- package/components/PDFViewer/index-Cnbioqzo.js +0 -51
- package/components/Page/index-DSSwuNSp.js +0 -117
- package/components/PaperForm/index-C1OKDnuY.js +0 -59
- package/components/Period/index-DYE7Bj45.js +0 -238
- package/components/PrintingSystem/index-BkfHXcTV.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Btg2zXVQ.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-GLjhqKd2.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-D9T1MWQd.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-C3LET1ZY.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-BPz7lGvC.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-DY4Yci1r.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-BYoGJll5.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-vFZ5Skyl.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-BNqGWpcj.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-wgdfWbfF.js +0 -24
- package/components/PropertyValue/index-dwO3Qo0Y.js +0 -264
- package/components/Resizeable/index-CHseEYjL.js +0 -20
- package/components/ScrollBar/index-BYMy_qJE.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-DqKD_S9_.js +0 -758
- package/components/SplitLayout/index-D4lxi0ig.js +0 -89
- package/components/ToastContainer/index-jnQcIcV1.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CTGGa4Yt.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-9dC9NmWv.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-BU9AX60_.js +0 -699
- package/components/areas/components/AreasViewer/index-CPlZxIzK.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-DGguLxcX.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-DBXtbtIu.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-faX1fxjn.js +0 -28
- package/components/commercial/SectionCommercial/index-Dspd2Hd7.js +0 -56
- package/components/commercial/TopBar/index-zACdM_C0.js +0 -232
- package/components/commercial/index-9P0yOdH4.js +0 -81
- package/components/formatters/BooleanFormatter/index-PoFZ3r_m.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-CEJ6VCMb.js +0 -109
- package/components/hook-form/HelperError/index-DRvAkpwm.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-DS57m8AX.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-Bu6NYmG_.js +0 -226
- package/components/hook-form/RHFCheckbox/index-BsB42rRc.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Dox0FPrV.js +0 -191
- package/components/hook-form/RHFDateTime/index-ef19Az1N.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-DyRLTD0w.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-pgTLVF9t.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-BgsElxUF.js +0 -337
- package/components/hook-form/RHFUpload/index-B6m3ypzh.js +0 -253
- package/components/maps/components/GpsTools/index-CeLi75XZ.js +0 -1948
- package/components/maps/components/Map/index-D4B8Lfgv.js +0 -2545
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-CkftshqR.js +0 -44
- package/components/modal/WindowConfirm-C5YnzF-B.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-jF2uxSmi.js +0 -124
- package/components/mui_extended/Avatar/index-CHmsrmfc.js +0 -64
- package/components/mui_extended/Badge/index-B_BGIjkQ.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-CgvCim_g.js +0 -222
- package/components/mui_extended/CheckBox-H73kpinr.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-B8lOMybH.js +0 -117
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/IconButton/types-l0sNRNKZ.js +0 -1
- 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-DA_aS7o5.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-BVp0M8fu.js +0 -47
- package/components/mui_extended/Pager/index-Dtk4aUiU.js +0 -257
- package/components/mui_extended/Popover/index-Dl1PwIS2.js +0 -153
- package/components/mui_extended/Stack/index-CRzpVi2a.js +0 -31
- package/components/mui_extended/Tab/index-DmrsMLOq.js +0 -129
- package/components/mui_extended/ToggleButton/index-CAnHC1N-.js +0 -18
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-DXq1fG8k.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-CMI1SK_O.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-DOkmuvnx.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-Bp_s1qUm.js +0 -39
- package/contexts/RHFormContext/index-BQ0XWrpK.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-dLVQB7hC.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-69rbrQ0v.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-DYRxOmMI.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-CqpubQQr.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-CqpubQQr.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-PoFZ3r_m.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-sLK3dYG0.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
|
-
};
|