@m4l/components 0.2.36 → 1.0.0
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/AccountPopover/{index.a9dc9f92.js → index.efc74d5c.js} +3 -5
- package/components/AppBar/{index.7dee7427.js → index.fc126a22.js} +6 -5
- package/components/AppBar/styles.d.ts +1 -1
- package/components/CommonActions/components/Actions/styles.d.ts +1 -1
- package/components/DataGrid/styles.d.ts +1 -1
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +7 -7
- package/components/DragResizeWindow/{index.a9f25040.js → index.46b380e1.js} +3 -6
- package/components/DynamicFilter/dynamicFilterSlots.d.ts +76 -101
- package/components/DynamicFilter/{index.48d809e2.js → index.d9168c12.js} +22 -96
- package/components/FieldLabel/{index.2622ee40.js → index.f9cdcc27.js} +4 -4
- package/components/GridLayout/{index.b9c47a4c.js → index.bb3b7769.js} +23 -46
- package/components/GridLayout/subcomponents/Griditem/{index.69bc14e5.js → index.bb23f651.js} +4 -3
- package/components/GridLayout/subcomponents/Responsive/{index.094c1d09.js → index.b8a2a121.js} +2 -1
- package/components/GridLayout/subcomponents/SizeProvider/{index.e1d2df80.js → index.094bc6b5.js} +1 -1
- package/components/{commercial/index.b90488db.js → HamburgerMenu/index.5997af31.js} +4 -6
- package/components/HelperText/{index.81c5d349.js → index.be949cdf.js} +3 -2
- package/components/HelperText/styles.d.ts +1 -1
- package/components/Icon/index.d5fed418.js +420 -0
- package/components/Icon/styles.d.ts +2 -2
- package/components/{hook-form/RHFUpload/index.c5e5c61c.js → Image/index.36a3d440.js} +233 -32
- package/components/Image/styles.d.ts +1 -1
- package/components/LanguagePopover/{index.72f316fc.js → index.e6fa2336.js} +5 -8
- package/components/LanguagePopover/styles.d.ts +5 -5
- package/components/LinearProgressIndeterminate/{index.2ecd571e.js → index.de9d447c.js} +2 -4
- package/components/Loadable/{index.97fe63f9.js → index.e83cdb4e.js} +1 -1
- package/components/LoadingError/{index.7aaba1cf.js → index.9f00c83c.js} +8 -12
- package/components/LoadingError/styles.d.ts +1 -1
- package/components/MFLoader/{index.40c419c0.js → index.402c1acc.js} +4 -8
- package/components/ModalDialog/{index.42349189.js → index.ea9189c3.js} +5 -14
- package/components/NavLink/{index.9e847eb5.js → index.4e548cee.js} +4 -4
- package/components/NavLink/styles.d.ts +1 -1
- package/components/NoItemSelected/{index.5a8160fd.js → index.418c8316.js} +6 -15
- package/components/NoItemSelected/styles.d.ts +4 -4
- package/components/ObjectLogs/{index.6955149e.js → index.bfa7dad3.js} +10 -27
- package/components/ObjectLogs/styles.d.ts +3 -3
- package/components/PDFViewer/{index.47bb0928.js → index.bb2eca5a.js} +2 -2
- package/components/{mui_extended/Pager/index.1ba2d52b.js → Page/index.fdf04592.js} +134 -26
- package/components/PaperForm/{index.9f6fd02d.js → index.8121e3da.js} +8 -7
- package/components/PaperForm/styles.d.ts +6 -6
- package/components/Period/{index.c6d1a95a.js → index.5233694b.js} +157 -22
- package/components/Period/styles.d.ts +5 -5
- package/components/PrintingSystem/{index.f51a00f8.js → index.fb176a93.js} +14 -14
- package/components/PrintingSystem/subcomponents/BodyNode/{index.6792c353.js → index.c1d61038.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.eec6b4cd.js → index.18bd9bad.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.e58467c9.js → index.67d9f1b4.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.920b75c9.js → index.eaee152a.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.6c1ad53c.js → index.f5f63a2a.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.e8b151ad.js → index.7de4e411.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.bf199422.js → index.f9ccf22b.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.44d436b9.js → index.f2f2e903.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.879cf13d.js → index.540a4b19.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.eb6af0ca.js → index.41e7fcb0.js} +1 -1
- package/components/PropertyValue/{index.5e59580c.js → index.9572c347.js} +4 -7
- package/components/Resizeable/{index.5e8e48b1.js → index.1f0c1359.js} +7 -7
- package/components/ResizeableWindow/styles.d.ts +1 -1
- package/components/ScrollBar/{index.4b965665.js → index.adf0eade.js} +2 -4
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/SideBar/{index.5d1f4a23.js → index.629ba840.js} +24 -26
- package/components/SideBar/styles.d.ts +2 -2
- package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +3 -3
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +1 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +2 -18
- package/components/SplitLayout/{index.15756f0f.js → index.74091a81.js} +1 -3
- package/components/ToastContainer/{index.dbd78941.js → index.f9b507b9.js} +3 -3
- package/components/animate/LoadingScreen/{index.1a83615a.js → index.779690a7.js} +3 -5
- package/components/animate/PropagateLoader/{index.76d7ea70.js → index.a9da8d00.js} +3 -2
- package/components/animate/PropagateLoader/syles.d.ts +1 -1
- package/components/animate/{index.87296638.js → index.b8497385.js} +3 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +3 -3
- package/components/areas/constants.5387d83e.js +412 -0
- package/components/areas/contexts/AreasContext/{index.19c7b906.js → index.bb316000.js} +5 -6
- package/components/areas/contexts/DynamicMFParmsContext/{index.3d9ad0ad.js → index.37d1d444.js} +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.992ae7a3.js → index.69d95c15.js} +2 -2
- package/components/areas/dictionary.7e74022a.js +286 -0
- package/components/areas/hooks/useAreas/{index.cedd30ee.js → index.e24bd74d.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.9e09e1e3.js → index.03ce6078.js} +1 -1
- package/components/areas/hooks/useWindowToolsMF/{index.2fbae9dc.js → index.09801b66.js} +1 -1
- package/components/areas/icons.504ec098.js +83 -0
- package/components/commercial/HamburgerMenu/styles.d.ts +1 -1
- package/components/commercial/SectionCommercial/styles.d.ts +4 -9
- package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/styles.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +4 -4
- package/components/hook-form/RHFCheckbox/styles.d.ts +2 -10
- package/components/hook-form/RHFPeriod/styles.d.ts +1 -1
- package/components/hook-form/RHFTextField/styles.d.ts +2 -2
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +2 -2
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +1 -1
- package/components/maps/components/GpsTools/{index.4ea69dd1.js → index.75880ce0.js} +14 -136
- package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +4 -9
- package/components/maps/{components/Map/index.62b7d09b.js → index.8ec46ce4.js} +19 -194
- package/components/modal/{WindowBase.2414cd02.js → WindowBase.a3ac7adc.js} +3 -4
- package/components/modal/{WindowConfirm.48140481.js → WindowConfirm.e35da619.js} +6 -10
- package/components/modal/{index.81eb6def.js → index.a0e30c8b.js} +1 -5
- package/components/mui_extended/Accordion/styles.d.ts +3 -3
- package/components/mui_extended/Badge/styles.d.ts +1 -1
- package/components/mui_extended/Button/styles.d.ts +2 -10
- package/components/mui_extended/IconButton/styles.d.ts +1 -1
- package/components/mui_extended/ImageButton/styles.d.ts +1 -1
- package/components/mui_extended/MenuActions/styles.d.ts +2 -27
- package/components/mui_extended/Pager/styles.d.ts +1 -1
- package/components/mui_extended/Stack/styles.d.ts +2 -9
- package/components/mui_extended/Tab/styles.d.ts +2 -2
- package/components/mui_extended/Tabs/styles.d.ts +3 -58
- package/components/mui_extended/Typography/styles.d.ts +1 -1
- package/components/popups/PopupsProvider/{index.8fb6232a.js → index.18669fb4.js} +1 -1
- package/components/popups/PopupsViewer/{index.813854e4.js → index.ba354267.js} +5 -10
- package/contexts/ModalContext/{index.45c275cd.js → index.cf02e6bd.js} +1 -1
- package/contexts/RHFormContext/{index.bf3a2812.js → index.dc955a09.js} +2 -6
- package/hooks/useFormAddEdit/{index.9b27ca02.js → index.f156a2cd.js} +4 -8
- package/hooks/useModal/index.ef54bcf2.js +66 -0
- package/hooks/useTab/{index.f7973779.js → index.bce8b99e.js} +1 -1
- package/index.d.ts +0 -1
- package/index.js +276 -360
- package/package.json +3 -2
- package/{react-draggable.79b4c69a.js → react-draggable.5331add7.js} +1 -1
- package/{react-resizable.af1f31c1.js → react-resizable.37bfb965.js} +3 -5
- package/test/{getNameDataTestId.0faeade8.js → getNameDataTestId.aee44365.js} +2 -2
- package/test/index.6d4b98b9.js +4 -0
- package/utils/{index.0718eeac.js → index.9ee4c99a.js} +113 -3
- package/vendor.a1ce6777.js +6352 -0
- package/assets/Logo/index.109a182d.js +0 -38
- package/assets/Logo.d.ts +0 -6
- package/components/CommonActions/components/ActionCancel/index.46f636e9.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index.2b0bd50d.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index.4f212c39.js +0 -33
- package/components/CommonActions/components/ActionIntro/index.7406bd47.js +0 -25
- package/components/CommonActions/components/Actions/index.273645af.js +0 -70
- package/components/DataGrid/constants.e334cd50.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cee6b676.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.708f3fb5.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.c064bb07.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +0 -10
- package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
- package/components/DataGrid/index.304437ee.js +0 -917
- package/components/DataGrid/subcomponents/Actions/index.f14590d2.js +0 -595
- package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +0 -76
- package/components/Icon/index.ee7b85c9.js +0 -192
- package/components/Image/index.8cc036b1.js +0 -168
- package/components/Page/index.c1d4a319.js +0 -114
- package/components/animate/variants/index.7a912140.js +0 -1
- package/components/areas/components/AreasAdmin/index.f239c717.js +0 -733
- package/components/areas/components/AreasViewer/index.61e0538b.js +0 -1071
- package/components/areas/components/index.558684b3.js +0 -1
- package/components/areas/constants.66529246.js +0 -6
- package/components/areas/contexts/index.24025b97.js +0 -1
- package/components/areas/dictionary.08cfc4c9.js +0 -36
- package/components/areas/hooks/index.d9dc1e21.js +0 -1
- package/components/areas/icons.8266ccc8.js +0 -26
- package/components/areas/index.4cc6a221.js +0 -22
- package/components/commercial/AppBarCommercial/index.9f654f8e.js +0 -28
- package/components/commercial/SectionCommercial/index.3df4685b.js +0 -57
- package/components/commercial/TopBar/index.7aeb6ec0.js +0 -234
- package/components/formatters/BooleanFormatter/index.0c2d8e35.js +0 -44
- package/components/formatters/DateFormatter/index.2ef6f261.js +0 -43
- package/components/formatters/PointsFormatter/index.d8a4ee54.js +0 -25
- package/components/formatters/PriceFormatter/index.97f75b4b.js +0 -35
- package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +0 -29
- package/components/formatters/index.b816c6b6.js +0 -117
- package/components/hook-form/HelperError/index.c8b046b7.js +0 -19
- package/components/hook-form/RHFAutocomplete/index.ea2ac2b1.js +0 -408
- package/components/hook-form/RHFAutocompleteAsync/index.98dcf0de.js +0 -158
- package/components/hook-form/RHFCheckbox/index.c32278fa.js +0 -142
- package/components/hook-form/RHFColorPicker/index.8c939bfd.js +0 -191
- package/components/hook-form/RHFDateTime/index.ac27deab.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +0 -34
- package/components/hook-form/RHFPeriod/index.70cfc422.js +0 -104
- package/components/hook-form/RHFRadioGroup/index.11c0add8.js +0 -35
- package/components/hook-form/RHFSelect/index.c6c60ecc.js +0 -29
- package/components/hook-form/RHFTextField/index.fa97889a.js +0 -325
- package/components/maps/index.13bb982c.js +0 -7
- package/components/mui_extended/Accordion/index.d08a0361.js +0 -142
- package/components/mui_extended/Avatar/index.fb9ad158.js +0 -63
- package/components/mui_extended/Badge/index.2a3aef2c.js +0 -30
- package/components/mui_extended/BoxIcon/index.d61e7ac5.js +0 -22
- package/components/mui_extended/Breadcrumbs/index.4a44883c.js +0 -87
- package/components/mui_extended/Button/index.5395d101.js +0 -213
- package/components/mui_extended/CheckBox.256169f0.js +0 -76
- package/components/mui_extended/CircularProgress/index.967e70b7.js +0 -8
- package/components/mui_extended/IconButton/index.b0ee4965.js +0 -119
- package/components/mui_extended/LinearProgress/index.4092bb69.js +0 -9
- package/components/mui_extended/LinkWithRoute/index.288c51f3.js +0 -15
- package/components/mui_extended/MenuActions/index.d92ed0d6.js +0 -175
- package/components/mui_extended/Popover/index.4e7340b4.js +0 -142
- package/components/mui_extended/Stack/index.fe363ca5.js +0 -31
- package/components/mui_extended/Tab/index.c5ad86e2.js +0 -134
- package/components/mui_extended/ToggleButton/index.7fbc8614.js +0 -18
- package/components/mui_extended/ToggleIconButton/index.0cd347b4.js +0 -24
- package/components/mui_extended/Tooltip/index.49bb5ee1.js +0 -40
- package/components/mui_extended/Typography/index.a1e774a2.js +0 -54
- package/components/mui_extended/index.b606cd9d.js +0 -1
- package/hooks/useModal/index.30674bb7.js +0 -11
- package/style.css +0 -65
- package/test/constants_no_mock.86c553a9.js +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const AREAS_DICTIONARY_ID = "areas";
|
|
2
|
-
function getAreasComponentsDictionary() {
|
|
3
|
-
return [AREAS_DICTIONARY_ID];
|
|
4
|
-
}
|
|
5
|
-
const LABEL_FILTER_BUTTON = "filter_tooltip";
|
|
6
|
-
const DICCTIONARY = {
|
|
7
|
-
label_new_area: "label_new_area",
|
|
8
|
-
label_persist_module_cookies: "label_persist_module_cookies",
|
|
9
|
-
validation_edit_area: "validation_edit_area",
|
|
10
|
-
label_edit_area: "label_edit_area",
|
|
11
|
-
label_delete_area: "label_delete_area",
|
|
12
|
-
label_window_colapse: "label_window_colapse",
|
|
13
|
-
label_window_un_colapse: "label_window_un_colapse",
|
|
14
|
-
area_error_title: "area_error_title",
|
|
15
|
-
area_error_description: "area_error_description",
|
|
16
|
-
area_error_recommendation: "area_error_recommendation",
|
|
17
|
-
area_error_intro: "area_error_intro",
|
|
18
|
-
area_add_new: "area_add_new",
|
|
19
|
-
label_reset_module_cookies: "label_reset_module_cookies",
|
|
20
|
-
label_close_window: "label_close_window",
|
|
21
|
-
label_maximize_window: "label_maximize_window",
|
|
22
|
-
label_minimize_window: "label_minimize_window",
|
|
23
|
-
label_collapse_window: "label_collapse_window",
|
|
24
|
-
label_uncollapse_window: "label_uncollapse_window",
|
|
25
|
-
label_module_actions: "label_module_actions"
|
|
26
|
-
};
|
|
27
|
-
const getAreasDictionary = (key) => {
|
|
28
|
-
return `${AREAS_DICTIONARY_ID}.${key}`;
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
AREAS_DICTIONARY_ID as A,
|
|
32
|
-
DICCTIONARY as D,
|
|
33
|
-
LABEL_FILTER_BUTTON as L,
|
|
34
|
-
getAreasComponentsDictionary as a,
|
|
35
|
-
getAreasDictionary as g
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const ICONS = {
|
|
2
|
-
CLOSE: "close.svg",
|
|
3
|
-
MAXIMIZE: "maximize.svg",
|
|
4
|
-
NORMALIZE: "normalize.svg",
|
|
5
|
-
COLAPSE: "colapse.svg",
|
|
6
|
-
UNCOLPASE: "uncolapse.svg",
|
|
7
|
-
RESET_COOKIES: "reset_cookies.svg",
|
|
8
|
-
SAVE_COOKIES: "save_cookies.svg",
|
|
9
|
-
DELETE_AREA: "delete_area.svg",
|
|
10
|
-
ADD_AREA: "add_area.svg",
|
|
11
|
-
LAYERS: "layers.svg",
|
|
12
|
-
NAVIGATE_ERROR: "navegate_error.svg",
|
|
13
|
-
EDIT_AREA: "edit.svg",
|
|
14
|
-
CHECK: "checkmarkInCircle.svg",
|
|
15
|
-
RESIZE: "controlSize.svg",
|
|
16
|
-
VERSION: "version.svg",
|
|
17
|
-
SHOW_OPTIONS: "showMoreVertical.svg",
|
|
18
|
-
CHEVRON_DOWN: "chevronDown.svg",
|
|
19
|
-
TOASTY_CLOSE: "close.svg",
|
|
20
|
-
TOASTY_PIN: "pin.svg",
|
|
21
|
-
MODULE: "module.svg",
|
|
22
|
-
POPUP: "popup.svg"
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
ICONS as I
|
|
26
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
function useOnClickOutside(ref, handler, noRef) {
|
|
3
|
-
useEffect(() => {
|
|
4
|
-
const listener = (event) => {
|
|
5
|
-
const el = ref?.current;
|
|
6
|
-
const noEl = noRef?.current;
|
|
7
|
-
if (!el || el.contains(event.target) || noEl && noEl.contains(event.target)) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
handler(event);
|
|
11
|
-
};
|
|
12
|
-
document.addEventListener("mousedown", listener);
|
|
13
|
-
document.addEventListener("touchstart", listener);
|
|
14
|
-
return () => {
|
|
15
|
-
document.removeEventListener("mousedown", listener);
|
|
16
|
-
document.removeEventListener("touchstart", listener);
|
|
17
|
-
};
|
|
18
|
-
}, [ref, handler]);
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
useOnClickOutside as u
|
|
22
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { generateUtilityClasses, styled } from "@mui/material";
|
|
3
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
4
|
-
import { g as getComponentUtilityClass } from "../../../utils/index.0718eeac.js";
|
|
5
|
-
const componentName = "M4LAppBarCommercial";
|
|
6
|
-
generateUtilityClasses(
|
|
7
|
-
componentName,
|
|
8
|
-
[
|
|
9
|
-
"root"
|
|
10
|
-
]
|
|
11
|
-
);
|
|
12
|
-
const useAppBarComercialUtilityClasses = () => {
|
|
13
|
-
const slots = {
|
|
14
|
-
root: ["root"]
|
|
15
|
-
};
|
|
16
|
-
return unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
|
|
17
|
-
};
|
|
18
|
-
const AppBarComercialRoot = styled("div")(({ theme }) => ({
|
|
19
|
-
...theme.components?.M4LAppBarCommercial?.styleOverrides
|
|
20
|
-
}));
|
|
21
|
-
const AppBarComercial = (props) => {
|
|
22
|
-
const { children } = props;
|
|
23
|
-
const classes = useAppBarComercialUtilityClasses();
|
|
24
|
-
return /* @__PURE__ */ jsx(AppBarComercialRoot, { className: classes.root, children });
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
AppBarComercial as A
|
|
28
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { generateUtilityClasses, styled } from "@mui/material";
|
|
3
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
4
|
-
import { g as getComponentUtilityClass } from "../../../utils/index.0718eeac.js";
|
|
5
|
-
import { S as Stack } from "../../mui_extended/Stack/index.fe363ca5.js";
|
|
6
|
-
const componentName = "M4LSectionCommercial";
|
|
7
|
-
generateUtilityClasses(
|
|
8
|
-
componentName,
|
|
9
|
-
[
|
|
10
|
-
"root",
|
|
11
|
-
"fullWidth",
|
|
12
|
-
"boxed",
|
|
13
|
-
"columnReverse"
|
|
14
|
-
]
|
|
15
|
-
);
|
|
16
|
-
const useAppBarComercialUtilityClasses = (ownerState) => {
|
|
17
|
-
const slots = {
|
|
18
|
-
root: [
|
|
19
|
-
"root",
|
|
20
|
-
ownerState.contentWith === "fullWidth" && "fullWidth",
|
|
21
|
-
ownerState.contentWith === "boxed" && "boxed",
|
|
22
|
-
ownerState.columnReverse && "columnReverse"
|
|
23
|
-
]
|
|
24
|
-
};
|
|
25
|
-
return unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
|
|
26
|
-
};
|
|
27
|
-
const SectionCommercialRoot = styled(Stack)(({ theme }) => ({
|
|
28
|
-
...theme.components?.M4LSectionCommercial?.styleOverrides
|
|
29
|
-
}));
|
|
30
|
-
const SectionCommercial = (props) => {
|
|
31
|
-
const {
|
|
32
|
-
children,
|
|
33
|
-
contentWith = "boxed",
|
|
34
|
-
paddingX = "40px",
|
|
35
|
-
paddingY,
|
|
36
|
-
columnReverse = false,
|
|
37
|
-
...others
|
|
38
|
-
} = props;
|
|
39
|
-
const ownerState = {
|
|
40
|
-
contentWith,
|
|
41
|
-
columnReverse
|
|
42
|
-
};
|
|
43
|
-
const classes = useAppBarComercialUtilityClasses(ownerState);
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
-
SectionCommercialRoot,
|
|
46
|
-
{
|
|
47
|
-
className: classes.root,
|
|
48
|
-
paddingY,
|
|
49
|
-
...others,
|
|
50
|
-
...contentWith === "boxed" ? { paddingX } : null,
|
|
51
|
-
children
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
SectionCommercial as S
|
|
57
|
-
};
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
|
|
3
|
-
import { generateUtilityClasses, styled, useTheme, Box, Grid } from "@mui/material";
|
|
4
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
5
|
-
import { g as getComponentUtilityClass } from "../../../utils/index.0718eeac.js";
|
|
6
|
-
import { createContext, useContext, useState } from "react";
|
|
7
|
-
import { useEnvironment } from "@m4l/core";
|
|
8
|
-
import { I as Icon } from "../../Icon/index.ee7b85c9.js";
|
|
9
|
-
import clsx from "clsx";
|
|
10
|
-
import { g as getNameDataTestId } from "../../../test/getNameDataTestId.0faeade8.js";
|
|
11
|
-
import { A as Accordion } from "../../mui_extended/Accordion/index.d08a0361.js";
|
|
12
|
-
import { B as Button } from "../../mui_extended/Button/index.5395d101.js";
|
|
13
|
-
import { P as Popover } from "../../mui_extended/Popover/index.4e7340b4.js";
|
|
14
|
-
const componentName = "M4LTopBar";
|
|
15
|
-
const TopBarClasses = generateUtilityClasses(componentName, [
|
|
16
|
-
"root",
|
|
17
|
-
"ContainerImageComercial",
|
|
18
|
-
"SimplebarComercial",
|
|
19
|
-
"ItemRoot",
|
|
20
|
-
"ItemSelect",
|
|
21
|
-
"ContainerAccordion",
|
|
22
|
-
"ContainerAccordionCase1",
|
|
23
|
-
"IconAndButton",
|
|
24
|
-
"IsActive"
|
|
25
|
-
]);
|
|
26
|
-
function getTopBarClassesUtilityClass() {
|
|
27
|
-
const slots = {
|
|
28
|
-
root: ["root"],
|
|
29
|
-
ContainerImageComercial: ["ContainerImageComercial"],
|
|
30
|
-
SimplebarComercial: ["SimplebarComercial"],
|
|
31
|
-
ItemRoot: ["ItemRoot"],
|
|
32
|
-
ItemSelect: ["ItemSelect"],
|
|
33
|
-
ContainerAccordion: ["ContainerAccordion"],
|
|
34
|
-
ContainerAccordionCase1: ["ContainerAccordionCase1"],
|
|
35
|
-
IconAndButton: ["IconAndButton"]
|
|
36
|
-
};
|
|
37
|
-
const composedClasses = unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
|
|
38
|
-
return {
|
|
39
|
-
...composedClasses
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
const initialstate = {
|
|
43
|
-
dataMenu: [],
|
|
44
|
-
classes: getTopBarClassesUtilityClass(),
|
|
45
|
-
dataTestId: ""
|
|
46
|
-
};
|
|
47
|
-
const TopBarContext = createContext(initialstate);
|
|
48
|
-
const TopBarProvider = (props) => {
|
|
49
|
-
const { children, value } = props;
|
|
50
|
-
const { dataMenu: DataMenu, classes, dataTestId } = value;
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
-
TopBarContext.Provider,
|
|
53
|
-
{
|
|
54
|
-
value: { dataMenu: DataMenu, classes, dataTestId },
|
|
55
|
-
children
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
const useTopBar = () => useContext(TopBarContext);
|
|
60
|
-
const useTopBar$1 = useTopBar;
|
|
61
|
-
const ArrowIconRoot = styled("div")(() => ({
|
|
62
|
-
display: "flex",
|
|
63
|
-
alignSelf: "center",
|
|
64
|
-
lineHeight: 0
|
|
65
|
-
}));
|
|
66
|
-
function ArrowIcon(props) {
|
|
67
|
-
const { openState } = props;
|
|
68
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
69
|
-
return /* @__PURE__ */ jsx(ArrowIconRoot, { className: "", children: /* @__PURE__ */ jsx(
|
|
70
|
-
Icon,
|
|
71
|
-
{
|
|
72
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/sidebar/assets/icons/ChevronRight.svg`,
|
|
73
|
-
rotationAngle: openState ? 270 : 90,
|
|
74
|
-
size: "medium"
|
|
75
|
-
}
|
|
76
|
-
) });
|
|
77
|
-
}
|
|
78
|
-
const isActive = (data) => {
|
|
79
|
-
const path = window.location.pathname;
|
|
80
|
-
if (data.path === path) {
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
if (data.children) {
|
|
84
|
-
return data.children.some((item) => isActive(item));
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
};
|
|
88
|
-
const NavItemRoot = (props) => {
|
|
89
|
-
const theme = useTheme();
|
|
90
|
-
const { classes, dataTestId } = useTopBar$1();
|
|
91
|
-
const { itemRootData } = props;
|
|
92
|
-
const { title, children, module_id } = itemRootData;
|
|
93
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
94
|
-
const [openedPopoverId, setOpenedPopoverId] = useState(null);
|
|
95
|
-
const handleClick = (event, popoverId) => {
|
|
96
|
-
setAnchorEl(event.currentTarget);
|
|
97
|
-
setOpenedPopoverId(popoverId);
|
|
98
|
-
};
|
|
99
|
-
const handleClose = () => {
|
|
100
|
-
setAnchorEl(null);
|
|
101
|
-
setOpenedPopoverId(null);
|
|
102
|
-
};
|
|
103
|
-
const renderMenuItems = (items) => {
|
|
104
|
-
return items.map((item, index) => /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: item.children ? item.children && item.children.length > 0 && /* @__PURE__ */ jsx(Accordion, { label: item.title, children: renderMenuItems(item.children) }) : /* @__PURE__ */ jsx(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
className: clsx(
|
|
108
|
-
classes.ItemSelect,
|
|
109
|
-
item.path === window.location.pathname ? TopBarClasses.IsActive : null
|
|
110
|
-
),
|
|
111
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(componentName, "ItemSelect", dataTestId) } : {},
|
|
112
|
-
children: /* @__PURE__ */ jsx(Button, { variant: "text", href: item.path, fullWidth: true, children: item.title })
|
|
113
|
-
}
|
|
114
|
-
) }, index));
|
|
115
|
-
};
|
|
116
|
-
const renderPopover = () => {
|
|
117
|
-
return /* @__PURE__ */ jsx(
|
|
118
|
-
Popover,
|
|
119
|
-
{
|
|
120
|
-
elevation: 3,
|
|
121
|
-
id: module_id,
|
|
122
|
-
open: openedPopoverId === itemRootData.module_id ? true : false,
|
|
123
|
-
anchorEl,
|
|
124
|
-
onClose: handleClose,
|
|
125
|
-
anchorOrigin: {
|
|
126
|
-
vertical: "bottom",
|
|
127
|
-
horizontal: "center"
|
|
128
|
-
},
|
|
129
|
-
transformOrigin: {
|
|
130
|
-
vertical: "top",
|
|
131
|
-
horizontal: "center"
|
|
132
|
-
},
|
|
133
|
-
arrowType: "top-center",
|
|
134
|
-
sx: { ...theme.components?.M4LPopoverTopBar?.styleOverrides },
|
|
135
|
-
children: /* @__PURE__ */ jsx(Grid, { container: true, spacing: 0.5, children: children && children.length > 0 && renderMenuItems(children) })
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
const render = () => {
|
|
140
|
-
if (itemRootData.children && itemRootData.path) {
|
|
141
|
-
return /* @__PURE__ */ jsxs(
|
|
142
|
-
"div",
|
|
143
|
-
{
|
|
144
|
-
className: classes.ContainerAccordionCase1,
|
|
145
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
146
|
-
[TEST_PROP_ID]: getNameDataTestId(
|
|
147
|
-
componentName,
|
|
148
|
-
"ContainerAccordionCase1",
|
|
149
|
-
dataTestId
|
|
150
|
-
)
|
|
151
|
-
} : {},
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ jsx(Button, { size: "medium", variant: "text", href: itemRootData.path, children: title }),
|
|
154
|
-
/* @__PURE__ */ jsx(
|
|
155
|
-
Button,
|
|
156
|
-
{
|
|
157
|
-
variant: "text",
|
|
158
|
-
id: module_id,
|
|
159
|
-
onClick: (e) => handleClick(e, module_id),
|
|
160
|
-
endIcon: /* @__PURE__ */ jsx(ArrowIcon, { openState: openedPopoverId === module_id ? true : false })
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
renderPopover()
|
|
164
|
-
]
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
if (itemRootData.children) {
|
|
169
|
-
return /* @__PURE__ */ jsxs(
|
|
170
|
-
"div",
|
|
171
|
-
{
|
|
172
|
-
className: classes.ContainerAccordion,
|
|
173
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(componentName, "ContainerAccordion", dataTestId) } : {},
|
|
174
|
-
children: [
|
|
175
|
-
/* @__PURE__ */ jsx(
|
|
176
|
-
Button,
|
|
177
|
-
{
|
|
178
|
-
"aria-describedby": module_id,
|
|
179
|
-
variant: "text",
|
|
180
|
-
size: "medium",
|
|
181
|
-
onClick: (e) => handleClick(e, itemRootData.module_id),
|
|
182
|
-
endIcon: /* @__PURE__ */ jsx(ArrowIcon, { openState: openedPopoverId === module_id ? true : false }),
|
|
183
|
-
children: title
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
renderPopover()
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
if (itemRootData.path)
|
|
192
|
-
return /* @__PURE__ */ jsx(Button, { variant: "text", size: "medium", href: itemRootData.path, "aria-describedby": module_id, children: /* @__PURE__ */ jsx("div", { children: title }) });
|
|
193
|
-
};
|
|
194
|
-
return /* @__PURE__ */ jsx(
|
|
195
|
-
Box,
|
|
196
|
-
{
|
|
197
|
-
className: clsx(
|
|
198
|
-
classes.ItemRoot,
|
|
199
|
-
isActive(itemRootData) || openedPopoverId === itemRootData.module_id ? TopBarClasses.IsActive : null
|
|
200
|
-
),
|
|
201
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(componentName, "ItemRoot", dataTestId) } : {},
|
|
202
|
-
children: render()
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
const ConteinItem = () => {
|
|
207
|
-
const { dataMenu: DataMenu, classes, dataTestId } = useTopBar$1();
|
|
208
|
-
return /* @__PURE__ */ jsx(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
className: classes.SimplebarComercial,
|
|
212
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(componentName, "SimplebarComercial", dataTestId) } : {},
|
|
213
|
-
children: DataMenu.map((group) => /* @__PURE__ */ jsx(NavItemRoot, { itemRootData: group }, group.module_id))
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
const TopBarRoot = styled("header")(({ theme }) => ({
|
|
218
|
-
...theme.components?.M4LTopBar?.styleOverrides
|
|
219
|
-
}));
|
|
220
|
-
const TopBar = (props) => {
|
|
221
|
-
const { dataMenu: DataMenu, dataTestId } = props;
|
|
222
|
-
const classes = getTopBarClassesUtilityClass();
|
|
223
|
-
return /* @__PURE__ */ jsx(
|
|
224
|
-
TopBarRoot,
|
|
225
|
-
{
|
|
226
|
-
className: classes.root,
|
|
227
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(componentName, "root", dataTestId) } : {},
|
|
228
|
-
children: /* @__PURE__ */ jsx(TopBarProvider, { value: { dataMenu: DataMenu, classes, dataTestId }, children: /* @__PURE__ */ jsx(ConteinItem, {}) })
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
};
|
|
232
|
-
export {
|
|
233
|
-
TopBar as T
|
|
234
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
|
-
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
4
|
-
import { I as Icon } from "../../Icon/index.ee7b85c9.js";
|
|
5
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index.57964195.js";
|
|
6
|
-
import { F as FormatterRoot, f as formatterClasses } from "../index.b816c6b6.js";
|
|
7
|
-
import clsx from "clsx";
|
|
8
|
-
const BOOLEAN_FORMATTER_DICTIONARY_KEY = `boolean_formatter`;
|
|
9
|
-
const LABEL_BOOLEAN_YES = `${BOOLEAN_FORMATTER_DICTIONARY_KEY}.boolean_yes`;
|
|
10
|
-
const LABEL_BOOLEAN_NO = `${BOOLEAN_FORMATTER_DICTIONARY_KEY}.boolean_no`;
|
|
11
|
-
const LABEL_BOOLEAN_TRUE = `${BOOLEAN_FORMATTER_DICTIONARY_KEY}.boolean_true`;
|
|
12
|
-
const LABEL_BOOLEAN_FALSE = `${BOOLEAN_FORMATTER_DICTIONARY_KEY}.boolean_false`;
|
|
13
|
-
function BooleanFormatter(props) {
|
|
14
|
-
const { presentationType, value, Component = WrapperComponent } = props;
|
|
15
|
-
const { getLabel } = useModuleDictionary();
|
|
16
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
17
|
-
const final_value = value ?? false;
|
|
18
|
-
const srcCheckTrue = `${host_static_assets}/${environment_assets}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_true.svg`;
|
|
19
|
-
const srcCheckFalse = `${host_static_assets}/${environment_assets}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_false.svg`;
|
|
20
|
-
const memoComponent = useMemo(() => {
|
|
21
|
-
if (presentationType === "string_yes_no") {
|
|
22
|
-
return /* @__PURE__ */ jsx(Component, { children: final_value ? getLabel(LABEL_BOOLEAN_YES) : getLabel(LABEL_BOOLEAN_NO) });
|
|
23
|
-
}
|
|
24
|
-
if (presentationType === "string_true_false") {
|
|
25
|
-
return /* @__PURE__ */ jsx(Component, { children: final_value ? getLabel(LABEL_BOOLEAN_TRUE) : getLabel(LABEL_BOOLEAN_FALSE) });
|
|
26
|
-
}
|
|
27
|
-
return /* @__PURE__ */ jsx(FormatterRoot, { children: /* @__PURE__ */ jsx(Component, { children: /* @__PURE__ */ jsx(
|
|
28
|
-
Icon,
|
|
29
|
-
{
|
|
30
|
-
src: final_value ? srcCheckTrue : srcCheckFalse,
|
|
31
|
-
className: clsx(
|
|
32
|
-
formatterClasses.root,
|
|
33
|
-
formatterClasses.booleanFormatterIcon,
|
|
34
|
-
final_value && formatterClasses.booleanFormatterCheck
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
) }) });
|
|
38
|
-
}, [final_value]);
|
|
39
|
-
return memoComponent;
|
|
40
|
-
}
|
|
41
|
-
export {
|
|
42
|
-
BooleanFormatter as B,
|
|
43
|
-
BOOLEAN_FORMATTER_DICTIONARY_KEY as a
|
|
44
|
-
};
|
|
@@ -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.57964195.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 { evaluateWithContext } from "@m4l/core";
|
|
3
|
-
import { W as WrapperComponent } from "../../WrapperComponent/index.57964195.js";
|
|
4
|
-
function getFormatPoints(obProps, fieldValue, fieldUnit, chainPoint) {
|
|
5
|
-
let result = "";
|
|
6
|
-
const points = evaluateWithContext(obProps, fieldValue);
|
|
7
|
-
const unit = evaluateWithContext(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(`[${evaluateWithContext(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.57964195.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.57964195.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 ? "<" : "\u2264";
|
|
14
|
-
const cmc_max_closed = obj.cmc_max_closed != true ? "<" : "\u2264";
|
|
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} \xB1 ${obj.cmc_uncertainty}]` : `[${obj.cmc_min}${unit} \xB1 ${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
|
-
};
|