@erpsquad/common 1.3.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -826,9 +826,8 @@ MIT License - see the [LICENSE](LICENSE) file for details.
826
826
 
827
827
  ## 🆘 Support
828
828
 
829
- - **Documentation**: [Library Docs](https://github.com/erpforce/common#readme)
830
- - **Issues**: [GitHub Issues](https://github.com/erpforce/common/issues)
831
- - **Discussions**: [GitHub Discussions](https://github.com/erpforce/common/discussions)
829
+ - **Documentation**: [Library Docs](https://github.com/erpforce/erpforce-common-hub-fe/tree/dev#readme)
830
+ - **Issues**: [GitHub Issues](https://github.com/erpforce/erpforce-common-hub-fe/issues)
832
831
  - **NPM Package**: [@erpsquad/common](https://www.npmjs.com/package/@erpsquad/common)
833
832
  - **Changelog**: [CHANGELOG.md](./CHANGELOG.md)
834
833
  - **Migration Guide**: [MIGRATION.md](./MIGRATION.md)
package/dist/index.esm.js CHANGED
@@ -22,11 +22,11 @@ import { c as getV1Settings } from "./api-CnNWjdg1.esm.js";
22
22
  import { d as d6, e as e4, f as f4, h as h4, i as i4, j as j3, k as k3, l as l3, s as s2, b as b14 } from "./api-CnNWjdg1.esm.js";
23
23
  import { AccordionActions, AccordionDetails, AccordionSummary, AlertTitle, Autocomplete, AvatarGroup, Backdrop, Badge, BottomNavigation, BottomNavigationAction, Box as Box2, ButtonBase, ButtonGroup, Card, CardActionArea, CardActions, CardContent, CardHeader, CardMedia, ClickAwayListener, Collapse, Container, CssBaseline as CssBaseline2, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Drawer, Fab, Fade, FilledInput, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, GlobalStyles, Grid, Grow, Hidden, Icon, IconButton, ImageList, ImageListItem, ImageListItemBar, Input, InputAdornment, InputBase, InputLabel, LinearProgress, Link, ListItem, ListItemAvatar, ListItemButton, ListItemIcon, ListItemSecondaryAction, ListItemText, ListSubheader, Accordion, Alert, AppBar, Avatar, Breadcrumbs, Button, Checkbox, Chip, CircularProgress, Dialog, List, Menu, Modal, Pagination, Radio, Select, Snackbar, Tabs, TextField, Tooltip, Typography, MenuItem, MenuList, MobileStepper, NativeSelect, NoSsr, OutlinedInput, PaginationItem, Paper, Popover, Popper, Portal, RadioGroup, Rating, ScopedCssBaseline, Slider, SnackbarContent, SpeedDial, SpeedDialAction, SpeedDialIcon, Stack, Step, StepButton, StepContent, StepLabel, Stepper, SvgIcon, SwipeableDrawer, Switch, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, TextareaAutosize, ToggleButton, ToggleButtonGroup, Toolbar, Zoom, useMediaQuery, useScrollTrigger } from "@mui/material";
24
24
  import { default as default2 } from "dayjs";
25
- import { C as C4, a as a15, e as e5, j as j4, i as i5, c as c16, l as l4, h as h5, b as b15, d as d7, f as f5, g as g3, k as k4, m as m4, p as p3, u as u3 } from "./migration-utils-DgL-o5H7.esm.js";
25
+ import { C as C4, o as o3, n as n4, M as M5, S as S3, a as a15, e as e5, j as j4, i as i5, c as c16, l as l4, h as h5, b as b15, d as d7, f as f5, g as g3, k as k4, m as m4, p as p3, u as u3 } from "./menu-filter-D6MAKEqM.esm.js";
26
26
  import { a as a16, s as s3 } from "./api-z0lNDG2t.esm.js";
27
27
  import { l as l5 } from "./translations-BFQz0wdK.esm.js";
28
28
  export * from "react-i18next";
29
- import { F as F3, b as b16, f as f6, g as g4, G as G3, h as h6, i as i6, E as E4, r as r4, p as p4, D as D5, o as o3, v as v3, k as k5, z as z3, A as A2, m as m5, d as d8, w as w3, C as C5, B as B3, x as x3, l as l6, n as n4, q as q3, u as u4, t as t5, j as j5, e as e6, c as c17, y as y3, a as a17, s as s4 } from "./store-Cdr3nEX7.esm.js";
29
+ import { F as F3, b as b16, f as f6, g as g4, G as G3, h as h6, i as i6, E as E4, r as r4, p as p4, D as D5, o as o4, v as v3, k as k5, z as z3, A as A2, m as m5, d as d8, w as w3, C as C5, B as B3, x as x3, l as l6, n as n5, q as q3, u as u4, t as t5, j as j5, e as e6, c as c17, y as y3, a as a17, s as s4 } from "./store-Cdr3nEX7.esm.js";
30
30
  import { API_METHOD_GROUPS, createConfiguredApiClient, validateApiClient } from "./redux/index.esm.js";
31
31
  import { b as b17, c as c18, u as u5, a as a18 } from "./hooks-Cu6IOQ9o.esm.js";
32
32
  import { DriveTypes, InventoryTypes, ManufacturingTypes, PurchaseTypes, RbacTypes, RentalTypes, SalesTypes, SystemFeatureTypes, UserApi, UserTypes } from "./api-client/index.esm.js";
@@ -382,7 +382,7 @@ export {
382
382
  FormLabel,
383
383
  bL as FormLoader,
384
384
  bO as FormParser,
385
- FullscreenLayout,
385
+ FullscreenLayout as FullScreenLayout,
386
386
  M as Gantt,
387
387
  GlobalStyles,
388
388
  Grid,
@@ -463,11 +463,14 @@ export {
463
463
  ManufacturingTypes,
464
464
  W as MaterialTable,
465
465
  M2 as Menu,
466
+ o3 as MenuFilter,
467
+ n4 as MenuFilterService,
466
468
  MenuItem,
467
469
  MenuList,
468
470
  MobileStepper,
469
471
  X as Modal,
470
472
  bN as ModalLoader,
473
+ M5 as ModuleAccessService,
471
474
  Y as ModuleButton,
472
475
  aL as MoreIcon,
473
476
  _ as MultiSelect,
@@ -552,6 +555,7 @@ export {
552
555
  StepContent,
553
556
  StepLabel,
554
557
  Stepper,
558
+ S3 as StorageUtils,
555
559
  ah as SubHeaderDoc,
556
560
  SvgIcon,
557
561
  SwipeableDrawer,
@@ -747,7 +751,7 @@ export {
747
751
  r4 as reportsTitleBarSlice,
748
752
  p4 as resetHeaderState,
749
753
  D5 as resetInventoryReportsTitleBarState,
750
- o3 as resetLanguagesState,
754
+ o4 as resetLanguagesState,
751
755
  v3 as resetReportsTitleBarState,
752
756
  k5 as resetShareState,
753
757
  ax2 as responseItemDetailsColumns,
@@ -761,7 +765,7 @@ export {
761
765
  B3 as setInventoryLoading,
762
766
  x3 as setItems,
763
767
  l6 as setLanguages,
764
- n4 as setLanguagesData,
768
+ n5 as setLanguagesData,
765
769
  a92 as setRateBasedOnPriceRules,
766
770
  q3 as setReportsCompanies,
767
771
  u4 as setReportsError,
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./pathname.rental-BbpaQSgg.js"),t=require("./route-page-map-BYGZ0Fm2.js"),r=require("./common-DyuISUDa.js"),o=require("./modules-Ct1hHDvJ.js"),a=require("./index-DFSXVdXk.js"),n=require("./navigation-utils-LF9-2ZD0.js"),s=require("./common-ZGNib3x2.js"),i=require("./index-DcJptCKc.js"),p=require("./use-permissions-rBXbao3-.js"),l=require("./hooks/index.js"),u=require("./theme/index.js"),c=require("./theme-impl-DDVfmrMB.js"),d=require("react/jsx-runtime"),x=require("@mui/material/CssBaseline"),m=require("@mui/material/Box"),g=require("react"),b=require("@mui/material/styles"),f=require("./api-CoR86qOS.js"),y=require("@mui/material"),P=require("dayjs"),T=require("./migration-utils-BFCeKgrc.js"),D=require("./api-VeUt6PG8.js"),S=require("./translations-BQO6LcM0.js"),C=require("react-i18next"),h=require("./store-7xbraBig.js"),I=require("./redux/index.js"),A=require("./hooks-CzoDgYvR.js"),O=require("./api-client/index.js");function L(e){return e&&e.__esModule?e:{default:e}}var j=/* @__PURE__ */L(x),F=/* @__PURE__ */L(m),R=/* @__PURE__ */L(P);let E={};const B=300,M="_is_drawer_open";exports.images=e.images,exports.DEFAULT_LANG=t.DEFAULT_LANG,exports.LANGUAGES=t.LANGUAGES,exports.S3_BUCKET_URL=r.S3_BUCKET_URL,exports.modules=o.modules,exports.Accordion=a.Accordion,exports.ActionBar=a.ActionBar,exports.ActivityArea=a.ActivityArea,exports.ActivityLog=a.ActivityTag$1,exports.ActivityTag=a.ActivityTag,exports.AddCircle=a.AddCircle,exports.Alert=a.Alert,exports.AndroidSwitch=a.Android12Switch,exports.AppBar=a.AppBarWrapper,exports.ApprovalWrapper=a.ApprovalWrapper,exports.AreaLinearChart=a.AreaLineChart,exports.ArrowBidirectional=a.ArrowBidirectional,exports.ArrowCircleDown=a.ArrowCircleDown,exports.ArrowDown=a.ArrowDown,exports.ArrowDownThree=a.ArrowDownThree,exports.ArrowDownTwo=a.ArrowDownTwo,exports.ArrowUpDown=a.ArrowUpDown,exports.ArrowUpTwo=a.ArrowUpTwo,exports.Assignments=a.Assignments,exports.Avatar=a.Avatar,exports.BlankCircle=a.BlankCircle,exports.BlockFiled=a.BlockFiled,exports.Board=a.BoardWrapper,exports.BreadCrumb=a.BreadCrumb,exports.Button=a.Button,exports.CalculationSummary=a.CalculationSummary,exports.Calendar=a.CalendarWrapper,exports.CalendarAdd=a.CalendarAdd,exports.CardWrapper=a.CardWrapper,exports.ChangeUserPasswordModal=a.ChangeUserPasswordModal,exports.ChartLegends=a.ChartLegends,exports.CheckBoxIcon=a.CheckBoxIcon,exports.Checkbox=a.Checkbox,exports.CheckboxSquare=a.CheckboxSquare,exports.ChipGenerator=a.ChipGenerator,exports.ChipOrPlaceholder=a.ChipOrPlaceholder,exports.CircularArrowSetting=a.CircularArrowSetting,exports.Clock=a.Clock,exports.Close=a.Close,exports.CoinOutline=a.CoinOutline,exports.ColorPickerInput=a.ColorPickerInput,exports.ConfirmModal=a.ConfirmPopUp,exports.Copy=a.Copy,exports.CountrySelect=a.CountrySelect,exports.CrossHire=a.CrossHire,exports.CustomGridCard=a.CustomGridCard,exports.CustomToggleSwitch=a.CustomToggleSwitch,exports.Dashboard=a.Dashboard,exports.DashboardCard=a.DashBoardCard,exports.DashboardHeader=a.DashBoardHeader,exports.DatePicker=a.DatePicker,exports.DateRangePicker=a.DateRangePicker,exports.DateTimePicker=a.DateTimePicker,exports.DocumentDownload=a.DocumentDownload,exports.DollarCircle=a.DollarCircle,exports.DollarCircleFilled=a.DollarCircleFilled,exports.DropdownButton=a.DropdownButton,exports.DyanmicTextEditor=a.DyanmicTextEditor,exports.DynamicButton=a.DynamicButton,exports.DynamicCheckBox=a.DynamicCheckBox,exports.DynamicCurrency=a.DynamicCurrency,exports.DynamicDate=a.DynamicDate,exports.DynamicDateRange=a.DynamicDateRange,exports.DynamicDateTime=a.DynamicDateTime,exports.DynamicElementHOC=a.DynamicElementHOC,exports.DynamicInfo=a.DynamicInfo,exports.DynamicInput=a.DynamicInput,exports.DynamicInputSelect=a.DynamicInputSelect,exports.DynamicLayoutWrapper=a.DynamicLayoutWrapper,exports.DynamicMedia=a.DynamicMedia,exports.DynamicModal=a.DynamicModal,exports.DynamicPhone=a.DynamicPhone,exports.DynamicRadioButton=a.DynamicRadioButton,exports.DynamicSearchSelect=a.DynamicSearchSelect,exports.DynamicSectionHOC=a.DynamicSectionHOC,exports.DynamicSelect=a.DynamicSelect,exports.DynamicTable=a.DynamicTable,exports.DynamicTagsInput=a.DynamicTagsInput,exports.DynamicTime=a.DynamicTime,exports.DynamicToggleButton=a.DynamicToggleButton,exports.ERPUIProvider=a.ERPUIProvider,exports.Edit=a.Edit,exports.Editor=a.CustomEditor,exports.Email=a.Email,exports.EntityViewWrapper=a.EntityViewWrapper,exports.ExpandableSummaryWrapper=a.ExpandableSummaryWrapper,exports.Export=a.Export,exports.Eye=a.Eye,exports.EyeOff=a.EyeOff,exports.EyePlusCircle=a.EyePlusCircle,exports.Fallback=a.Fallback,exports.FilledCircle=a.FilledCircle,exports.Filter=a.Filter,exports.FilterRemove=a.FilterRemove,exports.FolderSave=a.FolderSave,exports.Footer=a.Footer,exports.FormHeader=a.FormHeader,exports.FormLoader=a.FormLoader,exports.FormParser=a.FormParser,exports.Gantt=a.GanttChart,exports.GridCard=a.GridCard,exports.GridFallback=a.GridFallback,exports.GridWrapper=a.GridWrapper,exports.Hashtag=a.Hashtag,exports.Header=a.Header,exports.HeaderCard=a.HeaderCard,exports.HrLine=a.HrLine,exports.Image=a.Image,exports.Import=a.Import,exports.Info=a.Info,exports.InfoCard=a.InfoCard,exports.InfoCircle=a.InfoCircle,exports.InventoryReportsTitleBar=a.InventoryReportsTitleBar,exports.LinkHorizontal=a.LinkHorizontal,exports.List=a.List,exports.Loader=a.Loader,exports.Location=a.Location,exports.LocationAddModal=a.LocationAddModal,exports.LocationSelect=a.LocationSearchSelect,exports.MaterialTable=a.MaterialTable,exports.Modal=a.Modal,exports.ModalLoader=a.ModalLoader,exports.ModuleButton=a.ModuleTile,exports.MoreIcon=a.MoreIcon,exports.MultiSelect=a.MultiSelect,exports.Multiline=a.MultiLine,exports.PageLoader=a.PageLoader,exports.PageNavigator=a.PageNavigator,exports.Pagination=a.Pagination,exports.PaperClip=a.PaperClip,exports.Paragraph=a.Paragraph,exports.PartiesModal=a.CustomerVendorModal,exports.PaymentRequest=a.PaymentRequest,exports.Phone=a.Phone,exports.PhoneInput=a.PhoneInput,exports.Printer=a.Printer,exports.Promotion=a.Promotion,exports.ProtectedRoute=a.ProtectedRoute,exports.QuickApprovalModal=a.QuickApprovalModal,exports.Radio=a.Radio,exports.RadioButton=a.RadioButton,exports.Receipt=a.Receipt,exports.ReceiptFilled=a.ReceiptFilled,exports.ReceiptOutline=a.ReceiptOutline,exports.RecgtangleIcon=a.RecgtangleIcon,exports.RectangleFilledIcon=a.RectangleFilledIcon,exports.Replace=a.Replace,exports.ReportTable=a.ReportTable,exports.ReportsTitleBar=a.ReportsTitleBar,exports.ResetPasswordModal=a.ResetPasswordModal,exports.RfqResponse=a.ItemResponseDetails,exports.Save=a.Save,exports.SaveFilterModal=a.SaveFilterModal,exports.ScheduleReport=a.GeneralScheduleReport,exports.ScheduleReportModal=a.ScheduleReportModal,exports.Search=a.Search,exports.SearchBar=a.SearchBar,exports.SearchStatus=a.SearchStatus,exports.SearchableSelect=a.SearchableSelect,exports.Select=a.Select,exports.SettingsFallback=a.SettingsFallback,exports.SettingsFallbackIcon=a.SettingsFallbackIcon,exports.ShareModal=a.SharePopUp,exports.Sidebar=a.Sidebar,exports.Snackbar=a.Snackbar,exports.StackedLayer=a.StackedLayer,exports.StartFilled=a.StartFilled,exports.SubHeaderDoc=a.SubHeaderDoc,exports.TabBarUI=a.TabBarUi,exports.Tabs=a.TabBar,exports.TextArea=a.TextArea,exports.TextField=a.TextField,exports.Tick=a.Tick,exports.TickCircle=a.TickCircle,exports.TickCircleFilled=a.TickCircleFilled,exports.TimePicker=a.TimePicker,exports.TimeRangePicker=a.TimeRangePicker,exports.TitleDropdownButton=a.TitleDropdownButton,exports.Toast=a.Toast,exports.Toggle=a.Toggle,exports.ToggleSwitch=a.ToggleSwitch,exports.Tooltip=a.Tooltip,exports.Trash=a.Trash,exports.Upload=a.Upload,exports.UploadExcel=a.UploadExcel,exports.UploadMedia=a.UploadMedia,exports.UserDropdown=a.UserDropdown,exports.ViewModal=a.ViewModal,exports.Wave=a.Wave,exports.WorkCentre=a.WorkCentre,exports.createLocationThunk=a.createLocationThunk,exports.dynamicSelectAdd=a.dynamicSelectAdd,exports.useERPUI=a.useERPUI,exports.Chip=n.Chip,exports.Document=n.Document,exports.Menu=n.Menu,exports.RANGE=n.RANGE,exports.ValueField=n.ValueField,exports.calculateEntries=n.calculateEntries,exports.convertTableColumns=n.convertTableColumns,exports.getEntityId=n.getEntityId,exports.getFileNamesFromUrls=n.getFileNamesFromUrls,exports.getFileNamesFromUrlsAsLink=n.getFileNamesFromUrlsAsLink,exports.handleCompareDateRange=n.handleCompareDateRange,exports.handleCompareDateRangeSync=n.handleCompareDateRangeSync,exports.navigateWithId=n.navigateWithId,exports.renderEmptyRowsFallback=n.renderEmptyRowsFallback,exports.renderValueField=n.renderValueField,exports.transformTableColumns=n.transformTableColumns,exports.AuthContext=s.AuthContext,exports.AuthProvider=s.AuthProvider,exports.CustomSnackbar=s.CustomSnackbar,exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=s.INVENTORY_ADD_MODE_DISABLED_FIELDS,exports.INVENTORY_ALWAYS_DISABLED_FIELDS=s.INVENTORY_ALWAYS_DISABLED_FIELDS,exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=s.INVENTORY_EDIT_MODE_DISABLED_FIELDS,exports.INVENTORY_FIELDS_TO_BE_DISABLED=s.INVENTORY_FIELDS_TO_BE_DISABLED,exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=s.INVENTORY_MATERIAL_COSTING_TYPE_ARR,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=s.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS,exports.INVENTORY_VARIANT_DISABLED_FIELDS=s.INVENTORY_VARIANT_DISABLED_FIELDS,exports.InvoiceStatus=s.InvoiceStatus,exports.Notification=s.Notification,exports.SECTION_TYPES=s.SECTION_TYPES,exports.Typography=s.Typography,exports.UTCDateFormat=s.UTCDateFormat,exports.addOrEditArray=s.addOrEditArray,exports.apiConfigurations=s.apiConfigurations,exports.appendConditionSafely=s.appendConditionSafely,exports.calculateAmountData=s.calculateAmountData,exports.calculatePeriods=s.calculatePeriods,exports.checkDuplicateTracking=s.checkDuplicateTracking,exports.checkForDuplicate=s.checkForDuplicate,exports.checkSkuAndItemName=s.checkSkuAndItemName,exports.convertRoutesToUseIdParams=s.convertRoutesToUseIdParams,exports.convertToUnderscore=s.convertToUnderscore,exports.createdOnAndBy=s.createdOnAndBy,exports.defaultCompany=s.defaultCompany,exports.defaultCurrencyFormat=s.defaultCurrencyFormat,exports.defaultCurrencySymbol=s.defaultCurrencySymbol,exports.displayPhone=s.displayPhone,exports.downloadDoc=s.downloadDoc,exports.downloadFile=s.downloadFile,exports.fetchApi=s.fetchApi,exports.fetchAssemblyItemData=s.fetchAssemblyItemData,exports.fetchCompanyLocations=s.fetchCompanyLocations,exports.fetchExchageRate=s.fetchExchageRate,exports.fetchItems=s.fetchItems,exports.fetchRentalResponseItems=s.fetchRentalResponseItems,exports.fetchRfqItemsByIdForResponse=s.fetchRfqItemsByIdForResponse,exports.filterAccessibleModules=s.filterAccessibleModules,exports.filterCoaByCompanyIdOrNull=s.filterCoaByCompanyIdOrNull,exports.findById=s.findById,exports.formatAmount=s.formatAmount,exports.formatAmountWithCurrency=s.formatAmountWithCurrency,exports.formatAmountWithCurrencyData=s.formatAmountWithCurrencyData,exports.formatDataTime=s.formatDataTime,exports.formatDate=s.formatDate,exports.formatDateForPayload=s.formatDateForPayload,exports.formatDateTimeForPayload=s.formatDateTimeForPayload,exports.formatEmptyDataToNull=s.formatEmptyDataToNull,exports.formatLabel=s.formatLabel,exports.formatOnlyTime=s.formatOnlyTime,exports.formatResponseDatesToDayJS=s.formatResponseDatesToDayJS,exports.formatResponseOnlyDatesToDayJS=s.formatResponseOnlyDatesToDayJS,exports.formatTimeForPayload=s.formatTimeForPayload,exports.formatUtcDate=s.formatUtcDate,exports.generateAndFormatStringFromObj=s.generateAndFormatStringFromObj,exports.generateFields=s.generateFields,exports.generateQueryString=s.generateQueryString,exports.generateRandomId=s.generateRandomId,exports.generateRouteWithId=s.generateRouteWithId,exports.getAccessibleModules=s.getAccessibleModules,exports.getCountryIdByName=s.getCountryIdByName,exports.getCurrency=s.getCurrency,exports.getErrorMessage=s.getErrorMessage,exports.getExcelExportTemplate=s.getExcelExportTemplate,exports.getExcelTemplateGenerateTemplate=s.getExcelTemplateGenerateTemplate,exports.getFieldFilters=s.getFieldFilters,exports.getFileName=s.getFileName,exports.getItems=s.getItems,exports.getLabelValuePairs=s.getLabelValuePairs,exports.getMinutesFromTime=s.getMinutesFromTime,exports.getName=s.getName,exports.getNestedValue=s.getNestedValue,exports.getNextScheduleDate=s.getNextScheduleDate,exports.getOperatorLabel=s.getOperatorLabel,exports.getOptions=s.getOptions,exports.getOptionsData=s.getOptionsData,exports.getPartyDependentData=s.getPartyDependentData,exports.getPartyName=s.getPartyName,exports.getSlicedValue=s.getSlicedValue,exports.getTaxAmountDataFromMultipleTaxCodes=s.getTaxAmountDataFromMultipleTaxCodes,exports.getTaxAmountFromMultipleTaxCodes=s.getTaxAmountFromMultipleTaxCodes,exports.getTimeFromMinutes=s.getTimeFromMinutes,exports.getToken=s.getToken,exports.handleRegularUpload=s.handleRegularUpload,exports.hasValue=s.hasValue,exports.isBetweenTheDates=s.isBetweenTheDates,exports.isJSONString=s.isJSONString,exports.isJsonParse=s.isJsonParse,exports.manageItems=s.manageItems,exports.mapApiPayload=s.mapApiPayload,exports.mapAsyncApiPayload=s.mapAsyncApiPayload,exports.matchedMaterialCostingTypeLabel=s.matchedMaterialCostingTypeLabel,exports.navigateToRouteWithId=s.navigateToRouteWithId,exports.omitDataKeys=s.omitDataKeys,exports.partyDuplicateCheck=s.partyDuplicateCheck,exports.partyEmailIds=s.partyEmailIds,exports.postImportSheet=s.postImportSheet,exports.remainingMaterialCostingTypes=s.remainingMaterialCostingTypes,exports.removeIdFromObject=s.removeIdFromObject,exports.removeIdStaticIdsFromMongoObject=s.removeIdStaticIdsFromMongoObject,exports.responseItemDetailsColumns=s.responseItemDetailsColumns,exports.setRateBasedOnPriceRules=s.setRateBasedOnPriceRules,exports.showSnackBar=s.showSnackBar,exports.skuGenerator=s.skuGenerator,exports.specificFilters=s.specificFilters,exports.subModuleMappings=s.subModuleMappings,exports.toFixedWithNumbers=s.toFixedWithNumbers,exports.updateFieldsDisabledState=s.updateFieldsDisabledState,exports.updatePathnameWithIdParams=s.updatePathnameWithIdParams,exports.uploadAttachments=s.uploadAttachments,exports.uploadFiles=s.uploadFiles,exports.useAuth=s.useAuth,exports.validateDiscountValidity=s.validateDiscountValidity,exports.ErpLoader=i.ErpLoader,exports.LanguageContext=i.LanguageContext,exports.LanguageProvider=i.LanguageProvider,exports.PageContext=i.PageContext,exports.PageProvider=i.PageProvider,exports.PermissionContext=i.PermissionsContext,exports.PermissionProvider=i.PermissionsProvider,exports.useDeepMemo=p.useDeepMemo,exports.useLanguage=p.useLanguage,exports.useLocationFilter=p.useLocationFilter,exports.usePages=p.usePages,exports.usePermissions=p.usePermissions,exports.apiType=l.apiType,exports.capitalizeWords=l.capitalizeWords,exports.convertEmptyToNull=l.convertEmptyToNull,exports.defaultUserCurrency=l.defaultUserCurrency,exports.formatNumber=l.formatNumber,exports.formatTime=l.formatTime,exports.formateDate=l.formateDate,exports.recursiveSort=l.recursiveSort,exports.removeExtraKeys=l.removeExtraKeys,exports.sortData=l.sortData,exports.useAppTranslations=l.useAppTranslations,exports.useCheckSkuAndName=l.useCheckSkuAndName,exports.useDataFetcher=l.useDataFetcher,exports.useLanguageFallback=l.useLanguageFallback,exports.useMaterialCalculations=l.useMaterialCalculations,exports.valueWithCurrency=l.valueWithCurrency,exports.ThemeSelector=u.ThemeSelector,exports.getTheme=u.getTheme,exports.themeVariant=u.ThemeSelector,exports.ThemeWrapper=c.MUIThemeWrapper,exports.createDarkTheme=c.createDarkTheme,exports.createLightTheme=c.createLightTheme,exports.createTheme=c.createLightTheme,exports.themes=c.themes,exports.AccountingApi=f.api,exports.InventoryApi=f.api$1,exports.ManufacturingApi=f.api$2,exports.PurchaseApi=f.api$3,exports.RbacApi=f.api$4,exports.RentalApi=f.api$5,exports.SalesApi=f.api$6,exports.SystemFeatureApi=f.api$7,exports.setRoleURL=f.setBaseUrl,exports.setSystemFeatureURL=f.setBaseUrl$1,Object.defineProperty(exports,"AccordionActions",{enumerable:!0,get:function(){return y.AccordionActions}}),Object.defineProperty(exports,"AccordionDetails",{enumerable:!0,get:function(){return y.AccordionDetails}}),Object.defineProperty(exports,"AccordionSummary",{enumerable:!0,get:function(){return y.AccordionSummary}}),Object.defineProperty(exports,"AlertTitle",{enumerable:!0,get:function(){return y.AlertTitle}}),Object.defineProperty(exports,"Autocomplete",{enumerable:!0,get:function(){return y.Autocomplete}}),Object.defineProperty(exports,"AvatarGroup",{enumerable:!0,get:function(){return y.AvatarGroup}}),Object.defineProperty(exports,"Backdrop",{enumerable:!0,get:function(){return y.Backdrop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return y.Badge}}),Object.defineProperty(exports,"BottomNavigation",{enumerable:!0,get:function(){return y.BottomNavigation}}),Object.defineProperty(exports,"BottomNavigationAction",{enumerable:!0,get:function(){return y.BottomNavigationAction}}),Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return y.Box}}),Object.defineProperty(exports,"ButtonBase",{enumerable:!0,get:function(){return y.ButtonBase}}),Object.defineProperty(exports,"ButtonGroup",{enumerable:!0,get:function(){return y.ButtonGroup}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return y.Card}}),Object.defineProperty(exports,"CardActionArea",{enumerable:!0,get:function(){return y.CardActionArea}}),Object.defineProperty(exports,"CardActions",{enumerable:!0,get:function(){return y.CardActions}}),Object.defineProperty(exports,"CardContent",{enumerable:!0,get:function(){return y.CardContent}}),Object.defineProperty(exports,"CardHeader",{enumerable:!0,get:function(){return y.CardHeader}}),Object.defineProperty(exports,"CardMedia",{enumerable:!0,get:function(){return y.CardMedia}}),Object.defineProperty(exports,"ClickAwayListener",{enumerable:!0,get:function(){return y.ClickAwayListener}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return y.Collapse}}),Object.defineProperty(exports,"Container",{enumerable:!0,get:function(){return y.Container}}),Object.defineProperty(exports,"CssBaseline",{enumerable:!0,get:function(){return y.CssBaseline}}),Object.defineProperty(exports,"DialogActions",{enumerable:!0,get:function(){return y.DialogActions}}),Object.defineProperty(exports,"DialogContent",{enumerable:!0,get:function(){return y.DialogContent}}),Object.defineProperty(exports,"DialogContentText",{enumerable:!0,get:function(){return y.DialogContentText}}),Object.defineProperty(exports,"DialogTitle",{enumerable:!0,get:function(){return y.DialogTitle}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return y.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return y.Drawer}}),Object.defineProperty(exports,"Fab",{enumerable:!0,get:function(){return y.Fab}}),Object.defineProperty(exports,"Fade",{enumerable:!0,get:function(){return y.Fade}}),Object.defineProperty(exports,"FilledInput",{enumerable:!0,get:function(){return y.FilledInput}}),Object.defineProperty(exports,"FormControl",{enumerable:!0,get:function(){return y.FormControl}}),Object.defineProperty(exports,"FormControlLabel",{enumerable:!0,get:function(){return y.FormControlLabel}}),Object.defineProperty(exports,"FormGroup",{enumerable:!0,get:function(){return y.FormGroup}}),Object.defineProperty(exports,"FormHelperText",{enumerable:!0,get:function(){return y.FormHelperText}}),Object.defineProperty(exports,"FormLabel",{enumerable:!0,get:function(){return y.FormLabel}}),Object.defineProperty(exports,"GlobalStyles",{enumerable:!0,get:function(){return y.GlobalStyles}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return y.Grid}}),Object.defineProperty(exports,"Grow",{enumerable:!0,get:function(){return y.Grow}}),Object.defineProperty(exports,"Hidden",{enumerable:!0,get:function(){return y.Hidden}}),Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return y.Icon}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return y.IconButton}}),Object.defineProperty(exports,"ImageList",{enumerable:!0,get:function(){return y.ImageList}}),Object.defineProperty(exports,"ImageListItem",{enumerable:!0,get:function(){return y.ImageListItem}}),Object.defineProperty(exports,"ImageListItemBar",{enumerable:!0,get:function(){return y.ImageListItemBar}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return y.Input}}),Object.defineProperty(exports,"InputAdornment",{enumerable:!0,get:function(){return y.InputAdornment}}),Object.defineProperty(exports,"InputBase",{enumerable:!0,get:function(){return y.InputBase}}),Object.defineProperty(exports,"InputLabel",{enumerable:!0,get:function(){return y.InputLabel}}),Object.defineProperty(exports,"LinearProgress",{enumerable:!0,get:function(){return y.LinearProgress}}),Object.defineProperty(exports,"Link",{enumerable:!0,get:function(){return y.Link}}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return y.ListItem}}),Object.defineProperty(exports,"ListItemAvatar",{enumerable:!0,get:function(){return y.ListItemAvatar}}),Object.defineProperty(exports,"ListItemButton",{enumerable:!0,get:function(){return y.ListItemButton}}),Object.defineProperty(exports,"ListItemIcon",{enumerable:!0,get:function(){return y.ListItemIcon}}),Object.defineProperty(exports,"ListItemSecondaryAction",{enumerable:!0,get:function(){return y.ListItemSecondaryAction}}),Object.defineProperty(exports,"ListItemText",{enumerable:!0,get:function(){return y.ListItemText}}),Object.defineProperty(exports,"ListSubheader",{enumerable:!0,get:function(){return y.ListSubheader}}),Object.defineProperty(exports,"MUIAccordion",{enumerable:!0,get:function(){return y.Accordion}}),Object.defineProperty(exports,"MUIAlert",{enumerable:!0,get:function(){return y.Alert}}),Object.defineProperty(exports,"MUIAppBar",{enumerable:!0,get:function(){return y.AppBar}}),Object.defineProperty(exports,"MUIAvatar",{enumerable:!0,get:function(){return y.Avatar}}),Object.defineProperty(exports,"MUIBreadcrumbs",{enumerable:!0,get:function(){return y.Breadcrumbs}}),Object.defineProperty(exports,"MUIButton",{enumerable:!0,get:function(){return y.Button}}),Object.defineProperty(exports,"MUICheckbox",{enumerable:!0,get:function(){return y.Checkbox}}),Object.defineProperty(exports,"MUIChip",{enumerable:!0,get:function(){return y.Chip}}),Object.defineProperty(exports,"MUICircularProgress",{enumerable:!0,get:function(){return y.CircularProgress}}),Object.defineProperty(exports,"MUIDialog",{enumerable:!0,get:function(){return y.Dialog}}),Object.defineProperty(exports,"MUIList",{enumerable:!0,get:function(){return y.List}}),Object.defineProperty(exports,"MUIMenu",{enumerable:!0,get:function(){return y.Menu}}),Object.defineProperty(exports,"MUIModal",{enumerable:!0,get:function(){return y.Modal}}),Object.defineProperty(exports,"MUIPagination",{enumerable:!0,get:function(){return y.Pagination}}),Object.defineProperty(exports,"MUIRadio",{enumerable:!0,get:function(){return y.Radio}}),Object.defineProperty(exports,"MUISelect",{enumerable:!0,get:function(){return y.Select}}),Object.defineProperty(exports,"MUISnackbar",{enumerable:!0,get:function(){return y.Snackbar}}),Object.defineProperty(exports,"MUITabs",{enumerable:!0,get:function(){return y.Tabs}}),Object.defineProperty(exports,"MUITextField",{enumerable:!0,get:function(){return y.TextField}}),Object.defineProperty(exports,"MUITooltip",{enumerable:!0,get:function(){return y.Tooltip}}),Object.defineProperty(exports,"MUITypography",{enumerable:!0,get:function(){return y.Typography}}),Object.defineProperty(exports,"MenuItem",{enumerable:!0,get:function(){return y.MenuItem}}),Object.defineProperty(exports,"MenuList",{enumerable:!0,get:function(){return y.MenuList}}),Object.defineProperty(exports,"MobileStepper",{enumerable:!0,get:function(){return y.MobileStepper}}),Object.defineProperty(exports,"NativeSelect",{enumerable:!0,get:function(){return y.NativeSelect}}),Object.defineProperty(exports,"NoSsr",{enumerable:!0,get:function(){return y.NoSsr}}),Object.defineProperty(exports,"OutlinedInput",{enumerable:!0,get:function(){return y.OutlinedInput}}),Object.defineProperty(exports,"PaginationItem",{enumerable:!0,get:function(){return y.PaginationItem}}),Object.defineProperty(exports,"Paper",{enumerable:!0,get:function(){return y.Paper}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return y.Popover}}),Object.defineProperty(exports,"Popper",{enumerable:!0,get:function(){return y.Popper}}),Object.defineProperty(exports,"Portal",{enumerable:!0,get:function(){return y.Portal}}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:function(){return y.RadioGroup}}),Object.defineProperty(exports,"Rating",{enumerable:!0,get:function(){return y.Rating}}),Object.defineProperty(exports,"ScopedCssBaseline",{enumerable:!0,get:function(){return y.ScopedCssBaseline}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return y.Slider}}),Object.defineProperty(exports,"SnackbarContent",{enumerable:!0,get:function(){return y.SnackbarContent}}),Object.defineProperty(exports,"SpeedDial",{enumerable:!0,get:function(){return y.SpeedDial}}),Object.defineProperty(exports,"SpeedDialAction",{enumerable:!0,get:function(){return y.SpeedDialAction}}),Object.defineProperty(exports,"SpeedDialIcon",{enumerable:!0,get:function(){return y.SpeedDialIcon}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return y.Stack}}),Object.defineProperty(exports,"Step",{enumerable:!0,get:function(){return y.Step}}),Object.defineProperty(exports,"StepButton",{enumerable:!0,get:function(){return y.StepButton}}),Object.defineProperty(exports,"StepContent",{enumerable:!0,get:function(){return y.StepContent}}),Object.defineProperty(exports,"StepLabel",{enumerable:!0,get:function(){return y.StepLabel}}),Object.defineProperty(exports,"Stepper",{enumerable:!0,get:function(){return y.Stepper}}),Object.defineProperty(exports,"SvgIcon",{enumerable:!0,get:function(){return y.SvgIcon}}),Object.defineProperty(exports,"SwipeableDrawer",{enumerable:!0,get:function(){return y.SwipeableDrawer}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return y.Switch}}),Object.defineProperty(exports,"Tab",{enumerable:!0,get:function(){return y.Tab}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return y.Table}}),Object.defineProperty(exports,"TableBody",{enumerable:!0,get:function(){return y.TableBody}}),Object.defineProperty(exports,"TableCell",{enumerable:!0,get:function(){return y.TableCell}}),Object.defineProperty(exports,"TableContainer",{enumerable:!0,get:function(){return y.TableContainer}}),Object.defineProperty(exports,"TableFooter",{enumerable:!0,get:function(){return y.TableFooter}}),Object.defineProperty(exports,"TableHead",{enumerable:!0,get:function(){return y.TableHead}}),Object.defineProperty(exports,"TablePagination",{enumerable:!0,get:function(){return y.TablePagination}}),Object.defineProperty(exports,"TableRow",{enumerable:!0,get:function(){return y.TableRow}}),Object.defineProperty(exports,"TableSortLabel",{enumerable:!0,get:function(){return y.TableSortLabel}}),Object.defineProperty(exports,"TextareaAutosize",{enumerable:!0,get:function(){return y.TextareaAutosize}}),Object.defineProperty(exports,"ToggleButton",{enumerable:!0,get:function(){return y.ToggleButton}}),Object.defineProperty(exports,"ToggleButtonGroup",{enumerable:!0,get:function(){return y.ToggleButtonGroup}}),Object.defineProperty(exports,"Toolbar",{enumerable:!0,get:function(){return y.Toolbar}}),Object.defineProperty(exports,"Zoom",{enumerable:!0,get:function(){return y.Zoom}}),Object.defineProperty(exports,"useMediaQuery",{enumerable:!0,get:function(){return y.useMediaQuery}}),Object.defineProperty(exports,"useScrollTrigger",{enumerable:!0,get:function(){return y.useScrollTrigger}}),Object.defineProperty(exports,"dayjs",{enumerable:!0,get:function(){return R.default}}),exports.COMMON_DATE_VALIDATIONS=T.COMMON_DATE_VALIDATIONS,exports.anyDateValidation=T.anyDateValidation,exports.businessDateValidation=T.businessDateValidation,exports.conditionalDateValidation=T.conditionalDateValidation,exports.createCustomMessages=T.createCustomMessages,exports.createDateValidation=T.createDateValidation,exports.createParameterizedNavigationHandler=T.createParameterizedNavigationHandler,exports.dateRangeValidation=T.dateRangeValidation,exports.dateTimeValidation=T.dateTimeValidation,exports.dateValidation=T.dateValidation,exports.futureDateValidation=T.futureDateValidation,exports.getCountry=T.getCountry,exports.migrateRoutesToUseParams=T.migrateRoutesToUseParams,exports.migrateToPathWithId=T.migrateToPathWithId,exports.pastDateValidation=T.pastDateValidation,exports.updateTableConfigForParameterizedNavigation=T.updateTableConfigForParameterizedNavigation,exports.DriveApi=D.api,exports.setDriveURL=D.setBaseUrl,exports.loadModuleTranslations=S.loadModuleTranslations,exports.createLibraryStore=h.createLibraryStore,exports.fetchBom=h.fetchBom,exports.fetchCompanies=h.fetchCompanies,exports.getAllUserAndDepartmentDropdown=h.getAllUserAndDepartmentDropdown,exports.getLibrarySlices=h.getLibrarySlices,exports.headerSlice=h.headerSlice,exports.inventoryReportsTitleBarSlice=h.inventoryReportsTitleBarSlice,exports.libraryReducers=h.libraryReducers,exports.reportsTitleBarSlice=h.reportsTitleBarSlice,exports.resetHeaderState=h.resetHeaderState,exports.resetInventoryReportsTitleBarState=h.resetInventoryReportsTitleBarState,exports.resetLanguagesState=h.resetLanguagesState,exports.resetReportsTitleBarState=h.resetReportsTitleBarState,exports.resetShareState=h.resetState,exports.setAssemblyItems=h.setAssemblyItems,exports.setBomData=h.setBomData,exports.setCurrentLanguage=h.setCurrentLanguage,exports.setDepartments=h.setDepartments,exports.setInventoryCompanies=h.setCompanies$1,exports.setInventoryError=h.setError$2,exports.setInventoryLoading=h.setLoading$2,exports.setItems=h.setItems,exports.setLanguages=h.setLanguages,exports.setLanguagesData=h.setLanguagesData,exports.setReportsCompanies=h.setCompanies,exports.setReportsError=h.setError$1,exports.setReportsLoading=h.setLoading$1,exports.setShareError=h.setError,exports.setShareLoading=h.setLoading,exports.setUsers=h.setUsers,exports.setWarehouseLocations=h.setWarehouseLocations,exports.sharePage=h.sharePage,exports.shareSlice=h.shareSlice,exports.API_METHOD_GROUPS=I.API_METHOD_GROUPS,exports.createConfiguredApiClient=I.createConfiguredApiClient,exports.validateApiClient=I.validateApiClient,exports.useAppDispatch=A.useAppDispatch,exports.useAppSelector=A.useAppSelector,exports.useLibraryDispatch=A.useLibraryDispatch,exports.useLibrarySelector=A.useLibrarySelector,exports.DriveTypes=O.DriveTypes,exports.InventoryTypes=O.InventoryTypes,exports.ManufacturingTypes=O.ManufacturingTypes,exports.PurchaseTypes=O.PurchaseTypes,exports.RbacTypes=O.RbacTypes,exports.RentalTypes=O.RentalTypes,exports.SalesTypes=O.SalesTypes,exports.SystemFeatureTypes=O.SystemFeatureTypes,exports.UserApi=O.UserApi,exports.UserTypes=O.UserTypes,exports.FullscreenLayout=function(e){/* @__PURE__ */
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./pathname.rental-BbpaQSgg.js"),t=require("./route-page-map-BYGZ0Fm2.js"),r=require("./common-DyuISUDa.js"),o=require("./modules-Ct1hHDvJ.js"),a=require("./index-DFSXVdXk.js"),n=require("./navigation-utils-LF9-2ZD0.js"),s=require("./common-ZGNib3x2.js"),i=require("./index-DcJptCKc.js"),p=require("./use-permissions-rBXbao3-.js"),l=require("./hooks/index.js"),u=require("./theme/index.js"),c=require("./theme-impl-DDVfmrMB.js"),d=require("react/jsx-runtime"),x=require("@mui/material/CssBaseline"),m=require("@mui/material/Box"),g=require("react"),b=require("@mui/material/styles"),f=require("./api-CoR86qOS.js"),y=require("@mui/material"),P=require("dayjs"),T=require("./menu-filter-BqGaycuM.js"),D=require("./api-VeUt6PG8.js"),S=require("./translations-BQO6LcM0.js"),C=require("react-i18next"),h=require("./store-7xbraBig.js"),I=require("./redux/index.js"),A=require("./hooks-CzoDgYvR.js"),O=require("./api-client/index.js");function L(e){return e&&e.__esModule?e:{default:e}}var j=/* @__PURE__ */L(x),F=/* @__PURE__ */L(m),R=/* @__PURE__ */L(P);let E={};const M=300,B="_is_drawer_open";exports.images=e.images,exports.DEFAULT_LANG=t.DEFAULT_LANG,exports.LANGUAGES=t.LANGUAGES,exports.S3_BUCKET_URL=r.S3_BUCKET_URL,exports.modules=o.modules,exports.Accordion=a.Accordion,exports.ActionBar=a.ActionBar,exports.ActivityArea=a.ActivityArea,exports.ActivityLog=a.ActivityTag$1,exports.ActivityTag=a.ActivityTag,exports.AddCircle=a.AddCircle,exports.Alert=a.Alert,exports.AndroidSwitch=a.Android12Switch,exports.AppBar=a.AppBarWrapper,exports.ApprovalWrapper=a.ApprovalWrapper,exports.AreaLinearChart=a.AreaLineChart,exports.ArrowBidirectional=a.ArrowBidirectional,exports.ArrowCircleDown=a.ArrowCircleDown,exports.ArrowDown=a.ArrowDown,exports.ArrowDownThree=a.ArrowDownThree,exports.ArrowDownTwo=a.ArrowDownTwo,exports.ArrowUpDown=a.ArrowUpDown,exports.ArrowUpTwo=a.ArrowUpTwo,exports.Assignments=a.Assignments,exports.Avatar=a.Avatar,exports.BlankCircle=a.BlankCircle,exports.BlockFiled=a.BlockFiled,exports.Board=a.BoardWrapper,exports.BreadCrumb=a.BreadCrumb,exports.Button=a.Button,exports.CalculationSummary=a.CalculationSummary,exports.Calendar=a.CalendarWrapper,exports.CalendarAdd=a.CalendarAdd,exports.CardWrapper=a.CardWrapper,exports.ChangeUserPasswordModal=a.ChangeUserPasswordModal,exports.ChartLegends=a.ChartLegends,exports.CheckBoxIcon=a.CheckBoxIcon,exports.Checkbox=a.Checkbox,exports.CheckboxSquare=a.CheckboxSquare,exports.ChipGenerator=a.ChipGenerator,exports.ChipOrPlaceholder=a.ChipOrPlaceholder,exports.CircularArrowSetting=a.CircularArrowSetting,exports.Clock=a.Clock,exports.Close=a.Close,exports.CoinOutline=a.CoinOutline,exports.ColorPickerInput=a.ColorPickerInput,exports.ConfirmModal=a.ConfirmPopUp,exports.Copy=a.Copy,exports.CountrySelect=a.CountrySelect,exports.CrossHire=a.CrossHire,exports.CustomGridCard=a.CustomGridCard,exports.CustomToggleSwitch=a.CustomToggleSwitch,exports.Dashboard=a.Dashboard,exports.DashboardCard=a.DashBoardCard,exports.DashboardHeader=a.DashBoardHeader,exports.DatePicker=a.DatePicker,exports.DateRangePicker=a.DateRangePicker,exports.DateTimePicker=a.DateTimePicker,exports.DocumentDownload=a.DocumentDownload,exports.DollarCircle=a.DollarCircle,exports.DollarCircleFilled=a.DollarCircleFilled,exports.DropdownButton=a.DropdownButton,exports.DyanmicTextEditor=a.DyanmicTextEditor,exports.DynamicButton=a.DynamicButton,exports.DynamicCheckBox=a.DynamicCheckBox,exports.DynamicCurrency=a.DynamicCurrency,exports.DynamicDate=a.DynamicDate,exports.DynamicDateRange=a.DynamicDateRange,exports.DynamicDateTime=a.DynamicDateTime,exports.DynamicElementHOC=a.DynamicElementHOC,exports.DynamicInfo=a.DynamicInfo,exports.DynamicInput=a.DynamicInput,exports.DynamicInputSelect=a.DynamicInputSelect,exports.DynamicLayoutWrapper=a.DynamicLayoutWrapper,exports.DynamicMedia=a.DynamicMedia,exports.DynamicModal=a.DynamicModal,exports.DynamicPhone=a.DynamicPhone,exports.DynamicRadioButton=a.DynamicRadioButton,exports.DynamicSearchSelect=a.DynamicSearchSelect,exports.DynamicSectionHOC=a.DynamicSectionHOC,exports.DynamicSelect=a.DynamicSelect,exports.DynamicTable=a.DynamicTable,exports.DynamicTagsInput=a.DynamicTagsInput,exports.DynamicTime=a.DynamicTime,exports.DynamicToggleButton=a.DynamicToggleButton,exports.ERPUIProvider=a.ERPUIProvider,exports.Edit=a.Edit,exports.Editor=a.CustomEditor,exports.Email=a.Email,exports.EntityViewWrapper=a.EntityViewWrapper,exports.ExpandableSummaryWrapper=a.ExpandableSummaryWrapper,exports.Export=a.Export,exports.Eye=a.Eye,exports.EyeOff=a.EyeOff,exports.EyePlusCircle=a.EyePlusCircle,exports.Fallback=a.Fallback,exports.FilledCircle=a.FilledCircle,exports.Filter=a.Filter,exports.FilterRemove=a.FilterRemove,exports.FolderSave=a.FolderSave,exports.Footer=a.Footer,exports.FormHeader=a.FormHeader,exports.FormLoader=a.FormLoader,exports.FormParser=a.FormParser,exports.Gantt=a.GanttChart,exports.GridCard=a.GridCard,exports.GridFallback=a.GridFallback,exports.GridWrapper=a.GridWrapper,exports.Hashtag=a.Hashtag,exports.Header=a.Header,exports.HeaderCard=a.HeaderCard,exports.HrLine=a.HrLine,exports.Image=a.Image,exports.Import=a.Import,exports.Info=a.Info,exports.InfoCard=a.InfoCard,exports.InfoCircle=a.InfoCircle,exports.InventoryReportsTitleBar=a.InventoryReportsTitleBar,exports.LinkHorizontal=a.LinkHorizontal,exports.List=a.List,exports.Loader=a.Loader,exports.Location=a.Location,exports.LocationAddModal=a.LocationAddModal,exports.LocationSelect=a.LocationSearchSelect,exports.MaterialTable=a.MaterialTable,exports.Modal=a.Modal,exports.ModalLoader=a.ModalLoader,exports.ModuleButton=a.ModuleTile,exports.MoreIcon=a.MoreIcon,exports.MultiSelect=a.MultiSelect,exports.Multiline=a.MultiLine,exports.PageLoader=a.PageLoader,exports.PageNavigator=a.PageNavigator,exports.Pagination=a.Pagination,exports.PaperClip=a.PaperClip,exports.Paragraph=a.Paragraph,exports.PartiesModal=a.CustomerVendorModal,exports.PaymentRequest=a.PaymentRequest,exports.Phone=a.Phone,exports.PhoneInput=a.PhoneInput,exports.Printer=a.Printer,exports.Promotion=a.Promotion,exports.ProtectedRoute=a.ProtectedRoute,exports.QuickApprovalModal=a.QuickApprovalModal,exports.Radio=a.Radio,exports.RadioButton=a.RadioButton,exports.Receipt=a.Receipt,exports.ReceiptFilled=a.ReceiptFilled,exports.ReceiptOutline=a.ReceiptOutline,exports.RecgtangleIcon=a.RecgtangleIcon,exports.RectangleFilledIcon=a.RectangleFilledIcon,exports.Replace=a.Replace,exports.ReportTable=a.ReportTable,exports.ReportsTitleBar=a.ReportsTitleBar,exports.ResetPasswordModal=a.ResetPasswordModal,exports.RfqResponse=a.ItemResponseDetails,exports.Save=a.Save,exports.SaveFilterModal=a.SaveFilterModal,exports.ScheduleReport=a.GeneralScheduleReport,exports.ScheduleReportModal=a.ScheduleReportModal,exports.Search=a.Search,exports.SearchBar=a.SearchBar,exports.SearchStatus=a.SearchStatus,exports.SearchableSelect=a.SearchableSelect,exports.Select=a.Select,exports.SettingsFallback=a.SettingsFallback,exports.SettingsFallbackIcon=a.SettingsFallbackIcon,exports.ShareModal=a.SharePopUp,exports.Sidebar=a.Sidebar,exports.Snackbar=a.Snackbar,exports.StackedLayer=a.StackedLayer,exports.StartFilled=a.StartFilled,exports.SubHeaderDoc=a.SubHeaderDoc,exports.TabBarUI=a.TabBarUi,exports.Tabs=a.TabBar,exports.TextArea=a.TextArea,exports.TextField=a.TextField,exports.Tick=a.Tick,exports.TickCircle=a.TickCircle,exports.TickCircleFilled=a.TickCircleFilled,exports.TimePicker=a.TimePicker,exports.TimeRangePicker=a.TimeRangePicker,exports.TitleDropdownButton=a.TitleDropdownButton,exports.Toast=a.Toast,exports.Toggle=a.Toggle,exports.ToggleSwitch=a.ToggleSwitch,exports.Tooltip=a.Tooltip,exports.Trash=a.Trash,exports.Upload=a.Upload,exports.UploadExcel=a.UploadExcel,exports.UploadMedia=a.UploadMedia,exports.UserDropdown=a.UserDropdown,exports.ViewModal=a.ViewModal,exports.Wave=a.Wave,exports.WorkCentre=a.WorkCentre,exports.createLocationThunk=a.createLocationThunk,exports.dynamicSelectAdd=a.dynamicSelectAdd,exports.useERPUI=a.useERPUI,exports.Chip=n.Chip,exports.Document=n.Document,exports.Menu=n.Menu,exports.RANGE=n.RANGE,exports.ValueField=n.ValueField,exports.calculateEntries=n.calculateEntries,exports.convertTableColumns=n.convertTableColumns,exports.getEntityId=n.getEntityId,exports.getFileNamesFromUrls=n.getFileNamesFromUrls,exports.getFileNamesFromUrlsAsLink=n.getFileNamesFromUrlsAsLink,exports.handleCompareDateRange=n.handleCompareDateRange,exports.handleCompareDateRangeSync=n.handleCompareDateRangeSync,exports.navigateWithId=n.navigateWithId,exports.renderEmptyRowsFallback=n.renderEmptyRowsFallback,exports.renderValueField=n.renderValueField,exports.transformTableColumns=n.transformTableColumns,exports.AuthContext=s.AuthContext,exports.AuthProvider=s.AuthProvider,exports.CustomSnackbar=s.CustomSnackbar,exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=s.INVENTORY_ADD_MODE_DISABLED_FIELDS,exports.INVENTORY_ALWAYS_DISABLED_FIELDS=s.INVENTORY_ALWAYS_DISABLED_FIELDS,exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=s.INVENTORY_EDIT_MODE_DISABLED_FIELDS,exports.INVENTORY_FIELDS_TO_BE_DISABLED=s.INVENTORY_FIELDS_TO_BE_DISABLED,exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=s.INVENTORY_MATERIAL_COSTING_TYPE_ARR,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=s.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS,exports.INVENTORY_VARIANT_DISABLED_FIELDS=s.INVENTORY_VARIANT_DISABLED_FIELDS,exports.InvoiceStatus=s.InvoiceStatus,exports.Notification=s.Notification,exports.SECTION_TYPES=s.SECTION_TYPES,exports.Typography=s.Typography,exports.UTCDateFormat=s.UTCDateFormat,exports.addOrEditArray=s.addOrEditArray,exports.apiConfigurations=s.apiConfigurations,exports.appendConditionSafely=s.appendConditionSafely,exports.calculateAmountData=s.calculateAmountData,exports.calculatePeriods=s.calculatePeriods,exports.checkDuplicateTracking=s.checkDuplicateTracking,exports.checkForDuplicate=s.checkForDuplicate,exports.checkSkuAndItemName=s.checkSkuAndItemName,exports.convertRoutesToUseIdParams=s.convertRoutesToUseIdParams,exports.convertToUnderscore=s.convertToUnderscore,exports.createdOnAndBy=s.createdOnAndBy,exports.defaultCompany=s.defaultCompany,exports.defaultCurrencyFormat=s.defaultCurrencyFormat,exports.defaultCurrencySymbol=s.defaultCurrencySymbol,exports.displayPhone=s.displayPhone,exports.downloadDoc=s.downloadDoc,exports.downloadFile=s.downloadFile,exports.fetchApi=s.fetchApi,exports.fetchAssemblyItemData=s.fetchAssemblyItemData,exports.fetchCompanyLocations=s.fetchCompanyLocations,exports.fetchExchageRate=s.fetchExchageRate,exports.fetchItems=s.fetchItems,exports.fetchRentalResponseItems=s.fetchRentalResponseItems,exports.fetchRfqItemsByIdForResponse=s.fetchRfqItemsByIdForResponse,exports.filterAccessibleModules=s.filterAccessibleModules,exports.filterCoaByCompanyIdOrNull=s.filterCoaByCompanyIdOrNull,exports.findById=s.findById,exports.formatAmount=s.formatAmount,exports.formatAmountWithCurrency=s.formatAmountWithCurrency,exports.formatAmountWithCurrencyData=s.formatAmountWithCurrencyData,exports.formatDataTime=s.formatDataTime,exports.formatDate=s.formatDate,exports.formatDateForPayload=s.formatDateForPayload,exports.formatDateTimeForPayload=s.formatDateTimeForPayload,exports.formatEmptyDataToNull=s.formatEmptyDataToNull,exports.formatLabel=s.formatLabel,exports.formatOnlyTime=s.formatOnlyTime,exports.formatResponseDatesToDayJS=s.formatResponseDatesToDayJS,exports.formatResponseOnlyDatesToDayJS=s.formatResponseOnlyDatesToDayJS,exports.formatTimeForPayload=s.formatTimeForPayload,exports.formatUtcDate=s.formatUtcDate,exports.generateAndFormatStringFromObj=s.generateAndFormatStringFromObj,exports.generateFields=s.generateFields,exports.generateQueryString=s.generateQueryString,exports.generateRandomId=s.generateRandomId,exports.generateRouteWithId=s.generateRouteWithId,exports.getAccessibleModules=s.getAccessibleModules,exports.getCountryIdByName=s.getCountryIdByName,exports.getCurrency=s.getCurrency,exports.getErrorMessage=s.getErrorMessage,exports.getExcelExportTemplate=s.getExcelExportTemplate,exports.getExcelTemplateGenerateTemplate=s.getExcelTemplateGenerateTemplate,exports.getFieldFilters=s.getFieldFilters,exports.getFileName=s.getFileName,exports.getItems=s.getItems,exports.getLabelValuePairs=s.getLabelValuePairs,exports.getMinutesFromTime=s.getMinutesFromTime,exports.getName=s.getName,exports.getNestedValue=s.getNestedValue,exports.getNextScheduleDate=s.getNextScheduleDate,exports.getOperatorLabel=s.getOperatorLabel,exports.getOptions=s.getOptions,exports.getOptionsData=s.getOptionsData,exports.getPartyDependentData=s.getPartyDependentData,exports.getPartyName=s.getPartyName,exports.getSlicedValue=s.getSlicedValue,exports.getTaxAmountDataFromMultipleTaxCodes=s.getTaxAmountDataFromMultipleTaxCodes,exports.getTaxAmountFromMultipleTaxCodes=s.getTaxAmountFromMultipleTaxCodes,exports.getTimeFromMinutes=s.getTimeFromMinutes,exports.getToken=s.getToken,exports.handleRegularUpload=s.handleRegularUpload,exports.hasValue=s.hasValue,exports.isBetweenTheDates=s.isBetweenTheDates,exports.isJSONString=s.isJSONString,exports.isJsonParse=s.isJsonParse,exports.manageItems=s.manageItems,exports.mapApiPayload=s.mapApiPayload,exports.mapAsyncApiPayload=s.mapAsyncApiPayload,exports.matchedMaterialCostingTypeLabel=s.matchedMaterialCostingTypeLabel,exports.navigateToRouteWithId=s.navigateToRouteWithId,exports.omitDataKeys=s.omitDataKeys,exports.partyDuplicateCheck=s.partyDuplicateCheck,exports.partyEmailIds=s.partyEmailIds,exports.postImportSheet=s.postImportSheet,exports.remainingMaterialCostingTypes=s.remainingMaterialCostingTypes,exports.removeIdFromObject=s.removeIdFromObject,exports.removeIdStaticIdsFromMongoObject=s.removeIdStaticIdsFromMongoObject,exports.responseItemDetailsColumns=s.responseItemDetailsColumns,exports.setRateBasedOnPriceRules=s.setRateBasedOnPriceRules,exports.showSnackBar=s.showSnackBar,exports.skuGenerator=s.skuGenerator,exports.specificFilters=s.specificFilters,exports.subModuleMappings=s.subModuleMappings,exports.toFixedWithNumbers=s.toFixedWithNumbers,exports.updateFieldsDisabledState=s.updateFieldsDisabledState,exports.updatePathnameWithIdParams=s.updatePathnameWithIdParams,exports.uploadAttachments=s.uploadAttachments,exports.uploadFiles=s.uploadFiles,exports.useAuth=s.useAuth,exports.validateDiscountValidity=s.validateDiscountValidity,exports.ErpLoader=i.ErpLoader,exports.LanguageContext=i.LanguageContext,exports.LanguageProvider=i.LanguageProvider,exports.PageContext=i.PageContext,exports.PageProvider=i.PageProvider,exports.PermissionContext=i.PermissionsContext,exports.PermissionProvider=i.PermissionsProvider,exports.useDeepMemo=p.useDeepMemo,exports.useLanguage=p.useLanguage,exports.useLocationFilter=p.useLocationFilter,exports.usePages=p.usePages,exports.usePermissions=p.usePermissions,exports.apiType=l.apiType,exports.capitalizeWords=l.capitalizeWords,exports.convertEmptyToNull=l.convertEmptyToNull,exports.defaultUserCurrency=l.defaultUserCurrency,exports.formatNumber=l.formatNumber,exports.formatTime=l.formatTime,exports.formateDate=l.formateDate,exports.recursiveSort=l.recursiveSort,exports.removeExtraKeys=l.removeExtraKeys,exports.sortData=l.sortData,exports.useAppTranslations=l.useAppTranslations,exports.useCheckSkuAndName=l.useCheckSkuAndName,exports.useDataFetcher=l.useDataFetcher,exports.useLanguageFallback=l.useLanguageFallback,exports.useMaterialCalculations=l.useMaterialCalculations,exports.valueWithCurrency=l.valueWithCurrency,exports.ThemeSelector=u.ThemeSelector,exports.getTheme=u.getTheme,exports.themeVariant=u.ThemeSelector,exports.ThemeWrapper=c.MUIThemeWrapper,exports.createDarkTheme=c.createDarkTheme,exports.createLightTheme=c.createLightTheme,exports.createTheme=c.createLightTheme,exports.themes=c.themes,exports.AccountingApi=f.api,exports.InventoryApi=f.api$1,exports.ManufacturingApi=f.api$2,exports.PurchaseApi=f.api$3,exports.RbacApi=f.api$4,exports.RentalApi=f.api$5,exports.SalesApi=f.api$6,exports.SystemFeatureApi=f.api$7,exports.setRoleURL=f.setBaseUrl,exports.setSystemFeatureURL=f.setBaseUrl$1,Object.defineProperty(exports,"AccordionActions",{enumerable:!0,get:function(){return y.AccordionActions}}),Object.defineProperty(exports,"AccordionDetails",{enumerable:!0,get:function(){return y.AccordionDetails}}),Object.defineProperty(exports,"AccordionSummary",{enumerable:!0,get:function(){return y.AccordionSummary}}),Object.defineProperty(exports,"AlertTitle",{enumerable:!0,get:function(){return y.AlertTitle}}),Object.defineProperty(exports,"Autocomplete",{enumerable:!0,get:function(){return y.Autocomplete}}),Object.defineProperty(exports,"AvatarGroup",{enumerable:!0,get:function(){return y.AvatarGroup}}),Object.defineProperty(exports,"Backdrop",{enumerable:!0,get:function(){return y.Backdrop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return y.Badge}}),Object.defineProperty(exports,"BottomNavigation",{enumerable:!0,get:function(){return y.BottomNavigation}}),Object.defineProperty(exports,"BottomNavigationAction",{enumerable:!0,get:function(){return y.BottomNavigationAction}}),Object.defineProperty(exports,"Box",{enumerable:!0,get:function(){return y.Box}}),Object.defineProperty(exports,"ButtonBase",{enumerable:!0,get:function(){return y.ButtonBase}}),Object.defineProperty(exports,"ButtonGroup",{enumerable:!0,get:function(){return y.ButtonGroup}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return y.Card}}),Object.defineProperty(exports,"CardActionArea",{enumerable:!0,get:function(){return y.CardActionArea}}),Object.defineProperty(exports,"CardActions",{enumerable:!0,get:function(){return y.CardActions}}),Object.defineProperty(exports,"CardContent",{enumerable:!0,get:function(){return y.CardContent}}),Object.defineProperty(exports,"CardHeader",{enumerable:!0,get:function(){return y.CardHeader}}),Object.defineProperty(exports,"CardMedia",{enumerable:!0,get:function(){return y.CardMedia}}),Object.defineProperty(exports,"ClickAwayListener",{enumerable:!0,get:function(){return y.ClickAwayListener}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return y.Collapse}}),Object.defineProperty(exports,"Container",{enumerable:!0,get:function(){return y.Container}}),Object.defineProperty(exports,"CssBaseline",{enumerable:!0,get:function(){return y.CssBaseline}}),Object.defineProperty(exports,"DialogActions",{enumerable:!0,get:function(){return y.DialogActions}}),Object.defineProperty(exports,"DialogContent",{enumerable:!0,get:function(){return y.DialogContent}}),Object.defineProperty(exports,"DialogContentText",{enumerable:!0,get:function(){return y.DialogContentText}}),Object.defineProperty(exports,"DialogTitle",{enumerable:!0,get:function(){return y.DialogTitle}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return y.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return y.Drawer}}),Object.defineProperty(exports,"Fab",{enumerable:!0,get:function(){return y.Fab}}),Object.defineProperty(exports,"Fade",{enumerable:!0,get:function(){return y.Fade}}),Object.defineProperty(exports,"FilledInput",{enumerable:!0,get:function(){return y.FilledInput}}),Object.defineProperty(exports,"FormControl",{enumerable:!0,get:function(){return y.FormControl}}),Object.defineProperty(exports,"FormControlLabel",{enumerable:!0,get:function(){return y.FormControlLabel}}),Object.defineProperty(exports,"FormGroup",{enumerable:!0,get:function(){return y.FormGroup}}),Object.defineProperty(exports,"FormHelperText",{enumerable:!0,get:function(){return y.FormHelperText}}),Object.defineProperty(exports,"FormLabel",{enumerable:!0,get:function(){return y.FormLabel}}),Object.defineProperty(exports,"GlobalStyles",{enumerable:!0,get:function(){return y.GlobalStyles}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return y.Grid}}),Object.defineProperty(exports,"Grow",{enumerable:!0,get:function(){return y.Grow}}),Object.defineProperty(exports,"Hidden",{enumerable:!0,get:function(){return y.Hidden}}),Object.defineProperty(exports,"Icon",{enumerable:!0,get:function(){return y.Icon}}),Object.defineProperty(exports,"IconButton",{enumerable:!0,get:function(){return y.IconButton}}),Object.defineProperty(exports,"ImageList",{enumerable:!0,get:function(){return y.ImageList}}),Object.defineProperty(exports,"ImageListItem",{enumerable:!0,get:function(){return y.ImageListItem}}),Object.defineProperty(exports,"ImageListItemBar",{enumerable:!0,get:function(){return y.ImageListItemBar}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return y.Input}}),Object.defineProperty(exports,"InputAdornment",{enumerable:!0,get:function(){return y.InputAdornment}}),Object.defineProperty(exports,"InputBase",{enumerable:!0,get:function(){return y.InputBase}}),Object.defineProperty(exports,"InputLabel",{enumerable:!0,get:function(){return y.InputLabel}}),Object.defineProperty(exports,"LinearProgress",{enumerable:!0,get:function(){return y.LinearProgress}}),Object.defineProperty(exports,"Link",{enumerable:!0,get:function(){return y.Link}}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return y.ListItem}}),Object.defineProperty(exports,"ListItemAvatar",{enumerable:!0,get:function(){return y.ListItemAvatar}}),Object.defineProperty(exports,"ListItemButton",{enumerable:!0,get:function(){return y.ListItemButton}}),Object.defineProperty(exports,"ListItemIcon",{enumerable:!0,get:function(){return y.ListItemIcon}}),Object.defineProperty(exports,"ListItemSecondaryAction",{enumerable:!0,get:function(){return y.ListItemSecondaryAction}}),Object.defineProperty(exports,"ListItemText",{enumerable:!0,get:function(){return y.ListItemText}}),Object.defineProperty(exports,"ListSubheader",{enumerable:!0,get:function(){return y.ListSubheader}}),Object.defineProperty(exports,"MUIAccordion",{enumerable:!0,get:function(){return y.Accordion}}),Object.defineProperty(exports,"MUIAlert",{enumerable:!0,get:function(){return y.Alert}}),Object.defineProperty(exports,"MUIAppBar",{enumerable:!0,get:function(){return y.AppBar}}),Object.defineProperty(exports,"MUIAvatar",{enumerable:!0,get:function(){return y.Avatar}}),Object.defineProperty(exports,"MUIBreadcrumbs",{enumerable:!0,get:function(){return y.Breadcrumbs}}),Object.defineProperty(exports,"MUIButton",{enumerable:!0,get:function(){return y.Button}}),Object.defineProperty(exports,"MUICheckbox",{enumerable:!0,get:function(){return y.Checkbox}}),Object.defineProperty(exports,"MUIChip",{enumerable:!0,get:function(){return y.Chip}}),Object.defineProperty(exports,"MUICircularProgress",{enumerable:!0,get:function(){return y.CircularProgress}}),Object.defineProperty(exports,"MUIDialog",{enumerable:!0,get:function(){return y.Dialog}}),Object.defineProperty(exports,"MUIList",{enumerable:!0,get:function(){return y.List}}),Object.defineProperty(exports,"MUIMenu",{enumerable:!0,get:function(){return y.Menu}}),Object.defineProperty(exports,"MUIModal",{enumerable:!0,get:function(){return y.Modal}}),Object.defineProperty(exports,"MUIPagination",{enumerable:!0,get:function(){return y.Pagination}}),Object.defineProperty(exports,"MUIRadio",{enumerable:!0,get:function(){return y.Radio}}),Object.defineProperty(exports,"MUISelect",{enumerable:!0,get:function(){return y.Select}}),Object.defineProperty(exports,"MUISnackbar",{enumerable:!0,get:function(){return y.Snackbar}}),Object.defineProperty(exports,"MUITabs",{enumerable:!0,get:function(){return y.Tabs}}),Object.defineProperty(exports,"MUITextField",{enumerable:!0,get:function(){return y.TextField}}),Object.defineProperty(exports,"MUITooltip",{enumerable:!0,get:function(){return y.Tooltip}}),Object.defineProperty(exports,"MUITypography",{enumerable:!0,get:function(){return y.Typography}}),Object.defineProperty(exports,"MenuItem",{enumerable:!0,get:function(){return y.MenuItem}}),Object.defineProperty(exports,"MenuList",{enumerable:!0,get:function(){return y.MenuList}}),Object.defineProperty(exports,"MobileStepper",{enumerable:!0,get:function(){return y.MobileStepper}}),Object.defineProperty(exports,"NativeSelect",{enumerable:!0,get:function(){return y.NativeSelect}}),Object.defineProperty(exports,"NoSsr",{enumerable:!0,get:function(){return y.NoSsr}}),Object.defineProperty(exports,"OutlinedInput",{enumerable:!0,get:function(){return y.OutlinedInput}}),Object.defineProperty(exports,"PaginationItem",{enumerable:!0,get:function(){return y.PaginationItem}}),Object.defineProperty(exports,"Paper",{enumerable:!0,get:function(){return y.Paper}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return y.Popover}}),Object.defineProperty(exports,"Popper",{enumerable:!0,get:function(){return y.Popper}}),Object.defineProperty(exports,"Portal",{enumerable:!0,get:function(){return y.Portal}}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:function(){return y.RadioGroup}}),Object.defineProperty(exports,"Rating",{enumerable:!0,get:function(){return y.Rating}}),Object.defineProperty(exports,"ScopedCssBaseline",{enumerable:!0,get:function(){return y.ScopedCssBaseline}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return y.Slider}}),Object.defineProperty(exports,"SnackbarContent",{enumerable:!0,get:function(){return y.SnackbarContent}}),Object.defineProperty(exports,"SpeedDial",{enumerable:!0,get:function(){return y.SpeedDial}}),Object.defineProperty(exports,"SpeedDialAction",{enumerable:!0,get:function(){return y.SpeedDialAction}}),Object.defineProperty(exports,"SpeedDialIcon",{enumerable:!0,get:function(){return y.SpeedDialIcon}}),Object.defineProperty(exports,"Stack",{enumerable:!0,get:function(){return y.Stack}}),Object.defineProperty(exports,"Step",{enumerable:!0,get:function(){return y.Step}}),Object.defineProperty(exports,"StepButton",{enumerable:!0,get:function(){return y.StepButton}}),Object.defineProperty(exports,"StepContent",{enumerable:!0,get:function(){return y.StepContent}}),Object.defineProperty(exports,"StepLabel",{enumerable:!0,get:function(){return y.StepLabel}}),Object.defineProperty(exports,"Stepper",{enumerable:!0,get:function(){return y.Stepper}}),Object.defineProperty(exports,"SvgIcon",{enumerable:!0,get:function(){return y.SvgIcon}}),Object.defineProperty(exports,"SwipeableDrawer",{enumerable:!0,get:function(){return y.SwipeableDrawer}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return y.Switch}}),Object.defineProperty(exports,"Tab",{enumerable:!0,get:function(){return y.Tab}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return y.Table}}),Object.defineProperty(exports,"TableBody",{enumerable:!0,get:function(){return y.TableBody}}),Object.defineProperty(exports,"TableCell",{enumerable:!0,get:function(){return y.TableCell}}),Object.defineProperty(exports,"TableContainer",{enumerable:!0,get:function(){return y.TableContainer}}),Object.defineProperty(exports,"TableFooter",{enumerable:!0,get:function(){return y.TableFooter}}),Object.defineProperty(exports,"TableHead",{enumerable:!0,get:function(){return y.TableHead}}),Object.defineProperty(exports,"TablePagination",{enumerable:!0,get:function(){return y.TablePagination}}),Object.defineProperty(exports,"TableRow",{enumerable:!0,get:function(){return y.TableRow}}),Object.defineProperty(exports,"TableSortLabel",{enumerable:!0,get:function(){return y.TableSortLabel}}),Object.defineProperty(exports,"TextareaAutosize",{enumerable:!0,get:function(){return y.TextareaAutosize}}),Object.defineProperty(exports,"ToggleButton",{enumerable:!0,get:function(){return y.ToggleButton}}),Object.defineProperty(exports,"ToggleButtonGroup",{enumerable:!0,get:function(){return y.ToggleButtonGroup}}),Object.defineProperty(exports,"Toolbar",{enumerable:!0,get:function(){return y.Toolbar}}),Object.defineProperty(exports,"Zoom",{enumerable:!0,get:function(){return y.Zoom}}),Object.defineProperty(exports,"useMediaQuery",{enumerable:!0,get:function(){return y.useMediaQuery}}),Object.defineProperty(exports,"useScrollTrigger",{enumerable:!0,get:function(){return y.useScrollTrigger}}),Object.defineProperty(exports,"dayjs",{enumerable:!0,get:function(){return R.default}}),exports.COMMON_DATE_VALIDATIONS=T.COMMON_DATE_VALIDATIONS,exports.MenuFilter=T.MenuFilter,exports.MenuFilterService=T.MenuFilterService,exports.ModuleAccessService=T.ModuleAccessService,exports.StorageUtils=T.StorageUtils,exports.anyDateValidation=T.anyDateValidation,exports.businessDateValidation=T.businessDateValidation,exports.conditionalDateValidation=T.conditionalDateValidation,exports.createCustomMessages=T.createCustomMessages,exports.createDateValidation=T.createDateValidation,exports.createParameterizedNavigationHandler=T.createParameterizedNavigationHandler,exports.dateRangeValidation=T.dateRangeValidation,exports.dateTimeValidation=T.dateTimeValidation,exports.dateValidation=T.dateValidation,exports.futureDateValidation=T.futureDateValidation,exports.getCountry=T.getCountry,exports.migrateRoutesToUseParams=T.migrateRoutesToUseParams,exports.migrateToPathWithId=T.migrateToPathWithId,exports.pastDateValidation=T.pastDateValidation,exports.updateTableConfigForParameterizedNavigation=T.updateTableConfigForParameterizedNavigation,exports.DriveApi=D.api,exports.setDriveURL=D.setBaseUrl,exports.loadModuleTranslations=S.loadModuleTranslations,exports.createLibraryStore=h.createLibraryStore,exports.fetchBom=h.fetchBom,exports.fetchCompanies=h.fetchCompanies,exports.getAllUserAndDepartmentDropdown=h.getAllUserAndDepartmentDropdown,exports.getLibrarySlices=h.getLibrarySlices,exports.headerSlice=h.headerSlice,exports.inventoryReportsTitleBarSlice=h.inventoryReportsTitleBarSlice,exports.libraryReducers=h.libraryReducers,exports.reportsTitleBarSlice=h.reportsTitleBarSlice,exports.resetHeaderState=h.resetHeaderState,exports.resetInventoryReportsTitleBarState=h.resetInventoryReportsTitleBarState,exports.resetLanguagesState=h.resetLanguagesState,exports.resetReportsTitleBarState=h.resetReportsTitleBarState,exports.resetShareState=h.resetState,exports.setAssemblyItems=h.setAssemblyItems,exports.setBomData=h.setBomData,exports.setCurrentLanguage=h.setCurrentLanguage,exports.setDepartments=h.setDepartments,exports.setInventoryCompanies=h.setCompanies$1,exports.setInventoryError=h.setError$2,exports.setInventoryLoading=h.setLoading$2,exports.setItems=h.setItems,exports.setLanguages=h.setLanguages,exports.setLanguagesData=h.setLanguagesData,exports.setReportsCompanies=h.setCompanies,exports.setReportsError=h.setError$1,exports.setReportsLoading=h.setLoading$1,exports.setShareError=h.setError,exports.setShareLoading=h.setLoading,exports.setUsers=h.setUsers,exports.setWarehouseLocations=h.setWarehouseLocations,exports.sharePage=h.sharePage,exports.shareSlice=h.shareSlice,exports.API_METHOD_GROUPS=I.API_METHOD_GROUPS,exports.createConfiguredApiClient=I.createConfiguredApiClient,exports.validateApiClient=I.validateApiClient,exports.useAppDispatch=A.useAppDispatch,exports.useAppSelector=A.useAppSelector,exports.useLibraryDispatch=A.useLibraryDispatch,exports.useLibrarySelector=A.useLibrarySelector,exports.DriveTypes=O.DriveTypes,exports.InventoryTypes=O.InventoryTypes,exports.ManufacturingTypes=O.ManufacturingTypes,exports.PurchaseTypes=O.PurchaseTypes,exports.RbacTypes=O.RbacTypes,exports.RentalTypes=O.RentalTypes,exports.SalesTypes=O.SalesTypes,exports.SystemFeatureTypes=O.SystemFeatureTypes,exports.UserApi=O.UserApi,exports.UserTypes=O.UserTypes,exports.FullScreenLayout=function(e){/* @__PURE__ */
2
2
  return d.jsxs(F.default,{sx:{display:"flex"},children:[
3
3
  /* @__PURE__ */d.jsx(j.default,{}),
4
- /* @__PURE__ */d.jsx(a.AppBarWrapper,{width:B}),
5
- /* @__PURE__ */d.jsx(a.ActivityArea,{children:e.children})]})},exports.SidebarLayout=function(e){const t=b.useTheme(),{currentLanguage:r}=p.useLanguage(),o=g.useMemo(()=>"rtl"===(null==r?void 0:r.direction),[r]),[n,i]=g.useState(!0),[l,u]=g.useState(!1),[c,x]=g.useState(!1),m=n||!n&&l,y=g.useCallback(()=>{i(!0),u(!1);try{window.localStorage.setItem(M,"true")}catch(e){}},[]),P=g.useCallback(()=>{i(!1),window.localStorage.setItem("_is_drawer_open","false")},[]),[T,D]=g.useState(null),S=g.useCallback(async()=>{var e,t;const r=s.getToken(),o={"x-token":r["x-token"],"x-timezone":String(r["x-timezone"])},a=await f.getV1Settings(o),n=a&&(null==(t=null==(e=null==a?void 0:a.data)?void 0:e.settings)?void 0:t[0])||null;D(n)},[]);g.useEffect(()=>{S()},[S]);const[C,h]=g.useState(e.menu);g.useEffect(()=>{if(T&&Array.isArray(null==e?void 0:e.menu)){const t=e.menu.filter(e=>(null==T?void 0:T.enable_production_planning)?e:"Plans"!==e.label);h(t)}},[T,e.menu]);const I=g.useCallback(()=>{!n&&c&&(u(!1),window.localStorage.setItem(M,"false"))},[n,c]),A=g.useCallback(()=>{n?P():y()},[n,P,y]);return g.useEffect(()=>{(()=>{try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(M);i("true"===e),u(!1),x(!0)}else i(!0),x(!0)}catch(e){i(!0),x(!0)}})()},[]),g.useEffect(()=>{const e=()=>{try{if("undefined"!=typeof window&&window.localStorage){const e="true"===window.localStorage.getItem(M);e!==n&&(i(e),u(!1))}}catch(e){}};return window.addEventListener("focus",e),()=>{window.removeEventListener("focus",e)}},[n]),c?/* @__PURE__ */d.jsxs(F.default,{sx:{display:"flex",minHeight:"100vh",direction:o?"rtl":"ltr"},children:[
6
- /* @__PURE__ */d.jsx(a.AppBarWrapper,{open:n,handleDrawerOpen:y,handleDrawerClose:P,toggleDrawer:A,width:B,forcedOpen:n,hoverOpen:l}),
7
- /* @__PURE__ */d.jsx(a.Sidebar,{open:n,forcedOpen:n,hoverOpen:l,handleDrawerClose:P,handleDrawerOpen:y,toggleDrawer:A,width:B,theme:t,menu:C,handleMouseEnter:()=>{n||(setOpen(!0),window.localStorage.setItem(M,"true"))},handleMouseLeave:I,isInitialized:c}),
8
- /* @__PURE__ */d.jsx(a.ActivityArea,{isDrawerOpen:m,drawerWidth:B,forcedOpen:n,children:e.children})]}):/* @__PURE__ */d.jsx(F.default,{sx:{display:"flex",minHeight:"100vh",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */d.jsx(F.default,{children:"Loading..."})})},exports.configureLibrary=e=>{E={...E,...e}},exports.getConfigFunction=(e,t)=>{const r=E[e];if(r&&r[t])return r[t];switch(`${String(e)}.${String(t)}`){case"routes.generatePathWithId":return(e,t)=>e.replace(":id",String(t));case"dataTransforms.formatCurrency":return(e,t="USD")=>`${t} ${e.toFixed(2)}`;case"dataTransforms.formatDate":return e=>new Date(e).toLocaleDateString();case"validation.validateEmail":return e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);case"permissions.hasPermission":return()=>!0;case"localization.getCurrentLanguage":return()=>"en";case"localization.translate":return e=>e;case"notifications.showSuccess":case"notifications.showError":case"notifications.showInfo":return e=>{};default:return(...r)=>{throw new Error(`Configuration not provided for ${String(e)}.${String(t)}. Please configure this in your consuming application.`)}}},exports.getLibraryConfig=()=>E,Object.keys(C).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return C[e]}})});
4
+ /* @__PURE__ */d.jsx(a.AppBarWrapper,{width:M}),
5
+ /* @__PURE__ */d.jsx(a.ActivityArea,{children:e.children})]})},exports.SidebarLayout=function(e){const t=b.useTheme(),{currentLanguage:r}=p.useLanguage(),o=g.useMemo(()=>"rtl"===(null==r?void 0:r.direction),[r]),[n,i]=g.useState(!0),[l,u]=g.useState(!1),[c,x]=g.useState(!1),m=n||!n&&l,y=g.useCallback(()=>{i(!0),u(!1);try{window.localStorage.setItem(B,"true")}catch(e){}},[]),P=g.useCallback(()=>{i(!1),window.localStorage.setItem("_is_drawer_open","false")},[]),[T,D]=g.useState(null),S=g.useCallback(async()=>{var e,t;const r=s.getToken(),o={"x-token":r["x-token"],"x-timezone":String(r["x-timezone"])},a=await f.getV1Settings(o),n=a&&(null==(t=null==(e=null==a?void 0:a.data)?void 0:e.settings)?void 0:t[0])||null;D(n)},[]);g.useEffect(()=>{S()},[S]);const[C,h]=g.useState(e.menu);g.useEffect(()=>{if(T&&Array.isArray(null==e?void 0:e.menu)){const t=e.menu.filter(e=>(null==T?void 0:T.enable_production_planning)?e:"Plans"!==e.label);h(t)}},[T,e.menu]);const I=g.useCallback(()=>{!n&&c&&(u(!1),window.localStorage.setItem(B,"false"))},[n,c]),A=g.useCallback(()=>{n?P():y()},[n,P,y]);return g.useEffect(()=>{(()=>{try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(B);i("true"===e),u(!1),x(!0)}else i(!0),x(!0)}catch(e){i(!0),x(!0)}})()},[]),g.useEffect(()=>{const e=()=>{try{if("undefined"!=typeof window&&window.localStorage){const e="true"===window.localStorage.getItem(B);e!==n&&(i(e),u(!1))}}catch(e){}};return window.addEventListener("focus",e),()=>{window.removeEventListener("focus",e)}},[n]),c?/* @__PURE__ */d.jsxs(F.default,{sx:{display:"flex",minHeight:"100vh",direction:o?"rtl":"ltr"},children:[
6
+ /* @__PURE__ */d.jsx(a.AppBarWrapper,{open:n,handleDrawerOpen:y,handleDrawerClose:P,toggleDrawer:A,width:M,forcedOpen:n,hoverOpen:l}),
7
+ /* @__PURE__ */d.jsx(a.Sidebar,{open:n,forcedOpen:n,hoverOpen:l,handleDrawerClose:P,handleDrawerOpen:y,toggleDrawer:A,width:M,theme:t,menu:C,handleMouseEnter:()=>{n||(setOpen(!0),window.localStorage.setItem(B,"true"))},handleMouseLeave:I,isInitialized:c}),
8
+ /* @__PURE__ */d.jsx(a.ActivityArea,{isDrawerOpen:m,drawerWidth:M,forcedOpen:n,children:e.children})]}):/* @__PURE__ */d.jsx(F.default,{sx:{display:"flex",minHeight:"100vh",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */d.jsx(F.default,{children:"Loading..."})})},exports.configureLibrary=e=>{E={...E,...e}},exports.getConfigFunction=(e,t)=>{const r=E[e];if(r&&r[t])return r[t];switch(`${String(e)}.${String(t)}`){case"routes.generatePathWithId":return(e,t)=>e.replace(":id",String(t));case"dataTransforms.formatCurrency":return(e,t="USD")=>`${t} ${e.toFixed(2)}`;case"dataTransforms.formatDate":return e=>new Date(e).toLocaleDateString();case"validation.validateEmail":return e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);case"permissions.hasPermission":return()=>!0;case"localization.getCurrentLanguage":return()=>"en";case"localization.translate":return e=>e;case"notifications.showSuccess":case"notifications.showError":case"notifications.showInfo":return e=>{};default:return(...r)=>{throw new Error(`Configuration not provided for ${String(e)}.${String(t)}. Please configure this in your consuming application.`)}}},exports.getLibraryConfig=()=>E,Object.keys(C).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return C[e]}})});
9
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/config/index.ts","../src/constants/mui.constants.ts","../src/layout/sidebarScreen/sidebarScreen.tsx","../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["// Configuration system for application-specific business logic\n\nexport interface LibraryConfig {\n // Route and navigation configuration\n routes?: {\n // Function to generate paths with IDs\n generatePathWithId?: (path: string, id: string | number) => string;\n // Base paths for different modules\n basePaths?: {\n [module: string]: string;\n };\n };\n \n // Data transformation functions\n dataTransforms?: {\n // Function to transform API responses\n transformApiResponse?: (response: any, context?: string) => any;\n // Function to format currency\n formatCurrency?: (amount: number, currency?: string) => string;\n // Function to format dates\n formatDate?: (date: any, format?: string) => string;\n };\n \n // Validation functions\n validation?: {\n // Custom validation rules\n validateField?: (value: any, rules: any) => boolean | string;\n // Phone number validation\n validatePhone?: (phone: string, country?: string) => boolean;\n // Email validation\n validateEmail?: (email: string) => boolean;\n };\n \n // Permission system\n permissions?: {\n // Check if user has permission\n hasPermission?: (permission: string, context?: any) => boolean;\n // Get user permissions\n getUserPermissions?: () => string[];\n };\n \n // Localization\n localization?: {\n // Get current language\n getCurrentLanguage?: () => string;\n // Translate function\n translate?: (key: string, params?: any) => string;\n // Get available languages\n getAvailableLanguages?: () => Array<{ code: string; name: string }>;\n };\n \n // File handling\n fileHandling?: {\n // Upload file function\n uploadFile?: (file: File, options?: any) => Promise<any>;\n // Download file function\n downloadFile?: (fileId: string, options?: any) => Promise<any>;\n // Get file URL\n getFileUrl?: (fileId: string) => string;\n };\n \n // Notification system\n notifications?: {\n // Show success notification\n showSuccess?: (message: string, options?: any) => void;\n // Show error notification\n showError?: (message: string, options?: any) => void;\n // Show info notification\n showInfo?: (message: string, options?: any) => void;\n };\n}\n\nlet libraryConfig: LibraryConfig = {};\n\nexport const configureLibrary = (config: LibraryConfig) => {\n libraryConfig = { ...libraryConfig, ...config };\n};\n\nexport const getLibraryConfig = () => libraryConfig;\n\n// Helper function to get configuration with fallback\nexport const getConfigFunction = <T extends keyof LibraryConfig>(\n category: T,\n functionName: keyof LibraryConfig[T]\n): any => {\n const categoryConfig = libraryConfig[category];\n if (categoryConfig && categoryConfig[functionName]) {\n return categoryConfig[functionName];\n }\n \n // Return default implementation or throw error based on criticality\n switch (`${String(category)}.${String(functionName)}`) {\n case 'routes.generatePathWithId':\n return (path: string, id: string | number) => path.replace(':id', String(id));\n \n case 'dataTransforms.formatCurrency':\n return (amount: number, currency = 'USD') => `${currency} ${amount.toFixed(2)}`;\n \n case 'dataTransforms.formatDate':\n return (date: any) => new Date(date).toLocaleDateString();\n \n case 'validation.validateEmail':\n return (email: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n \n case 'permissions.hasPermission':\n return () => true; // Default to allowing all permissions\n \n case 'localization.getCurrentLanguage':\n return () => 'en';\n \n case 'localization.translate':\n return (key: string) => key; // Return key as fallback\n \n case 'notifications.showSuccess':\n case 'notifications.showError':\n case 'notifications.showInfo':\n return (message: string) => console.log(message);\n \n default:\n return (...args: any[]) => {\n throw new Error(`Configuration not provided for ${String(category)}.${String(functionName)}. Please configure this in your consuming application.`);\n };\n }\n};","const drawerWidth = 300;\n\nexport default drawerWidth;\n","import { useEffect, useState, useCallback, useMemo } from \"react\";\r\n\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport Box from \"@mui/material/Box\";\r\n\r\nimport AppBar from \"../../components/appbar/appbar\";\r\nimport SideBar from \"../../components/sidebar/sidebar\";\r\nimport ActivityArea from \"../../components/activityArea/activityArea\";\r\n\r\nimport drawerWidth from \"../../constants/mui.constants\";\r\n// const drawerWidth = 240;\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { getToken } from \"@/utils\";\r\nimport { getV1Settings } from \"../../api-client/api.manufacturing/api\";\r\n\r\n// Local storage key for drawer state\r\nconst DRAWER_STATE_KEY = '_is_drawer_open';\r\n\r\n// Interface for better type safety\r\ninterface SidebarLayoutProps {\r\n menu: any[];\r\n children: React.ReactNode;\r\n}\r\n\r\nexport default function SidebarLayout(props: SidebarLayoutProps) {\r\n const theme = useTheme();\r\n const {currentLanguage}=useLanguage();\r\n const isRtl=useMemo(()=>currentLanguage?.direction===\"rtl\",[currentLanguage])\r\n // Enhanced state management\r\n const [forcedOpen, setForcedOpen] = useState(true);\r\n const [hoverOpen, setHoverOpen] = useState(false);\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n \r\n // Memoized computed state for actual drawer open status\r\n const isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\r\n\r\n // Enhanced drawer control functions with better state management\r\n const handleDrawerOpen = useCallback(() => {\r\n setForcedOpen(true);\r\n setHoverOpen(false); // Clear hover state when forcing open\r\n try {\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n } catch (error) {\r\n console.warn('Failed to save drawer state to localStorage:', error);\r\n }\r\n }, []);\r\n\r\n const handleDrawerClose = useCallback(() => {\r\n setForcedOpen(false);\r\n window.localStorage.setItem('_is_drawer_open', 'false')\r\n }, []);\r\n\r\n const [wipSettingsData, setWipSettingsData] = useState<any>(null)\r\n \r\n const getSettings = useCallback(async () => {\r\n // getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\r\n const tokenData = getToken();\r\n const apiParams = {\r\n \"x-token\": tokenData[\"x-token\"],\r\n \"x-timezone\": String(tokenData[\"x-timezone\"]),\r\n };\r\n const response = await getV1Settings(apiParams);\r\n // The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\r\n const data = (response && (response as any)?.data?.settings?.[0]) || null;\r\n setWipSettingsData(data);\r\n }, []);\r\n useEffect(() => {\r\n getSettings()\r\n }, [getSettings])\r\n\r\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(props.menu)\r\n\r\n\tuseEffect(() => {\r\n\t\tif(wipSettingsData && Array.isArray(props?.menu)){\r\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\r\n\t\t\tconst _new = props.menu.filter((item) => {\r\n\t\t\t\tif(!wipSettingsData?.enable_production_planning){\r\n\t\t\t\t\treturn item.label !== \"Plans\"\r\n\t\t\t\t}else {\r\n\t\t\t\t\treturn item\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tsetManufacturingSubmenu(_new)\r\n\t\t}\r\n\t}, [wipSettingsData, props.menu])\r\n\t// const module_type = '';\r\n\r\n const handleMouseEnter = () => {\r\n if(!forcedOpen) {\r\n setOpen(true)\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'true')\r\n }\r\n };\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n if (!forcedOpen && isInitialized) {\r\n setHoverOpen(false);\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'false');\r\n }\r\n }, [forcedOpen, isInitialized]);\r\n\r\n // Toggle function for programmatic control\r\n const toggleDrawer = useCallback(() => {\r\n if (forcedOpen) {\r\n handleDrawerClose();\r\n } else {\r\n handleDrawerOpen();\r\n }\r\n }, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\r\n\r\n // Enhanced initialization with error handling\r\n useEffect(() => {\r\n const initializeDrawerState = () => {\r\n try {\r\n if (typeof window !== 'undefined' && window.localStorage) {\r\n const savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n const shouldBeOpen = savedState === 'true';\r\n \r\n setForcedOpen(shouldBeOpen);\r\n setHoverOpen(false); // Ensure hover state is reset\r\n setIsInitialized(true);\r\n } else {\r\n // Fallback for environments without localStorage\r\n setForcedOpen(true);\r\n setIsInitialized(true);\r\n }\r\n } catch (error) {\r\n console.warn('Failed to read drawer state from localStorage:', error);\r\n // Fallback to default state\r\n setForcedOpen(true);\r\n setIsInitialized(true);\r\n }\r\n };\r\n\r\n initializeDrawerState();\r\n }, []);\r\n\r\n // Handle window focus to sync state across tabs\r\n useEffect(() => {\r\n const handleWindowFocus = () => {\r\n try {\r\n if (typeof window !== 'undefined' && window.localStorage) {\r\n const savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n const shouldBeOpen = savedState === 'true';\r\n \r\n if (shouldBeOpen !== forcedOpen) {\r\n setForcedOpen(shouldBeOpen);\r\n setHoverOpen(false);\r\n }\r\n }\r\n } catch (error) {\r\n console.warn('Failed to sync drawer state on window focus:', error);\r\n }\r\n };\r\n\r\n window.addEventListener('focus', handleWindowFocus);\r\n \r\n return () => {\r\n window.removeEventListener('focus', handleWindowFocus);\r\n };\r\n }, [forcedOpen]);\r\n\r\n // Prevent rendering until initialization is complete\r\n if (!isInitialized) {\r\n return (\r\n <Box sx={{ \r\n display: \"flex\", \r\n minHeight: \"100vh\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\"\r\n }}>\r\n {/* Optional loading indicator */}\r\n <Box>Loading...</Box>\r\n </Box>\r\n );\r\n }\r\n\r\n return (\r\n <Box sx={{ display: \"flex\", minHeight: \"100vh\",direction: isRtl ? \"rtl\" : \"ltr\" }}>\r\n <AppBar\r\n open={forcedOpen}\r\n handleDrawerOpen={handleDrawerOpen}\r\n handleDrawerClose={handleDrawerClose}\r\n toggleDrawer={toggleDrawer}\r\n width={drawerWidth}\r\n forcedOpen={forcedOpen}\r\n hoverOpen={hoverOpen}\r\n />\r\n \r\n <SideBar\r\n open={forcedOpen}\r\n forcedOpen={forcedOpen}\r\n hoverOpen={hoverOpen}\r\n handleDrawerClose={handleDrawerClose}\r\n handleDrawerOpen={handleDrawerOpen}\r\n toggleDrawer={toggleDrawer}\r\n width={drawerWidth}\r\n theme={theme}\r\n menu={manufacturingSubmenu}\r\n handleMouseEnter={handleMouseEnter}\r\n handleMouseLeave={handleMouseLeave}\r\n isInitialized={isInitialized}\r\n />\r\n \r\n <ActivityArea \r\n isDrawerOpen={isDrawerOpen}\r\n drawerWidth={drawerWidth}\r\n forcedOpen={forcedOpen}\r\n >\r\n {props.children}\r\n </ActivityArea>\r\n </Box>\r\n );\r\n}","import CssBaseline from \"@mui/material/CssBaseline\";\r\nimport Box from \"@mui/material/Box\";\r\n\r\nimport AppBar from \"../../components/appbar/appbar\";\r\nimport ActivityArea from \"../../components/activityArea/activityArea\";\r\n\r\nimport drawerWidth from \"../../constants/mui.constants\";\r\n\r\nexport default function FullscreenLayout(props: any) {\r\n return (\r\n <Box sx={{ display: \"flex\" }}>\r\n <CssBaseline />\r\n <AppBar width={drawerWidth} />\r\n <ActivityArea>{props.children}</ActivityArea>\r\n </Box>\r\n );\r\n}\r\n"],"names":["libraryConfig","drawerWidth","DRAWER_STATE_KEY","props","Box","sx","display","children","jsx","CssBaseline","AppBar","width","ActivityArea","theme","useTheme","currentLanguage","useLanguage","isRtl","useMemo","direction","forcedOpen","setForcedOpen","useState","hoverOpen","setHoverOpen","isInitialized","setIsInitialized","isDrawerOpen","handleDrawerOpen","useCallback","window","localStorage","setItem","error","handleDrawerClose","wipSettingsData","setWipSettingsData","getSettings","async","tokenData","getToken","apiParams","String","response","getV1Settings","data","_b","_a","settings","useEffect","manufacturingSubmenu","setManufacturingSubmenu","menu","Array","isArray","_new","filter","item","enable_production_planning","label","handleMouseLeave","toggleDrawer","savedState","getItem","initializeDrawerState","handleWindowFocus","shouldBeOpen","addEventListener","removeEventListener","jsxs","minHeight","open","SideBar","handleMouseEnter","setOpen","alignItems","justifyContent","config","category","functionName","categoryConfig","path","id","replace","amount","currency","toFixed","date","Date","toLocaleDateString","email","test","key","message","args","Error"],"mappings":"+mCAwEA,IAAIA,EAA+B,CAAA,EAE5B,MC1EDC,EAAc,ICgBdC,EAAmB,6+6BCRzB,SAAyCC;AACvC,cACGC,EAAAA,QAAA,CAAIC,GAAI,CAAEC,QAAS,QAClBC,SAAA;eAAAC,EAAAA,IAACC,EAAAA,QAAA;iBACDD,IAACE,EAAAA,cAAA,CAAOC,MAAOV;eACfO,EAAAA,IAACI,EAAAA,aAAA,CAAcL,SAAAJ,EAAMI,aAG3B,wBDQA,SAAsCJ,GACpC,MAAMU,EAAQC,EAAAA,YACTC,gBAACA,GAAiBC,gBACjBC,EAAMC,EAAAA,QAAQ,IAAiC,eAA7BH,WAAiBI,WAAkB,CAACJ,KAErDK,EAAYC,GAAiBC,EAAAA,UAAS,IACtCC,EAAWC,GAAgBF,EAAAA,UAAS,IACpCG,EAAeC,GAAoBJ,EAAAA,UAAS,GAG7CK,EAAeP,IAAgBA,GAAcG,EAG7CK,EAAmBC,EAAAA,YAAY,KACnCR,GAAc,GACdG,GAAa,GACb,IACEM,OAAOC,aAAaC,QAAQ9B,EAAkB,OAChD,OAAS+B,GAET,GACC,IAEGC,EAAoBL,EAAAA,YAAY,KACpCR,GAAc,GACdS,OAAOC,aAAaC,QAAQ,kBAAmB,UAC9C,KAEIG,EAAiBC,GAAsBd,EAAAA,SAAc,MAEtDe,EAAcR,EAAAA,YAAYS,kBAE9B,MAAMC,EAAYC,EAAAA,WACZC,EA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KD,GAE9D,IAAK,4BACH,MAAO,KAAM,EAEf,IAAK,kCACH,MAAO,IAAM,KAEf,IAAK,yBACH,OAAQE,GAAgBA,EAE1B,IAAK,4BACL,IAAK,0BACL,IAAK,yBACH,OAAQC,MAEV,QACE,MAAO,IAAIC,KACT,MAAM,IAAIC,MAAM,kCAAkCrD,OAAOoC,MAAapC,OAAOqC,wFA1CrD,IAAM/E"}
1
+ {"version":3,"file":"index.js","sources":["../src/config/index.ts","../src/constants/mui.constants.ts","../src/layout/sidebarScreen/sidebarScreen.tsx","../src/layout/fullScreen/fullScreen.tsx"],"sourcesContent":["// Configuration system for application-specific business logic\n\nexport interface LibraryConfig {\n // Route and navigation configuration\n routes?: {\n // Function to generate paths with IDs\n generatePathWithId?: (path: string, id: string | number) => string;\n // Base paths for different modules\n basePaths?: {\n [module: string]: string;\n };\n };\n \n // Data transformation functions\n dataTransforms?: {\n // Function to transform API responses\n transformApiResponse?: (response: any, context?: string) => any;\n // Function to format currency\n formatCurrency?: (amount: number, currency?: string) => string;\n // Function to format dates\n formatDate?: (date: any, format?: string) => string;\n };\n \n // Validation functions\n validation?: {\n // Custom validation rules\n validateField?: (value: any, rules: any) => boolean | string;\n // Phone number validation\n validatePhone?: (phone: string, country?: string) => boolean;\n // Email validation\n validateEmail?: (email: string) => boolean;\n };\n \n // Permission system\n permissions?: {\n // Check if user has permission\n hasPermission?: (permission: string, context?: any) => boolean;\n // Get user permissions\n getUserPermissions?: () => string[];\n };\n \n // Localization\n localization?: {\n // Get current language\n getCurrentLanguage?: () => string;\n // Translate function\n translate?: (key: string, params?: any) => string;\n // Get available languages\n getAvailableLanguages?: () => Array<{ code: string; name: string }>;\n };\n \n // File handling\n fileHandling?: {\n // Upload file function\n uploadFile?: (file: File, options?: any) => Promise<any>;\n // Download file function\n downloadFile?: (fileId: string, options?: any) => Promise<any>;\n // Get file URL\n getFileUrl?: (fileId: string) => string;\n };\n \n // Notification system\n notifications?: {\n // Show success notification\n showSuccess?: (message: string, options?: any) => void;\n // Show error notification\n showError?: (message: string, options?: any) => void;\n // Show info notification\n showInfo?: (message: string, options?: any) => void;\n };\n}\n\nlet libraryConfig: LibraryConfig = {};\n\nexport const configureLibrary = (config: LibraryConfig) => {\n libraryConfig = { ...libraryConfig, ...config };\n};\n\nexport const getLibraryConfig = () => libraryConfig;\n\n// Helper function to get configuration with fallback\nexport const getConfigFunction = <T extends keyof LibraryConfig>(\n category: T,\n functionName: keyof LibraryConfig[T]\n): any => {\n const categoryConfig = libraryConfig[category];\n if (categoryConfig && categoryConfig[functionName]) {\n return categoryConfig[functionName];\n }\n \n // Return default implementation or throw error based on criticality\n switch (`${String(category)}.${String(functionName)}`) {\n case 'routes.generatePathWithId':\n return (path: string, id: string | number) => path.replace(':id', String(id));\n \n case 'dataTransforms.formatCurrency':\n return (amount: number, currency = 'USD') => `${currency} ${amount.toFixed(2)}`;\n \n case 'dataTransforms.formatDate':\n return (date: any) => new Date(date).toLocaleDateString();\n \n case 'validation.validateEmail':\n return (email: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n \n case 'permissions.hasPermission':\n return () => true; // Default to allowing all permissions\n \n case 'localization.getCurrentLanguage':\n return () => 'en';\n \n case 'localization.translate':\n return (key: string) => key; // Return key as fallback\n \n case 'notifications.showSuccess':\n case 'notifications.showError':\n case 'notifications.showInfo':\n return (message: string) => console.log(message);\n \n default:\n return (...args: any[]) => {\n throw new Error(`Configuration not provided for ${String(category)}.${String(functionName)}. Please configure this in your consuming application.`);\n };\n }\n};","const drawerWidth = 300;\n\nexport default drawerWidth;\n","import { useEffect, useState, useCallback, useMemo } from \"react\";\r\n\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport Box from \"@mui/material/Box\";\r\n\r\nimport AppBar from \"../../components/appbar/appbar\";\r\nimport SideBar from \"../../components/sidebar/sidebar\";\r\nimport ActivityArea from \"../../components/activityArea/activityArea\";\r\n\r\nimport drawerWidth from \"../../constants/mui.constants\";\r\n// const drawerWidth = 240;\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { getToken } from \"@/utils\";\r\nimport { getV1Settings } from \"../../api-client/api.manufacturing/api\";\r\n\r\n// Local storage key for drawer state\r\nconst DRAWER_STATE_KEY = '_is_drawer_open';\r\n\r\n// Interface for better type safety\r\ninterface SidebarLayoutProps {\r\n menu: any[];\r\n children: React.ReactNode;\r\n}\r\n\r\nexport default function SidebarLayout(props: SidebarLayoutProps) {\r\n const theme = useTheme();\r\n const {currentLanguage}=useLanguage();\r\n const isRtl=useMemo(()=>currentLanguage?.direction===\"rtl\",[currentLanguage])\r\n // Enhanced state management\r\n const [forcedOpen, setForcedOpen] = useState(true);\r\n const [hoverOpen, setHoverOpen] = useState(false);\r\n const [isInitialized, setIsInitialized] = useState(false);\r\n \r\n // Memoized computed state for actual drawer open status\r\n const isDrawerOpen = forcedOpen || (!forcedOpen && hoverOpen);\r\n\r\n // Enhanced drawer control functions with better state management\r\n const handleDrawerOpen = useCallback(() => {\r\n setForcedOpen(true);\r\n setHoverOpen(false); // Clear hover state when forcing open\r\n try {\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'true');\r\n } catch (error) {\r\n console.warn('Failed to save drawer state to localStorage:', error);\r\n }\r\n }, []);\r\n\r\n const handleDrawerClose = useCallback(() => {\r\n setForcedOpen(false);\r\n window.localStorage.setItem('_is_drawer_open', 'false')\r\n }, []);\r\n\r\n const [wipSettingsData, setWipSettingsData] = useState<any>(null)\r\n \r\n const getSettings = useCallback(async () => {\r\n // getToken returns { \"x-token\": string; \"x-timezone\": number }, but API expects string type for \"x-timezone\"\r\n const tokenData = getToken();\r\n const apiParams = {\r\n \"x-token\": tokenData[\"x-token\"],\r\n \"x-timezone\": String(tokenData[\"x-timezone\"]),\r\n };\r\n const response = await getV1Settings(apiParams);\r\n // The \"data\" property may not exist on GetV1SettingsResponses, so check existence safely\r\n const data = (response && (response as any)?.data?.settings?.[0]) || null;\r\n setWipSettingsData(data);\r\n }, []);\r\n useEffect(() => {\r\n getSettings()\r\n }, [getSettings])\r\n\r\n\tconst [manufacturingSubmenu, setManufacturingSubmenu] = useState<any>(props.menu)\r\n\r\n\tuseEffect(() => {\r\n\t\tif(wipSettingsData && Array.isArray(props?.menu)){\r\n\t\t\tconsole.log('wipSettingsData: ', wipSettingsData);\r\n\t\t\tconst _new = props.menu.filter((item) => {\r\n\t\t\t\tif(!wipSettingsData?.enable_production_planning){\r\n\t\t\t\t\treturn item.label !== \"Plans\"\r\n\t\t\t\t}else {\r\n\t\t\t\t\treturn item\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tsetManufacturingSubmenu(_new)\r\n\t\t}\r\n\t}, [wipSettingsData, props.menu])\r\n\t// const module_type = '';\r\n\r\n const handleMouseEnter = () => {\r\n if(!forcedOpen) {\r\n setOpen(true)\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'true')\r\n }\r\n };\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n if (!forcedOpen && isInitialized) {\r\n setHoverOpen(false);\r\n window.localStorage.setItem(DRAWER_STATE_KEY, 'false');\r\n }\r\n }, [forcedOpen, isInitialized]);\r\n\r\n // Toggle function for programmatic control\r\n const toggleDrawer = useCallback(() => {\r\n if (forcedOpen) {\r\n handleDrawerClose();\r\n } else {\r\n handleDrawerOpen();\r\n }\r\n }, [forcedOpen, handleDrawerClose, handleDrawerOpen]);\r\n\r\n // Enhanced initialization with error handling\r\n useEffect(() => {\r\n const initializeDrawerState = () => {\r\n try {\r\n if (typeof window !== 'undefined' && window.localStorage) {\r\n const savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n const shouldBeOpen = savedState === 'true';\r\n \r\n setForcedOpen(shouldBeOpen);\r\n setHoverOpen(false); // Ensure hover state is reset\r\n setIsInitialized(true);\r\n } else {\r\n // Fallback for environments without localStorage\r\n setForcedOpen(true);\r\n setIsInitialized(true);\r\n }\r\n } catch (error) {\r\n console.warn('Failed to read drawer state from localStorage:', error);\r\n // Fallback to default state\r\n setForcedOpen(true);\r\n setIsInitialized(true);\r\n }\r\n };\r\n\r\n initializeDrawerState();\r\n }, []);\r\n\r\n // Handle window focus to sync state across tabs\r\n useEffect(() => {\r\n const handleWindowFocus = () => {\r\n try {\r\n if (typeof window !== 'undefined' && window.localStorage) {\r\n const savedState = window.localStorage.getItem(DRAWER_STATE_KEY);\r\n const shouldBeOpen = savedState === 'true';\r\n \r\n if (shouldBeOpen !== forcedOpen) {\r\n setForcedOpen(shouldBeOpen);\r\n setHoverOpen(false);\r\n }\r\n }\r\n } catch (error) {\r\n console.warn('Failed to sync drawer state on window focus:', error);\r\n }\r\n };\r\n\r\n window.addEventListener('focus', handleWindowFocus);\r\n \r\n return () => {\r\n window.removeEventListener('focus', handleWindowFocus);\r\n };\r\n }, [forcedOpen]);\r\n\r\n // Prevent rendering until initialization is complete\r\n if (!isInitialized) {\r\n return (\r\n <Box sx={{ \r\n display: \"flex\", \r\n minHeight: \"100vh\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\"\r\n }}>\r\n {/* Optional loading indicator */}\r\n <Box>Loading...</Box>\r\n </Box>\r\n );\r\n }\r\n\r\n return (\r\n <Box sx={{ display: \"flex\", minHeight: \"100vh\",direction: isRtl ? \"rtl\" : \"ltr\" }}>\r\n <AppBar\r\n open={forcedOpen}\r\n handleDrawerOpen={handleDrawerOpen}\r\n handleDrawerClose={handleDrawerClose}\r\n toggleDrawer={toggleDrawer}\r\n width={drawerWidth}\r\n forcedOpen={forcedOpen}\r\n hoverOpen={hoverOpen}\r\n />\r\n \r\n <SideBar\r\n open={forcedOpen}\r\n forcedOpen={forcedOpen}\r\n hoverOpen={hoverOpen}\r\n handleDrawerClose={handleDrawerClose}\r\n handleDrawerOpen={handleDrawerOpen}\r\n toggleDrawer={toggleDrawer}\r\n width={drawerWidth}\r\n theme={theme}\r\n menu={manufacturingSubmenu}\r\n handleMouseEnter={handleMouseEnter}\r\n handleMouseLeave={handleMouseLeave}\r\n isInitialized={isInitialized}\r\n />\r\n \r\n <ActivityArea \r\n isDrawerOpen={isDrawerOpen}\r\n drawerWidth={drawerWidth}\r\n forcedOpen={forcedOpen}\r\n >\r\n {props.children}\r\n </ActivityArea>\r\n </Box>\r\n );\r\n}","import CssBaseline from \"@mui/material/CssBaseline\";\r\nimport Box from \"@mui/material/Box\";\r\n\r\nimport AppBar from \"../../components/appbar/appbar\";\r\nimport ActivityArea from \"../../components/activityArea/activityArea\";\r\n\r\nimport drawerWidth from \"../../constants/mui.constants\";\r\n\r\nexport default function FullscreenLayout(props: any) {\r\n return (\r\n <Box sx={{ display: \"flex\" }}>\r\n <CssBaseline />\r\n <AppBar width={drawerWidth} />\r\n <ActivityArea>{props.children}</ActivityArea>\r\n </Box>\r\n );\r\n}\r\n"],"names":["libraryConfig","drawerWidth","DRAWER_STATE_KEY","props","Box","sx","display","children","jsx","CssBaseline","AppBar","width","ActivityArea","theme","useTheme","currentLanguage","useLanguage","isRtl","useMemo","direction","forcedOpen","setForcedOpen","useState","hoverOpen","setHoverOpen","isInitialized","setIsInitialized","isDrawerOpen","handleDrawerOpen","useCallback","window","localStorage","setItem","error","handleDrawerClose","wipSettingsData","setWipSettingsData","getSettings","async","tokenData","getToken","apiParams","String","response","getV1Settings","data","_b","_a","settings","useEffect","manufacturingSubmenu","setManufacturingSubmenu","menu","Array","isArray","_new","filter","item","enable_production_planning","label","handleMouseLeave","toggleDrawer","savedState","getItem","initializeDrawerState","handleWindowFocus","shouldBeOpen","addEventListener","removeEventListener","jsxs","minHeight","open","SideBar","handleMouseEnter","setOpen","alignItems","justifyContent","config","category","functionName","categoryConfig","path","id","replace","amount","currency","toFixed","date","Date","toLocaleDateString","email","test","key","message","args","Error"],"mappings":"2mCAwEA,IAAIA,EAA+B,CAAA,EAE5B,MC1EDC,EAAc,ICgBdC,EAAmB,ip7BCRzB,SAAyCC;AACvC,cACGC,EAAAA,QAAA,CAAIC,GAAI,CAAEC,QAAS,QAClBC,SAAA;eAAAC,EAAAA,IAACC,EAAAA,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0D,mBACAnC;eAGFjB,EAAAA,IAACI,EAAAA,aAAA,CACCe,eACA1B,cACAmB,aAECb,SAAAJ,EAAMI,6BA5CTC,EAAAA,IAACJ,WAAIC,GAAI,CACPC,QAAS,OACTgE,UAAW,QACXK,WAAY,SACZC,eAAgB,UAGhBrE,wBAAAC,EAAAA,IAACJ,EAAAA,QAAA,CAAIG,SAAA,gBAyCb,2BF3IiCsE,IAC/B7E,EAAgB,IAAKA,KAAkB6E,8BAMR,CAC/BC,EACAC,KAEA,MAAMC,EAAiBhF,EAAc8E,GACrC,GAAIE,GAAkBA,EAAeD,GACnC,OAAOC,EAAeD,GAIxB,OAAQ,GAAGrC,OAAOoC,MAAapC,OAAOqC,MACpC,IAAK,4BACH,MAAO,CAACE,EAAcC,IAAwBD,EAAKE,QAAQ,MAAOzC,OAAOwC,IAE3E,IAAK,gCACH,MAAO,CAACE,EAAgBC,EAAW,QAAU,GAAGA,KAAYD,EAAOE,QAAQ,KAE7E,IAAK,4BACH,OAAQC,GAAc,IAAIC,KAAKD,GAAME,qBAEvC,IAAK,2BACH,OAAQC,GAAkB,6BAA6BC,KAAKD,GAE9D,IAAK,4BACH,MAAO,KAAM,EAEf,IAAK,kCACH,MAAO,IAAM,KAEf,IAAK,yBACH,OAAQE,GAAgBA,EAE1B,IAAK,4BACL,IAAK,0BACL,IAAK,yBACH,OAAQC,MAEV,QACE,MAAO,IAAIC,KACT,MAAM,IAAIC,MAAM,kCAAkCrD,OAAOoC,MAAapC,OAAOqC,wFA1CrD,IAAM/E"}
@@ -1,2 +1,2 @@
1
- export { default as FullscreenLayout } from './fullScreen/fullScreen';
1
+ export { default as FullScreenLayout } from './fullScreen/fullScreen';
2
2
  export { default as SidebarLayout } from './sidebarScreen/sidebarScreen';
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("yup"),t=require("dayjs"),a=require("./common-ZGNib3x2.js");function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var o=/* @__PURE__ */s(e),i=/* @__PURE__ */r(t);const u={required:"Date is required",invalidDate:"Date must be a valid date",pastDate:"Date cannot be in the past",futureDate:"Future dates are not allowed",todayNotAllowed:"Today's date is not allowed",pastTime:"Time cannot be in the past for today's date"},l=(e,t)=>i.default.isDayjs(t)?t.toDate():t instanceof Date?t:"string"==typeof t&&t?i.default(t).toDate():null,n=(e={})=>{const{allowPast:t=!1,allowToday:a=!0,allowFuture:r=!0,requiredMessage:s=u.required,pastDateMessage:n=u.pastDate,futureDateMessage:d=u.futureDate,todayNotAllowedMessage:c=u.todayNotAllowed,invalidDateMessage:f=u.invalidDate,checkTime:m=!1,pastTimeMessage:g=u.pastTime}=e;return o.mixed().transform(l).typeError(f).required(s).test("date-validation",function(e){if(!e)return!1;const s=i.default(),o=i.default(e),u=i.default().startOf("day"),l=i.default(e).startOf("day");if(l.isBefore(u)&&!t)return this.createError({message:n});if(l.isSame(u)){if(!a)return this.createError({message:c});if(m&&o.isBefore(s))return this.createError({message:g})}return!(l.isAfter(u)&&!r)||this.createError({message:d})})},d=(e,t={})=>n({allowPast:!1,allowToday:!0,allowFuture:!0,...t,requiredMessage:e}),c={rental:e=>d(e||"Rental date is required")};class f{static getUserData(){try{const e=localStorage.getItem("_u_data");return e?JSON.parse(e):null}catch(e){return null}}static getRolePermissions(){try{const e=localStorage.getItem("role-permission");return e?JSON.parse(e):{}}catch(e){return{}}}}class m{static getAccessibleSubModules(e,t){return(null==t?void 0:t.module_access)?t.module_access.filter(t=>e.includes(t.module_name)).map(e=>({...e,sub_modules:[...e.sub_modules||[],{sub_module_name:"dashboard"}]})):[]}static extractSubModuleNames(e){return new Set(e.flatMap(e=>(e.sub_modules||[]).map(e=>e.sub_module_name)))}static getMatchingSubModules(e,t){const a=Object.keys(t),r=Array.from(e).filter(e=>{const t=e.split("/").pop()||"";return a.some(e=>e.startsWith(t))});return new Set(r)}}class g{static filterMenuByAccess(e,t){return e.filter(e=>{const a=e.bacSubModuleName&&t.has(e.bacSubModuleName);let r=!1;return e.submenu&&e.submenu.length>0&&(e.submenu=this.filterMenuByAccess(e.submenu,t),r=e.submenu.length>0),a||r})}}exports.COMMON_DATE_VALIDATIONS=c,exports.MenuFilter=class{static filterByModuleAccess(e,t){const a=f.getUserData(),r=f.getRolePermissions(),s=m.getAccessibleSubModules(t,a),o=m.extractSubModuleNames(s),i=m.getMatchingSubModules(o,r);return g.filterMenuByAccess(e,i)}},exports.MenuFilterService=g,exports.ModuleAccessService=m,exports.StorageUtils=f,exports.anyDateValidation=e=>n({allowPast:!0,allowToday:!0,allowFuture:!0,requiredMessage:e}),exports.businessDateValidation=e=>n({allowPast:!1,allowToday:!0,allowFuture:!0,requiredMessage:e}).test("business-day","Please select a business day (Monday to Friday)",function(e){if(!e)return!1;const t=i.default(e).day();return t>=1&&t<=5}),exports.conditionalDateValidation=(e,t)=>o.mixed().when("$root",{is:e,then:t,otherwise:o.mixed().notRequired()}),exports.createCustomMessages=e=>({...u,...e}),exports.createDateValidation=n,exports.createParameterizedNavigationHandler=(e,t,r=e=>e.id)=>s=>{const o=r(s);e(a.generateRouteWithId(t,o))},exports.dateRangeValidation=(e,t,a)=>o.mixed().transform(l).typeError(u.invalidDate).required(a||u.required).test("date-range",function(a){if(!a)return!1;const r=i.default(a),s=i.default(e),o=i.default(t);return r.isBefore(s)?this.createError({message:`Date must be after ${s.format("MMM DD, YYYY")}`}):!r.isAfter(o)||this.createError({message:`Date must be before ${o.format("MMM DD, YYYY")}`})}),exports.dateTimeValidation=e=>n({allowPast:!1,allowToday:!0,allowFuture:!0,checkTime:!0,requiredMessage:e}),exports.dateValidation=d,exports.futureDateValidation=e=>n({allowPast:!1,allowToday:!1,allowFuture:!0,requiredMessage:e,pastDateMessage:"Please select a future date"}),exports.getCountry=e=>new Intl.DisplayNames(["en"],{type:"region"}).of(e),exports.migrateRoutesToUseParams=e=>{const t={...e};return Object.keys(t).forEach(e=>{(e.startsWith("VIEW_")||e.startsWith("EDIT_")||e.startsWith("DETAIL_")||e.includes("_VIEW_")||e.includes("_EDIT_")||e.includes("_DETAIL_"))&&(t[e].includes(":")||(t[e]=`${t[e]}/:id`))}),t},exports.migrateToPathWithId=(e,t="id")=>({redirectionPathWithId:`${e}/:id`,idField:t}),exports.pastDateValidation=e=>n({allowPast:!0,allowToday:!0,allowFuture:!1,requiredMessage:e,futureDateMessage:"Future dates are not allowed"}),exports.updateTableConfigForParameterizedNavigation=(e,t,a="id")=>{const{...r}=e;return{...r,redirectionPathWithId:t,idField:a}};
2
+ //# sourceMappingURL=menu-filter-BqGaycuM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-filter-BqGaycuM.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/menu-filter.ts","../src/utils/migration-utils.ts"],"sourcesContent":["export const getCountry = (code: string) => {\n const regionNames = new Intl.DisplayNames([\"en\"], { type: \"region\" });\n return regionNames.of(code);\n};\n","//eslint-disable @typescript-eslint/no-explicit-any\nimport * as Yup from 'yup';\nimport dayjs from 'dayjs';\n\n// Types for configuration\nexport interface DateValidationOptions {\n allowPast?: boolean;\n allowToday?: boolean;\n allowFuture?: boolean;\n requiredMessage?: string;\n pastDateMessage?: string;\n futureDateMessage?: string;\n todayNotAllowedMessage?: string;\n invalidDateMessage?: string;\n checkTime?: boolean;\n pastTimeMessage?: string;\n}\n\n// Default messages\nconst DEFAULT_MESSAGES = {\n required: 'Date is required',\n invalidDate: 'Date must be a valid date',\n pastDate: 'Date cannot be in the past',\n futureDate: 'Future dates are not allowed',\n todayNotAllowed: \"Today's date is not allowed\",\n pastTime: 'Time cannot be in the past for today\\'s date'\n};\n\n/**\n * Core date transformation function\n * Handles dayjs objects, Date objects, and string dates\n */\nconst transformDate = (value: any, originalValue: any) => {\n if (dayjs.isDayjs(originalValue)) {\n return originalValue.toDate();\n }\n if (originalValue instanceof Date) {\n return originalValue;\n }\n if (typeof originalValue === 'string' && originalValue) {\n return dayjs(originalValue).toDate();\n }\n return null;\n};\n\n/**\n * Global date validation function with full customization\n * @param options Configuration options for date validation\n * @returns Yup validation schema\n */\nexport const createDateValidation = (options: DateValidationOptions = {}) => {\n const {\n allowPast = false,\n allowToday = true,\n allowFuture = true,\n requiredMessage = DEFAULT_MESSAGES.required,\n pastDateMessage = DEFAULT_MESSAGES.pastDate,\n futureDateMessage = DEFAULT_MESSAGES.futureDate,\n todayNotAllowedMessage = DEFAULT_MESSAGES.todayNotAllowed,\n invalidDateMessage = DEFAULT_MESSAGES.invalidDate,\n checkTime = false,\n pastTimeMessage = DEFAULT_MESSAGES.pastTime\n } = options;\n\n return Yup.mixed()\n .transform(transformDate)\n .typeError(invalidDateMessage)\n .required(requiredMessage)\n .test('date-validation', function(value) {\n if (!value) return false;\n \n const now = dayjs();\n const selectedDateTime = dayjs(value);\n const today = dayjs().startOf('day');\n const selectedDate = dayjs(value).startOf('day');\n \n // Past date validation\n if (selectedDate.isBefore(today) && !allowPast) {\n return this.createError({ message: pastDateMessage });\n }\n \n // Today validation\n if (selectedDate.isSame(today)) {\n if (!allowToday) {\n return this.createError({ message: todayNotAllowedMessage });\n }\n \n // Time validation for today\n if (checkTime && selectedDateTime.isBefore(now)) {\n return this.createError({ message: pastTimeMessage });\n }\n }\n \n // Future date validation\n if (selectedDate.isAfter(today) && !allowFuture) {\n return this.createError({ message: futureDateMessage });\n }\n \n return true;\n });\n};\n\n/**\n * Quick preset validation functions for common use cases\n */\n\n// 1. Standard date validation (today + future allowed)\nexport const dateValidation = (requiredMessage?: string, options: DateValidationOptions = {}) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n ...options,\n requiredMessage\n });\n\n// 2. Future dates only (excluding today)\nexport const futureDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: false,\n allowFuture: true,\n requiredMessage,\n pastDateMessage: 'Please select a future date'\n });\n\n// 3. Any date allowed (for historical records)\nexport const anyDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n });\n\n// 4. Past dates only (for completed events)\nexport const pastDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: false,\n requiredMessage,\n futureDateMessage: 'Future dates are not allowed'\n });\n\n// 5. Date with time validation\nexport const dateTimeValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n checkTime: true,\n requiredMessage\n });\n\n// 6. Business days only (Monday to Friday, future dates)\nexport const businessDateValidation = (requiredMessage?: string) => {\n return createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n }).test('business-day', 'Please select a business day (Monday to Friday)', function(value) {\n if (!value) return false;\n \n const dayOfWeek = dayjs(value).day();\n return dayOfWeek >= 1 && dayOfWeek <= 5; // Monday = 1, Friday = 5\n });\n};\n\n// 7. Date range validation (between two dates)\nexport const dateRangeValidation = (\n minDate: dayjs.Dayjs | Date | string,\n maxDate: dayjs.Dayjs | Date | string,\n requiredMessage?: string\n) => {\n return Yup.mixed()\n .transform(transformDate)\n .typeError(DEFAULT_MESSAGES.invalidDate)\n .required(requiredMessage || DEFAULT_MESSAGES.required)\n .test('date-range', function(value) {\n if (!value) return false;\n \n const selected = dayjs(value);\n const min = dayjs(minDate);\n const max = dayjs(maxDate);\n \n if (selected.isBefore(min)) {\n return this.createError({\n message: `Date must be after ${min.format('MMM DD, YYYY')}`\n });\n }\n \n if (selected.isAfter(max)) {\n return this.createError({\n message: `Date must be before ${max.format('MMM DD, YYYY')}`\n });\n }\n \n return true;\n });\n};\n\n/**\n * Utility function to create custom validation messages\n */\nexport const createCustomMessages = (overrides: Partial<typeof DEFAULT_MESSAGES>) => ({\n ...DEFAULT_MESSAGES,\n ...overrides\n});\n\n/**\n * Helper function for conditional date validation\n * Example: Date required only if another field has a specific value\n */\nexport const conditionalDateValidation = (\n condition: (formValues: any) => boolean,\n validationSchema: any,\n) => {\n return Yup.mixed().when('$root', {\n is: condition,\n then: validationSchema,\n otherwise: Yup.mixed().notRequired()\n });\n};\n\n// Export commonly used validation presets\nexport const COMMON_DATE_VALIDATIONS = {\n // Rental/Order dates\n rental: (msg?: string) => dateValidation(msg || 'Rental date is required'),\n\n};\n\n/**\n * Usage Examples:\n * \n * // Basic usage with custom required message\n * date: dateValidation('Please select a valid date')\n * \n * // Full customization\n * date: createDateValidation({\n * allowPast: false,\n * allowToday: true,\n * allowFuture: true,\n * requiredMessage: 'Date is required',\n * pastDateMessage: 'Cannot select past dates'\n * })\n * \n * // Preset validations\n * rentalDate: COMMON_DATE_VALIDATIONS.rental('Rental date is required')\n * bookingDate: COMMON_DATE_VALIDATIONS.booking()\n * \n * // Date range\n * eventDate: dateRangeValidation(\n * dayjs().add(1, 'day'),\n * dayjs().add(1, 'year'),\n * 'Event date is required'\n * )\n */","// types.ts - Type definitions for better type safety\r\nexport interface SubModule {\r\n sub_module_name: string;\r\n}\r\n\r\nexport interface ModuleAccess {\r\n module_name: string;\r\n sub_modules?: SubModule[];\r\n}\r\n\r\nexport interface UserData {\r\n module_access?: ModuleAccess[];\r\n}\r\n\r\nexport interface MenuItem {\r\n bacSubModuleName?: string;\r\n submenu?: MenuItem[];\r\n [key: string]: any;\r\n}\r\n\r\nexport interface Permission {\r\n [key: string]: any;\r\n}\r\n\r\n// storageUtils.ts - Centralized storage access\r\nexport class StorageUtils {\r\n /**\r\n * Retrieves and parses user data from localStorage\r\n * @returns Parsed user data or null if not found\r\n */\r\n static getUserData(): UserData | null {\r\n try {\r\n const userData = localStorage.getItem(\"_u_data\");\r\n return userData ? JSON.parse(userData) : null;\r\n } catch (error) {\r\n console.error(\"Error parsing user data:\", error);\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves and parses role permissions from localStorage\r\n * @returns Parsed permissions object\r\n */\r\n static getRolePermissions(): Permission {\r\n try {\r\n const permissions = localStorage.getItem(\"role-permission\");\r\n return permissions ? JSON.parse(permissions) : {};\r\n } catch (error) {\r\n console.error(\"Error parsing role permissions:\", error);\r\n return {};\r\n }\r\n }\r\n}\r\n\r\n// moduleAccessService.ts - Business logic for module access\r\nexport class ModuleAccessService {\r\n /**\r\n * Filters modules by allowed module names and adds dashboard sub-module\r\n * @param moduleNames - Array of allowed module names\r\n * @param userData - User data containing module access\r\n * @returns Filtered modules with dashboard added\r\n */\r\n static getAccessibleSubModules(\r\n moduleNames: string[],\r\n userData: UserData | null\r\n ): ModuleAccess[] {\r\n if (!userData?.module_access) {\r\n return [];\r\n }\r\n\r\n return userData.module_access\r\n .filter((module) => moduleNames.includes(module.module_name))\r\n .map((module) => ({\r\n ...module,\r\n sub_modules: [\r\n ...(module.sub_modules || []),\r\n { sub_module_name: \"dashboard\" }\r\n ]\r\n }));\r\n }\r\n\r\n /**\r\n * Extracts unique sub-module names from modules\r\n * @param modules - Array of module access objects\r\n * @returns Set of unique sub-module names\r\n */\r\n static extractSubModuleNames(modules: ModuleAccess[]): Set<string> {\r\n return new Set(\r\n modules.flatMap((module) => \r\n (module.sub_modules || []).map((subModule) => subModule.sub_module_name)\r\n )\r\n );\r\n }\r\n\r\n /**\r\n * Matches sub-module names with permission keys\r\n * @param subModuleNames - Set of sub-module names\r\n * @param permissions - Permission object\r\n * @returns Set of matching sub-module names\r\n */\r\n static getMatchingSubModules(\r\n subModuleNames: Set<string>,\r\n permissions: Permission\r\n ): Set<string> {\r\n const permissionKeys = Object.keys(permissions);\r\n \r\n const matchingModules = Array.from(subModuleNames).filter((subModuleName) => {\r\n const lastPart = subModuleName.split(\"/\").pop() || \"\";\r\n return permissionKeys.some((permKey) => permKey.startsWith(lastPart));\r\n });\r\n\r\n return new Set(matchingModules);\r\n }\r\n}\r\n\r\n// menuFilterService.ts - Menu filtering logic\r\nexport class MenuFilterService {\r\n /**\r\n * Recursively filters menu items based on accessible sub-modules\r\n * @param menu - Array of menu items\r\n * @param accessibleSubModules - Set of accessible sub-module names\r\n * @returns Filtered menu array\r\n */\r\n static filterMenuByAccess(\r\n menu: MenuItem[],\r\n accessibleSubModules: Set<string>\r\n ): MenuItem[] {\r\n return menu.filter((item) => {\r\n const hasValidSubModule = \r\n item.bacSubModuleName && accessibleSubModules.has(item.bacSubModuleName);\r\n\r\n let hasValidSubmenu = false;\r\n \r\n if (item.submenu && item.submenu.length > 0) {\r\n item.submenu = this.filterMenuByAccess(item.submenu, accessibleSubModules);\r\n hasValidSubmenu = item.submenu.length > 0;\r\n }\r\n\r\n return hasValidSubModule || hasValidSubmenu;\r\n });\r\n }\r\n}\r\n\r\n// menuFilter.ts - Main filter orchestrator\r\nexport class MenuFilter {\r\n /**\r\n * Filters menu based on user permissions and module access\r\n * @param menu - Menu items to filter\r\n * @param allowedModules - Array of allowed module names\r\n * @returns Filtered menu items\r\n */\r\n static filterByModuleAccess(\r\n menu: MenuItem[],\r\n allowedModules: string[]\r\n ): MenuItem[] {\r\n // Retrieve user data and permissions\r\n const userData = StorageUtils.getUserData();\r\n const permissions = StorageUtils.getRolePermissions();\r\n\r\n // Get accessible sub-modules\r\n const accessibleModules = ModuleAccessService.getAccessibleSubModules(\r\n allowedModules,\r\n userData\r\n );\r\n\r\n // Extract sub-module names\r\n const subModuleNames = ModuleAccessService.extractSubModuleNames(\r\n accessibleModules\r\n );\r\n\r\n // Match with permissions\r\n const matchingSubModules = ModuleAccessService.getMatchingSubModules(\r\n subModuleNames,\r\n permissions\r\n );\r\n\r\n // Filter menu\r\n return MenuFilterService.filterMenuByAccess(menu, matchingSubModules);\r\n }\r\n}\r\n\r\n// Usage example in your module\r\n// manufacturing.ts\r\n// import { MenuFilter } from './menuFilter';\r\n// import { MenuItem } from './types';\r\n\r\n// export const getFilteredManufacturingMenu = (\r\n// menuData: MenuItem[]\r\n// ): MenuItem[] => {\r\n// const allowedModules = [\"manufacturing\", \"inventory\", \"sales\"];\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };\r\n\r\n// // sales.ts\r\n// export const getFilteredSalesMenu = (\r\n// menuData: MenuItem[]\r\n// ): MenuItem[] => {\r\n// const allowedModules = [\"sales\", \"inventory\"];\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };\r\n\r\n// // Generic usage with dynamic modules\r\n// export const getFilteredMenu = (\r\n// menuData: MenuItem[],\r\n// allowedModules: string[]\r\n// ): MenuItem[] => {\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };","\n\nimport { generateRouteWithId } from \"./route-utils\";\n\n\nexport const migrateToPathWithId = (redirectionLink: string, idField: string = 'id') => {\n return {\n redirectionPathWithId: `${redirectionLink}/:id`,\n idField\n };\n};\n\n\nexport const migrateRoutesToUseParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n Object.keys(updatedRoutes).forEach(key => {\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\nexport const createParameterizedNavigationHandler = (\n navigate: (path: string) => void,\n basePath: string,\n idExtractor: (row: any) => string | number = (row) => row.id\n) => {\n return (row: any) => {\n const id = idExtractor(row);\n navigate(generateRouteWithId(basePath, id));\n };\n};\n\n\nexport const updateTableConfigForParameterizedNavigation = (\n tableConfig: any,\n pathWithIdField: string,\n idField: string = 'id'\n) => {\n const { ...rest } = tableConfig;\n \n return {\n ...rest,\n redirectionPathWithId: pathWithIdField,\n idField\n };\n}; "],"names":["DEFAULT_MESSAGES","required","invalidDate","pastDate","futureDate","todayNotAllowed","pastTime","transformDate","value","originalValue","dayjs","isDayjs","toDate","Date","createDateValidation","options","allowPast","allowToday","allowFuture","requiredMessage","pastDateMessage","futureDateMessage","todayNotAllowedMessage","invalidDateMessage","checkTime","pastTimeMessage","Yup","mixed","transform","typeError","test","now","selectedDateTime","today","startOf","selectedDate","isBefore","this","createError","message","isSame","isAfter","dateValidation","COMMON_DATE_VALIDATIONS","rental","msg","StorageUtils","getUserData","userData","localStorage","getItem","JSON","parse","error","getRolePermissions","permissions","ModuleAccessService","getAccessibleSubModules","moduleNames","module_access","filter","module","includes","module_name","map","sub_modules","sub_module_name","extractSubModuleNames","modules","Set","flatMap","subModule","getMatchingSubModules","subModuleNames","permissionKeys","Object","keys","matchingModules","Array","from","subModuleName","lastPart","split","pop","some","permKey","startsWith","MenuFilterService","filterMenuByAccess","menu","accessibleSubModules","item","hasValidSubModule","bacSubModuleName","has","hasValidSubmenu","submenu","length","filterByModuleAccess","allowedModules","accessibleModules","matchingSubModules","dayOfWeek","day","condition","validationSchema","when","is","then","otherwise","notRequired","overrides","navigate","basePath","idExtractor","row","id","generateRouteWithId","minDate","maxDate","selected","min","max","format","code","Intl","DisplayNames","type","of","routes","updatedRoutes","forEach","key","redirectionLink","idField","redirectionPathWithId","tableConfig","pathWithIdField","rest"],"mappings":"seAAO,MCmBDA,EAAmB,CACvBC,SAAU,mBACVC,YAAa,4BACbC,SAAU,6BACVC,WAAY,+BACZC,gBAAiB,8BACjBC,SAAU,+CAONC,EAAgB,CAACC,EAAYC,IAC7BC,EAAAA,QAAMC,QAAQF,GACTA,EAAcG,SAEnBH,aAAyBI,KACpBJ,EAEoB,iBAAlBA,GAA8BA,EAChCC,EAAAA,QAAMD,GAAeG,SAEvB,KAQIE,EAAuB,CAACC,EAAiC,MACpE,MAAMC,UACJA,GAAY,EAAAC,WACZA,GAAa,EAAAC,YACbA,GAAc,EAAAC,gBACdA,EAAkBnB,EAAiBC,SAAAmB,gBACnCA,EAAkBpB,EAAiBG,SAAAkB,kBACnCA,EAAoBrB,EAAiBI,WA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ACf8C,EAAI9C,WAAW,UACf8C,EAAI9C,WAAW,YACf8C,EAAItE,SAAS,WACbsE,EAAItE,SAAS,WACbsE,EAAItE,SAAS,eAERoE,EAAcE,GAAKtE,SAAS,OAC/BoE,EAAcE,GAAO,GAAGF,EAAcE,aAKrCF,+BA1B0B,CAACG,EAAyBC,EAAkB,QACtE,CACLC,sBAAuB,GAAGF,QAC1BC,uCFgI+BnH,GACjCL,EAAqB,CACnBE,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,kBACAE,kBAAmB,qFEhGoC,CACzDmH,EACAC,EACAH,EAAkB,QAElB,SAAWI,GAASF,EAEpB,MAAO,IACFE,EACHH,sBAAuBE,EACvBH"}
@@ -172,8 +172,127 @@ const updateTableConfigForParameterizedNavigation = (tableConfig, pathWithIdFiel
172
172
  idField
173
173
  };
