@m4l/components 1.0.11 → 1.0.13
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.62b1290b.js → index.f22ad364.js} +4 -4
- package/components/AppBar/{index.b48343d8.js → index.8d90ce87.js} +4 -4
- package/components/CommonActions/components/ActionCancel/index.609a78ca.js +12 -0
- package/components/CommonActions/components/ActionFormCancel/index.a1318eac.js +56 -0
- package/components/CommonActions/components/ActionFormIntro/index.34d569d1.js +33 -0
- package/components/CommonActions/components/ActionIntro/index.ebac0bc1.js +25 -0
- package/components/CommonActions/components/Actions/index.258bf919.js +71 -0
- package/components/DataGrid/constants.e334cd50.js +10 -0
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index.7fb1ebaa.js +26 -0
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.0ee10612.js +22 -0
- package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +19 -0
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.dce9ada8.js +23 -0
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +14 -0
- package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +10 -0
- package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +10 -0
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +36 -0
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +10 -0
- package/components/DataGrid/formatters/index.2c2f0ae4.js +1 -0
- package/components/DataGrid/index.68e19254.js +915 -0
- package/components/DataGrid/subcomponents/Actions/index.6b044e84.js +596 -0
- package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +76 -0
- package/components/DragResizeWindow/{index.8b3e79f7.js → index.a358789f.js} +6 -3
- package/components/DynamicFilter/constants.1dddd09c.js +31 -0
- package/components/DynamicFilter/dictionary.d28d39ef.js +51 -0
- package/components/DynamicFilter/helpers/{index.609b3915.js → index.11ed2896.js} +4 -4
- package/components/DynamicFilter/{index.0f04f223.js → index.056a99c7.js} +3 -3
- package/components/DynamicFilter/slots/{index.00b68384.js → index.82d7eaf2.js} +31 -31
- package/components/DynamicFilter/store/{index.85a2812f.js → index.9b5121d6.js} +2 -2
- package/components/DynamicFilter/subcomponents/{index.86c6fda2.js → index.778c93cc.js} +217 -15
- package/components/FieldLabel/{index.1577ac9c.js → index.6b6f708e.js} +4 -4
- package/components/GridLayout/{index.656840a5.js → index.68d907d4.js} +34 -11
- package/components/GridLayout/subcomponents/Griditem/{index.b23625d7.js → index.8955a794.js} +3 -4
- package/components/GridLayout/subcomponents/Responsive/{index.97505a31.js → index.45cecca2.js} +1 -2
- package/components/GridLayout/subcomponents/SizeProvider/{index.36cb4139.js → index.7050ac4f.js} +1 -1
- package/components/HelperText/{index.ebb53dac.js → index.09e80920.js} +1 -1
- package/components/Icon/{index.8ecfb193.js → index.83867398.js} +10 -26
- package/components/Image/{index.4a822ede.js → index.19aa7ff5.js} +3 -2
- package/components/LanguagePopover/index.921efd11.js +188 -0
- package/components/{mui_extended/LinearProgress/index.e9455b2e.js → LinearProgressIndeterminate/index.ea9c8518.js} +4 -9
- package/components/LoadingError/{index.9e829e8d.js → index.aee18b24.js} +11 -7
- package/components/MFLoader/{index.29f445e2.js → index.c975666e.js} +8 -4
- package/components/ModalDialog/{index.96c4aba3.js → index.0dd5af28.js} +14 -5
- package/components/NavLink/{index.9f5d5670.js → index.ad039baf.js} +3 -2
- package/components/NoItemSelected/{index.0ae9f28f.js → index.d10603d7.js} +13 -3
- package/components/ObjectLogs/{index.40c5047f.js → index.a3e42b21.js} +26 -8
- package/components/PDFViewer/{index.651cc4b6.js → index.35f68e67.js} +2 -2
- package/components/Page/{index.1d08818c.js → index.f4755eba.js} +18 -2
- package/components/PaperForm/{index.1a8b10d4.js → index.007ef4cf.js} +2 -2
- package/components/Period/{index.236971ae.js → index.9647181b.js} +15 -54
- package/components/PrintingSystem/{index.9fdae551.js → index.a69a9d85.js} +14 -15
- package/components/PrintingSystem/subcomponents/BodyNode/{index.794dbc69.js → index.528fcfbf.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.6bbf7d75.js → index.fbe87257.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.015a2212.js → index.f5adab1d.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.08eeb1d2.js → index.f42ca7dc.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.23995699.js → index.041b9cff.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.3fa36620.js → index.a8140332.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.8b7d43f4.js → index.aabde2bb.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.9856c572.js → index.7f75ca46.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.89b3a4e0.js → index.61babb47.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.dc6e9dc2.js → index.4d0e67a3.js} +1 -1
- package/components/PropertyValue/{index.646a7e8b.js → index.51faabb5.js} +7 -4
- package/components/Resizeable/{index.414ff687.js → index.4f75c0b5.js} +1 -1
- package/components/ScrollBar/{index.1e89bb44.js → index.21bc5025.js} +1 -1
- package/components/SideBar/{index.d221254d.js → index.4075c562.js} +36 -7
- package/components/SplitLayout/{index.7d9edf4e.js → index.15756f0f.js} +3 -1
- package/components/ToastContainer/{index.7f246bbd.js → index.2a7d304e.js} +3 -3
- package/components/animate/variants/index.7a912140.js +1 -0
- package/components/areas/components/AreasAdmin/index.325bac22.js +733 -0
- package/components/areas/components/AreasViewer/index.6e30ec72.js +1072 -0
- package/components/areas/components/index.558684b3.js +1 -0
- package/components/areas/constants.66529246.js +6 -0
- package/components/areas/contexts/AreasContext/{index.0815f278.js → index.3311cbf9.js} +6 -5
- package/components/areas/contexts/DynamicMFParmsContext/{index.37d1d444.js → index.3d9ad0ad.js} +2 -2
- package/components/areas/contexts/WindowToolsMFContext/{index.69d95c15.js → index.992ae7a3.js} +2 -2
- package/components/areas/contexts/index.24025b97.js +1 -0
- package/components/areas/dictionary.08cfc4c9.js +36 -0
- package/components/areas/hooks/index.d9dc1e21.js +1 -0
- package/components/areas/hooks/useAreas/{index.4039e30d.js → index.f81493ef.js} +1 -1
- package/components/areas/hooks/useDynamicMFParameters/{index.03ce6078.js → index.9e09e1e3.js} +1 -1
- package/components/areas/hooks/useWindowToolsMF/{index.09801b66.js → index.2fbae9dc.js} +1 -1
- package/components/areas/icons.8266ccc8.js +26 -0
- package/components/areas/index.4cc6a221.js +22 -0
- package/components/commercial/AppBarCommercial/index.cbd55cf8.js +28 -0
- package/components/commercial/SectionCommercial/index.d22ebbd5.js +57 -0
- package/components/commercial/TopBar/index.410fffa8.js +234 -0
- package/components/{HamburgerMenu/index.6c82741d.js → commercial/index.07638f52.js} +5 -3
- package/components/formatters/BooleanFormatter/index.cbf9cd6e.js +44 -0
- package/components/formatters/DateFormatter/index.2ef6f261.js +43 -0
- package/components/formatters/PointsFormatter/index.d8a4ee54.js +25 -0
- package/components/formatters/PriceFormatter/index.97f75b4b.js +35 -0
- package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +29 -0
- package/components/formatters/index.63a3e08e.js +117 -0
- package/components/hook-form/HelperError/{index.2ed03a3c.js → index.c0109d5b.js} +1 -1
- package/components/hook-form/RHFAutocomplete/index.2991d444.js +404 -0
- package/components/hook-form/RHFAutocompleteAsync/{index.69f5661d.js → index.d97c727b.js} +2 -3
- package/components/hook-form/RHFCheckbox/{index.13de27db.js → index.b57e3131.js} +4 -4
- package/components/hook-form/RHFColorPicker/{index.66004599.js → index.310f6ff0.js} +6 -6
- package/components/hook-form/RHFDateTime/{index.dfe07e18.js → index.5689a29f.js} +5 -5
- package/components/hook-form/RHFPeriod/{index.d852649b.js → index.019e61ae.js} +4 -4
- package/components/hook-form/RHFTextField/{index.d207efc1.js → index.10e57945.js} +6 -6
- package/components/hook-form/RHFUpload/{index.955a4ba5.js → index.7fd23b2a.js} +5 -5
- package/components/{mui_extended/Tab/index.37d588d6.js → maps/components/GpsTools/index.20f83559.js} +331 -645
- package/components/maps/{index.a1bf63f2.js → components/Map/index.c37f3304.js} +737 -28
- package/components/maps/index.13bb982c.js +7 -0
- package/components/modal/{WindowBase.390b0910.js → WindowBase.cfbb0c9e.js} +4 -4
- package/components/modal/{WindowConfirm.243e1bef.js → WindowConfirm.300bd34b.js} +10 -6
- package/components/modal/{index.5bce430d.js → index.81eb6def.js} +5 -1
- package/components/mui_extended/Accordion/{index.f7a17c83.js → index.0843a609.js} +5 -5
- package/components/mui_extended/Avatar/{index.12b96914.js → index.fb9ad158.js} +1 -1
- package/components/mui_extended/Badge/{index.4737c113.js → index.8beaeefc.js} +1 -1
- package/components/mui_extended/Button/{index.52852c42.js → index.d742e9ee.js} +6 -81
- package/components/mui_extended/{CheckBox/index.01218423.js → CheckBox.21c25705.js} +1 -1
- package/components/mui_extended/IconButton/{index.d5b273e6.js → index.b4532b85.js} +1 -1
- package/components/mui_extended/LinearProgress/index.4092bb69.js +9 -0
- package/components/mui_extended/MenuActions/index.eae97857.js +176 -0
- package/components/mui_extended/Pager/{index.8960227c.js → index.3926c835.js} +22 -40
- package/components/mui_extended/Popover/index.2348fc4f.js +143 -0
- package/components/mui_extended/Tab/index.e911930f.js +135 -0
- package/components/mui_extended/ToggleButton/{index.c441b949.js → index.b834f5f0.js} +1 -1
- package/components/mui_extended/ToggleIconButton/{index.8a84f25e.js → index.fcd5205c.js} +1 -1
- package/components/mui_extended/Typography/{index.463f613f.js → index.642798f1.js} +1 -1
- package/components/mui_extended/index.b606cd9d.js +1 -0
- package/components/popups/PopupsProvider/{index.d4caacc3.js → index.d7c9efce.js} +1 -1
- package/components/popups/PopupsViewer/{index.42312806.js → index.f3677ab1.js} +10 -6
- package/contexts/ModalContext/{index.5f77a463.js → index.ad1fb73b.js} +1 -1
- package/contexts/RHFormContext/{index.95ebabc9.js → index.bf3a2812.js} +6 -2
- package/hooks/useFormAddEdit/{index.ecb77e67.js → index.6d983cd8.js} +6 -2
- package/hooks/useModal/index.2003c854.js +11 -0
- package/hooks/useTab/index.8d1a6e63.js +12 -0
- package/index.js +328 -273
- package/package.json +1 -1
- package/{react-draggable.0cc9b257.js → react-draggable.1c1ba224.js} +1 -1
- package/{react-resizable.837c446d.js → react-resizable.a59c14f4.js} +2 -2
- package/test/constants_no_mock.86c553a9.js +4 -0
- package/test/{getNameDataTestId.aee44365.js → getNameDataTestId.0faeade8.js} +2 -2
- package/utils/{index.c64c2dd1.js → index.14912462.js} +1 -54
- package/components/CommonActions/index.19f39dca.js +0 -170
- package/components/areas/constants.0d3ba950.js +0 -289
- package/components/areas/dictionary.6168209a.js +0 -266
- package/components/areas/icons.504ec098.js +0 -83
- package/components/maps/components/GpsTools/index.01acaf3e.js +0 -251
- package/components/mui_extended/Popover/index.146ded9e.js +0 -1044
- package/hooks/useModal/index.d14c7e46.js +0 -67
- package/vendor.5b266106.js +0 -3952
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -6,12 +6,13 @@ import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
|
6
6
|
import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
|
|
7
7
|
import { devtools } from "zustand/middleware";
|
|
8
8
|
import { immer } from "zustand/middleware/immer";
|
|
9
|
-
import { u as useAreasViewerUtilityClasses
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { u as useAreasViewerUtilityClasses } from "../../components/AreasViewer/index.6e30ec72.js";
|
|
10
|
+
import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/index.325bac22.js";
|
|
11
|
+
import { c as createDynamicMFStore } from "../DynamicMFParmsContext/index.3d9ad0ad.js";
|
|
12
|
+
import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.08cfc4c9.js";
|
|
13
|
+
import { a as addLayoutItemToBreakPointIfNoExists, b as addLayoutItemToBreakPoints, c as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/index.45cecca2.js";
|
|
13
14
|
import { debounce, cloneDeep } from "lodash";
|
|
14
|
-
import {
|
|
15
|
+
import { A as isEqualLayouts } from "../../../GridLayout/index.68d907d4.js";
|
|
15
16
|
import { useNavigate } from "react-router-dom";
|
|
16
17
|
const PADDING_GRIDLAYOUT = 11;
|
|
17
18
|
const MARGIN_GRIDLAYOUT = 11;
|
package/components/areas/contexts/DynamicMFParmsContext/{index.37d1d444.js → index.3d9ad0ad.js}
RENAMED
|
@@ -29,8 +29,8 @@ function DynamicMFParmsProvider(props) {
|
|
|
29
29
|
}
|
|
30
30
|
const MemonizedDynamicMFParmsProvider = React__default.memo(DynamicMFParmsProvider);
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
DynamicMFParmsProvider as D,
|
|
33
33
|
MemonizedDynamicMFParmsProvider as M,
|
|
34
|
-
|
|
34
|
+
DynamicMFParmsContext as a,
|
|
35
35
|
createDynamicMFStore as c
|
|
36
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { useStore } from "zustand";
|
|
3
|
-
import { A as AreasContext } from "../../contexts/AreasContext/index.
|
|
3
|
+
import { A as AreasContext } from "../../contexts/AreasContext/index.3311cbf9.js";
|
|
4
4
|
function useAreasStore(selector, equalityFn) {
|
|
5
5
|
const context = useContext(AreasContext);
|
|
6
6
|
if (!context)
|
package/components/areas/hooks/useDynamicMFParameters/{index.03ce6078.js → index.9e09e1e3.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { useStore } from "zustand";
|
|
3
|
-
import {
|
|
3
|
+
import { a as DynamicMFParmsContext } from "../../contexts/DynamicMFParmsContext/index.3d9ad0ad.js";
|
|
4
4
|
function useDynamicMFParametersStore(selector, equalityFn) {
|
|
5
5
|
const store = useContext(DynamicMFParmsContext);
|
|
6
6
|
if (!store)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { a as WindowToolsMFContext } from "../../contexts/WindowToolsMFContext/index.992ae7a3.js";
|
|
3
3
|
const useWindowToolsMF = () => {
|
|
4
4
|
const context = useContext(WindowToolsMFContext);
|
|
5
5
|
if (!context)
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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.14912462.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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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.14912462.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
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
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.14912462.js";
|
|
6
|
+
import { createContext, useContext, useState } from "react";
|
|
7
|
+
import { useEnvironment } from "@m4l/core";
|
|
8
|
+
import { I as Icon } from "../../Icon/index.83867398.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.0843a609.js";
|
|
12
|
+
import { B as Button } from "../../mui_extended/Button/index.d742e9ee.js";
|
|
13
|
+
import { P as Popover } from "../../mui_extended/Popover/index.2348fc4f.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
|
+
};
|
|
@@ -3,13 +3,14 @@ import { useState } from "react";
|
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
4
|
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
5
5
|
import { unstable_composeClasses } from "@mui/base";
|
|
6
|
-
import {
|
|
6
|
+
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
|
|
7
7
|
import { useEnvironment } from "@m4l/core";
|
|
8
|
-
import { S as SideBar } from "../SideBar/index.
|
|
9
|
-
import { I as IconButton } from "../mui_extended/IconButton/index.
|
|
8
|
+
import { S as SideBar } from "../SideBar/index.4075c562.js";
|
|
9
|
+
import { I as IconButton } from "../mui_extended/IconButton/index.b4532b85.js";
|
|
10
10
|
const HamburgerMenuRoot = styled("header")(({ theme }) => ({
|
|
11
11
|
...theme.components?.M4LHamburgerMenuCommercial?.styleOverrides
|
|
12
12
|
}));
|
|
13
|
+
const componentName = "M4LHamburgerMenuCommercial";
|
|
13
14
|
generateUtilityClasses(componentName, ["root", "ImageLogo"]);
|
|
14
15
|
function getHamburgerMenuComercialClassesUtilityClass(slot) {
|
|
15
16
|
return generateUtilityClass(componentName, slot);
|
|
@@ -24,6 +25,7 @@ const useHamburgerMenuComercialUtilityClasses = () => {
|
|
|
24
25
|
...composedClasses
|
|
25
26
|
};
|
|
26
27
|
};
|
|
28
|
+
const HAMBURGER_MENU_PREFIX = "M4LHamburgerMenu";
|
|
27
29
|
const getNameDataTestId = (KEY) => {
|
|
28
30
|
return `${HAMBURGER_MENU_PREFIX}-${KEY}`;
|
|
29
31
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
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.83867398.js";
|
|
5
|
+
import { W as WrapperComponent } from "../../WrapperComponent/index.57964195.js";
|
|
6
|
+
import { F as FormatterRoot, f as formatterClasses } from "../index.63a3e08e.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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
};
|