@erpsquad/common 1.8.84 → 1.8.85
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/dist/_virtual/index/index.esm10.js +3 -3
- package/dist/_virtual/index/index.esm11.js +2 -4
- package/dist/_virtual/index/index.esm11.js.map +1 -1
- package/dist/_virtual/index/index.esm3.js +4 -2
- package/dist/_virtual/index/index.esm3.js.map +1 -1
- package/dist/_virtual/index/index.esm4.js +3 -3
- package/dist/_virtual/index/index.esm5.js +3 -3
- package/dist/_virtual/index/index.esm6.js +3 -3
- package/dist/_virtual/index/index.esm7.js +3 -3
- package/dist/_virtual/index/index.esm8.js +3 -3
- package/dist/_virtual/index/index.esm9.js +3 -3
- package/dist/_virtual/index/index10.js +1 -1
- package/dist/_virtual/index/index11.js +1 -1
- package/dist/_virtual/index/index3.js +1 -1
- package/dist/_virtual/index/index4.js +1 -1
- package/dist/_virtual/index/index5.js +1 -1
- package/dist/_virtual/index/index6.js +1 -1
- package/dist/_virtual/index/index7.js +1 -1
- package/dist/_virtual/index/index8.js +1 -1
- package/dist/_virtual/index/index9.js +1 -1
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/action-bar/action-bar/index.esm.js +11 -9
- package/dist/components/action-bar/action-bar/index.esm.js.map +1 -1
- package/dist/components/action-bar/action-bar/index.js +24 -24
- package/dist/components/action-bar/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/action-bar.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/editor/custom-editor/index.esm.js +3 -1
- package/dist/components/editor/custom-editor/index.esm.js.map +1 -1
- package/dist/components/editor/custom-editor/index.js +2 -2
- package/dist/components/editor/custom-editor/index.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.esm.js +0 -1
- package/dist/components/filter/components/delete-group/index.esm.js.map +1 -1
- package/dist/components/filter/components/delete-group/index.js +1 -1
- package/dist/components/filter/components/delete-group/index.js.map +1 -1
- package/dist/components/filter/filter/index.esm.js +9 -7
- package/dist/components/filter/filter/index.esm.js.map +1 -1
- package/dist/components/filter/filter/index.js +21 -21
- package/dist/components/filter/filter/index.js.map +1 -1
- package/dist/components/footer/footer.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/components/header/header/index.esm.js +3 -1
- package/dist/components/header/header/index.esm.js.map +1 -1
- package/dist/components/header/header/index.js +21 -21
- package/dist/components/header/header/index.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.esm.js +2 -1
- package/dist/components/header/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/header/redux/actionCreator/index.js +1 -1
- package/dist/components/header/redux/actionCreator/index.js.map +1 -1
- package/dist/components/icons/action-arrow.d.ts +3 -3
- package/dist/components/icons/add-circle.d.ts +3 -3
- package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/components/icons/arrow-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/components/icons/assignments.d.ts +3 -3
- package/dist/components/icons/blank-circle.d.ts +3 -3
- package/dist/components/icons/block-filled.d.ts +3 -3
- package/dist/components/icons/calendar-add.d.ts +3 -3
- package/dist/components/icons/calendar.d.ts +3 -3
- package/dist/components/icons/checkbox-square.d.ts +3 -3
- package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/components/icons/clock.d.ts +3 -3
- package/dist/components/icons/close.d.ts +3 -3
- package/dist/components/icons/coin-outline.d.ts +3 -3
- package/dist/components/icons/copy.d.ts +3 -3
- package/dist/components/icons/coupon.d.ts +3 -3
- package/dist/components/icons/cross-hire.d.ts +3 -3
- package/dist/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/components/icons/dashboard.d.ts +3 -3
- package/dist/components/icons/document-download.d.ts +3 -3
- package/dist/components/icons/document.d.ts +3 -3
- package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/components/icons/dollar-circle.d.ts +3 -3
- package/dist/components/icons/edit.d.ts +3 -3
- package/dist/components/icons/email.d.ts +3 -3
- package/dist/components/icons/export.d.ts +3 -3
- package/dist/components/icons/eye-off.d.ts +3 -3
- package/dist/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/components/icons/eye.d.ts +3 -3
- package/dist/components/icons/filled-circle.d.ts +3 -3
- package/dist/components/icons/filter-remove.d.ts +3 -3
- package/dist/components/icons/filter.d.ts +3 -3
- package/dist/components/icons/folder-save.d.ts +3 -3
- package/dist/components/icons/grid.d.ts +3 -3
- package/dist/components/icons/hashtag.d.ts +3 -3
- package/dist/components/icons/image.d.ts +3 -3
- package/dist/components/icons/import.d.ts +3 -3
- package/dist/components/icons/info-circle.d.ts +3 -3
- package/dist/components/icons/info.d.ts +3 -3
- package/dist/components/icons/link-horizontal.d.ts +3 -3
- package/dist/components/icons/link.d.ts +3 -3
- package/dist/components/icons/location.d.ts +3 -3
- package/dist/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/components/icons/lowest-price.d.ts +3 -3
- package/dist/components/icons/more.d.ts +3 -3
- package/dist/components/icons/notification.d.ts +3 -3
- package/dist/components/icons/paper-clip.d.ts +3 -3
- package/dist/components/icons/paragraph.d.ts +3 -3
- package/dist/components/icons/payment-request.d.ts +3 -3
- package/dist/components/icons/phone.d.ts +3 -3
- package/dist/components/icons/printer.d.ts +3 -3
- package/dist/components/icons/process-calendar.d.ts +3 -3
- package/dist/components/icons/promotion.d.ts +3 -3
- package/dist/components/icons/radio-button.d.ts +3 -3
- package/dist/components/icons/receipt-filled.d.ts +3 -3
- package/dist/components/icons/receipt-outline.d.ts +3 -3
- package/dist/components/icons/receipt.d.ts +3 -3
- package/dist/components/icons/refresh-icon.d.ts +3 -3
- package/dist/components/icons/replace.d.ts +3 -3
- package/dist/components/icons/save.d.ts +3 -3
- package/dist/components/icons/search-status.d.ts +3 -3
- package/dist/components/icons/search.d.ts +3 -3
- package/dist/components/icons/settings-fallback.d.ts +3 -3
- package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/components/icons/stacked-layer.d.ts +3 -3
- package/dist/components/icons/start-filled.d.ts +3 -3
- package/dist/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/components/icons/tick-circle.d.ts +3 -3
- package/dist/components/icons/tick-octagon.d.ts +3 -3
- package/dist/components/icons/tick.d.ts +3 -3
- package/dist/components/icons/toggle-switch.d.ts +3 -3
- package/dist/components/icons/trash.d.ts +3 -3
- package/dist/components/icons/wave.d.ts +3 -3
- package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/components/icons/work-centre.d.ts +3 -3
- package/dist/components/index.esm.js +13 -13
- package/dist/components/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js +2 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/location-select.d.ts +1 -1
- package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/components/material-table/material-table.d.ts +1 -1
- package/dist/components/phone-input/phone-input.d.ts +1 -1
- package/dist/components/providers/ERPUIProvider/index.esm.js +15 -1
- package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
- package/dist/components/providers/ERPUIProvider/index.js +1 -1
- package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
- package/dist/components/providers/ERPUIProvider.d.ts +2 -0
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js +2 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js +1 -1
- package/dist/components/reports-title-bar/redux/actionCreator/index.js.map +1 -1
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js +2 -1
- package/dist/components/share-modal/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js +1 -1
- package/dist/components/share-modal/redux/actionCreator/index.js.map +1 -1
- package/dist/components/switches/android-12-switch.d.ts +3 -1
- package/dist/components/text-field/text-field.d.ts +1 -1
- package/dist/components/time-picker/time-picker.d.ts +1 -1
- package/dist/components/upload/upload/index.esm.js +3 -2
- package/dist/components/upload/upload/index.esm.js.map +1 -1
- package/dist/components/upload/upload/index.js +29 -29
- package/dist/components/upload/upload/index.js.map +1 -1
- package/dist/components/upload-media/upload-media.d.ts +1 -1
- package/dist/contexts/AuthContext/index.esm.js +4 -3
- package/dist/contexts/AuthContext/index.esm.js.map +1 -1
- package/dist/contexts/AuthContext/index.js +2 -2
- package/dist/contexts/AuthContext/index.js.map +1 -1
- package/dist/contexts/languageContext/index.esm.js +2 -1
- package/dist/contexts/languageContext/index.esm.js.map +1 -1
- package/dist/contexts/languageContext/index.js +2 -2
- package/dist/contexts/languageContext/index.js.map +1 -1
- package/dist/hooks/use-material-calculations/index.esm.js +1 -2
- package/dist/hooks/use-material-calculations/index.esm.js.map +1 -1
- package/dist/hooks/use-material-calculations/index.js +1 -1
- package/dist/hooks/use-material-calculations/index.js.map +1 -1
- package/dist/hooks/useLangauge/index.esm.js +1 -2
- package/dist/hooks/useLangauge/index.esm.js.map +1 -1
- package/dist/hooks/useLangauge/index.js +1 -1
- package/dist/hooks/useLangauge/index.js.map +1 -1
- package/dist/index.esm.js +20 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.esm.js +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js +1 -1
- package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.esm.js +14 -15
- package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.esm.js.map +1 -1
- package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.js +1 -1
- package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.js.map +1 -1
- package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.esm.js +2 -3
- package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.js +1 -1
- package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabContext/TabContext/index.esm.js +2 -3
- package/dist/node_modules/@mui/lab/TabContext/TabContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabContext/TabContext/index.js +2 -2
- package/dist/node_modules/@mui/lab/TabContext/TabContext/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabList/TabList/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TabList/TabList/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabList/TabList/index.js +1 -1
- package/dist/node_modules/@mui/lab/TabList/TabList/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.js +2 -2
- package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/Timeline/Timeline/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/Timeline/Timeline/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/Timeline/Timeline/index.js +2 -2
- package/dist/node_modules/@mui/lab/Timeline/Timeline/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.js +1 -1
- package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.js +2 -2
- package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.js +1 -1
- package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.js +2 -2
- package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.js +2 -2
- package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.esm.js +1 -2
- package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.js +2 -2
- package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Accordion/Accordion/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Accordion/Accordion/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Accordion/Accordion/index.js +2 -2
- package/dist/node_modules/@mui/material/Accordion/Accordion/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.js +1 -1
- package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.js +2 -2
- package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.js +2 -2
- package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Alert/Alert/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Alert/Alert/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Alert/Alert/index.js +1 -1
- package/dist/node_modules/@mui/material/Alert/Alert/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.js +1 -1
- package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AppBar/AppBar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/AppBar/AppBar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AppBar/AppBar/index.js +1 -1
- package/dist/node_modules/@mui/material/AppBar/AppBar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.js +1 -1
- package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Avatar/Avatar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Avatar/Avatar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Avatar/Avatar/index.js +1 -1
- package/dist/node_modules/@mui/material/Avatar/Avatar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.js +2 -2
- package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.js +1 -1
- package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Badge/Badge/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Badge/Badge/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Badge/Badge/index.js +1 -1
- package/dist/node_modules/@mui/material/Badge/Badge/index.js.map +1 -1
- package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.js +3 -3
- package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.js.map +1 -1
- package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.js +2 -2
- package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Box/Box/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Box/Box/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Box/Box/index.js +1 -1
- package/dist/node_modules/@mui/material/Box/Box/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.js +2 -2
- package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.js +2 -2
- package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Button/Button/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Button/Button/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Button/Button/index.js +1 -1
- package/dist/node_modules/@mui/material/Button/Button/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.js +3 -3
- package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.js +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.js +1 -1
- package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.js +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.js +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.js +1 -1
- package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Card/Card/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Card/Card/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Card/Card/index.js +1 -1
- package/dist/node_modules/@mui/material/Card/Card/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.js +2 -2
- package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CardActions/CardActions/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CardActions/CardActions/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CardActions/CardActions/index.js +2 -2
- package/dist/node_modules/@mui/material/CardActions/CardActions/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CardContent/CardContent/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CardContent/CardContent/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CardContent/CardContent/index.js +1 -1
- package/dist/node_modules/@mui/material/CardContent/CardContent/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.js +1 -1
- package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.js +2 -2
- package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.js +1 -1
- package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Chip/Chip/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Chip/Chip/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Chip/Chip/index.js +1 -1
- package/dist/node_modules/@mui/material/Chip/Chip/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.js +6 -6
- package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.js +1 -1
- package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Collapse/Collapse/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Collapse/Collapse/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Collapse/Collapse/index.js +1 -1
- package/dist/node_modules/@mui/material/Collapse/Collapse/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Container/Container/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Container/Container/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Container/Container/index.js +1 -1
- package/dist/node_modules/@mui/material/Container/Container/index.js.map +1 -1
- package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.js +2 -2
- package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Dialog/Dialog/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Dialog/Dialog/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Dialog/Dialog/index.js +1 -1
- package/dist/node_modules/@mui/material/Dialog/Dialog/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Dialog/DialogContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Dialog/DialogContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Dialog/DialogContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Dialog/DialogContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.js +1 -1
- package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.js +2 -2
- package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.js +1 -1
- package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.js +1 -1
- package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Divider/Divider/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Divider/Divider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Divider/Divider/index.js +1 -1
- package/dist/node_modules/@mui/material/Divider/Divider/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Drawer/Drawer/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Drawer/Drawer/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Drawer/Drawer/index.js +1 -1
- package/dist/node_modules/@mui/material/Drawer/Drawer/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Fab/Fab/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Fab/Fab/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Fab/Fab/index.js +2 -2
- package/dist/node_modules/@mui/material/Fab/Fab/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Fade/Fade/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Fade/Fade/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Fade/Fade/index.js +1 -1
- package/dist/node_modules/@mui/material/Fade/Fade/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.js +1 -1
- package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControl/FormControl/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/FormControl/FormControl/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControl/FormControl/index.js +2 -2
- package/dist/node_modules/@mui/material/FormControl/FormControl/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.js +1 -1
- package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.js +1 -1
- package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.js +1 -1
- package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.js +2 -2
- package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.js.map +1 -1
- package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.js +1 -1
- package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.js +2 -2
- package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Grid/Grid/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Grid/Grid/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Grid/Grid/index.js +2 -2
- package/dist/node_modules/@mui/material/Grid/Grid/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Grid/GridContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Grid/GridContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Grid/GridContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Grid/GridContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Grow/Grow/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Grow/Grow/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Grow/Grow/index.js +2 -2
- package/dist/node_modules/@mui/material/Grow/Grow/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/Hidden/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Hidden/Hidden/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/Hidden/index.js +1 -1
- package/dist/node_modules/@mui/material/Hidden/Hidden/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.js +2 -2
- package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.js +1 -1
- package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/withWidth/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Hidden/withWidth/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Hidden/withWidth/index.js +1 -1
- package/dist/node_modules/@mui/material/Hidden/withWidth/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Icon/Icon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Icon/Icon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Icon/Icon/index.js +2 -2
- package/dist/node_modules/@mui/material/Icon/Icon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/IconButton/IconButton/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/IconButton/IconButton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/IconButton/IconButton/index.js +1 -1
- package/dist/node_modules/@mui/material/IconButton/IconButton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageList/ImageList/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ImageList/ImageList/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageList/ImageList/index.js +2 -2
- package/dist/node_modules/@mui/material/ImageList/ImageList/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.js +1 -1
- package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.js +2 -2
- package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.js +1 -1
- package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Input/Input/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Input/Input/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Input/Input/index.js +2 -2
- package/dist/node_modules/@mui/material/Input/Input/index.js.map +1 -1
- package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.js +2 -2
- package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.js.map +1 -1
- package/dist/node_modules/@mui/material/InputBase/InputBase/index.esm.js +5 -6
- package/dist/node_modules/@mui/material/InputBase/InputBase/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/InputBase/InputBase/index.js +1 -1
- package/dist/node_modules/@mui/material/InputBase/InputBase/index.js.map +1 -1
- package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.js +1 -1
- package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.js +5 -5
- package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Link/Link/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Link/Link/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Link/Link/index.js +1 -1
- package/dist/node_modules/@mui/material/Link/Link/index.js.map +1 -1
- package/dist/node_modules/@mui/material/List/List/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/List/List/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/List/List/index.js +2 -2
- package/dist/node_modules/@mui/material/List/List/index.js.map +1 -1
- package/dist/node_modules/@mui/material/List/ListContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/List/ListContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/List/ListContext/index.js +1 -1
- package/dist/node_modules/@mui/material/List/ListContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItem/ListItem/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ListItem/ListItem/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItem/ListItem/index.js +1 -1
- package/dist/node_modules/@mui/material/ListItem/ListItem/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.js +1 -1
- package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.js +2 -2
- package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.js +2 -2
- package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.js +2 -2
- package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.js +1 -1
- package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.js +2 -2
- package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Menu/Menu/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Menu/Menu/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Menu/Menu/index.js +2 -2
- package/dist/node_modules/@mui/material/Menu/Menu/index.js.map +1 -1
- package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.js +1 -1
- package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.js.map +1 -1
- package/dist/node_modules/@mui/material/MenuList/MenuList/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/MenuList/MenuList/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/MenuList/MenuList/index.js +2 -2
- package/dist/node_modules/@mui/material/MenuList/MenuList/index.js.map +1 -1
- package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.js +1 -1
- package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Modal/Modal/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Modal/Modal/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Modal/Modal/index.js +1 -1
- package/dist/node_modules/@mui/material/Modal/Modal/index.js.map +1 -1
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.js +2 -2
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.js.map +1 -1
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.js +1 -1
- package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.js.map +1 -1
- package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.js +1 -1
- package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.js.map +1 -1
- package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.js +1 -1
- package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.js.map +1 -1
- package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.js +2 -2
- package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Pagination/Pagination/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Pagination/Pagination/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Pagination/Pagination/index.js +1 -1
- package/dist/node_modules/@mui/material/Pagination/Pagination/index.js.map +1 -1
- package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.js +1 -1
- package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Paper/Paper/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Paper/Paper/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Paper/Paper/index.js +1 -1
- package/dist/node_modules/@mui/material/Paper/Paper/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Popover/Popover/index.esm.js +6 -7
- package/dist/node_modules/@mui/material/Popover/Popover/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Popover/Popover/index.js +2 -2
- package/dist/node_modules/@mui/material/Popover/Popover/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Popper/BasePopper/index.esm.js +4 -5
- package/dist/node_modules/@mui/material/Popper/BasePopper/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Popper/BasePopper/index.js +3 -3
- package/dist/node_modules/@mui/material/Popper/BasePopper/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Popper/Popper/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Popper/Popper/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Popper/Popper/index.js +1 -1
- package/dist/node_modules/@mui/material/Popper/Popper/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Portal/Portal/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Portal/Portal/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Portal/Portal/index.js +4 -4
- package/dist/node_modules/@mui/material/Portal/Portal/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Radio/Radio/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Radio/Radio/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Radio/Radio/index.js +1 -1
- package/dist/node_modules/@mui/material/Radio/Radio/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.js +2 -2
- package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.js +2 -2
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.js.map +1 -1
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.js +1 -1
- package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Rating/Rating/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/Rating/Rating/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Rating/Rating/index.js +6 -6
- package/dist/node_modules/@mui/material/Rating/Rating/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.js +2 -2
- package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Select/Select/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Select/Select/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Select/Select/index.js +1 -1
- package/dist/node_modules/@mui/material/Select/Select/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Select/SelectInput/index.esm.js +4 -5
- package/dist/node_modules/@mui/material/Select/SelectInput/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Select/SelectInput/index.js +2 -2
- package/dist/node_modules/@mui/material/Select/SelectInput/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.js +1 -1
- package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Slide/Slide/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/Slide/Slide/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Slide/Slide/index.js +1 -1
- package/dist/node_modules/@mui/material/Slide/Slide/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Slider/Slider/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Slider/Slider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Slider/Slider/index.js +1 -1
- package/dist/node_modules/@mui/material/Slider/Slider/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.js +1 -1
- package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.js +1 -1
- package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.js +1 -1
- package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.js +3 -3
- package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.js +1 -1
- package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.js +2 -2
- package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Stack/Stack/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Stack/Stack/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Stack/Stack/index.js +1 -1
- package/dist/node_modules/@mui/material/Stack/Stack/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Step/Step/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Step/Step/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Step/Step/index.js +1 -1
- package/dist/node_modules/@mui/material/Step/Step/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Step/StepContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Step/StepContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Step/StepContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Step/StepContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/StepButton/StepButton/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/StepButton/StepButton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/StepButton/StepButton/index.js +1 -1
- package/dist/node_modules/@mui/material/StepButton/StepButton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.js +1 -1
- package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.js.map +1 -1
- package/dist/node_modules/@mui/material/StepContent/StepContent/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/StepContent/StepContent/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/StepContent/StepContent/index.js +1 -1
- package/dist/node_modules/@mui/material/StepContent/StepContent/index.js.map +1 -1
- package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.js +1 -1
- package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.js +2 -2
- package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Stepper/Stepper/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Stepper/Stepper/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Stepper/Stepper/index.js +2 -2
- package/dist/node_modules/@mui/material/Stepper/Stepper/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Stepper/StepperContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Stepper/StepperContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Stepper/StepperContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Stepper/StepperContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.js +2 -2
- package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.js +2 -2
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.js.map +1 -1
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.js +1 -1
- package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Switch/Switch/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Switch/Switch/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Switch/Switch/index.js +2 -2
- package/dist/node_modules/@mui/material/Switch/Switch/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Tab/Tab/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Tab/Tab/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Tab/Tab/index.js +1 -1
- package/dist/node_modules/@mui/material/Tab/Tab/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.js +2 -2
- package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/Table/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Table/Table/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/Table/index.js +2 -2
- package/dist/node_modules/@mui/material/Table/Table/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/TableContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Table/TableContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/TableContext/index.js +1 -1
- package/dist/node_modules/@mui/material/Table/TableContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.js +1 -1
- package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableBody/TableBody/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableBody/TableBody/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableBody/TableBody/index.js +1 -1
- package/dist/node_modules/@mui/material/TableBody/TableBody/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableCell/TableCell/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableCell/TableCell/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableCell/TableCell/index.js +1 -1
- package/dist/node_modules/@mui/material/TableCell/TableCell/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.js +2 -2
- package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.js +1 -1
- package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableHead/TableHead/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableHead/TableHead/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableHead/TableHead/index.js +1 -1
- package/dist/node_modules/@mui/material/TableHead/TableHead/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.js +2 -2
- package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.js +2 -2
- package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableRow/TableRow/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableRow/TableRow/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableRow/TableRow/index.js +1 -1
- package/dist/node_modules/@mui/material/TableRow/TableRow/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.js +1 -1
- package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.js +1 -1
- package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Tabs/Tabs/index.esm.js +6 -7
- package/dist/node_modules/@mui/material/Tabs/Tabs/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Tabs/Tabs/index.js +2 -2
- package/dist/node_modules/@mui/material/Tabs/Tabs/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TextField/TextField/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/TextField/TextField/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TextField/TextField/index.js +2 -2
- package/dist/node_modules/@mui/material/TextField/TextField/index.js.map +1 -1
- package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.js +1 -1
- package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.js +1 -1
- package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.esm.js +2 -3
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.js +2 -2
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.js +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.js +1 -1
- package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.js +2 -2
- package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.esm.js +4 -5
- package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.js +2 -2
- package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Typography/Typography/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Typography/Typography/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Typography/Typography/index.js +2 -2
- package/dist/node_modules/@mui/material/Typography/Typography/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.js +2 -2
- package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.js.map +1 -1
- package/dist/node_modules/@mui/material/Zoom/Zoom/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/Zoom/Zoom/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/Zoom/Zoom/index.js +1 -1
- package/dist/node_modules/@mui/material/Zoom/Zoom/index.js.map +1 -1
- package/dist/node_modules/@mui/material/internal/SwitchBase/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/internal/SwitchBase/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/internal/SwitchBase/index.js +2 -2
- package/dist/node_modules/@mui/material/internal/SwitchBase/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/ThemeProvider/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/styles/ThemeProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/ThemeProvider/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/ThemeProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createPalette/index.esm.js +4 -5
- package/dist/node_modules/@mui/material/styles/createPalette/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createPalette/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/createPalette/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTheme/index.esm.js +3 -4
- package/dist/node_modules/@mui/material/styles/createTheme/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTheme/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/createTheme/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTransitions/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/styles/createTransitions/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTransitions/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/createTransitions/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTypography/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/styles/createTypography/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/createTypography/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/createTypography/index.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/useTheme/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/styles/useTheme/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/styles/useTheme/index.js +1 -1
- package/dist/node_modules/@mui/material/styles/useTheme/index.js.map +1 -1
- package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.esm.js +5 -6
- package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.js +1 -1
- package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.js.map +1 -1
- package/dist/node_modules/@mui/material/utils/createSvgIcon/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/utils/createSvgIcon/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/utils/createSvgIcon/index.js +2 -2
- package/dist/node_modules/@mui/material/utils/createSvgIcon/index.js.map +1 -1
- package/dist/node_modules/@mui/material/utils/index/index.esm.js +1 -2
- package/dist/node_modules/@mui/material/utils/index/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/material/utils/index/index.js +1 -1
- package/dist/node_modules/@mui/material/utils/index/index.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.esm.js +5 -6
- package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.js +2 -2
- package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.esm.js +1 -2
- package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.js +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.esm.js +1 -2
- package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.js +1 -1
- package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.esm.js +1 -2
- package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.js +1 -1
- package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.esm.js +1 -2
- package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.js +1 -1
- package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/index/index.esm.js +8 -2
- package/dist/node_modules/@mui/styled-engine/index/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/styled-engine/index/index.js +1 -1
- package/dist/node_modules/@mui/styled-engine/index/index.js.map +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +10 -11
- package/dist/node_modules/@mui/system/colorManipulator/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
- package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.esm.js +8 -9
- package/dist/node_modules/@mui/system/createStyled/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
- package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/Container/createContainer/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/Container/createContainer/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/Container/createContainer/index.js +2 -2
- package/dist/node_modules/@mui/system/esm/Container/createContainer/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.js +2 -2
- package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/Stack/createStack/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/Stack/createStack/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/Stack/createStack/index.js +2 -2
- package/dist/node_modules/@mui/system/esm/Stack/createStack/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.esm.js +4 -5
- package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.js +2 -2
- package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/borders/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/borders/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/borders/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/borders/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/breakpoints/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/breakpoints/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/colorManipulator/index.esm.js +3 -4
- package/dist/node_modules/@mui/system/esm/colorManipulator/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/colorManipulator/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/colorManipulator/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/compose/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/compose/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/compose/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/compose/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/createStyled/index.esm.js +2 -3
- package/dist/node_modules/@mui/system/esm/createStyled/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/createStyled/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/createStyled/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/cssGrid/index.esm.js +3 -4
- package/dist/node_modules/@mui/system/esm/cssGrid/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/cssGrid/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/cssGrid/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/responsivePropType/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/responsivePropType/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/responsivePropType/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/responsivePropType/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/spacing/index.esm.js +6 -7
- package/dist/node_modules/@mui/system/esm/spacing/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/spacing/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/spacing/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/style/index.esm.js +1 -2
- package/dist/node_modules/@mui/system/esm/style/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/style/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/style/index.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.esm.js +2 -3
- package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.js +1 -1
- package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.js.map +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
- package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.esm.js +1 -2
- package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.js +1 -1
- package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.esm.js +2 -3
- package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.js +4 -4
- package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.esm.js +4 -5
- package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.js +2 -2
- package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.esm.js +3 -4
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.esm.js +1 -2
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.esm.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.js +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.js.map +1 -1
- package/dist/node_modules/@mui/x-date-pickers/internals/utils/warning/index.esm.js.map +1 -1
- package/dist/node_modules/@react-querybuilder/material/dist/react-querybuilder_material/index.esm.js.map +1 -1
- package/dist/node_modules/@react-querybuilder/material/dist/react-querybuilder_material/index.js.map +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index/index.esm.js +20 -11
- package/dist/node_modules/@tanstack/table-core/build/lib/index/index.esm.js.map +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index/index.js +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index/index.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.esm.js +6 -7
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.esm.js.map +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.js +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.js.map +1 -1
- package/dist/node_modules/notistack/notistack.esm/index.esm.js +2 -3
- package/dist/node_modules/notistack/notistack.esm/index.esm.js.map +1 -1
- package/dist/node_modules/notistack/notistack.esm/index.js +1 -1
- package/dist/node_modules/notistack/notistack.esm/index.js.map +1 -1
- package/dist/node_modules/prop-types/checkPropTypes/index.esm.js +3 -4
- package/dist/node_modules/prop-types/checkPropTypes/index.esm.js.map +1 -1
- package/dist/node_modules/prop-types/checkPropTypes/index.js +1 -1
- package/dist/node_modules/prop-types/checkPropTypes/index.js.map +1 -1
- package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js +5 -6
- package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js.map +1 -1
- package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js +1 -1
- package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js.map +1 -1
- package/dist/node_modules/prop-types/index/index.esm.js +1 -2
- package/dist/node_modules/prop-types/index/index.esm.js.map +1 -1
- package/dist/node_modules/prop-types/index/index.js +1 -1
- package/dist/node_modules/prop-types/index/index.js.map +1 -1
- package/dist/src/components/accordion/accordion.d.ts +1 -1
- package/dist/src/components/action-bar/action-bar.d.ts +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +1 -1
- package/dist/src/components/footer/footer.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
- package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
- package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
- package/dist/src/components/icons/action-arrow.d.ts +3 -3
- package/dist/src/components/icons/add-circle.d.ts +3 -3
- package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
- package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
- package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
- package/dist/src/components/icons/arrow-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
- package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
- package/dist/src/components/icons/assignments.d.ts +3 -3
- package/dist/src/components/icons/blank-circle.d.ts +3 -3
- package/dist/src/components/icons/block-filled.d.ts +3 -3
- package/dist/src/components/icons/calendar-add.d.ts +3 -3
- package/dist/src/components/icons/calendar.d.ts +3 -3
- package/dist/src/components/icons/checkbox-square.d.ts +3 -3
- package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
- package/dist/src/components/icons/clock.d.ts +3 -3
- package/dist/src/components/icons/close.d.ts +3 -3
- package/dist/src/components/icons/coin-outline.d.ts +3 -3
- package/dist/src/components/icons/copy.d.ts +3 -3
- package/dist/src/components/icons/coupon.d.ts +3 -3
- package/dist/src/components/icons/cross-hire.d.ts +3 -3
- package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
- package/dist/src/components/icons/dashboard.d.ts +3 -3
- package/dist/src/components/icons/document-download.d.ts +3 -3
- package/dist/src/components/icons/document.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/dollar-circle.d.ts +3 -3
- package/dist/src/components/icons/edit.d.ts +3 -3
- package/dist/src/components/icons/email.d.ts +3 -3
- package/dist/src/components/icons/export.d.ts +3 -3
- package/dist/src/components/icons/eye-off.d.ts +3 -3
- package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
- package/dist/src/components/icons/eye.d.ts +3 -3
- package/dist/src/components/icons/filled-circle.d.ts +3 -3
- package/dist/src/components/icons/filter-remove.d.ts +3 -3
- package/dist/src/components/icons/filter.d.ts +3 -3
- package/dist/src/components/icons/folder-save.d.ts +3 -3
- package/dist/src/components/icons/grid.d.ts +3 -3
- package/dist/src/components/icons/hashtag.d.ts +3 -3
- package/dist/src/components/icons/image.d.ts +3 -3
- package/dist/src/components/icons/import.d.ts +3 -3
- package/dist/src/components/icons/info-circle.d.ts +3 -3
- package/dist/src/components/icons/info.d.ts +3 -3
- package/dist/src/components/icons/link-horizontal.d.ts +3 -3
- package/dist/src/components/icons/link.d.ts +3 -3
- package/dist/src/components/icons/location.d.ts +3 -3
- package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
- package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
- package/dist/src/components/icons/lowest-price.d.ts +3 -3
- package/dist/src/components/icons/more.d.ts +3 -3
- package/dist/src/components/icons/notification.d.ts +3 -3
- package/dist/src/components/icons/paper-clip.d.ts +3 -3
- package/dist/src/components/icons/paragraph.d.ts +3 -3
- package/dist/src/components/icons/payment-request.d.ts +3 -3
- package/dist/src/components/icons/phone.d.ts +3 -3
- package/dist/src/components/icons/printer.d.ts +3 -3
- package/dist/src/components/icons/process-calendar.d.ts +3 -3
- package/dist/src/components/icons/promotion.d.ts +3 -3
- package/dist/src/components/icons/radio-button.d.ts +3 -3
- package/dist/src/components/icons/receipt-filled.d.ts +3 -3
- package/dist/src/components/icons/receipt-outline.d.ts +3 -3
- package/dist/src/components/icons/receipt.d.ts +3 -3
- package/dist/src/components/icons/refresh-icon.d.ts +3 -3
- package/dist/src/components/icons/replace.d.ts +3 -3
- package/dist/src/components/icons/save.d.ts +3 -3
- package/dist/src/components/icons/search-status.d.ts +3 -3
- package/dist/src/components/icons/search.d.ts +3 -3
- package/dist/src/components/icons/settings-fallback.d.ts +3 -3
- package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
- package/dist/src/components/icons/stacked-layer.d.ts +3 -3
- package/dist/src/components/icons/start-filled.d.ts +3 -3
- package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
- package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
- package/dist/src/components/icons/tick-circle.d.ts +3 -3
- package/dist/src/components/icons/tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/tick.d.ts +3 -3
- package/dist/src/components/icons/toggle-switch.d.ts +3 -3
- package/dist/src/components/icons/trash.d.ts +3 -3
- package/dist/src/components/icons/wave.d.ts +3 -3
- package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
- package/dist/src/components/icons/work-centre.d.ts +3 -3
- package/dist/src/components/index.d.ts +2 -2
- package/dist/src/components/location-select.d.ts +1 -1
- package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
- package/dist/src/components/material-table/material-table.d.ts +1 -1
- package/dist/src/components/phone-input/phone-input.d.ts +1 -1
- package/dist/src/components/providers/ERPUIProvider.d.ts +2 -0
- package/dist/src/components/radio/radio.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/components/switches/android-12-switch.d.ts +3 -1
- package/dist/src/components/text-field/text-field.d.ts +1 -1
- package/dist/src/components/time-picker/time-picker.d.ts +1 -1
- package/dist/src/components/upload-media/upload-media.d.ts +1 -1
- package/dist/src/utils/api-config.d.ts +9 -0
- package/dist/src/utils/api.d.ts +1 -0
- package/dist/src/utils/common-utility.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/style.css +73 -73
- package/dist/utils/api/index.esm.js +20 -7
- package/dist/utils/api/index.esm.js.map +1 -1
- package/dist/utils/api/index.js +1 -1
- package/dist/utils/api/index.js.map +1 -1
- package/dist/utils/api-config/index.esm.js +33 -0
- package/dist/utils/api-config/index.esm.js.map +1 -0
- package/dist/utils/api-config/index.js +2 -0
- package/dist/utils/api-config/index.js.map +1 -0
- package/dist/utils/api-config.d.ts +9 -0
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/common/index.esm.js +12 -8
- package/dist/utils/common/index.esm.js.map +1 -1
- package/dist/utils/common/index.js +1 -1
- package/dist/utils/common/index.js.map +1 -1
- package/dist/utils/common-utility.d.ts +1 -1
- package/dist/utils/index.esm.js +7 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js +2 -1
- package/dist/views/form-builder/redux/actionCreator/index.esm.js.map +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js +1 -1
- package/dist/views/form-builder/redux/actionCreator/index.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js +4 -3
- package/dist/views/template-editor/components/EditorSidebar/index.esm.js.map +1 -1
- package/dist/views/template-editor/components/EditorSidebar/index.js +14 -14
- package/dist/views/template-editor/components/EditorSidebar/index.js.map +1 -1
- package/dist/views/template-editor/templates/index.esm.js +2 -1
- package/dist/views/template-editor/templates/index.esm.js.map +1 -1
- package/dist/views/template-editor/templates/index.js +5 -5
- package/dist/views/template-editor/templates/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../api-client/api.rbac/api/index.js"),n=require("../../constants/auth/index.js"),r=require("react-router-dom"),o=require("../../constants/pathnames/pathname/index.js"),s=require("../../utils/common/index.js"),i=require("../../node_modules/notistack/notistack.esm/index.js"),
|
|
2
|
-
return e.jsx(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../api-client/api.rbac/api/index.js"),n=require("../../constants/auth/index.js"),r=require("react-router-dom"),o=require("../../constants/pathnames/pathname/index.js"),s=require("../../utils/common/index.js"),i=require("../../node_modules/notistack/notistack.esm/index.js"),u=require("socket.io-client"),c=require("../../utils/route-utils/index.js"),h=require("../../utils/api-config/index.js"),m=require("../../constants/pathnames/pathname.accounting/index.js"),g=require("../../constants/pathnames/pathname.inventory/index.js"),l=require("../../constants/pathnames/pathname.manufacturing/index.js"),d=require("../../constants/pathnames/pathname.procurement/index.js"),P=require("../../constants/pathnames/pathname.crm/index.js"),E=require("../../constants/pathnames/pathname.rental/index.js"),S=require("../../components/custom-snackbar/custom-snackbar/index.js");const R={user:null,loading:!0,authToken:"",setUser:()=>null,setLoading:()=>Boolean,login:()=>Promise.resolve(),logout:()=>Promise.resolve(),forgotPassword:()=>Promise.resolve(),resetPassword:()=>Promise.resolve(),changePassword:()=>Promise.resolve(),changeUserPassword:()=>Promise.resolve()},I=t.createContext(R);exports.AuthContext=I,exports.AuthProvider=({children:_})=>{const[w,W]=t.useState(R.user),[A,p]=t.useState(""),[f,T]=t.useState(R.loading),v=t.useRef(null),N=r.useNavigate(),y=e=>{if(!e)return!1;try{return JSON.parse(e)}catch(t){return!1}};t.useEffect(()=>{T(!0);const e=window.localStorage.getItem(n.auth.storageTokenKeyName),t=y(window.localStorage.getItem(n.auth.storageUserKeyName))??null,a=[o.Pathname.LOGIN,o.Pathname.FORGOT_PASSWORD,o.Pathname.RESET_PASSWORD,o.Pathname.CHANGE_PASSWORD],r=window.location.pathname;e||t?(W(t),p(e||""),T(!1)):(a.includes(r)||N(o.Pathname.LOGIN),T(!1))},[]),t.useEffect(()=>{var t;if(!A)return void(v.current&&(null==(t=v.current)||t.disconnect(),v.current=null));const a=h.getApiConfig(),n=u.io(a.socketBaseUrl,{transports:["websocket"],auth:{token:A},path:"/socket.io/"});return v.current=n,n.on("connect",()=>{n.onAny((e,...t)=>{})}),n.on("notification",t=>{const{message:a,notificationData:n}=t||{};let r=a;const o=(e=>{var t;const{moduleName:a="",moduleId:n="",notificationData:r={}}=e,o={"sales invoice":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_SALES_INVOICES),n.toString()),"asset transfers":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_ASSET_TRANSFER),n.toString()),budgets:()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_BUDGET),n.toString()),"cash expense":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_CASH_EXPENSE),n.toString()),"credit notes":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_CREDIT_NOTE),n.toString()),"debit notes":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_DEBIT_NOTE),n.toString()),"expense reimbursement":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT),n.toString()),"journal entries":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_JOURNAL_ENTRY),n.toString()),"payment entries":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_PAYMENT_ENTRY),n.toString()),"purchase invoice":()=>c.generateRouteWithId(m.PathnameGenerator(m.PathnameAccounting.VIEW_PURCHASE_INVOICE),n.toString()),"stock transfer":()=>c.generateRouteWithId(g.PathnameGenerator(g.PathnameInventory.VIEW_STOCK_TRANSFER),n.toString()),"bills of materials":()=>c.generateRouteWithId(l.PathnameGenerator(l.PathnameManufacturing.VIEW_BILL_OF_MATERIAL),n.toString()),"purchase agreement":()=>c.generateRouteWithId(d.PathnameGenerator(d.PathnamePurchase.VIEW_PURCHASE_AGREEMENT),n.toString()),"purchase orders":()=>{var e;return c.generateRouteWithId(1==(null==(e=null==r?void 0:r.data)?void 0:e.is_rental)?E.ROUTES.VIEW:d.PathnameGenerator(d.PathnamePurchase.VIEW_PURCHASE_ORDER),n.toString())},"purchase request":()=>c.generateRouteWithId(d.PathnameGenerator(d.PathnamePurchase.VIEW_PURCHASE_ORDER),n.toString()),vra:()=>c.generateRouteWithId(d.PathnameGenerator(d.PathnamePurchase.VIEW_VENDOR_RETURNS),n.toString()),"sl customer returns":()=>c.generateRouteWithId(P.PathnameGenerator(P.PathnameCrm.VIEW_CUSTOMER_RETURNS),n.toString()),"sales order":()=>c.generateRouteWithId(P.PathnameGenerator(P.PathnameCrm.VIEW_SALES_ORDER),n.toString()),"rental order":()=>c.generateRouteWithId(E.PathnameGenerator(E.PathnameRental.VIEW_RENTAL_ORDER),n.toString()),"replacement order":()=>c.generateRouteWithId(E.PathnameGenerator(E.PathnameRental.VIEW_RENTAL_ORDER),n.toString()),"rental agreement":()=>c.generateRouteWithId(E.PathnameGenerator(E.PathnameRental.VIEW_AGREEMENT),n.toString()),"cross hire order":()=>c.generateRouteWithId(E.PathnameGenerator(E.PathnameRental.VIEW_CROSS_HIRE_ORDER),n.toString()),"cross hire request":()=>c.generateRouteWithId(E.PathnameGenerator(E.PathnameRental.VIEW_CROSS_HIRE_REQUEST),n.toString())};return(null==(t=o[a.toLowerCase()])?void 0:t.call(o))||"/dashboard"})(t);if(n){const{notification_type:e}=n;r=a}i.enqueueSnackbar(String(a),{variant:"default",anchorOrigin:{vertical:"top",horizontal:"center"},autoHideDuration:5e3,content:t=>/* @__PURE__ */e.jsx(S.CustomSnackbar,{snackbarKey:t,message:r,data:n,variant:"default",linkUrl:o})})}),n.on("sales_invoice_viewed",e=>{}),n.on("error",e=>{i.enqueueSnackbar(`Socket error: ${e}`,{variant:"error"})}),()=>{v.current&&(v.current.disconnect(),v.current=null)}},[A]);const V={user:w,authToken:A,loading:f,setUser:W,setLoading:T,login:async(e,t)=>{var r;if(T(!0),window.localStorage.getItem(n.auth.storageTokenKeyName)&&w)return N(o.Pathname.DASHBOARD);try{const t=await a.postV1AuthLogin({...e,...s.getToken()});if(t.success){const e=(null==(r=null==t?void 0:t.data)?void 0:r.login)||null;if(e){window.localStorage.setItem(n.auth.storageTokenKeyName,e.token);const t={...e,full_name:`${e.first_name} ${e.last_name}`};window.localStorage.setItem(n.auth.storageUserKeyName,JSON.stringify(t)),W(t),p(e.token),N(o.Pathname.DASHBOARD),T(!1),delete e.token}}}catch(i){let e="Something went wrong";i instanceof Error&&(e=y(i.message).message||i.message),t(e)}},logout:async()=>{window.localStorage.removeItem(n.auth.storageTokenKeyName),window.localStorage.removeItem(n.auth.storageUserKeyName),window.localStorage.removeItem(n.auth.storageAccessKeyName),W(null),p(""),N(o.Pathname.LOGIN)},forgotPassword:async(e,t)=>{try{await a.postV1AuthForgotPassword({...e,...s.getToken()}),t(!0,"Reset Link sent to your email")}catch(n){let e="Something went wrong";n instanceof Error&&(e=y(n.message).message||n.message),t(!1,e)}},resetPassword:async(e,t)=>{try{t(await a.postV1AuthResetPassword({...e,...s.getToken()}))}catch(n){let e="Something went wrong";n instanceof Error&&(e=y(n.message).message||n.message,t(e))}},changePassword:async(e,t)=>{try{await a.postV1AuthChangePassword({...e,...s.getToken()}),t(null)}catch(n){let e="Something went wrong";n instanceof Error&&(e=y(n.message).message||n.message,t(e))}t("reset")},changeUserPassword:async(e,t)=>{try{await a.postV1AuthChangeUserPassword({...e,...s.getToken()}),t("Password Changed Successfully",!0)}catch(n){let e="Something went wrong";n instanceof Error&&(e=y(n.message).message||n.message,t(e,!1))}},changeUserPasswordByAdmin:async(e,t)=>{try{await a.postV1AuthChangeUserPasswordByAdmin({...e,...s.getToken()}),t("Password Changed Successfully",!0)}catch(n){let e="Something went wrong";n instanceof Error&&(e=y(n.message).message||n.message,t(e,!1))}}};/* @__PURE__ */
|
|
2
|
+
return e.jsx(I.Provider,{value:V,children:_})};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/contexts/AuthContext.tsx"],"sourcesContent":["import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { /* useLocation, */ useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format:string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n\tcompany_id: string;\n}\n\ninterface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n}\n\nsetBaseUrl(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\t// const location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER) , moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\n\t// const initAuth = async () => {\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tconst storedUser: ERPUser =\n\t// \t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) || null;\n\t// \tif (storedToken && storedUser) {\n\t// \t\ttry {\n\t// \t\t\tconst userData = await getV1UserId({\n\t// \t\t\t\t'x-token': storedToken,\n\t// \t\t\t\tid: String(storedUser.id)\n\t// \t\t\t});\n\t// \t\t} catch (error) {\n\t// \t\t}\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \tif (storedToken && storedUser) {\n\t// \t\tsetUser(storedUser);\n\t// setLoading(false);\n\t// \t} else {\n\t// \t\thandleLogout();\n\t// setLoading(false);\n\t// \t}\n\t// };\n\n\t// useEffect(() => {\n\t// setLoading(true)\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetUser(null);\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \teslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [location.pathname]);\n\n\t// useEffect(() => {\n\t// \tsetLoading(true);\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetLoading(false);\n\t// \t\tnavigate(Pathname.LOGIN);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst publicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tif (!publicRoutes.includes(currentPath)) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst socket = io(import.meta.env.VITE_SOCKET_BASE_URL, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\t\t\t\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\t\t\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\tconst { message, notificationData } = data || {};\n\t\tlet notificationContent: React.ReactNode = message;\n\t\tconst url = getNotificationUrl(data);\n\n\t\tif (notificationData) {\n\t\t\tconst { notification_type } = notificationData;\n\n\t\t\tswitch (notification_type) {\n\t\t\t\tcase 'addApprovers': {\n\t\t\t\t\t\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tenqueueSnackbar(String(message), {\n\t\t\tvariant: 'default',\n\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\tautoHideDuration: 5000,\n\t\t\tcontent: (key) => (\n\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url}/>\n\t\t\t),\n\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\twindow.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\twindow.localStorage.setItem(\n\t\t\t\t\t\tauth.storageUserKeyName,\n\t\t\t\t\t\tJSON.stringify(userData)\n\t\t\t\t\t);\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tnavigate(Pathname.DASHBOARD);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tdelete data.token;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageAccessKeyName);\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n"],"names":["defaultProvider","user","loading","authToken","setUser","setLoading","Boolean","login","Promise","resolve","logout","forgotPassword","resetPassword","changePassword","changeUserPassword","AuthContext","createContext","setBaseUrl","children","useState","setAuthToken","socketRef","useRef","navigate","useNavigate","isJsonParse","string","JSON","parse","error","useEffect","storedToken","window","localStorage","getItem","auth","storageTokenKeyName","storedUser","storageUserKeyName","publicRoutes","Pathname","LOGIN","FORGOT_PASSWORD","RESET_PASSWORD","CHANGE_PASSWORD","currentPath","location","pathname","includes","current","_a","disconnect","socket","io","transports","token","path","on","onAny","event","args","data","message","notificationData","notificationContent","url","moduleName","moduleId","routeMap","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","toString","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","VIEW_CASH_EXPENSE","VIEW_CREDIT_NOTE","VIEW_DEBIT_NOTE","VIEW_EXPENSE_REIMBURSEMENT","VIEW_JOURNAL_ENTRY","VIEW_PAYMENT_ENTRY","VIEW_PURCHASE_INVOICE","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","vra","VIEW_VENDOR_RETURNS","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","VIEW_SALES_ORDER","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","VIEW_AGREEMENT","VIEW_CROSS_HIRE_ORDER","VIEW_CROSS_HIRE_REQUEST","toLowerCase","call","getNotificationUrl","notification_type","enqueueSnackbar","String","variant","anchorOrigin","vertical","horizontal","autoHideDuration","content","key","jsx","CustomSnackbar","snackbarKey","linkUrl","errMsg","values","async","params","callback","DASHBOARD","loginUser","postV1AuthLogin","getToken","success","setItem","userData","full_name","first_name","last_name","stringify","Error","removeItem","storageAccessKeyName","postV1AuthForgotPassword","postV1AuthResetPassword","postV1AuthChangePassword","postV1AuthChangeUserPassword","changeUserPasswordByAdmin","postV1AuthChangeUserPasswordByAdmin","Provider","value"],"mappings":"67BAsIA,MAAMA,EAAwC,CAC7CC,KAAM,KACNC,SAAS,EACTC,UAAW,GACXC,QAAS,IAAM,KACfC,WAAY,IAAMC,QAClBC,MAAO,IAAMC,QAAQC,UACrBC,OAAQ,IAAMF,QAAQC,UACtBE,eAAgB,IAAMH,QAAQC,UAC9BG,cAAe,IAAMJ,QAAQC,UAC7BI,eAAgB,IAAML,QAAQC,UAC9BK,mBAAoB,IAAMN,QAAQC,WAG7BM,EAAcC,EAAAA,cAAchB,GAMlCiB,EAAAA,WAAW,8EAEuC,EAAGC,eAEpD,MAAOjB,EAAMG,GAAWe,EAAAA,SAASnB,EAAgBC,OAC1CE,EAAWiB,GAAgBD,EAAAA,SAAiB,KAC5CjB,EAASG,GAAcc,EAAAA,SAASnB,EAAgBE,SACjDmB,EAAYC,EAAAA,OAAsB,MAGlCC,EAAWC,EAAAA,cAEXC,EAAeC,IACpB,IAAKA,EAAQ,OAAO,EAEpB,IACC,OAAOC,KAAKC,MAAMF,EACnB,OAASG,GACR,OAAO,CACR,GAiIDC,EAAAA,UAAU,KACTzB,GAAW,GAEX,MAAM0B,EAAcC,OAAOC,aAAaC,QAAQC,EAAAA,KAAKC,qBAC/CC,EACLZ,EAAYO,OAAOC,aAAaC,QAAQC,EAAAA,KAAKG,sBAAwB,KAChEC,EAAe,CAACC,EAAAA,SAASC,MAAOD,EAAAA,SAASE,gBAAiBF,WAASG,eAAgBH,EAAAA,SAASI,iBAC5FC,EAAcb,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AAKlB,KAAWK,EAAAA,aAC/CJ,EAAS,KACV,OAASrG,GACR,IAAIiC,EAAkB,uBAElBjC,aAAiBiH,QACpBhF,EAAUrC,EAAYI,EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAEX,CACAoE,EAAS,UA2CTpH,mBAxCgCkH,MAAOC,EACvCC,KACA,UACOkB,EAAAA,6BAA6B,IAAKnB,KAAWK,EAAAA,aACnDJ,EAAS,iCAAiC,EAC3C,OAASrG,GACR,IAAIiC,EAAkB,uBAClBjC,aAAiBiH,QACpBhF,EAAUrC,EAAYI,EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAAS,GAEpB,GA8BAuF,0BA3BuCrB,MAAOC,EAC9CC,KACA,UACOoB,EAAAA,oCAAoC,IAAKrB,KAAWK,EAAAA,aAC1DJ,EAAS,iCAAiC,EAC3C,OAASrG,GACR,IAAIiC,EAAkB,uBAClBjC,aAAiBiH,QACpBhF,EAAUrC,EAAYI,EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAAS,GAEpB;AAmBD,aAAQ/C,EAAYwI,SAAZ,CAAqBC,MAAOzB,EAAS7G"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/contexts/AuthContext.tsx"],"sourcesContent":["import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { /* useLocation, */ useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport { getApiConfig } from '../utils/api-config';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format: string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n\tcompany_id: string;\n}\n\ninterface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n}\n\n// Base URL will be set at runtime via ERPUIProvider\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\t// const location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\n\t// const initAuth = async () => {\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tconst storedUser: ERPUser =\n\t// \t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) || null;\n\t// \tif (storedToken && storedUser) {\n\t// \t\ttry {\n\t// \t\t\tconst userData = await getV1UserId({\n\t// \t\t\t\t'x-token': storedToken,\n\t// \t\t\t\tid: String(storedUser.id)\n\t// \t\t\t});\n\t// \t\t} catch (error) {\n\t// \t\t}\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \tif (storedToken && storedUser) {\n\t// \t\tsetUser(storedUser);\n\t// setLoading(false);\n\t// \t} else {\n\t// \t\thandleLogout();\n\t// setLoading(false);\n\t// \t}\n\t// };\n\n\t// useEffect(() => {\n\t// setLoading(true)\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetUser(null);\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \teslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [location.pathname]);\n\n\t// useEffect(() => {\n\t// \tsetLoading(true);\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetLoading(false);\n\t// \t\tnavigate(Pathname.LOGIN);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst publicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tif (!publicRoutes.includes(currentPath)) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst config = getApiConfig();\n\t\tconst socket = io(config.socketBaseUrl, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\t\tconst { message, notificationData } = data || {};\n\t\t\tlet notificationContent: React.ReactNode = message;\n\t\t\tconst url = getNotificationUrl(data);\n\n\t\t\tif (notificationData) {\n\t\t\t\tconst { notification_type } = notificationData;\n\n\t\t\t\tswitch (notification_type) {\n\t\t\t\t\tcase 'addApprovers': {\n\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tenqueueSnackbar(String(message), {\n\t\t\t\tvariant: 'default',\n\t\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\t\tautoHideDuration: 5000,\n\t\t\t\tcontent: (key) => (\n\t\t\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url} />\n\t\t\t\t),\n\t\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\twindow.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\twindow.localStorage.setItem(\n\t\t\t\t\t\tauth.storageUserKeyName,\n\t\t\t\t\t\tJSON.stringify(userData)\n\t\t\t\t\t);\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tnavigate(Pathname.DASHBOARD);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tdelete data.token;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageAccessKeyName);\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n"],"names":["defaultProvider","user","loading","authToken","setUser","setLoading","Boolean","login","Promise","resolve","logout","forgotPassword","resetPassword","changePassword","changeUserPassword","AuthContext","createContext","children","useState","setAuthToken","socketRef","useRef","navigate","useNavigate","isJsonParse","string","JSON","parse","error","useEffect","storedToken","window","localStorage","getItem","auth","storageTokenKeyName","storedUser","storageUserKeyName","publicRoutes","Pathname","LOGIN","FORGOT_PASSWORD","RESET_PASSWORD","CHANGE_PASSWORD","currentPath","location","pathname","includes","current","_a","disconnect","config","getApiConfig","socket","io","socketBaseUrl","transports","token","path","on","onAny","event","args","data","message","notificationData","notificationContent","url","moduleName","moduleId","routeMap","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","toString","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","VIEW_CASH_EXPENSE","VIEW_CREDIT_NOTE","VIEW_DEBIT_NOTE","VIEW_EXPENSE_REIMBURSEMENT","VIEW_JOURNAL_ENTRY","VIEW_PAYMENT_ENTRY","VIEW_PURCHASE_INVOICE","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","vra","VIEW_VENDOR_RETURNS","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","VIEW_SALES_ORDER","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","VIEW_AGREEMENT","VIEW_CROSS_HIRE_ORDER","VIEW_CROSS_HIRE_REQUEST","toLowerCase","call","getNotificationUrl","notification_type","enqueueSnackbar","String","variant","anchorOrigin","vertical","horizontal","autoHideDuration","content","key","jsx","CustomSnackbar","snackbarKey","linkUrl","errMsg","values","async","params","callback","DASHBOARD","loginUser","postV1AuthLogin","getToken","success","setItem","userData","full_name","first_name","last_name","stringify","Error","removeItem","storageAccessKeyName","postV1AuthForgotPassword","postV1AuthResetPassword","postV1AuthChangePassword","postV1AuthChangeUserPassword","changeUserPasswordByAdmin","postV1AuthChangeUserPasswordByAdmin","Provider","value"],"mappings":"0+BAuIA,MAAMA,EAAwC,CAC7CC,KAAM,KACNC,SAAS,EACTC,UAAW,GACXC,QAAS,IAAM,KACfC,WAAY,IAAMC,QAClBC,MAAO,IAAMC,QAAQC,UACrBC,OAAQ,IAAMF,QAAQC,UACtBE,eAAgB,IAAMH,QAAQC,UAC9BG,cAAe,IAAMJ,QAAQC,UAC7BI,eAAgB,IAAML,QAAQC,UAC9BK,mBAAoB,IAAMN,QAAQC,WAG7BM,EAAcC,EAAAA,cAAchB,8CAQgB,EAAGiB,eAEpD,MAAOhB,EAAMG,GAAWc,EAAAA,SAASlB,EAAgBC,OAC1CE,EAAWgB,GAAgBD,EAAAA,SAAiB,KAC5ChB,EAASG,GAAca,EAAAA,SAASlB,EAAgBE,SACjDkB,EAAYC,EAAAA,OAAsB,MAGlCC,EAAWC,EAAAA,cAEXC,EAAeC,IACpB,IAAKA,EAAQ,OAAO,EAEpB,IACC,OAAOC,KAAKC,MAAMF,EACnB,OAASG,GACR,OAAO,CACR,GAiIDC,EAAAA,UAAU,KACTxB,GAAW,GAEX,MAAMyB,EAAcC,OAAOC,aAAaC,QAAQC,EAAAA,KAAKC,qBAC/CC,EACLZ,EAAYO,OAAOC,aAAaC,QAAQC,EAAAA,KAAKG,sBAAwB,KAChEC,EAAe,CAACC,EAAAA,SAASC,MAAOD,EAAAA,SAASE,gBAAiBF,WAASG,eAAgBH,EAAAA,SAASI,iBAC5FC,EAAcb,OAAOc,SAASC,SAC/BhB,GAAgBM,GAMpBhC,EAAQgC,GACRjB,EAAaW,GAAe,IAC5BzB,GAAW,KAPNiC,EAAaS,SAASH,IAC1BtB,EAASiB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BhF,EAAUxC,EAAYI,EAAMoC,SAASA,SAAWpC,EAAMoC,QACtDoE,EAASpE,GAEX,CACAoE,EAAS,UA2CTtH,mBAxCgCoH,MAAOC,EACvCC,KACA,UACOkB,EAAAA,6BAA6B,IAAKnB,KAAWK,EAAAA,aACnDJ,EAAS,iCAAiC,EAC3C,OAASxG,GACR,IAAIoC,EAAkB,uBAClBpC,aAAiBoH,QACpBhF,EAAUxC,EAAYI,EAAMoC,SAASA,SAAWpC,EAAMoC,QACtDoE,EAASpE,GAAS,GAEpB,GA8BAuF,0BA3BuCrB,MAAOC,EAC9CC,KACA,UACOoB,EAAAA,oCAAoC,IAAKrB,KAAWK,EAAAA,aAC1DJ,EAAS,iCAAiC,EAC3C,OAASxG,GACR,IAAIoC,EAAkB,uBAClBpC,aAAiBoH,QACpBhF,EAAUxC,EAAYI,EAAMoC,SAASA,SAAWpC,EAAMoC,QACtDoE,EAASpE,GAAS,GAEpB;AAmBD,aAAQjD,EAAY0I,SAAZ,CAAqBC,MAAOzB,EAAShH"}
|
|
@@ -5,6 +5,7 @@ import { DEFAULT_LANG } from "../../constants/all-language/index.esm.js";
|
|
|
5
5
|
import { getToken } from "../../utils/common/index.esm.js";
|
|
6
6
|
import { setBaseUrl } from "../../api-client/api.rbac/api/index.esm.js";
|
|
7
7
|
import { getV1Languages } from "../../api-client/api.system-feature/api/index.esm.js";
|
|
8
|
+
import { getApiConfig } from "../../utils/api-config/index.esm.js";
|
|
8
9
|
const FALLBACK_LANGUAGES = [
|
|
9
10
|
"en",
|
|
10
11
|
// English as primary fallback
|
|
@@ -80,7 +81,7 @@ const LanguageProvider = ({ children }) => {
|
|
|
80
81
|
const [state, dispatch] = useReducer(languageReducer, initialState);
|
|
81
82
|
const { i18n } = useTranslation();
|
|
82
83
|
useEffect(() => {
|
|
83
|
-
setBaseUrl(`${
|
|
84
|
+
setBaseUrl(`${getApiConfig().backendBaseUrl}/rbac`);
|
|
84
85
|
}, []);
|
|
85
86
|
const safeChangeLanguage = async (langCode) => {
|
|
86
87
|
if (i18n && typeof i18n.changeLanguage === "function") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[], \n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true, \n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n \n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n \n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n \n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n \n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: bestLanguage,\n isFallback \n });\n applyLanguageSettings(bestLanguage);\n \n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n \n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n \n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n \n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n \n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n \n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n \n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n \n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["setRoleURL"],"mappings":";;;;;;;AA8BA,MAAM,qBAAqB;AAAA,EACzB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAGA,MAAM,wBAAwB,OAAkB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAWA,MAAM,eAA8B;AAAA,EAClC,WAAW,CAAA;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AACpB;AAGA,MAAM,4BAA4B,CAChC,WACA,kBACqB;AACrB,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AAGjD,MAAI,eAAe;AACjB,UAAM,YAAY,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,aAAa;AACpE,QAAI,UAAW,QAAO;AAAA,EACxB;AAGA,aAAW,gBAAgB,oBAAoB;AAC7C,UAAM,WAAW,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,YAAY;AAClE,QAAI,SAAU,QAAO;AAAA,EACvB;AAGA,SAAO,UAAU,CAAC,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AAC,eAAe;AAE1C,eAAS,EAAE,MAAM,2BAA2B,SAAS,mBAAmB;AACxE,eAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACb;AAED,eAAS,KAAK,MAAM;AACpB,yBAAmB,IAAI;AACvB,mBAAa,QAAQ,aAAa,IAAI;AAEtC,cAAQ,KAAK,+CAA+C;AAAA,IAC9D;AAAA,EACF;AAGA,QAAM,iBAAiB,CAAC,aAA2B;AACjD,UAAM,mBAAmB,MAAM,UAAU,KAAK,CAAC,SAAS,KAAK,SAAS,QAAQ;AAE9E,QAAI,kBAAkB;AACpB,eAAS,EAAE,MAAM,wBAAwB,SAAS,kBAAkB;AACpE,eAAS,EAAE,MAAM,uBAAuB,SAAS,OAAO;AACxD,4BAAsB,gBAAgB;AAAA,IACxC,OAAO;AACL,cAAQ,MAAM,aAAa,QAAQ,oCAAoC;AAGvE,YAAM,kBAAkB,sBAAA;AACxB,eAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACb;AACD,4BAAsB,eAAe;AAAA,IACvC;AAAA,EACF;AAGA,YAAU,MAAM;AACd,mBAAA;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,QAAM,eAAoC;AAAA,IACxC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EAAA;AAGF,6BACG,gBAAgB,UAAhB,EAAyB,OAAO,cAE9B,UACH;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\nimport { getApiConfig } from '@/utils';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[],\n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true,\n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${getApiConfig().backendBaseUrl}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n\n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n\n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n\n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n\n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: bestLanguage,\n isFallback\n });\n applyLanguageSettings(bestLanguage);\n\n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n\n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n\n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n\n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n\n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n\n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n\n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["setRoleURL"],"mappings":";;;;;;;;AA+BA,MAAM,qBAAqB;AAAA,EACzB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAGA,MAAM,wBAAwB,OAAkB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAWA,MAAM,eAA8B;AAAA,EAClC,WAAW,CAAA;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AACpB;AAGA,MAAM,4BAA4B,CAChC,WACA,kBACqB;AACrB,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AAGjD,MAAI,eAAe;AACjB,UAAM,YAAY,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,aAAa;AACpE,QAAI,UAAW,QAAO;AAAA,EACxB;AAGA,aAAW,gBAAgB,oBAAoB;AAC7C,UAAM,WAAW,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,YAAY;AAClE,QAAI,SAAU,QAAO;AAAA,EACvB;AAGA,SAAO,UAAU,CAAC,KAAK;AACzB;AAGA,MAAM,kBAAkB,CAAC,OAAsB,WAA0C;AACvF,UAAQ,OAAO,MAAA;AAAA,IACb,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW;AAAA,QACX,OAAO;AAAA,MAAA;AAAA,IAEX,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW,OAAO;AAAA,QAClB,WAAW;AAAA,QACX,OAAO;AAAA,QACP,kBAAkB;AAAA,MAAA;AAAA,IAEtB,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW;AAAA,QACX,OAAO,OAAO;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I,kBAAkB;AACpB,eAAS,EAAE,MAAM,wBAAwB,SAAS,kBAAkB;AACpE,eAAS,EAAE,MAAM,uBAAuB,SAAS,OAAO;AACxD,4BAAsB,gBAAgB;AAAA,IACxC,OAAO;AACL,cAAQ,MAAM,aAAa,QAAQ,oCAAoC;AAGvE,YAAM,kBAAkB,sBAAA;AACxB,eAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACb;AACD,4BAAsB,eAAe;AAAA,IACvC;AAAA,EACF;AAGA,YAAU,MAAM;AACd,mBAAA;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,QAAM,eAAoC;AAAA,IACxC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EAAA;AAGF,6BACG,gBAAgB,UAAhB,EAAyB,OAAO,cAE9B,UACH;AAEJ;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),
|
|
2
|
-
return e.jsx(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),n=require("react-i18next"),t=require("../../constants/all-language/index.js"),i=require("../../utils/common/index.js"),l=require("../../api-client/api.rbac/api/index.js"),r=require("../../api-client/api.system-feature/api/index.js"),o=require("../../utils/api-config/index.js");const c=["en","en-US",t.DEFAULT_LANG],s={languages:[],currentLanguage:null,isLoading:!1,error:null,isFallbackActive:!1},d=(e,a)=>{switch(a.type){case"FETCH_LANGUAGES_START":return{...e,isLoading:!0,error:null};case"FETCH_LANGUAGES_SUCCESS":return{...e,languages:a.payload,isLoading:!1,error:null,isFallbackActive:!1};case"FETCH_LANGUAGES_ERROR":return{...e,isLoading:!1,error:a.payload,isFallbackActive:!0};case"SET_CURRENT_LANGUAGE":return{...e,currentLanguage:a.payload,isFallbackActive:a.isFallback||!1};case"SET_FALLBACK_ACTIVE":return{...e,isFallbackActive:a.payload};default:return e}},u=a.createContext(void 0);exports.LanguageContext=u,exports.LanguageProvider=({children:t})=>{const[g,E]=a.useReducer(d,s),{i18n:A}=n.useTranslation();a.useEffect(()=>{l.setBaseUrl(`${o.getApiConfig().backendBaseUrl}/rbac`)},[]);const p=async e=>{if(A&&"function"==typeof A.changeLanguage)try{await A.changeLanguage(e)}catch(a){}},_=e=>{document.body.dir=e.direction||"ltr",p(e.code),localStorage.setItem("_language",e.code)},y=async()=>{var e,a;try{E({type:"FETCH_LANGUAGES_START"});const n=await r.getV1Languages({order:"id:1",filters:"(is_active.in=[1])",...i.getToken()}),t=(null==(e=null==n?void 0:n.data)?void 0:e.languages)||[],l=null==(a=null==t?void 0:t.filter(e=>null==e?void 0:e.is_active))?void 0:a.map(e=>({label:null==e?void 0:e.name,code:null==e?void 0:e.code,direction:null==e?void 0:e.direction}));l.some(e=>"en"===e.code)||l.unshift({code:"en",label:"English",direction:"ltr"}),E({type:"FETCH_LANGUAGES_SUCCESS",payload:l});const o=localStorage.getItem("_language"),s=((e,a)=>{if(!e||0===e.length)return null;if(a){const n=e.find(e=>e.code===a);if(n)return n}for(const n of c){const a=e.find(e=>e.code===n);if(a)return a}return e[0]||null})(l,o||void 0);if(s){const e=o&&o!==s.code;E({type:"SET_CURRENT_LANGUAGE",payload:s,isFallback:e}),_(s)}}catch(n){const e=n instanceof Error?n.message:"Failed to fetch languages";E({type:"FETCH_LANGUAGES_ERROR",payload:e});const a={code:"en",label:"English",direction:"ltr"};E({type:"FETCH_LANGUAGES_SUCCESS",payload:[a]}),E({type:"SET_CURRENT_LANGUAGE",payload:a,isFallback:!0}),document.body.dir="ltr",p("en"),localStorage.setItem("_language","en")}};a.useEffect(()=>{y()},[]);const L={...g,changeLanguage:e=>{const a=g.languages.find(a=>a.code===e);if(a)E({type:"SET_CURRENT_LANGUAGE",payload:a}),E({type:"SET_FALLBACK_ACTIVE",payload:!1}),_(a);else{const e={code:"en",label:"English",direction:"ltr"};E({type:"SET_CURRENT_LANGUAGE",payload:e,isFallback:!0}),_(e)}},fetchLanguages:y};/* @__PURE__ */
|
|
2
|
+
return e.jsx(u.Provider,{value:L,children:t})},exports.default=u;
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[], \n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true, \n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n \n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n \n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n \n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n \n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: bestLanguage,\n isFallback \n });\n applyLanguageSettings(bestLanguage);\n \n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n \n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n \n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n \n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n \n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n \n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n \n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n \n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["FALLBACK_LANGUAGES","DEFAULT_LANG","initialState","languages","currentLanguage","isLoading","error","isFallbackActive","languageReducer","state","action","type","payload","isFallback","LanguageContext","createContext","children","dispatch","useReducer","i18n","useTranslation","useEffect","setRoleURL","safeChangeLanguage","async","langCode","changeLanguage","applyLanguageSettings","language","document","body","dir","direction","code","localStorage","setItem","fetchLanguages","response","getV1Languages","order","filters","getToken","data","_a","_b","filter","d","is_active","map","label","name","some","lang","unshift","savedLangCode","getItem","bestLanguage","preferredCode","length","preferred","find","fallbackCode","fallback","findBestAvailableLanguage","errorMessage","Error","message","englishFallback","contextValue","selectedLanguage","Provider","value"],"mappings":"mWA8BA,MAAMA,EAAqB,CACzB,KACA,QACAC,EAAAA,cAmBIC,EAA8B,CAClCC,UAAW,GACXC,gBAAiB,KACjBC,WAAW,EACXC,MAAO,KACPC,kBAAkB,GA2BdC,EAAkB,CAACC,EAAsBC,KAC7C,OAAQA,EAAOC,MACb,I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AAS,CAAEN,KAAM,uBAAwBC,QAASyD,IAClDpD,EAAS,CAAEN,KAAM,sBAAuBC,SAAS,IACjDe,EAAsB0C,OACjB,CAIL,MAAMF,EAlNkB,CAC5BlC,KAAM,KACNgB,MAAO,UACPjB,UAAW,OAgNPf,EAAS,CACPN,KAAM,uBACNC,QAASuD,EACTtD,YAAY,IAEdc,EAAsBwC,EACxB,GAYA/B;AAGF,aACGtB,EAAgBwD,SAAhB,CAAyBC,MAAOH,EAE9BpD"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\nimport { getApiConfig } from '@/utils';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[],\n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true,\n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${getApiConfig().backendBaseUrl}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n\n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n\n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n\n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n\n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: bestLanguage,\n isFallback\n });\n applyLanguageSettings(bestLanguage);\n\n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n\n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n\n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n\n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n\n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n\n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n\n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["FALLBACK_LANGUAGES","DEFAULT_LANG","initialState","languages","currentLanguage","isLoading","error","isFallbackActive","languageReducer","state","action","type","payload","isFallback","LanguageContext","createContext","children","dispatch","useReducer","i18n","useTranslation","useEffect","setRoleURL","getApiConfig","backendBaseUrl","safeChangeLanguage","async","langCode","changeLanguage","applyLanguageSettings","language","document","body","dir","direction","code","localStorage","setItem","fetchLanguages","response","getV1Languages","order","filters","getToken","data","_a","_b","filter","d","is_active","map","label","name","some","lang","unshift","savedLangCode","getItem","bestLanguage","preferredCode","length","preferred","find","fallbackCode","fallback","findBestAvailableLanguage","errorMessage","Error","message","englishFallback","contextValue","selectedLanguage","Provider","value"],"mappings":"gZA+BA,MA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BW,aAAaC,QAAQ,YAAa,KAGpC,GA0BFhB,EAAAA,UAAU,KACRiB,KAEC,IAEH,MAAMgC,EAAoC,IACrC7D,EACHmB,eA7BsBD,IACtB,MAAM4C,EAAmB9D,EAAMN,UAAU2D,KAAMR,GAASA,EAAKnB,OAASR,GAEtE,GAAI4C,EACFtD,EAAS,CAAEN,KAAM,uBAAwBC,QAAS2D,IAClDtD,EAAS,CAAEN,KAAM,sBAAuBC,SAAS,IACjDiB,EAAsB0C,OACjB,CAIL,MAAMF,EAlNkB,CAC5BlC,KAAM,KACNgB,MAAO,UACPjB,UAAW,OAgNPjB,EAAS,CACPN,KAAM,uBACNC,QAASyD,EACTxD,YAAY,IAEdgB,EAAsBwC,EACxB,GAYA/B;AAGF,aACGxB,EAAgB0D,SAAhB,CAAyBC,MAAOH,EAE9BtD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
var define_process_env_default = {};
|
|
3
2
|
const MATERIAL_CONSTANTS = {
|
|
4
3
|
STEEL_DENSITY: 7.85,
|
|
5
4
|
LENGTH_CONVERSION_FACTOR: 1e3,
|
|
@@ -155,7 +154,7 @@ const useMaterialCalculations = (formValues) => {
|
|
|
155
154
|
const boardsWeightResult = calculateBoardsWeight(formValues);
|
|
156
155
|
const steelWeightResult = calculateSteelWeight(formValues);
|
|
157
156
|
const materialWeightResult = calculateTubeMaterialWeight(formValues);
|
|
158
|
-
if (
|
|
157
|
+
if (process.env.NODE_ENV === "development") {
|
|
159
158
|
[totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult].filter((result) => !result.isValid && result.error).forEach((result) => console.warn("Calculation warning:", result.error));
|
|
160
159
|
}
|
|
161
160
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":[],"mappings":";;AAIA,MAAM,qBAAqB;AAAA,EACzB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,cAAc;AAAA,IACZ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;AAgDA,MAAM,kBAAkB,CAAC,UAAyE;AAChG,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,WAAO,EAAE,OAAO,GAAG,SAAS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,cAAc,mBAAmB;AAAA,MACjC,cAAc,mBAAmB;AAAA,MACjC,aAAa,kBAAkB;AAAA,MAC/B,gBAAgB,qBAAqB;AAAA,IAAA;AAAA,EAEzC,GAAG,CAAC,cAAc,UAAU,CAAC,CAAC;AAE9B,SAAO;AACT;AAMO,MAAM,qBAAqB,CAAC,eAAuE;AACxG,QAAM,SAAmB,CAAA;AACzB,QAAM,EAAE,WAAW,WAAA,IAAe;AAGlC,MAAI,cAAc,EAAE,cAAc,mBAAmB,eAAe;AAClE,WAAO,KAAK,uBAAuB,UAAU,EAAE;AAAA,EACjD;AAGA,MAAI,aAAa,CAAC,CAAC,SAAS,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":[],"mappings":";AAIA,MAAM,qBAAqB;AAAA,EACzB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,cAAc;AAAA,IACZ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;AAgDA,MAAM,kBAAkB,CAAC,UAAyE;AAChG,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,cAAA;AAAA,EAC5C;AAEA,QAAM,SAAS,OAAO,UAAU,WAAW,WAAW,MAAM,KAAA,CAAM,IAAI,OAAO,KAAK;AAElF,MAAI,MAAM,MAAM,GAAG;AACjB,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,wBAAA;AAAA,EAC5C;AAEA,MAAI,CAAC,SAAS,MAAM,GAAG;AACrB,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,uBAAA;AAAA,EAC5C;AAEA,SAAO,EAAE,OAAO,QAAQ,SAAS,KAAA;AACnC;AAKA,MAAM,0BAA0B,IAAI,WAAqD;AACvF,SAAO,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S,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const t={STEEL_DENSITY:7.85,LENGTH_CONVERSION_FACTOR:1e3,TUBE_CALCULATION_FACTOR:.024662,COIL_WEIGHTS:{GI:2879.95,HR:2356.59}},a=e=>{if(null==e||""===e)return{value:0,isValid:!1,error:"Empty value"};const t="string"==typeof e?parseFloat(e.trim()):Number(e);return isNaN(t)?{value:0,isValid:!1,error:"Invalid number format"}:isFinite(t)?{value:t,isValid:!0}:{value:0,isValid:!1,error:"Number is not finite"}},i=(...e)=>e.every(e=>{const t=a(e);return t.isValid&&t.value>0}),l=e=>e?["face_width","bending","height","total_width","boards_thickness","boards_length","steel_length","steel_width","steel_thickness","steel_type","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length"].map(t=>`${t}:${e[t]??""}`).join("|"):"empty";exports.getAvailableSteelTypes=()=>Object.keys(t.COIL_WEIGHTS),exports.getAvailableTubeTypes=()=>["Round","Square","Rectangle"],exports.useMaterialCalculations=r=>e.useMemo(()=>{if(!r)return{totalWidth:0,materialUnit:0,boardsWeight:0,steelWeight:0,materialWeight:0};const e=(e=>{const{face_width:t,bending:l,height:r}=e;if(!i(t,l,r))return{value:0,isValid:!1,error:"Invalid input values for boards total width calculation"};const s=a(t),u=a(l),n=a(r);return[s,u,n].every(e=>e.isValid)?{value:2*(n.value+u.value)+s.value,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),l=(e=>{const{steel_type:a}=e;return a?a in t.COIL_WEIGHTS?{value:t.COIL_WEIGHTS[a],isValid:!0}:{value:0,isValid:!1,error:`Unsupported steel type: ${a}`}:{value:0,isValid:!1,error:"Steel type not specified"}})(r),s=(e=>{const{total_width:l,boards_thickness:r,boards_length:s}=e;if(!i(l,r,s))return{value:0,isValid:!1,error:"Invalid input values for boards weight calculation"};const u=a(l),n=a(r),o=a(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*(o.value/t.LENGTH_CONVERSION_FACTOR)*t.STEEL_DENSITY,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),u=(e=>{const{steel_length:l,steel_width:r,steel_thickness:s}=e;if(!i(l,r,s))return{value:0,isValid:!1,error:"Invalid input values for steel weight calculation"};const u=a(l),n=a(r),o=a(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*o.value*t.STEEL_DENSITY/t.LENGTH_CONVERSION_FACTOR,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),n=(e=>{const{tube_type:i,tube_od:l,shape_width:r,shape_height:s,material_thickness:u,material_length:n}=e;if(!i)return{value:0,isValid:!1,error:"Tube type not specified"};const o=a(u),d=a(n);if(!o.isValid||!d.isValid)return{value:0,isValid:!1,error:"Invalid thickness or length values"};let v=0;switch(i){case"Round":{const e=a(l);if(!e.isValid||e.value<=o.value)return{value:0,isValid:!1,error:"Invalid outer diameter for round tube"};v=(e.value-o.value)*o.value*t.TUBE_CALCULATION_FACTOR*d.value;break}case"Square":case"Rectangle":{const e=a(r),i=a(s);if(!e.isValid||!i.isValid)return{value:0,isValid:!1,error:"Invalid width or height for rectangular tube"};v=(2*(e.value+i.value)/Math.PI-o.value)*o.value*t.TUBE_CALCULATION_FACTOR*d.value;break}default:return{value:0,isValid:!1,error:`Unsupported tube type: ${i}`}}return{value:Math.max(0,v),isValid:!0}})(r);return"development"===process.env.NODE_ENV&&[e,l,s,u,n].filter(e=>!e.isValid&&e.error).forEach(e=>{}),{totalWidth:e.value,materialUnit:l.value,boardsWeight:s.value,steelWeight:u.value,materialWeight:n.value}},[l(r)]),exports.validateFormValues=e=>{const a=[],{tube_type:i,steel_type:l}=e;return l&&!(l in t.COIL_WEIGHTS)&&a.push(`Invalid steel type: ${l}`),i&&!["Round","Square","Rectangle"].includes(i)&&a.push(`Invalid tube type: ${i}`),{isValid:0===a.length,errors:a}};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":["MATERIAL_CONSTANTS","STEEL_DENSITY","LENGTH_CONVERSION_FACTOR","TUBE_CALCULATION_FACTOR","COIL_WEIGHTS","GI","HR","safeParseNumber","value","isValid","error","parsed","parseFloat","trim","Number","isNaN","isFinite","validatePositiveNumbers","values","every","result","createMemoKey","formValues","map","field","join","Object","keys","useMemo","totalWidth","materialUnit","boardsWeight","steelWeight","materialWeight","totalWidthResult","face_width","bending","height","faceWidthResult","bendingResult","heightResult","r","calculateBoardsTotalWidth","materialUnitResult","steel_type","calculateMaterialUnit","boardsWeightResult","total_width","boards_thickness","boards_length","thicknessResult","lengthResult","calculateBoardsWeight","steelWeightResult","steel_length","steel_width","steel_thickness","widthResult","calculateSteelWeight","materialWeightResult","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length","weight","odResult","Math","PI","max","calculateTubeMaterialWeight","define_process_env_default","NODE_ENV","filter","forEach","errors","push","includes","length"],"mappings":"gGAIA,MAAMA,EAAqB,CACzBC,cAAe,KACfC,yBAA0B,IAC1BC,wBAAyB,QACzBC,aAAc,CACZC,GAAI,QACJC,GAAI,UAkDFC,EAAmBC,IACvB,GAAIA,SAAmD,KAAVA,EAC3C,MAAO,CAAEA,MAAO,EAAGC,SAAS,EAAOC,MAAO,eAG5C,MAAMC,EAA0B,iBAAVH,EAAqBI,WAAWJ,EAAMK,QAAUC,OAAON,GAE7E,OAAIO,MAAMJ,GACD,CAAEH,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBAGvCM,SAASL,GAIP,CAAEH,MAAOG,EAAQF,SAAS,GAHxB,CAAED,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBASxCO,EAA0B,IAAIC,IAC3BA,EAAOC,M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,EAAmB,IACnBhB,UAAEA,EAAAhB,WAAWA,GAAetB,EAYlC,OATIsB,KAAgBA,KAAc5C,EAAmBI,eACnDwE,EAAOC,KAAK,uBAAuBjC,KAIjCgB,IAAc,CAAC,QAAS,SAAU,aAAakB,SAASlB,IAC1DgB,EAAOC,KAAK,sBAAsBjB,KAG7B,CAAEnD,QAA2B,IAAlBmE,EAAOG,OAAcH"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":["MATERIAL_CONSTANTS","STEEL_DENSITY","LENGTH_CONVERSION_FACTOR","TUBE_CALCULATION_FACTOR","COIL_WEIGHTS","GI","HR","safeParseNumber","value","isValid","error","parsed","parseFloat","trim","Number","isNaN","isFinite","validatePositiveNumbers","values","every","result","createMemoKey","formValues","map","field","join","Object","keys","useMemo","totalWidth","materialUnit","boardsWeight","steelWeight","materialWeight","totalWidthResult","face_width","bending","height","faceWidthResult","bendingResult","heightResult","r","calculateBoardsTotalWidth","materialUnitResult","steel_type","calculateMaterialUnit","boardsWeightResult","total_width","boards_thickness","boards_length","thicknessResult","lengthResult","calculateBoardsWeight","steelWeightResult","steel_length","steel_width","steel_thickness","widthResult","calculateSteelWeight","materialWeightResult","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length","weight","odResult","Math","PI","max","calculateTubeMaterialWeight","process","env","NODE_ENV","filter","forEach","errors","push","includes","length"],"mappings":"2FAIA,MAAMA,EAAqB,CACzBC,cAAe,KACfC,yBAA0B,IAC1BC,wBAAyB,QACzBC,aAAc,CACZC,GAAI,QACJC,GAAI,UAkDFC,EAAmBC,IACvB,GAAIA,SAAmD,KAAVA,EAC3C,MAAO,CAAEA,MAAO,EAAGC,SAAS,EAAOC,MAAO,eAG5C,MAAMC,EAA0B,iBAAVH,EAAqBI,WAAWJ,EAAMK,QAAUC,OAAON,GAE7E,OAAIO,MAAMJ,GACD,CAAEH,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBAGvCM,SAASL,GAIP,CAAEH,MAAOG,EAAQF,SAAS,GAHxB,CAAED,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBASxCO,EAA0B,IAAIC,IAC3BA,EAAOC,MAAMX,IAClB,MAAMY,EAASb,EAAgBC,GAC/B,OAAOY,EAAOX,SAAWW,EAAOZ,MAAQ,IAOtCa,EAAiBC,GAChBA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