174
174
  };
175
+ class StorageUtils {
176
+ /**
177
+ * Retrieves and parses user data from localStorage
178
+ * @returns Parsed user data or null if not found
179
+ */
180
+ static getUserData() {
181
+ try {
182
+ const userData = localStorage.getItem("_u_data");
183
+ return userData ? JSON.parse(userData) : null;
184
+ } catch (error) {
185
+ console.error("Error parsing user data:", error);
186
+ return null;
187
+ }
188
+ }
189
+ /**
190
+ * Retrieves and parses role permissions from localStorage
191
+ * @returns Parsed permissions object
192
+ */
193
+ static getRolePermissions() {
194
+ try {
195
+ const permissions = localStorage.getItem("role-permission");
196
+ return permissions ? JSON.parse(permissions) : {};
197
+ } catch (error) {
198
+ console.error("Error parsing role permissions:", error);
199
+ return {};
200
+ }
201
+ }
202
+ }
203
+ class ModuleAccessService {
204
+ /**
205
+ * Filters modules by allowed module names and adds dashboard sub-module
206
+ * @param moduleNames - Array of allowed module names
207
+ * @param userData - User data containing module access
208
+ * @returns Filtered modules with dashboard added
209
+ */
210
+ static getAccessibleSubModules(moduleNames, userData) {
211
+ if (!(userData == null ? void 0 : userData.module_access)) {
212
+ return [];
213
+ }
214
+ return userData.module_access.filter((module) => moduleNames.includes(module.module_name)).map((module) => ({
215
+ ...module,
216
+ sub_modules: [
217
+ ...module.sub_modules || [],
218
+ { sub_module_name: "dashboard" }
219
+ ]
220
+ }));
221
+ }
222
+ /**
223
+ * Extracts unique sub-module names from modules
224
+ * @param modules - Array of module access objects
225
+ * @returns Set of unique sub-module names
226
+ */
227
+ static extractSubModuleNames(modules) {
228
+ return new Set(
229
+ modules.flatMap(
230
+ (module) => (module.sub_modules || []).map((subModule) => subModule.sub_module_name)
231
+ )
232
+ );
233
+ }
234
+ /**
235
+ * Matches sub-module names with permission keys
236
+ * @param subModuleNames - Set of sub-module names
237
+ * @param permissions - Permission object
238
+ * @returns Set of matching sub-module names
239
+ */
240
+ static getMatchingSubModules(subModuleNames, permissions) {
241
+ const permissionKeys = Object.keys(permissions);
242
+ const matchingModules = Array.from(subModuleNames).filter((subModuleName) => {
243
+ const lastPart = subModuleName.split("/").pop() || "";
244
+ return permissionKeys.some((permKey) => permKey.startsWith(lastPart));
245
+ });
246
+ return new Set(matchingModules);
247
+ }
248
+ }
249
+ class MenuFilterService {
250
+ /**
251
+ * Recursively filters menu items based on accessible sub-modules
252
+ * @param menu - Array of menu items
253
+ * @param accessibleSubModules - Set of accessible sub-module names
254
+ * @returns Filtered menu array
255
+ */
256
+ static filterMenuByAccess(menu, accessibleSubModules) {
257
+ return menu.filter((item) => {
258
+ const hasValidSubModule = item.bacSubModuleName && accessibleSubModules.has(item.bacSubModuleName);
259
+ let hasValidSubmenu = false;
260
+ if (item.submenu && item.submenu.length > 0) {
261
+ item.submenu = this.filterMenuByAccess(item.submenu, accessibleSubModules);
262
+ hasValidSubmenu = item.submenu.length > 0;
263
+ }
264
+ return hasValidSubModule || hasValidSubmenu;
265
+ });
266
+ }
267
+ }
268
+ class MenuFilter {
269
+ /**
270
+ * Filters menu based on user permissions and module access
271
+ * @param menu - Menu items to filter
272
+ * @param allowedModules - Array of allowed module names
273
+ * @returns Filtered menu items
274
+ */
275
+ static filterByModuleAccess(menu, allowedModules) {
276
+ const userData = StorageUtils.getUserData();
277
+ const permissions = StorageUtils.getRolePermissions();
278
+ const accessibleModules = ModuleAccessService.getAccessibleSubModules(
279
+ allowedModules,
280
+ userData
281
+ );
282
+ const subModuleNames = ModuleAccessService.extractSubModuleNames(
283
+ accessibleModules
284
+ );
285
+ const matchingSubModules = ModuleAccessService.getMatchingSubModules(
286
+ subModuleNames,
287
+ permissions
288
+ );
289
+ return MenuFilterService.filterMenuByAccess(menu, matchingSubModules);
290
+ }
291
+ }
175
292
  export {
176
293
  COMMON_DATE_VALIDATIONS as C,
294
+ ModuleAccessService as M,
295
+ StorageUtils as S,
177
296
  anyDateValidation as a,
178
297
  dateTimeValidation as b,
179
298
  createDateValidation as c,
@@ -187,7 +306,9 @@ export {
187
306
  migrateRoutesToUseParams as k,
188
307
  createParameterizedNavigationHandler as l,
189
308
  migrateToPathWithId as m,
309
+ MenuFilterService as n,
310
+ MenuFilter as o,
190
311
  pastDateValidation as p,
191
312
  updateTableConfigForParameterizedNavigation as u
192
313
  };
193
- //# sourceMappingURL=migration-utils-DgL-o5H7.esm.js.map
314
+ //# sourceMappingURL=menu-filter-D6MAKEqM.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-filter-D6MAKEqM.esm.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/migration-utils.ts","../src/utils/menu-filter.ts"],"sourcesContent":["export const getCountry = (code: string) => {\n const regionNames = new Intl.DisplayNames([\"en\"], { type: \"region\" });\n return regionNames.of(code);\n};\n","//eslint-disable @typescript-eslint/no-explicit-any\nimport * as Yup from 'yup';\nimport dayjs from 'dayjs';\n\n// Types for configuration\nexport interface DateValidationOptions {\n allowPast?: boolean;\n allowToday?: boolean;\n allowFuture?: boolean;\n requiredMessage?: string;\n pastDateMessage?: string;\n futureDateMessage?: string;\n todayNotAllowedMessage?: string;\n invalidDateMessage?: string;\n checkTime?: boolean;\n pastTimeMessage?: string;\n}\n\n// Default messages\nconst DEFAULT_MESSAGES = {\n required: 'Date is required',\n invalidDate: 'Date must be a valid date',\n pastDate: 'Date cannot be in the past',\n futureDate: 'Future dates are not allowed',\n todayNotAllowed: \"Today's date is not allowed\",\n pastTime: 'Time cannot be in the past for today\\'s date'\n};\n\n/**\n * Core date transformation function\n * Handles dayjs objects, Date objects, and string dates\n */\nconst transformDate = (value: any, originalValue: any) => {\n if (dayjs.isDayjs(originalValue)) {\n return originalValue.toDate();\n }\n if (originalValue instanceof Date) {\n return originalValue;\n }\n if (typeof originalValue === 'string' && originalValue) {\n return dayjs(originalValue).toDate();\n }\n return null;\n};\n\n/**\n * Global date validation function with full customization\n * @param options Configuration options for date validation\n * @returns Yup validation schema\n */\nexport const createDateValidation = (options: DateValidationOptions = {}) => {\n const {\n allowPast = false,\n allowToday = true,\n allowFuture = true,\n requiredMessage = DEFAULT_MESSAGES.required,\n pastDateMessage = DEFAULT_MESSAGES.pastDate,\n futureDateMessage = DEFAULT_MESSAGES.futureDate,\n todayNotAllowedMessage = DEFAULT_MESSAGES.todayNotAllowed,\n invalidDateMessage = DEFAULT_MESSAGES.invalidDate,\n checkTime = false,\n pastTimeMessage = DEFAULT_MESSAGES.pastTime\n } = options;\n\n return Yup.mixed()\n .transform(transformDate)\n .typeError(invalidDateMessage)\n .required(requiredMessage)\n .test('date-validation', function(value) {\n if (!value) return false;\n \n const now = dayjs();\n const selectedDateTime = dayjs(value);\n const today = dayjs().startOf('day');\n const selectedDate = dayjs(value).startOf('day');\n \n // Past date validation\n if (selectedDate.isBefore(today) && !allowPast) {\n return this.createError({ message: pastDateMessage });\n }\n \n // Today validation\n if (selectedDate.isSame(today)) {\n if (!allowToday) {\n return this.createError({ message: todayNotAllowedMessage });\n }\n \n // Time validation for today\n if (checkTime && selectedDateTime.isBefore(now)) {\n return this.createError({ message: pastTimeMessage });\n }\n }\n \n // Future date validation\n if (selectedDate.isAfter(today) && !allowFuture) {\n return this.createError({ message: futureDateMessage });\n }\n \n return true;\n });\n};\n\n/**\n * Quick preset validation functions for common use cases\n */\n\n// 1. Standard date validation (today + future allowed)\nexport const dateValidation = (requiredMessage?: string, options: DateValidationOptions = {}) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n ...options,\n requiredMessage\n });\n\n// 2. Future dates only (excluding today)\nexport const futureDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: false,\n allowFuture: true,\n requiredMessage,\n pastDateMessage: 'Please select a future date'\n });\n\n// 3. Any date allowed (for historical records)\nexport const anyDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n });\n\n// 4. Past dates only (for completed events)\nexport const pastDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: false,\n requiredMessage,\n futureDateMessage: 'Future dates are not allowed'\n });\n\n// 5. Date with time validation\nexport const dateTimeValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n checkTime: true,\n requiredMessage\n });\n\n// 6. Business days only (Monday to Friday, future dates)\nexport const businessDateValidation = (requiredMessage?: string) => {\n return createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n }).test('business-day', 'Please select a business day (Monday to Friday)', function(value) {\n if (!value) return false;\n \n const dayOfWeek = dayjs(value).day();\n return dayOfWeek >= 1 && dayOfWeek <= 5; // Monday = 1, Friday = 5\n });\n};\n\n// 7. Date range validation (between two dates)\nexport const dateRangeValidation = (\n minDate: dayjs.Dayjs | Date | string,\n maxDate: dayjs.Dayjs | Date | string,\n requiredMessage?: string\n) => {\n return Yup.mixed()\n .transform(transformDate)\n .typeError(DEFAULT_MESSAGES.invalidDate)\n .required(requiredMessage || DEFAULT_MESSAGES.required)\n .test('date-range', function(value) {\n if (!value) return false;\n \n const selected = dayjs(value);\n const min = dayjs(minDate);\n const max = dayjs(maxDate);\n \n if (selected.isBefore(min)) {\n return this.createError({\n message: `Date must be after ${min.format('MMM DD, YYYY')}`\n });\n }\n \n if (selected.isAfter(max)) {\n return this.createError({\n message: `Date must be before ${max.format('MMM DD, YYYY')}`\n });\n }\n \n return true;\n });\n};\n\n/**\n * Utility function to create custom validation messages\n */\nexport const createCustomMessages = (overrides: Partial<typeof DEFAULT_MESSAGES>) => ({\n ...DEFAULT_MESSAGES,\n ...overrides\n});\n\n/**\n * Helper function for conditional date validation\n * Example: Date required only if another field has a specific value\n */\nexport const conditionalDateValidation = (\n condition: (formValues: any) => boolean,\n validationSchema: any,\n) => {\n return Yup.mixed().when('$root', {\n is: condition,\n then: validationSchema,\n otherwise: Yup.mixed().notRequired()\n });\n};\n\n// Export commonly used validation presets\nexport const COMMON_DATE_VALIDATIONS = {\n // Rental/Order dates\n rental: (msg?: string) => dateValidation(msg || 'Rental date is required'),\n\n};\n\n/**\n * Usage Examples:\n * \n * // Basic usage with custom required message\n * date: dateValidation('Please select a valid date')\n * \n * // Full customization\n * date: createDateValidation({\n * allowPast: false,\n * allowToday: true,\n * allowFuture: true,\n * requiredMessage: 'Date is required',\n * pastDateMessage: 'Cannot select past dates'\n * })\n * \n * // Preset validations\n * rentalDate: COMMON_DATE_VALIDATIONS.rental('Rental date is required')\n * bookingDate: COMMON_DATE_VALIDATIONS.booking()\n * \n * // Date range\n * eventDate: dateRangeValidation(\n * dayjs().add(1, 'day'),\n * dayjs().add(1, 'year'),\n * 'Event date is required'\n * )\n */","\n\nimport { generateRouteWithId } from \"./route-utils\";\n\n\nexport const migrateToPathWithId = (redirectionLink: string, idField: string = 'id') => {\n return {\n redirectionPathWithId: `${redirectionLink}/:id`,\n idField\n };\n};\n\n\nexport const migrateRoutesToUseParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n Object.keys(updatedRoutes).forEach(key => {\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\nexport const createParameterizedNavigationHandler = (\n navigate: (path: string) => void,\n basePath: string,\n idExtractor: (row: any) => string | number = (row) => row.id\n) => {\n return (row: any) => {\n const id = idExtractor(row);\n navigate(generateRouteWithId(basePath, id));\n };\n};\n\n\nexport const updateTableConfigForParameterizedNavigation = (\n tableConfig: any,\n pathWithIdField: string,\n idField: string = 'id'\n) => {\n const { ...rest } = tableConfig;\n \n return {\n ...rest,\n redirectionPathWithId: pathWithIdField,\n idField\n };\n}; ","// types.ts - Type definitions for better type safety\r\nexport interface SubModule {\r\n sub_module_name: string;\r\n}\r\n\r\nexport interface ModuleAccess {\r\n module_name: string;\r\n sub_modules?: SubModule[];\r\n}\r\n\r\nexport interface UserData {\r\n module_access?: ModuleAccess[];\r\n}\r\n\r\nexport interface MenuItem {\r\n bacSubModuleName?: string;\r\n submenu?: MenuItem[];\r\n [key: string]: any;\r\n}\r\n\r\nexport interface Permission {\r\n [key: string]: any;\r\n}\r\n\r\n// storageUtils.ts - Centralized storage access\r\nexport class StorageUtils {\r\n /**\r\n * Retrieves and parses user data from localStorage\r\n * @returns Parsed user data or null if not found\r\n */\r\n static getUserData(): UserData | null {\r\n try {\r\n const userData = localStorage.getItem(\"_u_data\");\r\n return userData ? JSON.parse(userData) : null;\r\n } catch (error) {\r\n console.error(\"Error parsing user data:\", error);\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Retrieves and parses role permissions from localStorage\r\n * @returns Parsed permissions object\r\n */\r\n static getRolePermissions(): Permission {\r\n try {\r\n const permissions = localStorage.getItem(\"role-permission\");\r\n return permissions ? JSON.parse(permissions) : {};\r\n } catch (error) {\r\n console.error(\"Error parsing role permissions:\", error);\r\n return {};\r\n }\r\n }\r\n}\r\n\r\n// moduleAccessService.ts - Business logic for module access\r\nexport class ModuleAccessService {\r\n /**\r\n * Filters modules by allowed module names and adds dashboard sub-module\r\n * @param moduleNames - Array of allowed module names\r\n * @param userData - User data containing module access\r\n * @returns Filtered modules with dashboard added\r\n */\r\n static getAccessibleSubModules(\r\n moduleNames: string[],\r\n userData: UserData | null\r\n ): ModuleAccess[] {\r\n if (!userData?.module_access) {\r\n return [];\r\n }\r\n\r\n return userData.module_access\r\n .filter((module) => moduleNames.includes(module.module_name))\r\n .map((module) => ({\r\n ...module,\r\n sub_modules: [\r\n ...(module.sub_modules || []),\r\n { sub_module_name: \"dashboard\" }\r\n ]\r\n }));\r\n }\r\n\r\n /**\r\n * Extracts unique sub-module names from modules\r\n * @param modules - Array of module access objects\r\n * @returns Set of unique sub-module names\r\n */\r\n static extractSubModuleNames(modules: ModuleAccess[]): Set<string> {\r\n return new Set(\r\n modules.flatMap((module) => \r\n (module.sub_modules || []).map((subModule) => subModule.sub_module_name)\r\n )\r\n );\r\n }\r\n\r\n /**\r\n * Matches sub-module names with permission keys\r\n * @param subModuleNames - Set of sub-module names\r\n * @param permissions - Permission object\r\n * @returns Set of matching sub-module names\r\n */\r\n static getMatchingSubModules(\r\n subModuleNames: Set<string>,\r\n permissions: Permission\r\n ): Set<string> {\r\n const permissionKeys = Object.keys(permissions);\r\n \r\n const matchingModules = Array.from(subModuleNames).filter((subModuleName) => {\r\n const lastPart = subModuleName.split(\"/\").pop() || \"\";\r\n return permissionKeys.some((permKey) => permKey.startsWith(lastPart));\r\n });\r\n\r\n return new Set(matchingModules);\r\n }\r\n}\r\n\r\n// menuFilterService.ts - Menu filtering logic\r\nexport class MenuFilterService {\r\n /**\r\n * Recursively filters menu items based on accessible sub-modules\r\n * @param menu - Array of menu items\r\n * @param accessibleSubModules - Set of accessible sub-module names\r\n * @returns Filtered menu array\r\n */\r\n static filterMenuByAccess(\r\n menu: MenuItem[],\r\n accessibleSubModules: Set<string>\r\n ): MenuItem[] {\r\n return menu.filter((item) => {\r\n const hasValidSubModule = \r\n item.bacSubModuleName && accessibleSubModules.has(item.bacSubModuleName);\r\n\r\n let hasValidSubmenu = false;\r\n \r\n if (item.submenu && item.submenu.length > 0) {\r\n item.submenu = this.filterMenuByAccess(item.submenu, accessibleSubModules);\r\n hasValidSubmenu = item.submenu.length > 0;\r\n }\r\n\r\n return hasValidSubModule || hasValidSubmenu;\r\n });\r\n }\r\n}\r\n\r\n// menuFilter.ts - Main filter orchestrator\r\nexport class MenuFilter {\r\n /**\r\n * Filters menu based on user permissions and module access\r\n * @param menu - Menu items to filter\r\n * @param allowedModules - Array of allowed module names\r\n * @returns Filtered menu items\r\n */\r\n static filterByModuleAccess(\r\n menu: MenuItem[],\r\n allowedModules: string[]\r\n ): MenuItem[] {\r\n // Retrieve user data and permissions\r\n const userData = StorageUtils.getUserData();\r\n const permissions = StorageUtils.getRolePermissions();\r\n\r\n // Get accessible sub-modules\r\n const accessibleModules = ModuleAccessService.getAccessibleSubModules(\r\n allowedModules,\r\n userData\r\n );\r\n\r\n // Extract sub-module names\r\n const subModuleNames = ModuleAccessService.extractSubModuleNames(\r\n accessibleModules\r\n );\r\n\r\n // Match with permissions\r\n const matchingSubModules = ModuleAccessService.getMatchingSubModules(\r\n subModuleNames,\r\n permissions\r\n );\r\n\r\n // Filter menu\r\n return MenuFilterService.filterMenuByAccess(menu, matchingSubModules);\r\n }\r\n}\r\n\r\n// Usage example in your module\r\n// manufacturing.ts\r\n// import { MenuFilter } from './menuFilter';\r\n// import { MenuItem } from './types';\r\n\r\n// export const getFilteredManufacturingMenu = (\r\n// menuData: MenuItem[]\r\n// ): MenuItem[] => {\r\n// const allowedModules = [\"manufacturing\", \"inventory\", \"sales\"];\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };\r\n\r\n// // sales.ts\r\n// export const getFilteredSalesMenu = (\r\n// menuData: MenuItem[]\r\n// ): MenuItem[] => {\r\n// const allowedModules = [\"sales\", \"inventory\"];\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };\r\n\r\n// // Generic usage with dynamic modules\r\n// export const getFilteredMenu = (\r\n// menuData: MenuItem[],\r\n// allowedModules: string[]\r\n// ): MenuItem[] => {\r\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\r\n// };"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,CAAC,SAAiB;AAC1C,QAAM,cAAc,IAAI,KAAK,aAAa,CAAC,IAAI,GAAG,EAAE,MAAM,UAAU;AACpE,SAAO,YAAY,GAAG,IAAI;AAC5B;ACgBA,MAAM,mBAAmB;AAAA,EACvB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,UAAU;AACZ;AAMA,MAAM,gBAAgB,CAAC,OAAY,kBAAuB;AACxD,MAAI,MAAM,QAAQ,aAAa,GAAG;AAChC,WAAO,cAAc,OAAA;AAAA,EACvB;AACA,MAAI,yBAAyB,MAAM;AACjC,WAAO;AAAA,EACT;AACA,MAAI,OAAO,kBAAkB,YAAY,eAAe;AACtD,WAAO,MAAM,aAAa,EAAE,OAAA;AAAA,EAC9B;AACA,SAAO;AACT;AAOO,MAAM,uBAAuB,CAAC,UAAiC,OAAO;AAC3E,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,cAAc;AAAA,IACd,kBAAkB,iBAAiB;AAAA,IACnC,kBAAkB,iBAAiB;AAAA,IACnC,oBAAoB,iBAAiB;AAAA,IACrC,yBAAyB,iBAAiB;AAAA,IAC1C,qBAAqB,iBAAiB;AAAA,IACtC,YAAY;AAAA,IACZ,kBAAkB,iBAAiB;AAAA,EAAA,IACjC;AAEJ,SAAO,IAAI,MAAA,EACR,UAAU,aAAa,EACvB,UAAU,kBAAkB,EAC5B,SAAS,eAAe,EACxB,KAAK,mBAAmB,SAAS,OAAO;AACvC,QAAI,CAAC,MAAO,QAAO;AAEnB,UAAM,MAAM,MAAA;AACZ,UAAM,mBAAmB,MAAM,KAAK;AACpC,UAAM,QAAQ,QAAQ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ACA,sBACY;AACZ,WAAO,KAAK,OAAO,CAAC,SAAS;AAC3B,YAAM,oBACJ,KAAK,oBAAoB,qBAAqB,IAAI,KAAK,gBAAgB;AAEzE,UAAI,kBAAkB;AAEtB,UAAI,KAAK,WAAW,KAAK,QAAQ,SAAS,GAAG;AAC3C,aAAK,UAAU,KAAK,mBAAmB,KAAK,SAAS,oBAAoB;AACzE,0BAAkB,KAAK,QAAQ,SAAS;AAAA,MAC1C;AAEA,aAAO,qBAAqB;AAAA,IAC9B,CAAC;AAAA,EACH;AACF;AAGO,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOtB,OAAO,qBACL,MACA,gBACY;AAEZ,UAAM,WAAW,aAAa,YAAA;AAC9B,UAAM,cAAc,aAAa,mBAAA;AAGjC,UAAM,oBAAoB,oBAAoB;AAAA,MAC5C;AAAA,MACA;AAAA,IAAA;AAIF,UAAM,iBAAiB,oBAAoB;AAAA,MACzC;AAAA,IAAA;AAIF,UAAM,qBAAqB,oBAAoB;AAAA,MAC7C;AAAA,MACA;AAAA,IAAA;AAIF,WAAO,kBAAkB,mBAAmB,MAAM,kBAAkB;AAAA,EACtE;AACF;"}
@@ -26,4 +26,5 @@ export * from './server';
26
26
  export * from './i18n';
27
27
  export * from './translations';
28
28
  export { default as dayjs } from 'dayjs';
29
- export * from 'react-i18next';
29
+ export * from 'react-i18next';
30
+ export * from './menu-filter';
@@ -1,7 +1,7 @@
1
1
  import { g as getToken } from "../common-CzUO_Aj4.esm.js";
2
2
  import { aC, aB, aD, aA, ay, az, aE, I, aw, aK, ab, b, ak, O, ag, ae, a2, as, aQ, aP, a0, C, B, A, a4, H, G, f, al, Y, W, Z, $, ai, aj, ad, n, L, m, Q, R, aH, aG, t, x, F, aO, aF, J, V, w, aL, h, j, k, e, aR, ac, ap, c, z, q, o, an, am, d, E, aI, a1, af, ao, l, a, _, a5, T, aq, N, M, aJ, s, P, a8, y, i, S, a6, a7, av, aT, D, a3, U, p, au, ah, r, ax, a9, X, ar, aN, aM, K, at, aS, aa, u, v } from "../common-CzUO_Aj4.esm.js";
3
3
  import { R as R2, c as c2, e as e2, f as f2, a as a10, g, h as h2, d as d2, n as n2, r as r2, b as b2, t as t2 } from "../navigation-utils-CY-tJ7Yc.esm.js";
4
- import { C as C2, a as a11, e as e3, j as j2, i as i2, c as c3, l as l2, h as h3, b as b3, d as d3, f as f3, g as g2, k as k2, m as m2, p as p2, u as u2 } from "../migration-utils-DgL-o5H7.esm.js";
4
+ import { C as C2, o as o2, n as n3, M as M2, S as S2, a as a11, e as e3, j as j2, i as i2, c as c3, l as l2, h as h3, b as b3, d as d3, f as f3, g as g2, k as k2, m as m2, p as p2, u as u2 } from "../menu-filter-D6MAKEqM.esm.js";
5
5
  import { a as getV1Languages } from "../api-CnNWjdg1.esm.js";
6
6
  import { s as s2, b as b4 } from "../api-CnNWjdg1.esm.js";
7
7
  import { l as l3 } from "../translations-BFQz0wdK.esm.js";
@@ -142,8 +142,12 @@ export {
142
142
  az as INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS,
143
143
  aE as INVENTORY_VARIANT_DISABLED_FIELDS,
144
144
  I as InvoiceStatus,
145
+ o2 as MenuFilter,
146
+ n3 as MenuFilterService,
147
+ M2 as ModuleAccessService,
145
148
  R2 as RANGE,
146
149
  aw as SECTION_TYPES,
150
+ S2 as StorageUtils,
147
151
  aK as UTCDateFormat,
148
152
  ab as addOrEditArray,
149
153
  a11 as anyDateValidation,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-ZGNib3x2.js"),t=require("../navigation-utils-LF9-2ZD0.js"),a=require("../migration-utils-BFCeKgrc.js"),o=require("../api-CoR86qOS.js"),r=require("../translations-BQO6LcM0.js"),s=require("dayjs"),i=require("react-i18next"),n=require("../api-VeUt6PG8.js");function p(e){return e&&e.__esModule?e:{default:e}}var l=/* @__PURE__ */p(s);exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=e.INVENTORY_ADD_MODE_DISABLED_FIELDS,exports.INVENTORY_ALWAYS_DISABLED_FIELDS=e.INVENTORY_ALWAYS_DISABLED_FIELDS,exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=e.INVENTORY_EDIT_MODE_DISABLED_FIELDS,exports.INVENTORY_FIELDS_TO_BE_DISABLED=e.INVENTORY_FIELDS_TO_BE_DISABLED,exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=e.INVENTORY_MATERIAL_COSTING_TYPE_ARR,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=e.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS,exports.INVENTORY_VARIANT_DISABLED_FIELDS=e.INVENTORY_VARIANT_DISABLED_FIELDS,exports.InvoiceStatus=e.InvoiceStatus,exports.SECTION_TYPES=e.SECTION_TYPES,exports.UTCDateFormat=e.UTCDateFormat,exports.addOrEditArray=e.addOrEditArray,exports.apiConfigurations=e.apiConfigurations,exports.appendConditionSafely=e.appendConditionSafely,exports.calculateAmountData=e.calculateAmountData,exports.calculatePeriods=e.calculatePeriods,exports.checkDuplicateTracking=e.checkDuplicateTracking,exports.checkForDuplicate=e.checkForDuplicate,exports.checkSkuAndItemName=e.checkSkuAndItemName,exports.convertRoutesToUseIdParams=e.convertRoutesToUseIdParams,exports.convertToUnderscore=e.convertToUnderscore,exports.createdOnAndBy=e.createdOnAndBy,exports.defaultCompany=e.defaultCompany,exports.defaultCurrencyFormat=e.defaultCurrencyFormat,exports.defaultCurrencySymbol=e.defaultCurrencySymbol,exports.displayPhone=e.displayPhone,exports.downloadDoc=e.downloadDoc,exports.downloadFile=e.downloadFile,exports.fetchApi=e.fetchApi,exports.fetchAssemblyItemData=e.fetchAssemblyItemData,exports.fetchCompanyLocations=e.fetchCompanyLocations,exports.fetchExchageRate=e.fetchExchageRate,exports.fetchItems=e.fetchItems,exports.fetchOptions=e.fetchOptions,exports.fetchRentalResponseItems=e.fetchRentalResponseItems,exports.fetchRfqItemsByIdForResponse=e.fetchRfqItemsByIdForResponse,exports.filterAccessibleModules=e.filterAccessibleModules,exports.filterCoaByCompanyIdOrNull=e.filterCoaByCompanyIdOrNull,exports.findById=e.findById,exports.formatAmount=e.formatAmount,exports.formatAmountWithCurrency=e.formatAmountWithCurrency,exports.formatAmountWithCurrencyData=e.formatAmountWithCurrencyData,exports.formatDataTime=e.formatDataTime,exports.formatDate=e.formatDate,exports.formatDateForPayload=e.formatDateForPayload,exports.formatDateTimeForPayload=e.formatDateTimeForPayload,exports.formatEmptyDataToNull=e.formatEmptyDataToNull,exports.formatLabel=e.formatLabel,exports.formatOnlyTime=e.formatOnlyTime,exports.formatResponseDatesToDayJS=e.formatResponseDatesToDayJS,exports.formatResponseOnlyDatesToDayJS=e.formatResponseOnlyDatesToDayJS,exports.formatTimeForPayload=e.formatTimeForPayload,exports.formatUtcDate=e.formatUtcDate,exports.generateAndFormatStringFromObj=e.generateAndFormatStringFromObj,exports.generateFields=e.generateFields,exports.generateQueryString=e.generateQueryString,exports.generateRandomId=e.generateRandomId,exports.generateRouteWithId=e.generateRouteWithId,exports.getAccessibleModules=e.getAccessibleModules,exports.getCountryIdByName=e.getCountryIdByName,exports.getCurrency=e.getCurrency,exports.getErrorMessage=e.getErrorMessage,exports.getExcelExportTemplate=e.getExcelExportTemplate,exports.getExcelTemplateGenerateTemplate=e.getExcelTemplateGenerateTemplate,exports.getFieldFilters=e.getFieldFilters,exports.getFileName=e.getFileName,exports.getItems=e.getItems,exports.getLabelValuePairs=e.getLabelValuePairs,exports.getMinutesFromTime=e.getMinutesFromTime,exports.getName=e.getName,exports.getNestedValue=e.getNestedValue,exports.getNextScheduleDate=e.getNextScheduleDate,exports.getOperatorLabel=e.getOperatorLabel,exports.getOptions=e.getOptions,exports.getOptionsData=e.getOptionsData,exports.getPartyDependentData=e.getPartyDependentData,exports.getPartyName=e.getPartyName,exports.getSlicedValue=e.getSlicedValue,exports.getTaxAmountDataFromMultipleTaxCodes=e.getTaxAmountDataFromMultipleTaxCodes,exports.getTaxAmountFromMultipleTaxCodes=e.getTaxAmountFromMultipleTaxCodes,exports.getTimeFromMinutes=e.getTimeFromMinutes,exports.getToken=e.getToken,exports.handleRegularUpload=e.handleRegularUpload,exports.hasValue=e.hasValue,exports.isBetweenTheDates=e.isBetweenTheDates,exports.isJSONString=e.isJSONString,exports.isJsonParse=e.isJsonParse,exports.manageItems=e.manageItems,exports.mapApiPayload=e.mapApiPayload,exports.mapAsyncApiPayload=e.mapAsyncApiPayload,exports.matchedMaterialCostingTypeLabel=e.matchedMaterialCostingTypeLabel,exports.navigateToRouteWithId=e.navigateToRouteWithId,exports.omitDataKeys=e.omitDataKeys,exports.partyDuplicateCheck=e.partyDuplicateCheck,exports.partyEmailIds=e.partyEmailIds,exports.postImportSheet=e.postImportSheet,exports.remainingMaterialCostingTypes=e.remainingMaterialCostingTypes,exports.removeIdFromObject=e.removeIdFromObject,exports.removeIdStaticIdsFromMongoObject=e.removeIdStaticIdsFromMongoObject,exports.responseItemDetailsColumns=e.responseItemDetailsColumns,exports.setRateBasedOnPriceRules=e.setRateBasedOnPriceRules,exports.showSnackBar=e.showSnackBar,exports.skuGenerator=e.skuGenerator,exports.specificFilters=e.specificFilters,exports.subModuleMappings=e.subModuleMappings,exports.toFixedWithNumbers=e.toFixedWithNumbers,exports.updateFieldsDisabledState=e.updateFieldsDisabledState,exports.updatePathnameWithIdParams=e.updatePathnameWithIdParams,exports.uploadAttachments=e.uploadAttachments,exports.uploadFiles=e.uploadFiles,exports.validateDiscountValidity=e.validateDiscountValidity,exports.RANGE=t.RANGE,exports.calculateEntries=t.calculateEntries,exports.convertTableColumns=t.convertTableColumns,exports.getEntityId=t.getEntityId,exports.getFileNamesFromUrls=t.getFileNamesFromUrls,exports.getFileNamesFromUrlsAsLink=t.getFileNamesFromUrlsAsLink,exports.handleCompareDateRange=t.handleCompareDateRange,exports.handleCompareDateRangeSync=t.handleCompareDateRangeSync,exports.navigateWithId=t.navigateWithId,exports.renderEmptyRowsFallback=t.renderEmptyRowsFallback,exports.renderValueField=t.renderValueField,exports.transformTableColumns=t.transformTableColumns,exports.COMMON_DATE_VALIDATIONS=a.COMMON_DATE_VALIDATIONS,exports.anyDateValidation=a.anyDateValidation,exports.businessDateValidation=a.businessDateValidation,exports.conditionalDateValidation=a.conditionalDateValidation,exports.createCustomMessages=a.createCustomMessages,exports.createDateValidation=a.createDateValidation,exports.createParameterizedNavigationHandler=a.createParameterizedNavigationHandler,exports.dateRangeValidation=a.dateRangeValidation,exports.dateTimeValidation=a.dateTimeValidation,exports.dateValidation=a.dateValidation,exports.futureDateValidation=a.futureDateValidation,exports.getCountry=a.getCountry,exports.migrateRoutesToUseParams=a.migrateRoutesToUseParams,exports.migrateToPathWithId=a.migrateToPathWithId,exports.pastDateValidation=a.pastDateValidation,exports.updateTableConfigForParameterizedNavigation=a.updateTableConfigForParameterizedNavigation,exports.setRoleURL=o.setBaseUrl,exports.setSystemFeatureURL=o.setBaseUrl$1,exports.loadModuleTranslations=r.loadModuleTranslations,Object.defineProperty(exports,"dayjs",{enumerable:!0,get:function(){return l.default}}),exports.setDriveURL=n.setBaseUrl,exports.blue={100:"#DAF4FC",200:"#CDEBF4",300:"#C0E1EB",400:"#B3D8E2",500:"#A6CED9",600:"#72A7B6",700:"#5894A5",800:"#3E8193",900:"#246E82",1e3:"#0A5A70"},exports.error={100:"#FEDFDF",200:"#FCBFBF",300:"#FBA0A0",400:"#F98080",500:"#F86060",600:"#C64D4D",700:"#953A3A",800:"#632626",900:"#321313",1e3:"#250E0E"},exports.fetchLanguages=async function(){var t,a;const r=await o.getV1Languages({order:"id:1",...e.getToken()}),s=(null==(t=null==r?void 0:r.data)?void 0:t.languages)||[];return null==(a=null==s?void 0:s.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}))},exports.green={100:"#DDF9E4",200:"#D0F0DA",300:"#C3E6CF",400:"#B6DCC5",500:"#A8D2BA",600:"#72AA8F",700:"#58967A",800:"#3D8264",900:"#226E4F",1e3:"#075A39"},exports.lightGreen={100:"#F4FBCB",200:"#EAF2BF",300:"#E0E8B3",400:"#D6DEA7",500:"#CBD49A",600:"#A2AD69",700:"#98A45D",800:"#8E9A51",900:"#798638",1e3:"#505F07"},exports.magenta={100:"#FEECF1",200:"#F6DEE8",300:"#EDD0DF",400:"#E4C2D6",500:"#DBB3CC",600:"#B779A7",700:"#AE6B9E",800:"#A55D95",900:"#934082",1e3:"#6F065D"},exports.neutral={100:"#FBFBFB",200:"#EEEFF1",300:"#D3D3D4",400:"#BDBEBF",500:"#A7A8A9",600:"#919294",700:"#7B7C7F",800:"#656669",900:"#232529",1e3:"#1F2125"},exports.olive={100:"#FFF3CC",200:"#F7EAC0",300:"#EEE0B3",400:"#E5D6A6",500:"#DCCC99",600:"#B8A466",700:"#A6914D",800:"#947D33",900:"#82691A",1e3:"#705500"},exports.primaryGreen={100:"#EBF9F2",200:"#D6F3E5",300:"#ADE7CB",400:"#84DAB1",500:"#5BCE97",600:"#32C27D",700:"#289B64",800:"#1E744B",900:"#144E32",1e3:"#0A2719"},exports.red={100:"#FFEBEB",200:"#EED2D2",300:"#DDB9B9",400:"#D5ADAD",500:"#CCA0A0",600:"#BB8787",700:"#AA6E6E",800:"#995555",900:"#883C3C",1e3:"#772322"},Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../common-ZGNib3x2.js"),t=require("../navigation-utils-LF9-2ZD0.js"),a=require("../menu-filter-BqGaycuM.js"),o=require("../api-CoR86qOS.js"),r=require("../translations-BQO6LcM0.js"),s=require("dayjs"),i=require("react-i18next"),n=require("../api-VeUt6PG8.js");function p(e){return e&&e.__esModule?e:{default:e}}var l=/* @__PURE__ */p(s);exports.INVENTORY_ADD_MODE_DISABLED_FIELDS=e.INVENTORY_ADD_MODE_DISABLED_FIELDS,exports.INVENTORY_ALWAYS_DISABLED_FIELDS=e.INVENTORY_ALWAYS_DISABLED_FIELDS,exports.INVENTORY_EDIT_MODE_DISABLED_FIELDS=e.INVENTORY_EDIT_MODE_DISABLED_FIELDS,exports.INVENTORY_FIELDS_TO_BE_DISABLED=e.INVENTORY_FIELDS_TO_BE_DISABLED,exports.INVENTORY_MATERIAL_COSTING_TYPE_ARR=e.INVENTORY_MATERIAL_COSTING_TYPE_ARR,exports.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS=e.INVENTORY_MATERIAL_COSTING_TYPE_OPTIONS,exports.INVENTORY_VARIANT_DISABLED_FIELDS=e.INVENTORY_VARIANT_DISABLED_FIELDS,exports.InvoiceStatus=e.InvoiceStatus,exports.SECTION_TYPES=e.SECTION_TYPES,exports.UTCDateFormat=e.UTCDateFormat,exports.addOrEditArray=e.addOrEditArray,exports.apiConfigurations=e.apiConfigurations,exports.appendConditionSafely=e.appendConditionSafely,exports.calculateAmountData=e.calculateAmountData,exports.calculatePeriods=e.calculatePeriods,exports.checkDuplicateTracking=e.checkDuplicateTracking,exports.checkForDuplicate=e.checkForDuplicate,exports.checkSkuAndItemName=e.checkSkuAndItemName,exports.convertRoutesToUseIdParams=e.convertRoutesToUseIdParams,exports.convertToUnderscore=e.convertToUnderscore,exports.createdOnAndBy=e.createdOnAndBy,exports.defaultCompany=e.defaultCompany,exports.defaultCurrencyFormat=e.defaultCurrencyFormat,exports.defaultCurrencySymbol=e.defaultCurrencySymbol,exports.displayPhone=e.displayPhone,exports.downloadDoc=e.downloadDoc,exports.downloadFile=e.downloadFile,exports.fetchApi=e.fetchApi,exports.fetchAssemblyItemData=e.fetchAssemblyItemData,exports.fetchCompanyLocations=e.fetchCompanyLocations,exports.fetchExchageRate=e.fetchExchageRate,exports.fetchItems=e.fetchItems,exports.fetchOptions=e.fetchOptions,exports.fetchRentalResponseItems=e.fetchRentalResponseItems,exports.fetchRfqItemsByIdForResponse=e.fetchRfqItemsByIdForResponse,exports.filterAccessibleModules=e.filterAccessibleModules,exports.filterCoaByCompanyIdOrNull=e.filterCoaByCompanyIdOrNull,exports.findById=e.findById,exports.formatAmount=e.formatAmount,exports.formatAmountWithCurrency=e.formatAmountWithCurrency,exports.formatAmountWithCurrencyData=e.formatAmountWithCurrencyData,exports.formatDataTime=e.formatDataTime,exports.formatDate=e.formatDate,exports.formatDateForPayload=e.formatDateForPayload,exports.formatDateTimeForPayload=e.formatDateTimeForPayload,exports.formatEmptyDataToNull=e.formatEmptyDataToNull,exports.formatLabel=e.formatLabel,exports.formatOnlyTime=e.formatOnlyTime,exports.formatResponseDatesToDayJS=e.formatResponseDatesToDayJS,exports.formatResponseOnlyDatesToDayJS=e.formatResponseOnlyDatesToDayJS,exports.formatTimeForPayload=e.formatTimeForPayload,exports.formatUtcDate=e.formatUtcDate,exports.generateAndFormatStringFromObj=e.generateAndFormatStringFromObj,exports.generateFields=e.generateFields,exports.generateQueryString=e.generateQueryString,exports.generateRandomId=e.generateRandomId,exports.generateRouteWithId=e.generateRouteWithId,exports.getAccessibleModules=e.getAccessibleModules,exports.getCountryIdByName=e.getCountryIdByName,exports.getCurrency=e.getCurrency,exports.getErrorMessage=e.getErrorMessage,exports.getExcelExportTemplate=e.getExcelExportTemplate,exports.getExcelTemplateGenerateTemplate=e.getExcelTemplateGenerateTemplate,exports.getFieldFilters=e.getFieldFilters,exports.getFileName=e.getFileName,exports.getItems=e.getItems,exports.getLabelValuePairs=e.getLabelValuePairs,exports.getMinutesFromTime=e.getMinutesFromTime,exports.getName=e.getName,exports.getNestedValue=e.getNestedValue,exports.getNextScheduleDate=e.getNextScheduleDate,exports.getOperatorLabel=e.getOperatorLabel,exports.getOptions=e.getOptions,exports.getOptionsData=e.getOptionsData,exports.getPartyDependentData=e.getPartyDependentData,exports.getPartyName=e.getPartyName,exports.getSlicedValue=e.getSlicedValue,exports.getTaxAmountDataFromMultipleTaxCodes=e.getTaxAmountDataFromMultipleTaxCodes,exports.getTaxAmountFromMultipleTaxCodes=e.getTaxAmountFromMultipleTaxCodes,exports.getTimeFromMinutes=e.getTimeFromMinutes,exports.getToken=e.getToken,exports.handleRegularUpload=e.handleRegularUpload,exports.hasValue=e.hasValue,exports.isBetweenTheDates=e.isBetweenTheDates,exports.isJSONString=e.isJSONString,exports.isJsonParse=e.isJsonParse,exports.manageItems=e.manageItems,exports.mapApiPayload=e.mapApiPayload,exports.mapAsyncApiPayload=e.mapAsyncApiPayload,exports.matchedMaterialCostingTypeLabel=e.matchedMaterialCostingTypeLabel,exports.navigateToRouteWithId=e.navigateToRouteWithId,exports.omitDataKeys=e.omitDataKeys,exports.partyDuplicateCheck=e.partyDuplicateCheck,exports.partyEmailIds=e.partyEmailIds,exports.postImportSheet=e.postImportSheet,exports.remainingMaterialCostingTypes=e.remainingMaterialCostingTypes,exports.removeIdFromObject=e.removeIdFromObject,exports.removeIdStaticIdsFromMongoObject=e.removeIdStaticIdsFromMongoObject,exports.responseItemDetailsColumns=e.responseItemDetailsColumns,exports.setRateBasedOnPriceRules=e.setRateBasedOnPriceRules,exports.showSnackBar=e.showSnackBar,exports.skuGenerator=e.skuGenerator,exports.specificFilters=e.specificFilters,exports.subModuleMappings=e.subModuleMappings,exports.toFixedWithNumbers=e.toFixedWithNumbers,exports.updateFieldsDisabledState=e.updateFieldsDisabledState,exports.updatePathnameWithIdParams=e.updatePathnameWithIdParams,exports.uploadAttachments=e.uploadAttachments,exports.uploadFiles=e.uploadFiles,exports.validateDiscountValidity=e.validateDiscountValidity,exports.RANGE=t.RANGE,exports.calculateEntries=t.calculateEntries,exports.convertTableColumns=t.convertTableColumns,exports.getEntityId=t.getEntityId,exports.getFileNamesFromUrls=t.getFileNamesFromUrls,exports.getFileNamesFromUrlsAsLink=t.getFileNamesFromUrlsAsLink,exports.handleCompareDateRange=t.handleCompareDateRange,exports.handleCompareDateRangeSync=t.handleCompareDateRangeSync,exports.navigateWithId=t.navigateWithId,exports.renderEmptyRowsFallback=t.renderEmptyRowsFallback,exports.renderValueField=t.renderValueField,exports.transformTableColumns=t.transformTableColumns,exports.COMMON_DATE_VALIDATIONS=a.COMMON_DATE_VALIDATIONS,exports.MenuFilter=a.MenuFilter,exports.MenuFilterService=a.MenuFilterService,exports.ModuleAccessService=a.ModuleAccessService,exports.StorageUtils=a.StorageUtils,exports.anyDateValidation=a.anyDateValidation,exports.businessDateValidation=a.businessDateValidation,exports.conditionalDateValidation=a.conditionalDateValidation,exports.createCustomMessages=a.createCustomMessages,exports.createDateValidation=a.createDateValidation,exports.createParameterizedNavigationHandler=a.createParameterizedNavigationHandler,exports.dateRangeValidation=a.dateRangeValidation,exports.dateTimeValidation=a.dateTimeValidation,exports.dateValidation=a.dateValidation,exports.futureDateValidation=a.futureDateValidation,exports.getCountry=a.getCountry,exports.migrateRoutesToUseParams=a.migrateRoutesToUseParams,exports.migrateToPathWithId=a.migrateToPathWithId,exports.pastDateValidation=a.pastDateValidation,exports.updateTableConfigForParameterizedNavigation=a.updateTableConfigForParameterizedNavigation,exports.setRoleURL=o.setBaseUrl,exports.setSystemFeatureURL=o.setBaseUrl$1,exports.loadModuleTranslations=r.loadModuleTranslations,Object.defineProperty(exports,"dayjs",{enumerable:!0,get:function(){return l.default}}),exports.setDriveURL=n.setBaseUrl,exports.blue={100:"#DAF4FC",200:"#CDEBF4",300:"#C0E1EB",400:"#B3D8E2",500:"#A6CED9",600:"#72A7B6",700:"#5894A5",800:"#3E8193",900:"#246E82",1e3:"#0A5A70"},exports.error={100:"#FEDFDF",200:"#FCBFBF",300:"#FBA0A0",400:"#F98080",500:"#F86060",600:"#C64D4D",700:"#953A3A",800:"#632626",900:"#321313",1e3:"#250E0E"},exports.fetchLanguages=async function(){var t,a;const r=await o.getV1Languages({order:"id:1",...e.getToken()}),s=(null==(t=null==r?void 0:r.data)?void 0:t.languages)||[];return null==(a=null==s?void 0:s.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}))},exports.green={100:"#DDF9E4",200:"#D0F0DA",300:"#C3E6CF",400:"#B6DCC5",500:"#A8D2BA",600:"#72AA8F",700:"#58967A",800:"#3D8264",900:"#226E4F",1e3:"#075A39"},exports.lightGreen={100:"#F4FBCB",200:"#EAF2BF",300:"#E0E8B3",400:"#D6DEA7",500:"#CBD49A",600:"#A2AD69",700:"#98A45D",800:"#8E9A51",900:"#798638",1e3:"#505F07"},exports.magenta={100:"#FEECF1",200:"#F6DEE8",300:"#EDD0DF",400:"#E4C2D6",500:"#DBB3CC",600:"#B779A7",700:"#AE6B9E",800:"#A55D95",900:"#934082",1e3:"#6F065D"},exports.neutral={100:"#FBFBFB",200:"#EEEFF1",300:"#D3D3D4",400:"#BDBEBF",500:"#A7A8A9",600:"#919294",700:"#7B7C7F",800:"#656669",900:"#232529",1e3:"#1F2125"},exports.olive={100:"#FFF3CC",200:"#F7EAC0",300:"#EEE0B3",400:"#E5D6A6",500:"#DCCC99",600:"#B8A466",700:"#A6914D",800:"#947D33",900:"#82691A",1e3:"#705500"},exports.primaryGreen={100:"#EBF9F2",200:"#D6F3E5",300:"#ADE7CB",400:"#84DAB1",500:"#5BCE97",600:"#32C27D",700:"#289B64",800:"#1E744B",900:"#144E32",1e3:"#0A2719"},exports.red={100:"#FFEBEB",200:"#EED2D2",300:"#DDB9B9",400:"#D5ADAD",500:"#CCA0A0",600:"#BB8787",700:"#AA6E6E",800:"#995555",900:"#883C3C",1e3:"#772322"},Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})});
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/utils/color.ts","../../src/utils/language.ts"],"sourcesContent":["export interface Color {\n 100: string;\n 200: string;\n 300: string;\n 400: string;\n 500: string;\n 600: string;\n 700: string;\n 800: string;\n 900: string;\n 1000: string;\n}\n\nexport const primaryGreen: Color = {\n 100: \"#EBF9F2\",\n 200: \"#D6F3E5\",\n 300: \"#ADE7CB\",\n 400: \"#84DAB1\",\n 500: \"#5BCE97\",\n 600: \"#32C27D\",\n 700: \"#289B64\",\n 800: \"#1E744B\",\n 900: \"#144E32\",\n 1000: \"#0A2719\",\n};\n\nexport const green: Color = {\n 100: \"#DDF9E4\",\n 200: \"#D0F0DA\",\n 300: \"#C3E6CF\",\n 400: \"#B6DCC5\",\n 500: \"#A8D2BA\",\n 600: \"#72AA8F\",\n 700: \"#58967A\",\n 800: \"#3D8264\",\n 900: \"#226E4F\",\n 1000: \"#075A39\",\n};\n\nexport const lightGreen: Color = {\n 100: \"#F4FBCB\",\n 200: \"#EAF2BF\",\n 300: \"#E0E8B3\",\n 400: \"#D6DEA7\",\n 500: \"#CBD49A\",\n 600: \"#A2AD69\",\n 700: \"#98A45D\",\n 800: \"#8E9A51\",\n 900: \"#798638\",\n 1000: \"#505F07\",\n};\n\nexport const olive: Color = {\n 100: \"#FFF3CC\",\n 200: \"#F7EAC0\",\n 300: \"#EEE0B3\",\n 400: \"#E5D6A6\",\n 500: \"#DCCC99\",\n 600: \"#B8A466\",\n 700: \"#A6914D\",\n 800: \"#947D33\",\n 900: \"#82691A\",\n 1000: \"#705500\",\n};\n\nexport const magenta: Color = {\n 100: \"#FEECF1\",\n 200: \"#F6DEE8\",\n 300: \"#EDD0DF\",\n 400: \"#E4C2D6\",\n 500: \"#DBB3CC\",\n 600: \"#B779A7\",\n 700: \"#AE6B9E\",\n 800: \"#A55D95\",\n 900: \"#934082\",\n 1000: \"#6F065D\",\n};\n\nexport const blue: Color = {\n 100: \"#DAF4FC\",\n 200: \"#CDEBF4\",\n 300: \"#C0E1EB\",\n 400: \"#B3D8E2\",\n 500: \"#A6CED9\",\n 600: \"#72A7B6\",\n 700: \"#5894A5\",\n 800: \"#3E8193\",\n 900: \"#246E82\",\n 1000: \"#0A5A70\",\n};\n\nexport const neutral: Color = {\n 100: \"#FBFBFB\",\n 200: \"#EEEFF1\",\n 300: \"#D3D3D4\",\n 400: \"#BDBEBF\",\n 500: \"#A7A8A9\",\n 600: \"#919294\",\n 700: \"#7B7C7F\",\n 800: \"#656669\",\n 900: \"#232529\",\n 1000: \"#1F2125\",\n};\n\nexport const red: Color = {\n 100: \"#FFEBEB\",\n 200: \"#EED2D2\",\n 300: \"#DDB9B9\",\n 400: \"#D5ADAD\",\n 500: \"#CCA0A0\",\n 600: \"#BB8787\",\n 700: \"#AA6E6E\",\n 800: \"#995555\",\n 900: \"#883C3C\",\n 1000: \"#772322\",\n};\n\nexport const error: Color = {\n 100: \"#FEDFDF\",\n 200: \"#FCBFBF\",\n 300: \"#FBA0A0\",\n 400: \"#F98080\",\n 500: \"#F86060\",\n 600: \"#C64D4D\",\n 700: \"#953A3A\",\n 800: \"#632626\",\n 900: \"#321313\",\n 1000: \"#250E0E\",\n};\n","import { getV1Languages } from \"../api-client/api.system-feature/api\";\nimport { getToken } from \"./common\";\n\nexport async function fetchLanguages() {\n\n const response = await getV1Languages({\n order: `id:1`,\n ...getToken(),\n });\n const data = response?.data?.languages || [];\n const languages = data?.filter(d => d?.is_active)?.map(d => {\n return {\n label: d?.name,\n code: d?.code,\n direction: d?.direction\n }\n });\n\n return languages\n}"],"names":["async","response","getV1Languages","order","getToken","data","_a","languages","_b","filter","d","is_active","map","label","name","code","direction"],"mappings":"m8OA8E2B,CACzB,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,yBA6BoB,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,kCC5HRA,yBAEE,MAAMC,QAAiBC,iBAAe,CACpCC,MAAO,UACJC,EAAAA,aAECC,GAAO,OAAAC,EAAA,MAAAL,OAAA,EAAAA,EAAUI,WAAV,EAAAC,EAAgBC,YAAa,GAS1C,OARkB,OAAAC,EAAA,MAAAH,OAAA,EAAAA,EAAMI,OAAOC,SAAKA,WAAGC,iBAArB,EAAAH,EAAiCI,IAAIF,IAC9C,CACLG,MAAO,MAAAH,OAAA,EAAAA,EAAGI,KACVC,KAAM,MAAAL,OAAA,EAAAA,EAAGK,KACTC,UAAW,MAAAN,OAAA,EAAAA,EAAGM,YAKpB,gBDO4B,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,8BAGyB,CAC/B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,2BAgBsB,CAC5B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,2BAgBsB,CAC5B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,yBAjDoB,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,gCAjD2B,CACjC,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,uBAiFkB,CACxB,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM"}
1
+ {"version":3,"file":"index.js","sources":["../../src/utils/color.ts","../../src/utils/language.ts"],"sourcesContent":["export interface Color {\n 100: string;\n 200: string;\n 300: string;\n 400: string;\n 500: string;\n 600: string;\n 700: string;\n 800: string;\n 900: string;\n 1000: string;\n}\n\nexport const primaryGreen: Color = {\n 100: \"#EBF9F2\",\n 200: \"#D6F3E5\",\n 300: \"#ADE7CB\",\n 400: \"#84DAB1\",\n 500: \"#5BCE97\",\n 600: \"#32C27D\",\n 700: \"#289B64\",\n 800: \"#1E744B\",\n 900: \"#144E32\",\n 1000: \"#0A2719\",\n};\n\nexport const green: Color = {\n 100: \"#DDF9E4\",\n 200: \"#D0F0DA\",\n 300: \"#C3E6CF\",\n 400: \"#B6DCC5\",\n 500: \"#A8D2BA\",\n 600: \"#72AA8F\",\n 700: \"#58967A\",\n 800: \"#3D8264\",\n 900: \"#226E4F\",\n 1000: \"#075A39\",\n};\n\nexport const lightGreen: Color = {\n 100: \"#F4FBCB\",\n 200: \"#EAF2BF\",\n 300: \"#E0E8B3\",\n 400: \"#D6DEA7\",\n 500: \"#CBD49A\",\n 600: \"#A2AD69\",\n 700: \"#98A45D\",\n 800: \"#8E9A51\",\n 900: \"#798638\",\n 1000: \"#505F07\",\n};\n\nexport const olive: Color = {\n 100: \"#FFF3CC\",\n 200: \"#F7EAC0\",\n 300: \"#EEE0B3\",\n 400: \"#E5D6A6\",\n 500: \"#DCCC99\",\n 600: \"#B8A466\",\n 700: \"#A6914D\",\n 800: \"#947D33\",\n 900: \"#82691A\",\n 1000: \"#705500\",\n};\n\nexport const magenta: Color = {\n 100: \"#FEECF1\",\n 200: \"#F6DEE8\",\n 300: \"#EDD0DF\",\n 400: \"#E4C2D6\",\n 500: \"#DBB3CC\",\n 600: \"#B779A7\",\n 700: \"#AE6B9E\",\n 800: \"#A55D95\",\n 900: \"#934082\",\n 1000: \"#6F065D\",\n};\n\nexport const blue: Color = {\n 100: \"#DAF4FC\",\n 200: \"#CDEBF4\",\n 300: \"#C0E1EB\",\n 400: \"#B3D8E2\",\n 500: \"#A6CED9\",\n 600: \"#72A7B6\",\n 700: \"#5894A5\",\n 800: \"#3E8193\",\n 900: \"#246E82\",\n 1000: \"#0A5A70\",\n};\n\nexport const neutral: Color = {\n 100: \"#FBFBFB\",\n 200: \"#EEEFF1\",\n 300: \"#D3D3D4\",\n 400: \"#BDBEBF\",\n 500: \"#A7A8A9\",\n 600: \"#919294\",\n 700: \"#7B7C7F\",\n 800: \"#656669\",\n 900: \"#232529\",\n 1000: \"#1F2125\",\n};\n\nexport const red: Color = {\n 100: \"#FFEBEB\",\n 200: \"#EED2D2\",\n 300: \"#DDB9B9\",\n 400: \"#D5ADAD\",\n 500: \"#CCA0A0\",\n 600: \"#BB8787\",\n 700: \"#AA6E6E\",\n 800: \"#995555\",\n 900: \"#883C3C\",\n 1000: \"#772322\",\n};\n\nexport const error: Color = {\n 100: \"#FEDFDF\",\n 200: \"#FCBFBF\",\n 300: \"#FBA0A0\",\n 400: \"#F98080\",\n 500: \"#F86060\",\n 600: \"#C64D4D\",\n 700: \"#953A3A\",\n 800: \"#632626\",\n 900: \"#321313\",\n 1000: \"#250E0E\",\n};\n","import { getV1Languages } from \"../api-client/api.system-feature/api\";\nimport { getToken } from \"./common\";\n\nexport async function fetchLanguages() {\n\n const response = await getV1Languages({\n order: `id:1`,\n ...getToken(),\n });\n const data = response?.data?.languages || [];\n const languages = data?.filter(d => d?.is_active)?.map(d => {\n return {\n label: d?.name,\n code: d?.code,\n direction: d?.direction\n }\n });\n\n return languages\n}"],"names":["async","response","getV1Languages","order","getToken","data","_a","languages","_b","filter","d","is_active","map","label","name","code","direction"],"mappings":"mmPA8E2B,CACzB,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,yBA6BoB,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,kCC5HRA,yBAEE,MAAMC,QAAiBC,iBAAe,CACpCC,MAAO,UACJC,EAAAA,aAECC,GAAO,OAAAC,EAAA,MAAAL,OAAA,EAAAA,EAAUI,WAAV,EAAAC,EAAgBC,YAAa,GAS1C,OARkB,OAAAC,EAAA,MAAAH,OAAA,EAAAA,EAAMI,OAAOC,SAAKA,WAAGC,iBAArB,EAAAH,EAAiCI,IAAIF,IAC9C,CACLG,MAAO,MAAAH,OAAA,EAAAA,EAAGI,KACVC,KAAM,MAAAL,OAAA,EAAAA,EAAGK,KACTC,UAAW,MAAAN,OAAA,EAAAA,EAAGM,YAKpB,gBDO4B,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,8BAGyB,CAC/B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,2BAgBsB,CAC5B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,2BAgBsB,CAC5B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,yBAjDoB,CAC1B,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,gCAjD2B,CACjC,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM,uBAiFkB,CACxB,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAM"}
@@ -0,0 +1,70 @@
1
+ export interface SubModule {
2
+ sub_module_name: string;
3
+ }
4
+ export interface ModuleAccess {
5
+ module_name: string;
6
+ sub_modules?: SubModule[];
7
+ }
8
+ export interface UserData {
9
+ module_access?: ModuleAccess[];
10
+ }
11
+ export interface MenuItem {
12
+ bacSubModuleName?: string;
13
+ submenu?: MenuItem[];
14
+ [key: string]: any;
15
+ }
16
+ export interface Permission {
17
+ [key: string]: any;
18
+ }
19
+ export declare class StorageUtils {
20
+ /**
21
+ * Retrieves and parses user data from localStorage
22
+ * @returns Parsed user data or null if not found
23
+ */
24
+ static getUserData(): UserData | null;
25
+ /**
26
+ * Retrieves and parses role permissions from localStorage
27
+ * @returns Parsed permissions object
28
+ */
29
+ static getRolePermissions(): Permission;
30
+ }
31
+ export declare class ModuleAccessService {
32
+ /**
33
+ * Filters modules by allowed module names and adds dashboard sub-module
34
+ * @param moduleNames - Array of allowed module names
35
+ * @param userData - User data containing module access
36
+ * @returns Filtered modules with dashboard added
37
+ */
38
+ static getAccessibleSubModules(moduleNames: string[], userData: UserData | null): ModuleAccess[];
39
+ /**
40
+ * Extracts unique sub-module names from modules
41
+ * @param modules - Array of module access objects
42
+ * @returns Set of unique sub-module names
43
+ */
44
+ static extractSubModuleNames(modules: ModuleAccess[]): Set<string>;
45
+ /**
46
+ * Matches sub-module names with permission keys
47
+ * @param subModuleNames - Set of sub-module names
48
+ * @param permissions - Permission object
49
+ * @returns Set of matching sub-module names
50
+ */
51
+ static getMatchingSubModules(subModuleNames: Set<string>, permissions: Permission): Set<string>;
52
+ }
53
+ export declare class MenuFilterService {
54
+ /**
55
+ * Recursively filters menu items based on accessible sub-modules
56
+ * @param menu - Array of menu items
57
+ * @param accessibleSubModules - Set of accessible sub-module names
58
+ * @returns Filtered menu array
59
+ */
60
+ static filterMenuByAccess(menu: MenuItem[], accessibleSubModules: Set<string>): MenuItem[];
61
+ }
62
+ export declare class MenuFilter {
63
+ /**
64
+ * Filters menu based on user permissions and module access
65
+ * @param menu - Menu items to filter
66
+ * @param allowedModules - Array of allowed module names
67
+ * @returns Filtered menu items
68
+ */
69
+ static filterByModuleAccess(menu: MenuItem[], allowedModules: string[]): MenuItem[];
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erpsquad/common",
3
- "version": "1.3.4",
3
+ "version": "1.4.0",
4
4
  "description": "Shared UI component library for ERP modules",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -67,6 +67,12 @@
67
67
  "require": "./dist/api-client/index.js",
68
68
  "default": "./dist/api-client/index.esm.js"
69
69
  },
70
+ "./layouts": {
71
+ "types": "./dist/layout/index.d.ts",
72
+ "import": "./dist/layout/index.esm.js",
73
+ "require": "./dist/layout/index.js",
74
+ "default": "./dist/layout/index.esm.js"
75
+ },
70
76
  "./style.css": {
71
77
  "import": "./dist/style.css",
72
78
  "default": "./dist/style.css"
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("yup"),t=require("dayjs"),a=require("./common-ZGNib3x2.js");function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=/* @__PURE__ */Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var i=/* @__PURE__ */s(e),o=/* @__PURE__ */r(t);const d={required:"Date is required",invalidDate:"Date must be a valid date",pastDate:"Date cannot be in the past",futureDate:"Future dates are not allowed",todayNotAllowed:"Today's date is not allowed",pastTime:"Time cannot be in the past for today's date"},l=(e,t)=>o.default.isDayjs(t)?t.toDate():t instanceof Date?t:"string"==typeof t&&t?o.default(t).toDate():null,u=(e={})=>{const{allowPast:t=!1,allowToday:a=!0,allowFuture:r=!0,requiredMessage:s=d.required,pastDateMessage:u=d.pastDate,futureDateMessage:n=d.futureDate,todayNotAllowedMessage:f=d.todayNotAllowed,invalidDateMessage:c=d.invalidDate,checkTime:D=!1,pastTimeMessage:p=d.pastTime}=e;return i.mixed().transform(l).typeError(c).required(s).test("date-validation",function(e){if(!e)return!1;const s=o.default(),i=o.default(e),d=o.default().startOf("day"),l=o.default(e).startOf("day");if(l.isBefore(d)&&!t)return this.createError({message:u});if(l.isSame(d)){if(!a)return this.createError({message:f});if(D&&i.isBefore(s))return this.createError({message:p})}return!(l.isAfter(d)&&!r)||this.createError({message:n})})},n=(e,t={})=>u({allowPast:!1,allowToday:!0,allowFuture:!0,...t,requiredMessage:e}),f={rental:e=>n(e||"Rental date is required")};exports.COMMON_DATE_VALIDATIONS=f,exports.anyDateValidation=e=>u({allowPast:!0,allowToday:!0,allowFuture:!0,requiredMessage:e}),exports.businessDateValidation=e=>u({allowPast:!1,allowToday:!0,allowFuture:!0,requiredMessage:e}).test("business-day","Please select a business day (Monday to Friday)",function(e){if(!e)return!1;const t=o.default(e).day();return t>=1&&t<=5}),exports.conditionalDateValidation=(e,t)=>i.mixed().when("$root",{is:e,then:t,otherwise:i.mixed().notRequired()}),exports.createCustomMessages=e=>({...d,...e}),exports.createDateValidation=u,exports.createParameterizedNavigationHandler=(e,t,r=e=>e.id)=>s=>{const i=r(s);e(a.generateRouteWithId(t,i))},exports.dateRangeValidation=(e,t,a)=>i.mixed().transform(l).typeError(d.invalidDate).required(a||d.required).test("date-range",function(a){if(!a)return!1;const r=o.default(a),s=o.default(e),i=o.default(t);return r.isBefore(s)?this.createError({message:`Date must be after ${s.format("MMM DD, YYYY")}`}):!r.isAfter(i)||this.createError({message:`Date must be before ${i.format("MMM DD, YYYY")}`})}),exports.dateTimeValidation=e=>u({allowPast:!1,allowToday:!0,allowFuture:!0,checkTime:!0,requiredMessage:e}),exports.dateValidation=n,exports.futureDateValidation=e=>u({allowPast:!1,allowToday:!1,allowFuture:!0,requiredMessage:e,pastDateMessage:"Please select a future date"}),exports.getCountry=e=>new Intl.DisplayNames(["en"],{type:"region"}).of(e),exports.migrateRoutesToUseParams=e=>{const t={...e};return Object.keys(t).forEach(e=>{(e.startsWith("VIEW_")||e.startsWith("EDIT_")||e.startsWith("DETAIL_")||e.includes("_VIEW_")||e.includes("_EDIT_")||e.includes("_DETAIL_"))&&(t[e].includes(":")||(t[e]=`${t[e]}/:id`))}),t},exports.migrateToPathWithId=(e,t="id")=>({redirectionPathWithId:`${e}/:id`,idField:t}),exports.pastDateValidation=e=>u({allowPast:!0,allowToday:!0,allowFuture:!1,requiredMessage:e,futureDateMessage:"Future dates are not allowed"}),exports.updateTableConfigForParameterizedNavigation=(e,t,a="id")=>{const{...r}=e;return{...r,redirectionPathWithId:t,idField:a}};
2
- //# sourceMappingURL=migration-utils-BFCeKgrc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-utils-BFCeKgrc.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/migration-utils.ts"],"sourcesContent":["export const getCountry = (code: string) => {\n const regionNames = new Intl.DisplayNames([\"en\"], { type: \"region\" });\n return regionNames.of(code);\n};\n","//eslint-disable @typescript-eslint/no-explicit-any\nimport * as Yup from 'yup';\nimport dayjs from 'dayjs';\n\n// Types for configuration\nexport interface DateValidationOptions {\n allowPast?: boolean;\n allowToday?: boolean;\n allowFuture?: boolean;\n requiredMessage?: string;\n pastDateMessage?: string;\n futureDateMessage?: string;\n todayNotAllowedMessage?: string;\n invalidDateMessage?: string;\n checkTime?: boolean;\n pastTimeMessage?: string;\n}\n\n// Default messages\nconst DEFAULT_MESSAGES = {\n required: 'Date is required',\n invalidDate: 'Date must be a valid date',\n pastDate: 'Date cannot be in the past',\n futureDate: 'Future dates are not allowed',\n todayNotAllowed: \"Today's date is not allowed\",\n pastTime: 'Time cannot be in the past for today\\'s date'\n};\n\n/**\n * Core date transformation function\n * Handles dayjs objects, Date objects, and string dates\n */\nconst transformDate = (value: any, originalValue: any) => {\n if (dayjs.isDayjs(originalValue)) {\n return originalValue.toDate();\n }\n if (originalValue instanceof Date) {\n return originalValue;\n }\n if (typeof originalValue === 'string' && originalValue) {\n return dayjs(originalValue).toDate();\n }\n return null;\n};\n\n/**\n * Global date validation function with full customization\n * @param options Configuration options for date validation\n * @returns Yup validation schema\n */\nexport const createDateValidation = (options: DateValidationOptions = {}) => {\n const {\n allowPast = false,\n allowToday = true,\n allowFuture = true,\n requiredMessage = DEFAULT_MESSAGES.required,\n pastDateMessage = DEFAULT_MESSAGES.pastDate,\n futureDateMessage = DEFAULT_MESSAGES.futureDate,\n todayNotAllowedMessage = DEFAULT_MESSAGES.todayNotAllowed,\n invalidDateMessage = DEFAULT_MESSAGES.invalidDate,\n checkTime = false,\n pastTimeMessage = DEFAULT_MESSAGES.pastTime\n } = options;\n\n return Yup.mixed()\n .transform(transformDate)\n .typeError(invalidDateMessage)\n .required(requiredMessage)\n .test('date-validation', function(value) {\n if (!value) return false;\n \n const now = dayjs();\n const selectedDateTime = dayjs(value);\n const today = dayjs().startOf('day');\n const selectedDate = dayjs(value).startOf('day');\n \n // Past date validation\n if (selectedDate.isBefore(today) && !allowPast) {\n return this.createError({ message: pastDateMessage });\n }\n \n // Today validation\n if (selectedDate.isSame(today)) {\n if (!allowToday) {\n return this.createError({ message: todayNotAllowedMessage });\n }\n \n // Time validation for today\n if (checkTime && selectedDateTime.isBefore(now)) {\n return this.createError({ message: pastTimeMessage });\n }\n }\n \n // Future date validation\n if (selectedDate.isAfter(today) && !allowFuture) {\n return this.createError({ message: futureDateMessage });\n }\n \n return true;\n });\n};\n\n/**\n * Quick preset validation functions for common use cases\n */\n\n// 1. Standard date validation (today + future allowed)\nexport const dateValidation = (requiredMessage?: string, options: DateValidationOptions = {}) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n ...options,\n requiredMessage\n });\n\n// 2. Future dates only (excluding today)\nexport const futureDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: false,\n allowFuture: true,\n requiredMessage,\n pastDateMessage: 'Please select a future date'\n });\n\n// 3. Any date allowed (for historical records)\nexport const anyDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n });\n\n// 4. Past dates only (for completed events)\nexport const pastDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: false,\n requiredMessage,\n futureDateMessage: 'Future dates are not allowed'\n });\n\n// 5. Date with time validation\nexport const dateTimeValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n checkTime: true,\n requiredMessage\n });\n\n// 6. Business days only (Monday to Friday, future dates)\nexport const businessDateValidation = (requiredMessage?: string) => {\n return createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n }).test('business-day', 'Please select a business day (Monday to Friday)', function(value) {\n if (!value) return false;\n \n const dayOfWeek = dayjs(value).day();\n return dayOfWeek >= 1 && dayOfWeek <= 5; // Monday = 1, Friday = 5\n });\n};\n\n// 7. Date range validation (between two dates)\nexport const dateRangeValidation = (\n minDate: dayjs.Dayjs | Date | string,\n maxDate: dayjs.Dayjs | Date | string,\n requiredMessage?: string\n) => {\n return Yup.mixed()\n .transform(transformDate)\n .typeError(DEFAULT_MESSAGES.invalidDate)\n .required(requiredMessage || DEFAULT_MESSAGES.required)\n .test('date-range', function(value) {\n if (!value) return false;\n \n const selected = dayjs(value);\n const min = dayjs(minDate);\n const max = dayjs(maxDate);\n \n if (selected.isBefore(min)) {\n return this.createError({\n message: `Date must be after ${min.format('MMM DD, YYYY')}`\n });\n }\n \n if (selected.isAfter(max)) {\n return this.createError({\n message: `Date must be before ${max.format('MMM DD, YYYY')}`\n });\n }\n \n return true;\n });\n};\n\n/**\n * Utility function to create custom validation messages\n */\nexport const createCustomMessages = (overrides: Partial<typeof DEFAULT_MESSAGES>) => ({\n ...DEFAULT_MESSAGES,\n ...overrides\n});\n\n/**\n * Helper function for conditional date validation\n * Example: Date required only if another field has a specific value\n */\nexport const conditionalDateValidation = (\n condition: (formValues: any) => boolean,\n validationSchema: any,\n) => {\n return Yup.mixed().when('$root', {\n is: condition,\n then: validationSchema,\n otherwise: Yup.mixed().notRequired()\n });\n};\n\n// Export commonly used validation presets\nexport const COMMON_DATE_VALIDATIONS = {\n // Rental/Order dates\n rental: (msg?: string) => dateValidation(msg || 'Rental date is required'),\n\n};\n\n/**\n * Usage Examples:\n * \n * // Basic usage with custom required message\n * date: dateValidation('Please select a valid date')\n * \n * // Full customization\n * date: createDateValidation({\n * allowPast: false,\n * allowToday: true,\n * allowFuture: true,\n * requiredMessage: 'Date is required',\n * pastDateMessage: 'Cannot select past dates'\n * })\n * \n * // Preset validations\n * rentalDate: COMMON_DATE_VALIDATIONS.rental('Rental date is required')\n * bookingDate: COMMON_DATE_VALIDATIONS.booking()\n * \n * // Date range\n * eventDate: dateRangeValidation(\n * dayjs().add(1, 'day'),\n * dayjs().add(1, 'year'),\n * 'Event date is required'\n * )\n */","\n\nimport { generateRouteWithId } from \"./route-utils\";\n\n\nexport const migrateToPathWithId = (redirectionLink: string, idField: string = 'id') => {\n return {\n redirectionPathWithId: `${redirectionLink}/:id`,\n idField\n };\n};\n\n\nexport const migrateRoutesToUseParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n Object.keys(updatedRoutes).forEach(key => {\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\nexport const createParameterizedNavigationHandler = (\n navigate: (path: string) => void,\n basePath: string,\n idExtractor: (row: any) => string | number = (row) => row.id\n) => {\n return (row: any) => {\n const id = idExtractor(row);\n navigate(generateRouteWithId(basePath, id));\n };\n};\n\n\nexport const updateTableConfigForParameterizedNavigation = (\n tableConfig: any,\n pathWithIdField: string,\n idField: string = 'id'\n) => {\n const { ...rest } = tableConfig;\n \n return {\n ...rest,\n redirectionPathWithId: pathWithIdField,\n idField\n };\n}; "],"names":["DEFAULT_MESSAGES","required","invalidDate","pastDate","futureDate","todayNotAllowed","pastTime","transformDate","value","originalValue","dayjs","isDayjs","toDate","Date","createDateValidation","options","allowPast","allowToday","allowFuture","requiredMessage","pastDateMessage","futureDateMessage","todayNotAllowedMessage","invalidDateMessage","checkTime","pastTimeMessage","Yup","mixed","transform","typeError","test","now","selectedDateTime","today","startOf","selectedDate","isBefore","this","createError","message","isSame","isAfter","dateValidation","COMMON_DATE_VALIDATIONS","rental","msg","dayOfWeek","day","condition","validationSchema","when","is","then","otherwise","notRequired","overrides","navigate","basePath","idExtractor","row","id","generateRouteWithId","minDate","maxDate","selected","min","max","format","code","Intl","DisplayNames","type","of","routes","updatedRoutes","Object","keys","forEach","key","startsWith","includes","redirectionLink","idField","redirectionPathWithId","tableConfig","pathWithIdField","rest"],"mappings":"seAAO,MCmBDA,EAAmB,CACvBC,SAAU,mBACVC,YAAa,4BACbC,SAAU,6BACVC,WAAY,+BACZC,gBAAiB,8BACjBC,SAAU,+CAONC,EAAgB,CAACC,EAAYC,IAC7BC,EAAAA,QAAMC,QAAQF,GACTA,EAAcG,SAEnBH,aAAyBI,KACpBJ,EAEoB,iBAAlBA,GAA8BA,EAChCC,EAAAA,QAAMD,GAAeG,SAEvB,KAQIE,EAAuB,CAACC,EAAiC,MACpE,MAAMC,UACJA,GAAY,EAAAC,WACZA,GAAa,EAAAC,YACbA,GAAc,EAAAC,gBACdA,EAAkBnB,EAAiBC,SAAAmB,gBACnCA,EAAkBpB,EAAiBG,SAAAkB,kBACnCA,EAAoBrB,EAAiBI,WAAAkB,uBACrCA,EAAyBtB,EAAiBK,gBAAAkB,mBAC1CA,EAAqBvB,EAAiBE,YAAAsB,UACtCA,GAAY,EAAAC,gBACZA,EAAkBzB,EAAiBM,UACjCS,EAEJ,OAAOW,EAAIC,QACRC,UAAUrB,GACVsB,UAAUN,GACVtB,SAASkB,GACTW,KAAK,kBAAmB,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 +0,0 @@
1
- {"version":3,"file":"migration-utils-DgL-o5H7.esm.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/migration-utils.ts"],"sourcesContent":["export const getCountry = (code: string) => {\n const regionNames = new Intl.DisplayNames([\"en\"], { type: \"region\" });\n return regionNames.of(code);\n};\n","//eslint-disable @typescript-eslint/no-explicit-any\nimport * as Yup from 'yup';\nimport dayjs from 'dayjs';\n\n// Types for configuration\nexport interface DateValidationOptions {\n allowPast?: boolean;\n allowToday?: boolean;\n allowFuture?: boolean;\n requiredMessage?: string;\n pastDateMessage?: string;\n futureDateMessage?: string;\n todayNotAllowedMessage?: string;\n invalidDateMessage?: string;\n checkTime?: boolean;\n pastTimeMessage?: string;\n}\n\n// Default messages\nconst DEFAULT_MESSAGES = {\n required: 'Date is required',\n invalidDate: 'Date must be a valid date',\n pastDate: 'Date cannot be in the past',\n futureDate: 'Future dates are not allowed',\n todayNotAllowed: \"Today's date is not allowed\",\n pastTime: 'Time cannot be in the past for today\\'s date'\n};\n\n/**\n * Core date transformation function\n * Handles dayjs objects, Date objects, and string dates\n */\nconst transformDate = (value: any, originalValue: any) => {\n if (dayjs.isDayjs(originalValue)) {\n return originalValue.toDate();\n }\n if (originalValue instanceof Date) {\n return originalValue;\n }\n if (typeof originalValue === 'string' && originalValue) {\n return dayjs(originalValue).toDate();\n }\n return null;\n};\n\n/**\n * Global date validation function with full customization\n * @param options Configuration options for date validation\n * @returns Yup validation schema\n */\nexport const createDateValidation = (options: DateValidationOptions = {}) => {\n const {\n allowPast = false,\n allowToday = true,\n allowFuture = true,\n requiredMessage = DEFAULT_MESSAGES.required,\n pastDateMessage = DEFAULT_MESSAGES.pastDate,\n futureDateMessage = DEFAULT_MESSAGES.futureDate,\n todayNotAllowedMessage = DEFAULT_MESSAGES.todayNotAllowed,\n invalidDateMessage = DEFAULT_MESSAGES.invalidDate,\n checkTime = false,\n pastTimeMessage = DEFAULT_MESSAGES.pastTime\n } = options;\n\n return Yup.mixed()\n .transform(transformDate)\n .typeError(invalidDateMessage)\n .required(requiredMessage)\n .test('date-validation', function(value) {\n if (!value) return false;\n \n const now = dayjs();\n const selectedDateTime = dayjs(value);\n const today = dayjs().startOf('day');\n const selectedDate = dayjs(value).startOf('day');\n \n // Past date validation\n if (selectedDate.isBefore(today) && !allowPast) {\n return this.createError({ message: pastDateMessage });\n }\n \n // Today validation\n if (selectedDate.isSame(today)) {\n if (!allowToday) {\n return this.createError({ message: todayNotAllowedMessage });\n }\n \n // Time validation for today\n if (checkTime && selectedDateTime.isBefore(now)) {\n return this.createError({ message: pastTimeMessage });\n }\n }\n \n // Future date validation\n if (selectedDate.isAfter(today) && !allowFuture) {\n return this.createError({ message: futureDateMessage });\n }\n \n return true;\n });\n};\n\n/**\n * Quick preset validation functions for common use cases\n */\n\n// 1. Standard date validation (today + future allowed)\nexport const dateValidation = (requiredMessage?: string, options: DateValidationOptions = {}) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n ...options,\n requiredMessage\n });\n\n// 2. Future dates only (excluding today)\nexport const futureDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: false,\n allowFuture: true,\n requiredMessage,\n pastDateMessage: 'Please select a future date'\n });\n\n// 3. Any date allowed (for historical records)\nexport const anyDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n });\n\n// 4. Past dates only (for completed events)\nexport const pastDateValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: true,\n allowToday: true,\n allowFuture: false,\n requiredMessage,\n futureDateMessage: 'Future dates are not allowed'\n });\n\n// 5. Date with time validation\nexport const dateTimeValidation = (requiredMessage?: string) => \n createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n checkTime: true,\n requiredMessage\n });\n\n// 6. Business days only (Monday to Friday, future dates)\nexport const businessDateValidation = (requiredMessage?: string) => {\n return createDateValidation({\n allowPast: false,\n allowToday: true,\n allowFuture: true,\n requiredMessage\n }).test('business-day', 'Please select a business day (Monday to Friday)', function(value) {\n if (!value) return false;\n \n const dayOfWeek = dayjs(value).day();\n return dayOfWeek >= 1 && dayOfWeek <= 5; // Monday = 1, Friday = 5\n });\n};\n\n// 7. Date range validation (between two dates)\nexport const dateRangeValidation = (\n minDate: dayjs.Dayjs | Date | string,\n maxDate: dayjs.Dayjs | Date | string,\n requiredMessage?: string\n) => {\n return Yup.mixed()\n .transform(transformDate)\n .typeError(DEFAULT_MESSAGES.invalidDate)\n .required(requiredMessage || DEFAULT_MESSAGES.required)\n .test('date-range', function(value) {\n if (!value) return false;\n \n const selected = dayjs(value);\n const min = dayjs(minDate);\n const max = dayjs(maxDate);\n \n if (selected.isBefore(min)) {\n return this.createError({\n message: `Date must be after ${min.format('MMM DD, YYYY')}`\n });\n }\n \n if (selected.isAfter(max)) {\n return this.createError({\n message: `Date must be before ${max.format('MMM DD, YYYY')}`\n });\n }\n \n return true;\n });\n};\n\n/**\n * Utility function to create custom validation messages\n */\nexport const createCustomMessages = (overrides: Partial<typeof DEFAULT_MESSAGES>) => ({\n ...DEFAULT_MESSAGES,\n ...overrides\n});\n\n/**\n * Helper function for conditional date validation\n * Example: Date required only if another field has a specific value\n */\nexport const conditionalDateValidation = (\n condition: (formValues: any) => boolean,\n validationSchema: any,\n) => {\n return Yup.mixed().when('$root', {\n is: condition,\n then: validationSchema,\n otherwise: Yup.mixed().notRequired()\n });\n};\n\n// Export commonly used validation presets\nexport const COMMON_DATE_VALIDATIONS = {\n // Rental/Order dates\n rental: (msg?: string) => dateValidation(msg || 'Rental date is required'),\n\n};\n\n/**\n * Usage Examples:\n * \n * // Basic usage with custom required message\n * date: dateValidation('Please select a valid date')\n * \n * // Full customization\n * date: createDateValidation({\n * allowPast: false,\n * allowToday: true,\n * allowFuture: true,\n * requiredMessage: 'Date is required',\n * pastDateMessage: 'Cannot select past dates'\n * })\n * \n * // Preset validations\n * rentalDate: COMMON_DATE_VALIDATIONS.rental('Rental date is required')\n * bookingDate: COMMON_DATE_VALIDATIONS.booking()\n * \n * // Date range\n * eventDate: dateRangeValidation(\n * dayjs().add(1, 'day'),\n * dayjs().add(1, 'year'),\n * 'Event date is required'\n * )\n */","\n\nimport { generateRouteWithId } from \"./route-utils\";\n\n\nexport const migrateToPathWithId = (redirectionLink: string, idField: string = 'id') => {\n return {\n redirectionPathWithId: `${redirectionLink}/:id`,\n idField\n };\n};\n\n\nexport const migrateRoutesToUseParams = (routes: Record<string, string>): Record<string, string> => {\n const updatedRoutes: Record<string, string> = { ...routes };\n \n Object.keys(updatedRoutes).forEach(key => {\n if (\n key.startsWith('VIEW_') || \n key.startsWith('EDIT_') || \n key.startsWith('DETAIL_') ||\n key.includes('_VIEW_') || \n key.includes('_EDIT_') || \n key.includes('_DETAIL_')\n ) {\n if (!updatedRoutes[key].includes(':')) {\n updatedRoutes[key] = `${updatedRoutes[key]}/:id`;\n }\n }\n });\n \n return updatedRoutes;\n};\n\nexport const createParameterizedNavigationHandler = (\n navigate: (path: string) => void,\n basePath: string,\n idExtractor: (row: any) => string | number = (row) => row.id\n) => {\n return (row: any) => {\n const id = idExtractor(row);\n navigate(generateRouteWithId(basePath, id));\n };\n};\n\n\nexport const updateTableConfigForParameterizedNavigation = (\n tableConfig: any,\n pathWithIdField: string,\n idField: string = 'id'\n) => {\n const { ...rest } = tableConfig;\n \n return {\n ...rest,\n redirectionPathWithId: pathWithIdField,\n idField\n };\n}; "],"names":[],"mappings":";;;AAAO,MAAM,aAAa,CAAC,SAAiB;AAC1C,QAAM,cAAc,IAAI,KAAK,aAAa,CAAC,IAAI,GAAG,EAAE,MAAM,UAAU;AACpE,SAAO,YAAY,GAAG,IAAI;AAC5B;ACgBA,MAAM,mBAAmB;AAAA,EACvB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,UAAU;AACZ;AAMA,MAAM,gBAAgB,CAAC,OAAY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