@m4l/components 0.1.75 → 0.1.77
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/export.d.ts +97 -1
- package/components/AccountPopover/classes/index.d.ts +5 -0
- package/components/AccountPopover/classes/types.d.ts +5 -0
- package/components/AccountPopover/{index.93aefccd.js → index.3a79c395.js} +151 -142
- package/components/AccountPopover/subcomponents/MyAvatar/createAvatar.d.ts +1 -1
- package/components/AccountPopover/subcomponents/PopOver/types.d.ts +0 -4
- package/components/AppBar/classes/index.d.ts +1 -0
- package/components/AppBar/classes/types.d.ts +1 -0
- package/components/AppBar/{index.cc974d56.js → index.71b38ee9.js} +25 -15
- package/components/CommonActions/components/ActionCancel/{index.574ea031.js → index.b748a38e.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.e62db5d3.js → index.27ad09e1.js} +25 -22
- package/components/CommonActions/components/ActionFormIntro/{index.304da410.js → index.2556f054.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.d635cbc4.js → index.a7d92e66.js} +2 -2
- package/components/CommonActions/components/Actions/{index.37ffde59.js → index.3eba9d91.js} +20 -20
- package/components/DataGrid/{index.c0c626cd.js → index.545b492f.js} +50 -30
- package/components/DataGrid/types.d.ts +5 -1
- package/components/DraggableWindow/{index.b95a678e.js → index.c702d3f2.js} +1 -1
- package/components/DynamicFilter/{index.3034c6ba.js → index.d7be0f37.js} +46 -39
- package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +2 -1
- package/components/DynamicFilter/subcomponents/InnerForHooks/types.d.ts +2 -0
- package/components/DynamicFilter/tests/contants.d.ts +1 -1
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/GridLayout/GridLayout.d.ts +6 -0
- package/components/GridLayout/Responsive/index.a12a8cec.js +335 -0
- package/components/GridLayout/WidthProvider/index.8ff65909.js +67 -0
- package/components/GridLayout/calculateUtils.d.ts +42 -0
- package/components/GridLayout/index.4ba3767a.js +1400 -0
- package/components/GridLayout/index.d.ts +6 -0
- package/components/GridLayout/subcomponents/GridItem/index.d.ts +25 -0
- package/components/GridLayout/subcomponents/GridItem/types.d.ts +76 -0
- package/components/GridLayout/subcomponents/Responsive/index.d.ts +3 -0
- package/components/GridLayout/subcomponents/Responsive/responsiveUtils.d.ts +61 -0
- package/components/GridLayout/subcomponents/Responsive/types.d.ts +71 -0
- package/components/GridLayout/subcomponents/WidthProvider/index.d.ts +16 -0
- package/components/GridLayout/types.d.ts +355 -0
- package/components/GridLayout/utils.d.ts +123 -0
- package/components/HelperText/{index.ec9b3e6a.js → index.ef31df1f.js} +12 -10
- package/components/Icon/{index.f9119f5e.js → index.ecb63e65.js} +1 -1
- package/components/Image/{index.8aae9322.js → index.c18ebf5a.js} +6 -7
- package/components/Image/types.d.ts +1 -4
- package/components/LanguagePopover/{index.491e1306.js → index.0023d069.js} +12 -10
- package/components/LinearProgressIndeterminate/LinearProgressIndeterminate.d.ts +2 -0
- package/components/LinearProgressIndeterminate/classes/constants.d.ts +1 -0
- package/components/LinearProgressIndeterminate/classes/index.d.ts +3 -0
- package/components/LinearProgressIndeterminate/classes/types.d.ts +7 -0
- package/components/LinearProgressIndeterminate/index.60dabc06.js +43 -0
- package/components/LinearProgressIndeterminate/index.d.ts +1 -0
- package/components/LinearProgressIndeterminate/tests/constants.d.ts +1 -0
- package/components/LinearProgressIndeterminate/tests/utils.d.ts +2 -0
- package/components/ModalDialog/{index.f652ea12.js → index.d880e685.js} +21 -60
- package/components/NavLink/{index.f8aee9f4.js → index.cd92eceb.js} +12 -10
- package/components/NoItemSelected/{index.cce86db4.js → index.23dfc897.js} +1 -1
- package/components/ObjectLogs/{index.c31b3f8b.js → index.f174c542.js} +31 -21
- package/components/PaperForm/classes/constants.d.ts +1 -0
- package/components/PaperForm/classes/index.d.ts +11 -0
- package/components/PaperForm/classes/types.d.ts +10 -0
- package/components/PaperForm/{index.d79c6f76.js → index.1bd86ee5.js} +58 -25
- package/components/PaperForm/types.d.ts +5 -2
- package/components/Period/Period.d.ts +3 -0
- package/components/Period/classes/constants.d.ts +1 -0
- package/components/Period/classes/index.d.ts +10 -0
- package/components/Period/classes/types.d.ts +13 -0
- package/components/Period/index.711db043.js +321 -0
- package/components/Period/index.d.ts +2 -3
- package/components/Period/tests/constants.d.ts +1 -0
- package/components/Period/tests/utils.d.ts +2 -0
- package/components/Period/types.d.ts +3 -4
- package/components/PropertyValue/classes/constants.d.ts +1 -0
- package/components/PropertyValue/classes/index.d.ts +9 -0
- package/components/PropertyValue/classes/types.d.ts +9 -0
- package/components/PropertyValue/{index.dfcfe1ba.js → index.8a1adf3e.js} +60 -10
- package/components/PropertyValue/skeleton.d.ts +2 -1
- package/components/PropertyValue/tests/constants.d.ts +1 -0
- package/components/PropertyValue/tests/utils.d.ts +2 -0
- package/components/PropertyValue/types.d.ts +4 -0
- package/components/Resizeable/{index.41a8048b.js → index.9a9c79a4.js} +1 -1
- package/components/SideBar/{index.1ae13a73.js → index.c5ce0bad.js} +6 -6
- package/components/areas/components/AreasAdmin/classes/index.d.ts +1 -1
- package/components/areas/components/AreasAdmin/classes/types.d.ts +6 -0
- package/components/areas/components/AreasAdmin/index.cc4cbf56.js +463 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.d.ts +3 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/types.d.ts +4 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +0 -1
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/index.d.ts +2 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/index.d.ts +3 -0
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/types.d.ts +3 -0
- package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/classes/types.d.ts +15 -0
- package/components/areas/components/AreasViewer/{index.621c0de4.js → index.9c2aaaeb.js} +611 -541
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/{GridLayout → AreaGridLayout}/index.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +2 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +13 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +1 -7
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +3 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/types.d.ts +2 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/types.d.ts +6 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/helper.d.ts +18 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/ProggessLoadingMF/index.d.ts +3 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/ProggessLoadingMF/types.d.ts +4 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +1 -1
- package/components/areas/components/AreasViewer/subcomponents/AreasLoadingError/index.d.ts +3 -0
- package/components/areas/components/AreasViewer/subcomponents/AreasLoadingError/types.d.ts +5 -0
- package/components/areas/components/index.0f7ac464.js +29 -0
- package/components/areas/contexts/AreasContext/helper.d.ts +6 -16
- package/components/areas/contexts/AreasContext/{index.d98b89fc.js → index.c8147e8e.js} +282 -352
- package/components/areas/contexts/AreasContext/types.d.ts +28 -24
- package/components/areas/contexts/WindowToolsMFContext/types.d.ts +3 -2
- package/components/areas/contexts/{index.79d1912d.js → index.02336412.js} +1 -1
- package/components/areas/{dictionary.e72db809.js → dictionary.afb7e3d9.js} +10 -2
- package/components/areas/dictionary.d.ts +9 -1
- package/components/areas/hooks/useAreas/{index.a7b597fb.js → index.3406a6cb.js} +1 -1
- package/components/areas/{icons.3ec589d3.js → icons.8266ccc8.js} +8 -1
- package/components/areas/icons.d.ts +7 -0
- package/components/areas/index.6f2e5dab.js +31 -0
- package/components/areas/types.d.ts +34 -22
- package/components/formatters/BooleanFormatter/{index.60aa1c9d.js → index.5268b024.js} +1 -1
- package/components/formatters/{index.1f0efb32.js → index.137169d8.js} +2 -2
- package/components/hook-form/RHFAutocomplete/{index.af3296ac.js → index.ac2b1fae.js} +13 -11
- package/components/hook-form/RHFAutocompleteAsync/{index.76864056.js → index.8b4ccc8d.js} +1 -1
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +1 -0
- package/components/hook-form/RHFCheckbox/{index.865ba239.js → index.acef119c.js} +20 -13
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/types.d.ts +1 -0
- package/components/hook-form/RHFCheckbox/test/utils.d.ts +1 -1
- package/components/hook-form/RHFCheckbox/types.d.ts +3 -1
- package/components/hook-form/RHFDateTime/{index.fd9c5aca.js → index.5b080342.js} +14 -12
- package/components/hook-form/RHFPeriod/classes/constants.d.ts +1 -0
- package/components/hook-form/RHFPeriod/classes/index.d.ts +6 -0
- package/components/hook-form/RHFPeriod/classes/types.d.ts +6 -0
- package/components/hook-form/RHFPeriod/index.5304e3bd.js +77 -0
- package/components/hook-form/RHFPeriod/types.d.ts +2 -1
- package/components/hook-form/RHFTextField/index.d.ts +1 -0
- package/components/hook-form/RHFTextField/{index.abcbc2d3.js → index.e751dca7.js} +9 -6
- package/components/hook-form/RHFUpload/RHFUploadImage/classes/constants.d.ts +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/classes/index.d.ts +19 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/classes/types.d.ts +18 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/index.d.ts +2 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/types.d.ts +3 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/types.d.ts +5 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/constants.d.ts +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/utils.d.ts +2 -0
- package/components/hook-form/RHFUpload/index.25db0511.js +261 -0
- package/components/hook-form/RHFUpload/index.d.ts +1 -1
- package/components/index.d.ts +4 -3
- package/components/modal/WindowBase/subcomponents/Header/types.d.ts +4 -1
- package/components/modal/WindowBase/types.d.ts +0 -3
- package/components/modal/WindowBase.850ea31a.js +82 -0
- package/components/modal/WindowConfirm/subcomponents/MessageIlustration/types.d.ts +3 -5
- package/components/modal/WindowConfirm/types.d.ts +3 -2
- package/components/modal/WindowConfirm.cb37bc58.js +122 -0
- package/components/modal/classes/constants.d.ts +1 -0
- package/components/modal/classes/index.d.ts +19 -0
- package/components/modal/classes/types.d.ts +22 -0
- package/components/modal/index.a0978193.js +84 -0
- package/components/modal/index.d.ts +2 -1
- package/components/mui_extended/Accordion/classes/constants.d.ts +1 -0
- package/components/mui_extended/Accordion/classes/index.d.ts +10 -0
- package/components/mui_extended/Accordion/classes/types.d.ts +10 -0
- package/components/mui_extended/Accordion/index.12b1339a.js +127 -0
- package/components/mui_extended/Accordion/tests/constants.d.ts +1 -0
- package/components/mui_extended/Accordion/tests/utils.d.ts +2 -0
- package/components/mui_extended/Accordion/types.d.ts +2 -1
- package/components/mui_extended/Avatar/{index.1e1a91a3.js → index.75e6ed57.js} +3 -1
- package/components/mui_extended/Badge/Badge.d.ts +3 -0
- package/components/mui_extended/Badge/classes/constants.d.ts +1 -0
- package/components/mui_extended/Badge/classes/index.d.ts +6 -0
- package/components/mui_extended/Badge/classes/types.d.ts +6 -0
- package/components/mui_extended/Badge/index.8c2b8b66.js +36 -0
- package/components/mui_extended/Badge/index.d.ts +2 -0
- package/components/mui_extended/Badge/tests/constants.d.ts +1 -0
- package/components/mui_extended/Badge/tests/utils.d.ts +2 -0
- package/components/mui_extended/Badge/types.d.ts +4 -0
- package/components/mui_extended/Button/{index.aebbab34.js → index.4288f9fc.js} +10 -5
- package/components/mui_extended/IconButton/{index.3b05af71.js → index.fc5b7c2d.js} +1 -1
- package/components/mui_extended/LoadingButton/tests/constants.d.ts +1 -1
- package/components/mui_extended/MenuActions/{index.ca5ce35a.js → index.f5b1c022.js} +30 -11
- package/components/mui_extended/MenuActions/types.d.ts +10 -2
- package/components/mui_extended/Pager/{index.80ec975a.js → index.435af0df.js} +1 -1
- package/components/mui_extended/Tab/classes/constants.d.ts +1 -0
- package/components/mui_extended/Tab/classes/index.d.ts +7 -0
- package/components/mui_extended/Tab/classes/types.d.ts +7 -0
- package/components/mui_extended/Tab/index.9e2f6e34.js +71 -0
- package/components/mui_extended/Tab/tests/constants.d.ts +1 -0
- package/components/mui_extended/Tab/tests/utils.d.ts +2 -0
- package/components/mui_extended/Tooltip/Tooltip.d.ts +3 -0
- package/components/mui_extended/Tooltip/classes/constants.d.ts +1 -0
- package/components/mui_extended/Tooltip/classes/index.d.ts +6 -0
- package/components/mui_extended/Tooltip/classes/types.d.ts +6 -0
- package/components/mui_extended/Tooltip/index.5a795dcd.js +43 -0
- package/components/mui_extended/Tooltip/index.d.ts +2 -0
- package/components/mui_extended/Tooltip/types.d.ts +6 -0
- package/components/mui_extended/index.83979b6a.js +22 -0
- package/components/mui_extended/index.d.ts +3 -1
- package/contexts/ModalContext/{index.a0de81f0.js → index.dee85a61.js} +1 -1
- package/contexts/ModalContext/types.d.ts +2 -0
- package/contexts/RHFormContext/classes/constants.d.ts +1 -0
- package/contexts/RHFormContext/classes/index.d.ts +9 -0
- package/contexts/RHFormContext/classes/types.d.ts +6 -0
- package/contexts/RHFormContext/{index.a7511399.js → index.fe175bab.js} +33 -9
- package/hooks/useModal/{index.26075cdd.js → index.de522a10.js} +1 -1
- package/index.js +138 -119
- package/node_modules.d73a220d.js +363 -0
- package/package.json +4 -3
- package/{react-draggable.e625b0d1.js → react-draggable.7abb5d0a.js} +3 -2
- package/{react-resizable.24367d77.js → react-resizable.ba08699a.js} +13 -12
- package/utils/{index.b61dccbe.js → index.c43a95f4.js} +0 -27
- package/utils/types.d.ts +1 -1
- package/components/AccountPopover/style.d.ts +0 -2
- package/components/AppBar/styles.d.ts +0 -2
- package/components/CommonActions/components/Actions/styles.d.ts +0 -2
- package/components/DataGrid/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Actions/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/Density/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/styles.d.ts +0 -4
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +0 -8
- package/components/DataGrid/subcomponents/Table/styles.d.ts +0 -3
- package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +0 -2
- package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/ApplyedFilters/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/styles.d.ts +0 -6
- package/components/DynamicFilter/subcomponents/ClearFilters/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/FilterButton/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/InnerForHooks/styles.d.ts +0 -3
- package/components/DynamicFilter/subcomponents/PopoverFilter/styles.d.ts +0 -2
- package/components/HelperText/styles.d.ts +0 -2
- package/components/Icon/styles.d.ts +0 -4
- package/components/Image/styles.d.ts +0 -3
- package/components/Image/subcomponents/LazyLoadComponent/styles.d.ts +0 -2
- package/components/Image/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/LanguagePopover/styles.d.ts +0 -6
- package/components/NavLink/styles.d.ts +0 -2
- package/components/NoItemSelected/styles.d.ts +0 -5
- package/components/ObjectLogs/components/DetailDialog/styles.d.ts +0 -3
- package/components/ObjectLogs/styles.d.ts +0 -4
- package/components/PaperForm/styles.d.ts +0 -7
- package/components/Period/index.ff110093.js +0 -280
- package/components/Period/styles.d.ts +0 -7
- package/components/PropertyValue/styles.d.ts +0 -6
- package/components/ResizeableWindow/styles.d.ts +0 -5
- package/components/ScrollBar/styles.d.ts +0 -8
- package/components/SideBar/styles.d.ts +0 -5
- package/components/SideBar/subcomponents/ContentDesktop/style.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/styles.d.ts +0 -3
- package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +0 -5
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/styles.d.ts +0 -9
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/subcomponents/NavItemRootContent/styles.d.ts +0 -3
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +0 -22
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/styles.d.ts +0 -6
- package/components/SideBar/subcomponents/ContentMobile/styles.d.ts +0 -3
- package/components/SplitLayout/styles.d.ts +0 -4
- package/components/animate/LoadingScreen/styles.d.ts +0 -3
- package/components/animate/PropagateLoader/syles.d.ts +0 -2
- package/components/areas/components/AreasAdmin/index.158621e0.js +0 -289
- package/components/areas/components/AreasAdmin/styles.d.ts +0 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +0 -4
- package/components/areas/components/AreasViewer/styles.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/styles.d.ts +0 -9
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -6
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.d.ts +0 -3
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowPopUp/index.d.ts +0 -4
- package/components/areas/components/index.2ed9d60b.js +0 -14
- package/components/areas/index.d6b8e205.js +0 -16
- package/components/hook-form/RHFAutocomplete/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +0 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/styles.d.ts +0 -4
- package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +0 -5
- package/components/hook-form/RHFCheckbox/styles.d.ts +0 -15
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/styles.d.ts +0 -3
- package/components/hook-form/RHFDateTime/styles.d.ts +0 -2
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/hook-form/RHFPeriod/index.77486f61.js +0 -55
- package/components/hook-form/RHFPeriod/styles.d.ts +0 -2
- package/components/hook-form/RHFTextField/styles.d.ts +0 -3
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +0 -3
- package/components/hook-form/RHFTextFieldPassword/styles.d.ts +0 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +0 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +0 -12
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -2
- package/components/hook-form/RHFUpload/index.522bcad5.js +0 -283
- package/components/modal/ModalDialog/styles.d.ts +0 -9
- package/components/modal/ModalDialog/types.d.ts +0 -7
- package/components/modal/WindowBase/styles.d.ts +0 -2
- package/components/modal/WindowBase/subcomponents/Header/styles.d.ts +0 -6
- package/components/modal/WindowBase.c223e4da.js +0 -126
- package/components/modal/WindowConfirm/subcomponents/MessageIlustration/styles.d.ts +0 -6
- package/components/modal/WindowConfirm.023e293f.js +0 -132
- package/components/modal/index.dbce0cab.js +0 -36
- package/components/mui_extended/Accordion/components/AccordionLabel.d.ts +0 -3
- package/components/mui_extended/Accordion/index.03bd0e2a.js +0 -107
- package/components/mui_extended/Accordion/styles.d.ts +0 -4
- package/components/mui_extended/Avatar/styles.d.ts +0 -2
- package/components/mui_extended/Button/styles.d.ts +0 -13
- package/components/mui_extended/IconButton/styles.d.ts +0 -2
- package/components/mui_extended/ImageButton/styles.d.ts +0 -2
- package/components/mui_extended/LoadingButton/styles.d.ts +0 -2
- package/components/mui_extended/MenuActions/styles.d.ts +0 -30
- package/components/mui_extended/Pager/components/PagerActions/styles.d.ts +0 -2
- package/components/mui_extended/Pager/styles.d.ts +0 -6
- package/components/mui_extended/Popover/styles.d.ts +0 -1
- package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +0 -3
- package/components/mui_extended/Tab/index.e0653a0a.js +0 -32
- package/components/mui_extended/Tab/styles.d.ts +0 -2
- package/components/mui_extended/Typography/styles.d.ts +0 -2
- package/components/mui_extended/index.6dcdbb1f.js +0 -20
- package/contexts/RHFormContext/styles.d.ts +0 -2
- /package/components/PaperForm/{index.d.ts → PaperForm.d.ts} +0 -0
- /package/components/PropertyValue/{index.d.ts → PropertyValue.d.ts} +0 -0
- /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/{GridLayout → AreaGridLayout}/types.d.ts +0 -0
- /package/components/hook-form/RHFUpload/RHFUploadImage/{index.d.ts → RHFUploadImage.d.ts} +0 -0
- /package/components/mui_extended/Accordion/{index.d.ts → Accordion.d.ts} +0 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { c as cloneLayoutItem, a as cloneLayout, b as compact, d as correctBounds, G as GridLayout, n as noop } from "../index.4ba3767a.js";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
3
|
+
import { useFirstRender } from "@m4l/graphics";
|
|
4
|
+
import { d as deepEqual } from "../../../node_modules.d73a220d.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function getBreakpointFromWidth(breakpoints, width) {
|
|
7
|
+
const sorted = sortBreakpoints(breakpoints);
|
|
8
|
+
let matching = sorted[0];
|
|
9
|
+
for (let i = 1, len = sorted.length; i < len; i++) {
|
|
10
|
+
const breakpointName = sorted[i];
|
|
11
|
+
if (width > breakpoints[breakpointName])
|
|
12
|
+
matching = breakpointName;
|
|
13
|
+
}
|
|
14
|
+
return matching;
|
|
15
|
+
}
|
|
16
|
+
function getColsFromBreakpoint(breakpoint, cols) {
|
|
17
|
+
if (!cols[breakpoint]) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"ResponsiveReactGridLayout: `cols` entry for breakpoint " + breakpoint + " is missing!"
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return cols[breakpoint];
|
|
23
|
+
}
|
|
24
|
+
function findOrGenerateResponsiveLayout(layouts, breakpoints, breakpoint, lastBreakpoint, cols, compactType, brekpointsCols, colapsedHeight, colapsedItems) {
|
|
25
|
+
let layout = layouts[breakpoint];
|
|
26
|
+
const breakpointsSorted = sortBreakpoints(breakpoints);
|
|
27
|
+
const indexBreakointInit = breakpointsSorted.indexOf(breakpoint);
|
|
28
|
+
let compareBreakpoint;
|
|
29
|
+
console.log("findOrGenerateResponsiveLayout start", layout);
|
|
30
|
+
if (!layout) {
|
|
31
|
+
if (lastBreakpoint !== breakpoint && layouts[lastBreakpoint]) {
|
|
32
|
+
compareBreakpoint = lastBreakpoint;
|
|
33
|
+
} else {
|
|
34
|
+
const rotatedBreakpoints = [
|
|
35
|
+
...breakpointsSorted.splice(indexBreakointInit),
|
|
36
|
+
...breakpointsSorted.reverse()
|
|
37
|
+
];
|
|
38
|
+
console.log("findOrGenerateResponsiveLayout rotatedBreakpoints ", rotatedBreakpoints);
|
|
39
|
+
for (let i = 0, len = rotatedBreakpoints.length; i < len; i++) {
|
|
40
|
+
const b = rotatedBreakpoints[i];
|
|
41
|
+
if (layouts[b]) {
|
|
42
|
+
console.log("findOrGenerateResponsiveLayout above I*:", i, b);
|
|
43
|
+
compareBreakpoint = b;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
console.log("findOrGenerateResponsiveLayout compareBreakpoint ", compareBreakpoint);
|
|
49
|
+
if (compareBreakpoint) {
|
|
50
|
+
layout = [];
|
|
51
|
+
for (let i = 0, len = layouts[compareBreakpoint].length; i < len; i++) {
|
|
52
|
+
const li = cloneLayoutItem(layouts[compareBreakpoint][i]);
|
|
53
|
+
if (brekpointsCols[compareBreakpoint]) {
|
|
54
|
+
const newW = Math.round(li.w * cols / brekpointsCols[compareBreakpoint]);
|
|
55
|
+
console.log(
|
|
56
|
+
`findOrGenerateResponsiveLayout li:${li.i}, actual: ${li.w} -> new: ${newW} `,
|
|
57
|
+
compareBreakpoint
|
|
58
|
+
);
|
|
59
|
+
li.w = newW;
|
|
60
|
+
}
|
|
61
|
+
layout.push(li);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!layout) {
|
|
65
|
+
layout = [];
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
layout = cloneLayout(layout);
|
|
69
|
+
}
|
|
70
|
+
console.log("findOrGenerateResponsiveLayout layout filtrado:", layout);
|
|
71
|
+
layout = cloneLayout(layout);
|
|
72
|
+
for (let index = 0; index < layout.length; index++) {
|
|
73
|
+
const element = layout[index];
|
|
74
|
+
element.colapsed = false;
|
|
75
|
+
if (colapsedItems && colapsedItems[element.i]) {
|
|
76
|
+
element.colapsed = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
console.log("findOrGenerateResponsiveLayout layout clonado:", layout);
|
|
80
|
+
const ret = compact(
|
|
81
|
+
correctBounds(layout, { cols }, colapsedHeight),
|
|
82
|
+
compactType,
|
|
83
|
+
cols,
|
|
84
|
+
colapsedHeight
|
|
85
|
+
);
|
|
86
|
+
console.log("findOrGenerateResponsiveLayout layout ret **:", ret);
|
|
87
|
+
return ret;
|
|
88
|
+
}
|
|
89
|
+
function sortBreakpoints(breakpoints) {
|
|
90
|
+
const keys = Object.keys(breakpoints);
|
|
91
|
+
return keys.sort(function(a, b) {
|
|
92
|
+
return breakpoints[a] - breakpoints[b];
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function getIndentationValue(param, breakpoint) {
|
|
96
|
+
if (!param)
|
|
97
|
+
return [0, 0];
|
|
98
|
+
return Array.isArray(param) ? param : param[breakpoint];
|
|
99
|
+
}
|
|
100
|
+
function addLayoutItemToBreakPointIfNoExists(layouts, breakpoint, layoutItem, cols, margin, containerPadding, rowHeight, containerHeight) {
|
|
101
|
+
if (!layouts[breakpoint])
|
|
102
|
+
return;
|
|
103
|
+
if (layouts[breakpoint].findIndex((l) => l.i === layoutItem.i) === -1) {
|
|
104
|
+
const l = cloneLayoutItem(layoutItem);
|
|
105
|
+
const heigthUnits = containerHeight !== void 0 ? (containerHeight + getIndentationValue(margin, breakpoint)[1] - 2 * getIndentationValue(containerPadding, breakpoint)[1]) / (rowHeight + getIndentationValue(margin, breakpoint)[1]) : l.h;
|
|
106
|
+
if (l.freeMove) {
|
|
107
|
+
l.x = Math.round(cols[breakpoint] / 4);
|
|
108
|
+
l.y = Math.round(heigthUnits / 4);
|
|
109
|
+
l.w = Math.round(cols[breakpoint] / 2);
|
|
110
|
+
l.h = heigthUnits / 2;
|
|
111
|
+
} else {
|
|
112
|
+
l.w = cols[breakpoint];
|
|
113
|
+
l.h = Math.round(heigthUnits * 0.8);
|
|
114
|
+
}
|
|
115
|
+
if (breakpoint === "xxs") {
|
|
116
|
+
if (l.freeMove) {
|
|
117
|
+
l.visible = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (l.freeMove) {
|
|
121
|
+
layouts[breakpoint].push(l);
|
|
122
|
+
} else {
|
|
123
|
+
layouts[breakpoint].unshift(l);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function addLayoutItemToBreakPoints(layouts, layoutItem, cols, margin, containerPadding, rowHeight, containerHeight) {
|
|
128
|
+
const newLayouts = {};
|
|
129
|
+
for (const key in layouts) {
|
|
130
|
+
const layoutBreakpoint = cloneLayout(layouts[key]);
|
|
131
|
+
newLayouts[key] = layoutBreakpoint;
|
|
132
|
+
addLayoutItemToBreakPointIfNoExists(
|
|
133
|
+
newLayouts,
|
|
134
|
+
key,
|
|
135
|
+
layoutItem,
|
|
136
|
+
cols,
|
|
137
|
+
margin,
|
|
138
|
+
containerPadding,
|
|
139
|
+
rowHeight,
|
|
140
|
+
containerHeight
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return newLayouts;
|
|
144
|
+
}
|
|
145
|
+
function cloneLayouts(layouts, layoutItemReplaceProps) {
|
|
146
|
+
console.log("cloneLayout");
|
|
147
|
+
const newLayouts = {};
|
|
148
|
+
for (const breakPoint in layouts) {
|
|
149
|
+
newLayouts[breakPoint] = cloneLayout(layouts[breakPoint], layoutItemReplaceProps);
|
|
150
|
+
}
|
|
151
|
+
return newLayouts;
|
|
152
|
+
}
|
|
153
|
+
function generateInitialState(props) {
|
|
154
|
+
const {
|
|
155
|
+
width,
|
|
156
|
+
breakpoint,
|
|
157
|
+
breakpoints,
|
|
158
|
+
containerPadding = [10, 10],
|
|
159
|
+
containerMargin = [10, 10],
|
|
160
|
+
layouts: defaultLayouts = {},
|
|
161
|
+
cols,
|
|
162
|
+
compactType = null,
|
|
163
|
+
colapsedItems,
|
|
164
|
+
colapsedHeight = 2
|
|
165
|
+
} = props;
|
|
166
|
+
const newBreakpoint = breakpoint || getBreakpointFromWidth(breakpoints, width);
|
|
167
|
+
const colNo = getColsFromBreakpoint(newBreakpoint, cols);
|
|
168
|
+
let fireOnLoadLayoutChange = true;
|
|
169
|
+
const initialLayout = findOrGenerateResponsiveLayout(defaultLayouts, breakpoints, newBreakpoint, newBreakpoint, colNo, compactType, {
|
|
170
|
+
[newBreakpoint]: colNo
|
|
171
|
+
}, colapsedHeight, colapsedItems);
|
|
172
|
+
if (defaultLayouts[newBreakpoint]) {
|
|
173
|
+
if (deepEqual(defaultLayouts[newBreakpoint], initialLayout)) {
|
|
174
|
+
fireOnLoadLayoutChange = false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const ret = {
|
|
178
|
+
layout: initialLayout,
|
|
179
|
+
breakpoint: newBreakpoint,
|
|
180
|
+
cols: colNo,
|
|
181
|
+
contaierMargin: getIndentationValue(containerMargin, newBreakpoint),
|
|
182
|
+
contaierPadding: getIndentationValue(containerPadding, newBreakpoint),
|
|
183
|
+
fireOnLoadLayoutChange
|
|
184
|
+
};
|
|
185
|
+
console.log("generateInitialState", ret, initialLayout);
|
|
186
|
+
return ret;
|
|
187
|
+
}
|
|
188
|
+
function Responsive(props) {
|
|
189
|
+
const {
|
|
190
|
+
width,
|
|
191
|
+
height,
|
|
192
|
+
breakpoint,
|
|
193
|
+
compactType = null,
|
|
194
|
+
breakpoints = {
|
|
195
|
+
lg: 1200,
|
|
196
|
+
md: 996,
|
|
197
|
+
sm: 768,
|
|
198
|
+
xs: 480,
|
|
199
|
+
xxs: 1
|
|
200
|
+
},
|
|
201
|
+
cols = {
|
|
202
|
+
lg: 12,
|
|
203
|
+
md: 10,
|
|
204
|
+
sm: 6,
|
|
205
|
+
xs: 4,
|
|
206
|
+
xxs: 2
|
|
207
|
+
},
|
|
208
|
+
containerPadding = [10, 10],
|
|
209
|
+
containerMargin = [10, 10],
|
|
210
|
+
layouts = {},
|
|
211
|
+
onBreakpointChange = noop,
|
|
212
|
+
onLayoutChange = noop,
|
|
213
|
+
onContainerChange = noop,
|
|
214
|
+
layoutItemRender,
|
|
215
|
+
colapsedItems,
|
|
216
|
+
colapsedHeight = 2,
|
|
217
|
+
...other
|
|
218
|
+
} = props;
|
|
219
|
+
const [currentState, setCurrentState] = useState(() => generateInitialState(props));
|
|
220
|
+
const refLayouts = useRef({
|
|
221
|
+
layouts: {
|
|
222
|
+
...layouts,
|
|
223
|
+
[currentState.breakpoint]: currentState.layout
|
|
224
|
+
},
|
|
225
|
+
breakpoint: currentState.breakpoint,
|
|
226
|
+
breakpoints,
|
|
227
|
+
colapsedItems,
|
|
228
|
+
width,
|
|
229
|
+
height
|
|
230
|
+
});
|
|
231
|
+
const isFirstRender = useFirstRender([width, height, layouts]);
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
console.log("useEffect componente", currentState.fireOnLoadLayoutChange);
|
|
234
|
+
onContainerChange({
|
|
235
|
+
containerWidth: refLayouts.current.width,
|
|
236
|
+
containerHeight: refLayouts.current.height,
|
|
237
|
+
containerMargin: currentState.contaierMargin,
|
|
238
|
+
containerPadding: currentState.contaierPadding,
|
|
239
|
+
breakpoint: currentState.breakpoint,
|
|
240
|
+
cols: currentState.cols
|
|
241
|
+
});
|
|
242
|
+
if (currentState.fireOnLoadLayoutChange) {
|
|
243
|
+
onLayoutChange(currentState.layout, {
|
|
244
|
+
...layouts,
|
|
245
|
+
[currentState.breakpoint]: currentState.layout
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return () => {
|
|
249
|
+
console.debug("destruccion del componente");
|
|
250
|
+
};
|
|
251
|
+
}, []);
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
if (isFirstRender) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const newBreakpoint = breakpoint || getBreakpointFromWidth(breakpoints, width);
|
|
257
|
+
const newCols = getColsFromBreakpoint(newBreakpoint, cols);
|
|
258
|
+
const lastBreakpoint = currentState.breakpoint;
|
|
259
|
+
const newLayouts = {
|
|
260
|
+
...layouts
|
|
261
|
+
};
|
|
262
|
+
let newContainerMargin = currentState.contaierMargin;
|
|
263
|
+
let newContainerPadding = currentState.contaierPadding;
|
|
264
|
+
console.debug("useEffect responsive newLayouts es igual:", deepEqual(layouts, refLayouts.current.layouts), refLayouts.current.layouts);
|
|
265
|
+
if (newBreakpoint !== currentState.breakpoint || newCols !== currentState.cols || breakpoints !== refLayouts.current.breakpoints || colapsedItems !== refLayouts.current.colapsedItems || !deepEqual(layouts, refLayouts.current.layouts)) {
|
|
266
|
+
console.debug("useEffect responsive con cambio de algo", newBreakpoint, lastBreakpoint);
|
|
267
|
+
newContainerMargin = getIndentationValue(containerMargin, newBreakpoint);
|
|
268
|
+
newContainerPadding = getIndentationValue(containerPadding, newBreakpoint);
|
|
269
|
+
if (!(lastBreakpoint in newLayouts)) {
|
|
270
|
+
console.error("useEffect casi imposible", lastBreakpoint, newLayouts);
|
|
271
|
+
newLayouts[lastBreakpoint] = cloneLayout(currentState.layout);
|
|
272
|
+
}
|
|
273
|
+
const layout = findOrGenerateResponsiveLayout(newLayouts, breakpoints, newBreakpoint, lastBreakpoint, newCols, compactType, cols, colapsedHeight, colapsedItems);
|
|
274
|
+
newLayouts[newBreakpoint] = layout;
|
|
275
|
+
if (newBreakpoint !== currentState.breakpoint) {
|
|
276
|
+
onBreakpointChange(newBreakpoint, newCols, width, height);
|
|
277
|
+
}
|
|
278
|
+
refLayouts.current.layouts = newLayouts;
|
|
279
|
+
refLayouts.current.breakpoint = newBreakpoint;
|
|
280
|
+
refLayouts.current.breakpoints = breakpoints;
|
|
281
|
+
refLayouts.current.colapsedItems = colapsedItems;
|
|
282
|
+
console.debug("useEffect responsive****", layout);
|
|
283
|
+
setCurrentState({
|
|
284
|
+
breakpoint: newBreakpoint,
|
|
285
|
+
layout,
|
|
286
|
+
cols: newCols,
|
|
287
|
+
contaierMargin: newContainerMargin,
|
|
288
|
+
contaierPadding: newContainerPadding
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
onContainerChange({
|
|
292
|
+
containerWidth: width,
|
|
293
|
+
containerHeight: height,
|
|
294
|
+
containerMargin: newContainerMargin,
|
|
295
|
+
containerPadding: newContainerPadding,
|
|
296
|
+
breakpoint: newBreakpoint,
|
|
297
|
+
cols: newCols
|
|
298
|
+
});
|
|
299
|
+
}, [width, height, layouts, breakpoint, breakpoints, colapsedItems]);
|
|
300
|
+
const localOnLayoutChange = useCallback((newlayout) => {
|
|
301
|
+
console.log("localOnLayoutChange layouts antes de iniciar", refLayouts.current.layouts, newlayout);
|
|
302
|
+
try {
|
|
303
|
+
refLayouts.current.layouts[refLayouts.current.breakpoint] = cloneLayout(newlayout);
|
|
304
|
+
} catch (error) {
|
|
305
|
+
console.warn("localOnLayoutChange error");
|
|
306
|
+
}
|
|
307
|
+
setCurrentState((prev) => ({
|
|
308
|
+
...prev,
|
|
309
|
+
layout: cloneLayout(newlayout)
|
|
310
|
+
}));
|
|
311
|
+
onLayoutChange(newlayout, {
|
|
312
|
+
...refLayouts.current.layouts
|
|
313
|
+
});
|
|
314
|
+
}, [onLayoutChange]);
|
|
315
|
+
console.log("Render ResponsiveReactGridLayout: ", layouts, currentState, width, height);
|
|
316
|
+
return /* @__PURE__ */ jsx(GridLayout, {
|
|
317
|
+
width,
|
|
318
|
+
height,
|
|
319
|
+
colapsedHeight,
|
|
320
|
+
layoutItemRender,
|
|
321
|
+
containerMargin: currentState.contaierMargin,
|
|
322
|
+
containerPadding: getIndentationValue(containerPadding, currentState.breakpoint),
|
|
323
|
+
onLayoutChange: localOnLayoutChange,
|
|
324
|
+
layout: currentState.layout,
|
|
325
|
+
cols: currentState.cols,
|
|
326
|
+
compactType,
|
|
327
|
+
...other
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
export {
|
|
331
|
+
Responsive as R,
|
|
332
|
+
addLayoutItemToBreakPointIfNoExists as a,
|
|
333
|
+
addLayoutItemToBreakPoints as b,
|
|
334
|
+
cloneLayouts as c
|
|
335
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { throttle } from "lodash";
|
|
4
|
+
import { useResizeObserver } from "@m4l/graphics";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const THROTTLE_RESIZE_TIME = 200;
|
|
7
|
+
const layoutClassName = "react-grid-layout";
|
|
8
|
+
function WidthProvider(ComposedComponent) {
|
|
9
|
+
return (props) => {
|
|
10
|
+
const {
|
|
11
|
+
measureBeforeMount = true,
|
|
12
|
+
...rest
|
|
13
|
+
} = props;
|
|
14
|
+
const refMounted = useRef(false);
|
|
15
|
+
const [currentState, setCurrentState] = useState({
|
|
16
|
+
mounted: false,
|
|
17
|
+
width: 1280,
|
|
18
|
+
height: 100
|
|
19
|
+
});
|
|
20
|
+
const onWindowResizeMemo = useMemo(() => () => {
|
|
21
|
+
const node = elementRef.current;
|
|
22
|
+
if (node instanceof HTMLElement && node.offsetWidth) {
|
|
23
|
+
console.log("onWindowResize*******************************", node.offsetWidth, node.offsetHeight);
|
|
24
|
+
setCurrentState((prev) => ({
|
|
25
|
+
...prev,
|
|
26
|
+
width: node.offsetWidth,
|
|
27
|
+
height: node.offsetHeight
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const throttleResize = throttle(onWindowResizeMemo, THROTTLE_RESIZE_TIME, {
|
|
32
|
+
leading: false,
|
|
33
|
+
trailing: true
|
|
34
|
+
});
|
|
35
|
+
const onResize = useCallback((_target) => {
|
|
36
|
+
throttleResize();
|
|
37
|
+
}, []);
|
|
38
|
+
const elementRef = useResizeObserver(onResize);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
setCurrentState((prev) => ({
|
|
41
|
+
...prev,
|
|
42
|
+
mounted: true
|
|
43
|
+
}));
|
|
44
|
+
refMounted.current = true;
|
|
45
|
+
onWindowResizeMemo();
|
|
46
|
+
return () => {
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
if (measureBeforeMount && !currentState.mounted) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: clsx(props.className, layoutClassName),
|
|
52
|
+
style: props.style,
|
|
53
|
+
ref: elementRef
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
console.log("Render with provider");
|
|
57
|
+
return /* @__PURE__ */ jsx(ComposedComponent, {
|
|
58
|
+
innerRef: elementRef,
|
|
59
|
+
width: currentState.width,
|
|
60
|
+
height: currentState.height,
|
|
61
|
+
...rest
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
WidthProvider as W
|
|
67
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GridItemState, Maximize } from './subcomponents/GridItem/types';
|
|
2
|
+
import { Position, PositionParams } from './types';
|
|
3
|
+
export declare function calcGridColWidth(positionParams: PositionParams): number;
|
|
4
|
+
export declare function calcGridItemWHPx(gridUnits: number, colOrRowSize: number, marginPx: number): number;
|
|
5
|
+
/**
|
|
6
|
+
* Return position on the page given an x, y, w, h.
|
|
7
|
+
* left, top, width, height are all in pixels.
|
|
8
|
+
* @param {PositionParams} positionParams Parameters of grid needed for coordinates calculations.
|
|
9
|
+
* @param {Number} x X coordinate in grid units.
|
|
10
|
+
* @param {Number} y Y coordinate in grid units.
|
|
11
|
+
* @param {Number} w W coordinate in grid units.
|
|
12
|
+
* @param {Number} h H coordinate in grid units.
|
|
13
|
+
* @return {Position} Object containing coords.
|
|
14
|
+
*/
|
|
15
|
+
export declare function calcGridItemPosition(positionParams: PositionParams, x: number, y: number, w: number, h: number, maximize: Maximize, state?: GridItemState): Position;
|
|
16
|
+
/**
|
|
17
|
+
* Translate x and y coordinates from pixels to grid units.
|
|
18
|
+
* @param {PositionParams} positionParams Parameters of grid needed for coordinates calculations.
|
|
19
|
+
* @param {Number} top Top position (relative to parent) in pixels.
|
|
20
|
+
* @param {Number} left Left position (relative to parent) in pixels.
|
|
21
|
+
* @param {Number} w W coordinate in grid units.
|
|
22
|
+
* @param {Number} h H coordinate in grid units.
|
|
23
|
+
* @return {Object} x and y in grid units.
|
|
24
|
+
*/
|
|
25
|
+
export declare function calcXY(positionParams: PositionParams, top: number, left: number, w: number, h: number): {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Given a height and width in pixel values, calculate grid units.
|
|
31
|
+
* @param {PositionParams} positionParams Parameters of grid needed for coordinates calcluations.
|
|
32
|
+
* @param {Number} height Height in pixels.
|
|
33
|
+
* @param {Number} width Width in pixels.
|
|
34
|
+
* @param {Number} x X coordinate in grid units.
|
|
35
|
+
* @param {Number} y Y coordinate in grid units.
|
|
36
|
+
* @return {Object} w, h as grid units.
|
|
37
|
+
*/
|
|
38
|
+
export declare function calcWH(positionParams: PositionParams, width: number, height: number, x: number, y: number): {
|
|
39
|
+
w: number;
|
|
40
|
+
h: number;
|
|
41
|
+
};
|
|
42
|
+
export declare function clamp(num: number, lowerBound: number, upperBound: number): number;
|