@m4l/components 3.0.1 → 3.0.3
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/@types/types.d.ts +31 -8
- package/components/AccountPopover/{index-BJWLsxYq.js → index-C1SHV3XZ.js} +3 -3
- package/components/AppBar/{index-BdA-qQyV.js → index-CpiDi7W9.js} +4 -4
- package/components/BaseModule/{index-Bl0GPyrz.js → index-C3PN52OU.js} +1 -1
- package/components/CommonActions/components/ActionCancel/{index-BlaMdPmp.js → index-GS4HJIdE.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index-C5ZI4ZPP.js → index-CX2I9LHt.js} +4 -4
- package/components/CommonActions/components/ActionFormIntro/{index-BbVMcr05.js → index-w0_c4nBH.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index-DGooFqVu.js → index-iGNIvcsn.js} +2 -2
- package/components/CommonActions/components/Actions/{index-B_vOmNZT.js → index-BKkqUxgb.js} +1 -1
- package/components/DataGrid/formatters/ColumnBooleanFormatter/{index-0wqcK8ML.js → index-C5oGRz2u.js} +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/{index-Ozdfjlt2.js → index-D3U8qNWy.js} +1 -1
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/{index-D-98uXfl.js → index-BiSoxUSc.js} +1 -1
- package/components/DataGrid/formatters/{index-B5SJg0Qq.js → index-CBg-w3uZ.js} +2 -2
- package/components/DataGrid/{index-7vJWvQtu.js → index-BagYcO5M.js} +4 -4
- package/components/DataGrid/subcomponents/Actions/{index-C-p5O-cU.js → index-D3XaKBc9.js} +11 -11
- package/components/DynamicFilter/{dictionary-DbRGLe8j.js → dictionary-CZftQwMz.js} +2 -2
- package/components/DynamicFilter/{index-D2CmPq_i.js → index-ZWC-ymw6.js} +4 -4
- package/components/DynamicFilter/slots/{dynamicFilterSlots-BSCWv_Rw.js → dynamicFilterSlots-BJg8NW69.js} +5 -5
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +1 -1
- package/components/DynamicFilter/store/{index-BcaPHLdk.js → index-B8EJidMA.js} +1 -1
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/{index-BZAxYAp1.js → index-BxXqpZ2r.js} +3 -3
- package/components/DynamicFilter/subcomponents/AppliedFilters/{index-DIFUGgys.js → index-BsusIn_U.js} +4 -4
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/{index-D5BGKd5r.js → index-BDQlXUiN.js} +6 -6
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/{index-DFHDm1e4.js → index-JLN5ZRhw.js} +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/{index-Hn2Rzovd.js → index-BYqh8Qr6.js} +3 -3
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/{index-B5F1Ji7m.js → index-CjcL1o1V.js} +3 -3
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/{index-BQlxIk_N.js → index-tYDNVMc6.js} +4 -4
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/{index-DF7EGeSx.js → index-BFUVXE4A.js} +3 -3
- package/components/DynamicFilter/subcomponents/FieldTypes/{index-B6WQUIl7.js → index-BNi-tpG7.js} +5 -5
- package/components/DynamicFilter/subcomponents/FilterActions/{index-D5edNMdo.js → index-BATOWnYB.js} +3 -3
- package/components/DynamicFilter/subcomponents/InputFilter/{index-bbdBrHj0.js → index-yfPsp685.js} +4 -4
- package/components/DynamicFilter/subcomponents/PopoverFilter/{index-CD3aGB5S.js → index-C7ntxhq7.js} +6 -6
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/{index-MiYNpAu0.js → index-DrgdahUr.js} +2 -2
- package/components/FieldLabel/{index-BpW2AGJx.js → index-uRWxFkWU.js} +3 -3
- package/components/GridLayout/{index-HK_hTGnZ.js → index-CRsM-v5t.js} +2 -2
- package/components/GridLayout/subcomponents/Griditem/{index-izY8S7ns.js → index-D7RPlp1E.js} +1 -1
- package/components/GridLayout/subcomponents/Responsive/{index-bpKDnaCd.js → index-uchivok8.js} +1 -1
- package/components/GridLayout/subcomponents/SizeProvider/{index-OWN-RzRq.js → index-HZgs6M75.js} +1 -1
- package/components/HelperText/{index-COWCXeJp.js → index-D2yPRkGD.js} +2 -2
- package/components/Icon/{index-CedboS6y.js → index-94Yiv115.js} +3 -3
- package/components/Image/{index-B7FhR9uF.js → index-D0wxe0iA.js} +2 -2
- package/components/LanguagePopover/{index-4kPWKmxk.js → index-BvbgbVe2.js} +4 -4
- package/components/LinearProgressIndeterminate/{index-Do7CKcow.js → index-DOKrJpZ4.js} +1 -1
- package/components/LoadingError/{index-CNh7b1ew.js → index-DbVvt8Og.js} +5 -5
- package/components/MFIsolationApp/{index-DJ-MUHoQ.js → index-CzX8pqYQ.js} +3 -3
- package/components/MFLoader/{index-Bcg9TXnJ.js → index-B4k4mKvG.js} +2 -2
- package/components/ModalDialog/{index-BuGRs967.js → index-D8uF8eMi.js} +3 -3
- package/components/NavLink/{index-B6Gmzyl0.js → index-mHY1nBUC.js} +2 -2
- package/components/NoItemSelected/{index-CMet73v_.js → index-B1BsnTIa.js} +1 -1
- package/components/ObjectLogs/{index-_8l1PbEQ.js → index-CNAZX4Ww.js} +9 -9
- package/components/PDFViewer/{index-CV9x1XKR.js → index-D_ICdj18.js} +2 -2
- package/components/Page/{index-DKQLs5le.js → index-BjeY10EA.js} +1 -1
- package/components/PaperForm/{index-DciWfnML.js → index-B1W7MP_K.js} +2 -2
- package/components/Period/{index-DxijnNw6.js → index-Dvul8haj.js} +4 -4
- package/components/PrintingSystem/{index-sSZkZbrr.js → index-B56vJjAF.js} +13 -13
- package/components/PrintingSystem/subcomponents/BodyNode/{index-CxYjxWxL.js → index-D5KO0QfW.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index-D85qi4Qz.js → index-Ba_7C2wF.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index-BA-IYLWh.js → index-BNNGCXzD.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index-Bn9eNtAi.js → index-DJkRhg7I.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index-gNEGVptD.js → index-BheH6Pxb.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index-CiVr-jBF.js → index-D10NbTfK.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index-BGbvh0Xk.js → index-eDLVQIAt.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index-DvhbyOo3.js → index-G_ggggdA.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index-Cw8ZUwsm.js → index-Ct4ZH9_9.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index-l9SFQ11V.js → index-CC3kIul5.js} +1 -1
- package/components/PropertyValue/{index-hcXIE6qk.js → index-C8XbXuPK.js} +3 -3
- package/components/Resizeable/{index-ObbOlXFx.js → index-enxKr_xx.js} +1 -1
- package/components/ScrollBar/{index-BpTjE7o3.js → index-CHwim4Ga.js} +1 -1
- package/components/SideBar/{index-Cg1bZn8y.js → index-Bi1cZIrX.js} +5 -5
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +1 -1
- package/components/SplitLayout/{index-CYnKlhi5.js → index-CKvln8Em.js} +1 -1
- package/components/ToastContainer/{index-B5VGIn45.js → index-CcDbkO5x.js} +2 -2
- package/components/animate/LoadingScreen/{index-CzDq3A0i.js → index-CxwaarhX.js} +1 -1
- package/components/animate/{index-mH4o-crX.js → index-C2MciKBn.js} +1 -1
- package/components/areas/components/AreasAdmin/{index-qqSduaty.js → index-w4ZiYbUn.js} +14 -14
- package/components/areas/components/AreasViewer/{index-D5If8gFK.js → index-C_Doyhlf.js} +52 -60
- package/components/areas/contexts/AreasContext/{index-Dyj8tCdG.js → index-BhgVSihv.js} +10 -5
- package/components/areas/contexts/AreasContext/types.d.ts +1 -0
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +5 -0
- package/components/areas/hooks/index.d.ts +1 -0
- package/components/areas/hooks/useAreas/{index-o0DvT3xZ.js → index-D9svmsAV.js} +1 -1
- package/components/areas/hooks/useSetWindowsTitle/index.d.ts +1 -0
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +31 -0
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle.d.ts +3 -0
- package/components/commercial/AppBarCommercial/{index-DvigwCQP.js → index-C2XuD_Di.js} +1 -1
- package/components/commercial/SectionCommercial/{index-CLHGooDg.js → index-CQ909EmI.js} +1 -1
- package/components/commercial/TopBar/{index-DJNYXgHq.js → index-C3oRupMz.js} +5 -5
- package/components/commercial/{index-BLUHQfcA.js → index-D8V8uETc.js} +3 -3
- package/components/formatters/BooleanFormatter/{index-DpF0x_xp.js → index-Cgmuw-1G.js} +2 -2
- package/components/formatters/{index-CDt8LzvL.js → index-D52mbpAz.js} +2 -2
- package/components/hook-form/HelperError/{index-D-_czK9n.js → index-B6yzmaGZ.js} +1 -1
- package/components/hook-form/RHFAutocomplete/{index-BhbgwNUz.js → index-BAUo34ue.js} +6 -6
- package/components/hook-form/RHFAutocompleteAsync/{index-BnUgdSnR.js → index-C7qy6PHH.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index-ubHFuH1F.js → index-Dmsakuyn.js} +3 -3
- package/components/hook-form/RHFCheckbox/styles.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/{index-DBpi0Zhe.js → index-DCTeXEXx.js} +6 -6
- package/components/hook-form/RHFDateTime/{index-BtfOlX4T.js → index-Cn5PXhkh.js} +4 -4
- package/components/hook-form/RHFInputNumberSpinner/constants.d.ts +1 -0
- package/components/hook-form/RHFInputNumberSpinner/slots/RHFInputNumberSpinnnerEnum.d.ts +9 -0
- package/components/hook-form/RHFInputNumberSpinner/types.d.ts +21 -0
- package/components/hook-form/RHFPeriod/{index-BicAIry0.js → index-BeUY33Fb.js} +4 -4
- package/components/hook-form/RHFRadioGroup/{index-Di37rp0B.js → index-DCq9ErFn.js} +1 -1
- package/components/hook-form/RHFTextField/{index-Cz7BMTLe.js → index-BcOjGk_X.js} +4 -4
- package/components/hook-form/RHFUpload/{index-D52JNxDh.js → index-B9Yv-1cI.js} +5 -5
- package/components/maps/components/GpsTools/{index-BP1dIwh6.js → index-CPthTXb6.js} +22 -22
- package/components/maps/components/Map/{index-CS6xr1Fl.js → index-h_YuCA40.js} +12 -12
- package/components/modal/{WindowBase-CLBER1xc.js → WindowBase-CbvNt18-.js} +3 -3
- package/components/modal/{WindowConfirm-DraflAKP.js → WindowConfirm-BcBjlBYB.js} +6 -6
- package/components/mui_extended/Accordion/{index-ZFpEUCnw.js → index-CImLE2c2.js} +4 -4
- package/components/mui_extended/Avatar/{index-Bk4Hq2nk.js → index-QcHxAObO.js} +1 -1
- package/components/mui_extended/Badge/{index-D6F1o3k2.js → index-CkxVcDch.js} +1 -1
- package/components/mui_extended/Button/{index-DlzpoczE.js → index-CeKWngaw.js} +3 -3
- package/components/mui_extended/Button/styles.d.ts +1 -1
- package/components/mui_extended/{CheckBox-ByxYagHV.js → CheckBox-D4lOF2ZN.js} +2 -2
- package/components/mui_extended/IconButton/{index-BfDbi0cC.js → index-8KJAFQdk.js} +2 -2
- package/components/mui_extended/IconButton/types.d.ts +18 -0
- package/components/mui_extended/MenuActions/MenuActions.d.ts +5 -0
- package/components/mui_extended/MenuActions/constant.d.ts +5 -0
- package/components/mui_extended/MenuActions/dictionary.d.ts +7 -0
- package/components/mui_extended/MenuActions/index-DUH9jcY3.js +202 -0
- package/components/mui_extended/MenuActions/index.d.ts +2 -5
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum.d.ts +9 -0
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +24 -0
- package/components/mui_extended/MenuActions/slots/index.d.ts +2 -0
- package/components/mui_extended/MenuActions/types.d.ts +11 -2
- package/components/mui_extended/Pager/{index-CRgYDkV8.js → index-CPojTM6X.js} +4 -4
- package/components/mui_extended/Popover/{index-C6_2t4L1.js → index-ADNJKYaU.js} +1 -1
- package/components/mui_extended/Stack/{index-CV2W-_eL.js → index-COSPZIcB.js} +1 -1
- package/components/mui_extended/Tab/{index-PyZxxeDt.js → index-DIBG_fln.js} +1 -1
- package/components/mui_extended/Tabs/styles.d.ts +1 -1
- package/components/mui_extended/ToggleButton/{index-X6htsgfF.js → index-iPblHkXQ.js} +1 -1
- package/components/mui_extended/ToggleIconButton/{index-mT-xXWg9.js → index-C-84m9IF.js} +1 -1
- package/components/mui_extended/Typography/{index-DKPqV11f.js → index-DdbNIn5v.js} +1 -1
- package/components/popups/PopupsViewer/{index-D8iTb2JJ.js → index-CZGtpMc5.js} +3 -3
- package/components/popups/PopupsViewer/slots/{popupsViewerSlots-DEQAZ8fq.js → popupsViewerSlots-a4Hanx4W.js} +1 -1
- package/contexts/ModalContext/{index-CMPcjPCy.js → index-5DJdcEm0.js} +1 -1
- package/contexts/RHFormContext/{index-B4a0h0fX.js → index-D-Aek3pv.js} +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/useFormAddEdit/{index-DvRNtaub.js → index-DfH0uOq9.js} +2 -2
- package/hooks/useInterval/index.d.ts +7 -0
- package/hooks/useModal/{index-C9r1LQIz.js → index-CHufWxiG.js} +1 -1
- package/hooks/useTab/{index-DTbLh_DH.js → index-B9UPdit5.js} +1 -1
- package/index.js +114 -93
- package/package.json +1 -1
- package/style.css +65 -1
- package/styles/MenuActions.styles.d.ts +2 -0
- package/styles/{index-Cc9p_h7i.js → index-DITv2ClE.js} +49 -19
- package/components/mui_extended/MenuActions/classes/constants.d.ts +0 -1
- package/components/mui_extended/MenuActions/classes/index.d.ts +0 -7
- package/components/mui_extended/MenuActions/classes/types.d.ts +0 -7
- package/components/mui_extended/MenuActions/icons.d.ts +0 -3
- package/components/mui_extended/MenuActions/index-CUz70BPj.js +0 -171
- package/components/mui_extended/MenuActions/styles.d.ts +0 -5
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { styled, alpha, Skeleton, Popover,
|
|
1
|
+
import { styled, alpha, Skeleton, Popover, Stack, Tabs, Dialog, ListItemText, ListItemButton } from "@mui/material";
|
|
2
2
|
import { styled as styled$1, alpha as alpha$1 } from "@mui/material/styles";
|
|
3
3
|
import SimpleBarReact from "simplebar-react";
|
|
4
|
-
import { h as gridLayoutClasses } from "../components/GridLayout/index-
|
|
4
|
+
import { h as gridLayoutClasses } from "../components/GridLayout/index-CRsM-v5t.js";
|
|
5
5
|
import { a as ResizableBox } from "../react-resizable-eBbFl2dX.js";
|
|
6
|
-
import { a as areasAdminClasses } from "../components/areas/components/AreasAdmin/index-
|
|
7
|
-
import { a as areasViewerClasses } from "../components/areas/components/AreasViewer/index-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { a as areasAdminClasses } from "../components/areas/components/AreasAdmin/index-w4ZiYbUn.js";
|
|
7
|
+
import { a as areasViewerClasses } from "../components/areas/components/AreasViewer/index-C_Doyhlf.js";
|
|
8
|
+
import styles from "react-toastify/dist/ReactToastify.min.css";
|
|
9
|
+
import { g as gpsToolsClasses } from "../components/maps/components/GpsTools/index-CPthTXb6.js";
|
|
10
|
+
import { R as RHFormProvider } from "../contexts/RHFormContext/index-D-Aek3pv.js";
|
|
11
|
+
import { S as Stack$1 } from "../components/mui_extended/Stack/index-COSPZIcB.js";
|
|
12
|
+
import { I as Image } from "../components/Image/index-D0wxe0iA.js";
|
|
12
13
|
const RootStyle$1 = styled("div", {
|
|
13
14
|
shouldForwardProp: (props) => props !== "variant"
|
|
14
15
|
})(({ theme, variant }) => ({
|
|
@@ -300,19 +301,47 @@ const LoadingButtonRoot = styled("div")(({ theme }) => ({
|
|
|
300
301
|
/* Styles overrides of m4l_styles */
|
|
301
302
|
...theme.components?.M4LLoadingButton?.styleOverrides
|
|
302
303
|
}));
|
|
304
|
+
const CONTAINER_QUERY_NAME$1 = "menuActions";
|
|
305
|
+
const menuActionsStyles = {
|
|
306
|
+
root: ({ theme }) => ({
|
|
307
|
+
containerName: CONTAINER_QUERY_NAME$1,
|
|
308
|
+
"& .MuiPaper-root": {
|
|
309
|
+
display: "flex",
|
|
310
|
+
flexDirection: "column",
|
|
311
|
+
background: theme.palette.background.default,
|
|
312
|
+
gap: "8px",
|
|
313
|
+
maxWidth: 300
|
|
314
|
+
}
|
|
315
|
+
}),
|
|
316
|
+
badge: {},
|
|
317
|
+
menuItem: ({ theme, ownerState }) => ({
|
|
318
|
+
display: "flex",
|
|
319
|
+
justifyContent: "center",
|
|
320
|
+
minHeight: "24px",
|
|
321
|
+
minWidth: "24px",
|
|
322
|
+
padding: "0",
|
|
323
|
+
gap: "0px",
|
|
324
|
+
...ownerState.variant === "delete" ? {
|
|
325
|
+
color: theme.palette.state.error.normal
|
|
326
|
+
} : {}
|
|
327
|
+
}),
|
|
328
|
+
menuItemLabel: {},
|
|
329
|
+
menuItemIcon: ({ theme, ownerState }) => ({
|
|
330
|
+
"&.M4LIcon-root": {
|
|
331
|
+
minHeight: "24px",
|
|
332
|
+
minWidth: "24px",
|
|
333
|
+
"& > .M4LIcon-icon": {
|
|
334
|
+
backgroundColor: ownerState.variant === "delete" ? theme.palette.state.error.normal : ""
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}),
|
|
338
|
+
labelEmpty: () => ({
|
|
339
|
+
zIndex: 1
|
|
340
|
+
})
|
|
341
|
+
};
|
|
303
342
|
const PopoverRoot = styled$1(Popover)(({ theme }) => ({
|
|
304
343
|
...theme.components?.M4LPopover?.styleOverrides
|
|
305
344
|
}));
|
|
306
|
-
styled$1(IconButton)(() => ({}));
|
|
307
|
-
const LabelMemuItem = styled$1("div")(({ theme }) => ({
|
|
308
|
-
height: "22px",
|
|
309
|
-
overflow: "hidden",
|
|
310
|
-
wordBreak: "break-all",
|
|
311
|
-
// padding: '0px',
|
|
312
|
-
marginLeft: theme.spacing(1.5),
|
|
313
|
-
display: "flex",
|
|
314
|
-
alignItems: "center"
|
|
315
|
-
}));
|
|
316
345
|
const MUISTack = styled(Stack)(({ theme }) => ({
|
|
317
346
|
...theme.components?.M4LStack?.styleOverrides
|
|
318
347
|
}));
|
|
@@ -943,6 +972,7 @@ const toastStyles = {
|
|
|
943
972
|
"--toastify-toast-bd-radius": "8px",
|
|
944
973
|
// used to control the opacity of the progress trail
|
|
945
974
|
"--toastify-color-progress-bgo": ".2",
|
|
975
|
+
styles,
|
|
946
976
|
...ownerState?.fixed === false ? {
|
|
947
977
|
top: 0,
|
|
948
978
|
position: "absolute",
|
|
@@ -1639,7 +1669,7 @@ export {
|
|
|
1639
1669
|
LoadingButtonRoot as aC,
|
|
1640
1670
|
CheckBoxRoot as aD,
|
|
1641
1671
|
IconButtonRoot as aE,
|
|
1642
|
-
|
|
1672
|
+
menuActionsStyles as aF,
|
|
1643
1673
|
PagerRoot as aG,
|
|
1644
1674
|
PopoverRoot as aH,
|
|
1645
1675
|
MUISTack as aI,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LMenuActions";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MenuActionsClassesType } from './types';
|
|
2
|
-
export declare const menuActionsClasses: MenuActionsClassesType;
|
|
3
|
-
export declare function getMenuActionsUtilityClass(slot: string): string;
|
|
4
|
-
export declare const useMenuActionsUtilityClasses: () => {
|
|
5
|
-
root: string;
|
|
6
|
-
itemDelete: string;
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { useMenuActionsUtilityClasses } from '.';
|
|
2
|
-
export interface MenuActionsClassesType {
|
|
3
|
-
root: string;
|
|
4
|
-
itemDelete: string;
|
|
5
|
-
}
|
|
6
|
-
export declare type StackClassesKey = keyof MenuActionsClassesType;
|
|
7
|
-
export declare type Classes = ReturnType<typeof useMenuActionsUtilityClasses>;
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useState, useEffect, useMemo } from "react";
|
|
3
|
-
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { generateUtilityClasses, generateUtilityClass, useTheme, MenuItem } from "@mui/material";
|
|
5
|
-
import { P as Popover } from "../Popover/index-C6_2t4L1.js";
|
|
6
|
-
import { aF as LabelMemuItem } from "../../../styles/index-Cc9p_h7i.js";
|
|
7
|
-
import { I as Icon } from "../../Icon/index-CedboS6y.js";
|
|
8
|
-
import clsx from "clsx";
|
|
9
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
10
|
-
import { B as Badge } from "../Badge/index-D6F1o3k2.js";
|
|
11
|
-
import { I as IconButton } from "../IconButton/index-BfDbi0cC.js";
|
|
12
|
-
const ICONS = {
|
|
13
|
-
MENU: "menu.svg"
|
|
14
|
-
};
|
|
15
|
-
const componentName = "M4LMenuActions";
|
|
16
|
-
generateUtilityClasses(componentName, [
|
|
17
|
-
/* elements */
|
|
18
|
-
"root",
|
|
19
|
-
"itemDelete"
|
|
20
|
-
/* states or variants of elements */
|
|
21
|
-
]);
|
|
22
|
-
function getMenuActionsUtilityClass(slot) {
|
|
23
|
-
return generateUtilityClass(componentName, slot);
|
|
24
|
-
}
|
|
25
|
-
const useMenuActionsUtilityClasses = () => {
|
|
26
|
-
const slots = {
|
|
27
|
-
root: ["root"],
|
|
28
|
-
itemDelete: ["itemDelete"]
|
|
29
|
-
};
|
|
30
|
-
const composedClasses = unstable_composeClasses(slots, getMenuActionsUtilityClass, {});
|
|
31
|
-
return {
|
|
32
|
-
...composedClasses
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
function MenuActions(props) {
|
|
36
|
-
const {
|
|
37
|
-
menuActions,
|
|
38
|
-
endListElement,
|
|
39
|
-
menuActionSx,
|
|
40
|
-
className,
|
|
41
|
-
iconButtonClassName = "",
|
|
42
|
-
objItem = {},
|
|
43
|
-
urlIcon,
|
|
44
|
-
toolTip = "",
|
|
45
|
-
marginTop = -1,
|
|
46
|
-
marginBottom,
|
|
47
|
-
marginLeft,
|
|
48
|
-
marginRight,
|
|
49
|
-
width = 200,
|
|
50
|
-
withBadge = false,
|
|
51
|
-
badgeContent,
|
|
52
|
-
arrowType = "right-top",
|
|
53
|
-
externalOpen = null,
|
|
54
|
-
externalClose,
|
|
55
|
-
...other
|
|
56
|
-
} = props;
|
|
57
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
58
|
-
const { getLabel } = useModuleDictionary();
|
|
59
|
-
const [open, setOpen] = useState(null);
|
|
60
|
-
const handleOpen = (event) => {
|
|
61
|
-
setOpen(event.currentTarget);
|
|
62
|
-
};
|
|
63
|
-
const theme = useTheme();
|
|
64
|
-
const classes = useMenuActionsUtilityClasses();
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
let mounted = true;
|
|
67
|
-
if (mounted) {
|
|
68
|
-
setOpen(externalOpen);
|
|
69
|
-
}
|
|
70
|
-
return function cleanUp() {
|
|
71
|
-
mounted = false;
|
|
72
|
-
};
|
|
73
|
-
}, [externalOpen]);
|
|
74
|
-
const urlFinalIcon = useMemo(() => {
|
|
75
|
-
if (urlIcon) return urlIcon;
|
|
76
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/menu_actions/assets/icons/${ICONS.MENU}`;
|
|
77
|
-
}, [urlIcon, host_static_assets, environment_assets]);
|
|
78
|
-
const handleClose = (e) => {
|
|
79
|
-
e.stopPropagation();
|
|
80
|
-
setOpen(null);
|
|
81
|
-
externalClose && externalClose(null);
|
|
82
|
-
};
|
|
83
|
-
const handleClick = (e, menuAction) => {
|
|
84
|
-
e.stopPropagation();
|
|
85
|
-
setOpen(null);
|
|
86
|
-
menuAction.onClick();
|
|
87
|
-
};
|
|
88
|
-
const finalActions = useMemo(() => {
|
|
89
|
-
let ret;
|
|
90
|
-
if (typeof menuActions !== "function") {
|
|
91
|
-
ret = menuActions;
|
|
92
|
-
} else {
|
|
93
|
-
ret = menuActions(objItem);
|
|
94
|
-
}
|
|
95
|
-
return ret;
|
|
96
|
-
}, [menuActions, objItem]);
|
|
97
|
-
const IconButtonElement = (
|
|
98
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
99
|
-
/* @__PURE__ */ jsx(Fragment, { children: withBadge ? /* @__PURE__ */ jsx(Badge, { badgeContent, children: /* @__PURE__ */ jsx(
|
|
100
|
-
IconButton,
|
|
101
|
-
{
|
|
102
|
-
src: urlFinalIcon,
|
|
103
|
-
onClick: handleOpen,
|
|
104
|
-
tooltip: toolTip,
|
|
105
|
-
className: iconButtonClassName
|
|
106
|
-
}
|
|
107
|
-
) }) : /* @__PURE__ */ jsx(
|
|
108
|
-
IconButton,
|
|
109
|
-
{
|
|
110
|
-
src: urlFinalIcon,
|
|
111
|
-
onClick: handleOpen,
|
|
112
|
-
tooltip: toolTip,
|
|
113
|
-
className: iconButtonClassName
|
|
114
|
-
}
|
|
115
|
-
) })
|
|
116
|
-
);
|
|
117
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
118
|
-
IconButtonElement,
|
|
119
|
-
/* @__PURE__ */ jsxs(
|
|
120
|
-
Popover,
|
|
121
|
-
{
|
|
122
|
-
id: "Popover",
|
|
123
|
-
open: Boolean(open),
|
|
124
|
-
anchorEl: open,
|
|
125
|
-
onClose: handleClose,
|
|
126
|
-
arrowType,
|
|
127
|
-
className: clsx(classes.root, className),
|
|
128
|
-
sx: {
|
|
129
|
-
marginTop,
|
|
130
|
-
marginBottom,
|
|
131
|
-
marginLeft,
|
|
132
|
-
marginRight,
|
|
133
|
-
width,
|
|
134
|
-
maxWidth: 300,
|
|
135
|
-
"& .MuiMenuItem-root": { px: 1, typography: "body2", borderRadius: 0.75 },
|
|
136
|
-
...theme.components?.M4LMenuActions?.styleOverrides,
|
|
137
|
-
...menuActionSx
|
|
138
|
-
},
|
|
139
|
-
...other,
|
|
140
|
-
children: [
|
|
141
|
-
finalActions.map((menuAction, index) => /* @__PURE__ */ jsxs(
|
|
142
|
-
MenuItem,
|
|
143
|
-
{
|
|
144
|
-
dense: true,
|
|
145
|
-
onClick: (e) => {
|
|
146
|
-
handleClick(e, menuAction);
|
|
147
|
-
},
|
|
148
|
-
sx: { color: menuAction.color ?? "text.main" },
|
|
149
|
-
disabled: menuAction.disabled,
|
|
150
|
-
className: clsx(
|
|
151
|
-
menuAction?.className,
|
|
152
|
-
menuAction.variant === "delete" && classes.itemDelete
|
|
153
|
-
),
|
|
154
|
-
children: [
|
|
155
|
-
menuAction.urlIcon ? /* @__PURE__ */ jsx(Icon, { src: menuAction.urlIcon }) : null,
|
|
156
|
-
/* @__PURE__ */ jsx(LabelMemuItem, { children: menuAction.label || menuAction.dictionaryId && getLabel(menuAction.dictionaryId) })
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
`menu_action_${index}`
|
|
160
|
-
)),
|
|
161
|
-
endListElement ? endListElement : null
|
|
162
|
-
]
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
] });
|
|
166
|
-
}
|
|
167
|
-
const MemonizedMenuActions = React__default.memo(MenuActions);
|
|
168
|
-
export {
|
|
169
|
-
MenuActions as M,
|
|
170
|
-
MemonizedMenuActions as a
|
|
171
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const WrapperMenuActions: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
3
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
4
|
-
}, "style" | "disabled" | "children" | "tabIndex" | "className" | "color" | "size" | "action" | "sx" | "classes" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
-
export declare const LabelMemuItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|