@erpsquad/common 1.8.146 → 1.8.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/index.esm.js +12271 -10
- package/dist/constants/index.esm.js.map +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/hooks/index.esm.js +38 -32
- package/dist/hooks/index.esm.js.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.esm.js +1 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{migration-utils--ZDLIXHX.esm.js → migration-utils-hV41wEaX.esm.js} +3 -3
- package/dist/migration-utils-hV41wEaX.esm.js.map +1 -0
- package/dist/migration-utils-t8N4H56x.js +6 -0
- package/dist/migration-utils-t8N4H56x.js.map +1 -0
- package/dist/utils/index.esm.js +1 -2
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/migration-utils--ZDLIXHX.esm.js.map +0 -1
- package/dist/migration-utils-e8WoiOOR.js +0 -6
- package/dist/migration-utils-e8WoiOOR.js.map +0 -1
- package/dist/resource-lang-DGLkQTMh.js +0 -2
- package/dist/resource-lang-DGLkQTMh.js.map +0 -1
- package/dist/resource-lang-aiXJhRQt.esm.js +0 -12269
- package/dist/resource-lang-aiXJhRQt.esm.js.map +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-utils--ZDLIXHX.esm.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/fileSize.ts","../src/utils/i18n.ts","../src/utils/menu-filter.ts","../src/utils/metaComponent.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 */","const fileSize = (size: number) => {\n let sizeCategory;\n const absSize = Math.abs(size);\n\n switch (true) {\n case absSize < 1024:\n sizeCategory = `${(size / 1024).toFixed(2)} Byte`;\n break;\n case absSize >= 1024 && absSize < 1024 * 1024:\n sizeCategory = `${(size / 1024).toFixed(2)} KB`;\n break;\n case absSize >= 1024 * 1024 && absSize < 1024 * 1024 * 1024:\n sizeCategory = `${(size / (1024 * 1024)).toFixed(2)} MB`;\n break;\n default:\n sizeCategory = `${(size / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n }\n\n return sizeCategory;\n};\n\nexport { fileSize };\nexport default fileSize;\n","import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport i18nBackend from \"i18next-http-backend\";\n\nimport { resource } from \"../constants/resource-lang\";\nimport { DEFAULT_LANG } from \"../constants/all-language\";\n\ni18n\n .use(i18nBackend)\n .use(initReactI18next)\n .init({\n fallbackLng: \"en\", \n lng: DEFAULT_LANG,\n \n // fallbackLng: {\n // 'ar': ['en'], \n // 'es': ['en'], \n // 'default': ['en']\n // },\n \n fallbackNS: false, // Don't fallback to other namespaces\n \n \n returnNull: false,\n returnEmptyString: false,\n\n interpolation: {\n escapeValue: false,\n },\n debug: false, // Make sure this is false\n saveMissing: false,\n missingKeyHandler: false, // Explicitly disable\n missingKeyNoValueFallbackToKey: true,\n\n \n \n resources: resource,\n\n // debug: process.env.NODE_ENV === 'development',\n\n saveMissingTo: 'fallback',\n \n keySeparator: '.',\n nsSeparator: ':',\n });\n\nexport default i18n;","// types.ts - Type definitions for better type safety\nexport interface SubModule {\n sub_module_name: string;\n}\n\nexport interface ModuleAccess {\n module_name: string;\n sub_modules?: SubModule[];\n}\n\nexport interface UserData {\n module_access?: ModuleAccess[];\n}\n\nexport interface MenuItem {\n bacSubModuleName?: string;\n submenu?: MenuItem[];\n [key: string]: any;\n}\n\nexport interface Permission {\n [key: string]: any;\n}\n\n// storageUtils.ts - Centralized storage access\nexport class StorageUtils {\n /**\n * Retrieves and parses user data from localStorage\n * @returns Parsed user data or null if not found\n */\n static getUserData(): UserData | null {\n try {\n const userData = localStorage.getItem(\"_u_data\");\n return userData ? JSON.parse(userData) : null;\n } catch (error) {\n console.error(\"Error parsing user data:\", error);\n return null;\n }\n }\n\n /**\n * Retrieves and parses role permissions from localStorage\n * @returns Parsed permissions object\n */\n static getRolePermissions(): Permission {\n try {\n const permissions = localStorage.getItem(\"role-permission\");\n return permissions ? JSON.parse(permissions) : {};\n } catch (error) {\n console.error(\"Error parsing role permissions:\", error);\n return {};\n }\n }\n}\n\n// moduleAccessService.ts - Business logic for module access\nexport class ModuleAccessService {\n /**\n * Filters modules by allowed module names and adds dashboard sub-module\n * @param moduleNames - Array of allowed module names\n * @param userData - User data containing module access\n * @returns Filtered modules with dashboard added\n */\n static getAccessibleSubModules(\n moduleNames: string[],\n userData: UserData | null\n ): ModuleAccess[] {\n if (!userData?.module_access) {\n return [];\n }\n\n return userData.module_access\n .filter((module) => moduleNames.includes(module.module_name))\n .map((module) => ({\n ...module,\n sub_modules: [\n ...(module.sub_modules || []),\n { sub_module_name: \"dashboard\" }\n ]\n }));\n }\n\n /**\n * Extracts unique sub-module names from modules\n * @param modules - Array of module access objects\n * @returns Set of unique sub-module names\n */\n static extractSubModuleNames(modules: ModuleAccess[]): Set<string> {\n return new Set(\n modules.flatMap((module) => \n (module.sub_modules || []).map((subModule) => subModule.sub_module_name)\n )\n );\n }\n\n /**\n * Matches sub-module names with permission keys\n * @param subModuleNames - Set of sub-module names\n * @param permissions - Permission object\n * @returns Set of matching sub-module names\n */\n static getMatchingSubModules(\n subModuleNames: Set<string>,\n permissions: Permission\n ): Set<string> {\n const permissionKeys = Object.keys(permissions);\n \n const matchingModules = Array.from(subModuleNames).filter((subModuleName) => {\n const lastPart = subModuleName.split(\"/\").pop() || \"\";\n return permissionKeys.some((permKey) => permKey.startsWith(lastPart));\n });\n\n return new Set(matchingModules);\n }\n}\n\n// menuFilterService.ts - Menu filtering logic\nexport class MenuFilterService {\n /**\n * Recursively filters menu items based on accessible sub-modules\n * @param menu - Array of menu items\n * @param accessibleSubModules - Set of accessible sub-module names\n * @returns Filtered menu array\n */\n static filterMenuByAccess(\n menu: MenuItem[],\n accessibleSubModules: Set<string>\n ): MenuItem[] {\n return menu.filter((item) => {\n const hasValidSubModule = \n item.bacSubModuleName && accessibleSubModules.has(item.bacSubModuleName);\n\n let hasValidSubmenu = false;\n \n if (item.submenu && item.submenu.length > 0) {\n item.submenu = this.filterMenuByAccess(item.submenu, accessibleSubModules);\n hasValidSubmenu = item.submenu.length > 0;\n }\n\n return hasValidSubModule || hasValidSubmenu;\n });\n }\n}\n\n// menuFilter.ts - Main filter orchestrator\nexport class MenuFilter {\n /**\n * Filters menu based on user permissions and module access\n * @param menu - Menu items to filter\n * @param allowedModules - Array of allowed module names\n * @returns Filtered menu items\n */\n static filterByModuleAccess(\n menu: MenuItem[],\n allowedModules: string[]\n ): MenuItem[] {\n // Retrieve user data and permissions\n const userData = StorageUtils.getUserData();\n const permissions = StorageUtils.getRolePermissions();\n\n // Get accessible sub-modules\n const accessibleModules = ModuleAccessService.getAccessibleSubModules(\n allowedModules,\n userData\n );\n\n // Extract sub-module names\n const subModuleNames = ModuleAccessService.extractSubModuleNames(\n accessibleModules\n );\n\n // Match with permissions\n const matchingSubModules = ModuleAccessService.getMatchingSubModules(\n subModuleNames,\n permissions\n );\n\n // Filter menu\n return MenuFilterService.filterMenuByAccess(menu, matchingSubModules);\n }\n}\n\n// Usage example in your module\n// manufacturing.ts\n// import { MenuFilter } from './menuFilter';\n// import { MenuItem } from './types';\n\n// export const getFilteredManufacturingMenu = (\n// menuData: MenuItem[]\n// ): MenuItem[] => {\n// const allowedModules = [\"manufacturing\", \"inventory\", \"sales\"];\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };\n\n// // sales.ts\n// export const getFilteredSalesMenu = (\n// menuData: MenuItem[]\n// ): MenuItem[] => {\n// const allowedModules = [\"sales\", \"inventory\"];\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };\n\n// // Generic usage with dynamic modules\n// export const getFilteredMenu = (\n// menuData: MenuItem[],\n// allowedModules: string[]\n// ): MenuItem[] => {\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };","import { Helmet } from \"react-helmet\";\nimport propTypes from \"prop-types\";\n\nconst MetaComponent = (props: any) => {\n const canonicalURL = props.location\n ? `${props.location.protocol}//${props.location.host}${window.location.pathname}`\n : \"\";\n\n return (\n <Helmet>\n <title>{props.title}</title>\n <meta name=\"description\" content={props.description} />\n <meta name=\"keywords\" content={props.keywords} />\n {props.location && <link rel=\"canonical\" href={`${canonicalURL}`} />}\n\n {/* {props.schema && <JsonLd data={props.schema} />} */}\n </Helmet>\n );\n};\n\nconst JsonLd = ({ data }: any) => {\n return data.map((schema: any, index: number) => {\n return (\n <script\n key={index}\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}\n />\n );\n });\n};\n\nMetaComponent.propTypes = {\n title: propTypes.string,\n keywords: propTypes.string,\n description: propTypes.string,\n image: propTypes.string,\n schema: propTypes.arrayOf(propTypes.object),\n location: propTypes.object,\n};\n\nJsonLd.propTypes = {\n data: propTypes.arrayOf(propTypes.object),\n};\n\nexport { MetaComponent };\nexport default MetaComponent;\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":["propTypes"],"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,UA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O;AAAA,IACL,GAAG;AAAA,IACH,uBAAuB;AAAA,IACvB;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("yup"),t=require("dayjs"),a=require("i18next"),r=require("react-i18next"),s=require("i18next-http-backend"),o=require("./resource-lang-DGLkQTMh.js"),i=require("./all-language-XhvdjcQg.js"),l=require("react/jsx-runtime"),n=require("react-helmet"),u=require("./DefaultPropsProvider-DXLRpppW.js"),d=require("./route-utils-ifjI7_7l.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function p(e){if(e&&"object"==typeof e&&"default"in e)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,t}var f=/* @__PURE__ */p(e),m=/* @__PURE__ */c(t),g=/* @__PURE__ */c(a),y=/* @__PURE__ */c(s);const b={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"},M=(e,t)=>m.default.isDayjs(t)?t.toDate():t instanceof Date?t:"string"==typeof t&&t?m.default(t).toDate():null,h=(e={})=>{const{allowPast:t=!1,allowToday:a=!0,allowFuture:r=!0,requiredMessage:s=b.required,pastDateMessage:o=b.pastDate,futureDateMessage:i=b.futureDate,todayNotAllowedMessage:l=b.todayNotAllowed,invalidDateMessage:n=b.invalidDate,checkTime:u=!1,pastTimeMessage:d=b.pastTime}=e;return f.mixed().transform(M).typeError(n).required(s).test("date-validation",function(e){if(!e)return!1;const s=m.default(),n=m.default(e),c=m.default().startOf("day"),p=m.default(e).startOf("day");if(p.isBefore(c)&&!t)return this.createError({message:o});if(p.isSame(c)){if(!a)return this.createError({message:l});if(u&&n.isBefore(s))return this.createError({message:d})}return!(p.isAfter(c)&&!r)||this.createError({message:i})})},D=(e,t={})=>h({allowPast:!1,allowToday:!0,allowFuture:!0,...t,requiredMessage:e}),x={rental:e=>D(e||"Rental date is required")};g.default.use(y.default).use(r.initReactI18next).init({fallbackLng:"en",lng:i.DEFAULT_LANG,fallbackNS:!1,returnNull:!1,returnEmptyString:!1,interpolation:{escapeValue:!1},debug:!1,saveMissing:!1,missingKeyHandler:!1,missingKeyNoValueFallbackToKey:!0,resources:o.resource,saveMissingTo:"fallback",keySeparator:".",nsSeparator:":"});class w{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 T{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 P{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})}}const q=e=>{const t=e.location?`${e.location.protocol}//${e.location.host}${window.location.pathname}`:"";/* @__PURE__ */
|
|
2
|
-
return l.jsxs(n.Helmet,{children:[
|
|
3
|
-
/* @__PURE__ */l.jsx("title",{children:e.title}),
|
|
4
|
-
/* @__PURE__ */l.jsx("meta",{name:"description",content:e.description}),
|
|
5
|
-
/* @__PURE__ */l.jsx("meta",{name:"keywords",content:e.keywords}),e.location&&/* @__PURE__ */l.jsx("link",{rel:"canonical",href:`${t}`})]})};q.propTypes={title:u.PropTypes.string,keywords:u.PropTypes.string,description:u.PropTypes.string,image:u.PropTypes.string,schema:u.PropTypes.arrayOf(u.PropTypes.object),location:u.PropTypes.object},u.PropTypes.arrayOf(u.PropTypes.object),exports.COMMON_DATE_VALIDATIONS=x,exports.MenuFilter=class{static filterByModuleAccess(e,t){const a=w.getUserData(),r=w.getRolePermissions(),s=T.getAccessibleSubModules(t,a),o=T.extractSubModuleNames(s),i=T.getMatchingSubModules(o,r);return P.filterMenuByAccess(e,i)}},exports.MenuFilterService=P,exports.MetaComponent=q,exports.ModuleAccessService=T,exports.StorageUtils=w,exports.anyDateValidation=e=>h({allowPast:!0,allowToday:!0,allowFuture:!0,requiredMessage:e}),exports.businessDateValidation=e=>h({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=m.default(e).day();return t>=1&&t<=5}),exports.conditionalDateValidation=(e,t)=>f.mixed().when("$root",{is:e,then:t,otherwise:f.mixed().notRequired()}),exports.createCustomMessages=e=>({...b,...e}),exports.createDateValidation=h,exports.createParameterizedNavigationHandler=(e,t,a=e=>e.id)=>r=>{const s=a(r);e(d.generateRouteWithId(t,s))},exports.dateRangeValidation=(e,t,a)=>f.mixed().transform(M).typeError(b.invalidDate).required(a||b.required).test("date-range",function(a){if(!a)return!1;const r=m.default(a),s=m.default(e),o=m.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=>h({allowPast:!1,allowToday:!0,allowFuture:!0,checkTime:!0,requiredMessage:e}),exports.dateValidation=D,exports.fileSize=e=>{let t;const a=Math.abs(e);switch(!0){case a<1024:t=`${(e/1024).toFixed(2)} Byte`;break;case a>=1024&&a<1048576:t=`${(e/1024).toFixed(2)} KB`;break;case a>=1048576&&a<1073741824:t=`${(e/1048576).toFixed(2)} MB`;break;default:t=`${(e/1073741824).toFixed(2)} GB`}return t},exports.futureDateValidation=e=>h({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=>h({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}};
|
|
6
|
-
//# sourceMappingURL=migration-utils-e8WoiOOR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration-utils-e8WoiOOR.js","sources":["../src/utils/country.ts","../src/utils/dateValidation.tsx","../src/utils/i18n.ts","../src/utils/menu-filter.ts","../src/utils/metaComponent.tsx","../src/utils/migration-utils.ts","../src/utils/fileSize.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 */","import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport i18nBackend from \"i18next-http-backend\";\n\nimport { resource } from \"../constants/resource-lang\";\nimport { DEFAULT_LANG } from \"../constants/all-language\";\n\ni18n\n .use(i18nBackend)\n .use(initReactI18next)\n .init({\n fallbackLng: \"en\", \n lng: DEFAULT_LANG,\n \n // fallbackLng: {\n // 'ar': ['en'], \n // 'es': ['en'], \n // 'default': ['en']\n // },\n \n fallbackNS: false, // Don't fallback to other namespaces\n \n \n returnNull: false,\n returnEmptyString: false,\n\n interpolation: {\n escapeValue: false,\n },\n debug: false, // Make sure this is false\n saveMissing: false,\n missingKeyHandler: false, // Explicitly disable\n missingKeyNoValueFallbackToKey: true,\n\n \n \n resources: resource,\n\n // debug: process.env.NODE_ENV === 'development',\n\n saveMissingTo: 'fallback',\n \n keySeparator: '.',\n nsSeparator: ':',\n });\n\nexport default i18n;","// types.ts - Type definitions for better type safety\nexport interface SubModule {\n sub_module_name: string;\n}\n\nexport interface ModuleAccess {\n module_name: string;\n sub_modules?: SubModule[];\n}\n\nexport interface UserData {\n module_access?: ModuleAccess[];\n}\n\nexport interface MenuItem {\n bacSubModuleName?: string;\n submenu?: MenuItem[];\n [key: string]: any;\n}\n\nexport interface Permission {\n [key: string]: any;\n}\n\n// storageUtils.ts - Centralized storage access\nexport class StorageUtils {\n /**\n * Retrieves and parses user data from localStorage\n * @returns Parsed user data or null if not found\n */\n static getUserData(): UserData | null {\n try {\n const userData = localStorage.getItem(\"_u_data\");\n return userData ? JSON.parse(userData) : null;\n } catch (error) {\n console.error(\"Error parsing user data:\", error);\n return null;\n }\n }\n\n /**\n * Retrieves and parses role permissions from localStorage\n * @returns Parsed permissions object\n */\n static getRolePermissions(): Permission {\n try {\n const permissions = localStorage.getItem(\"role-permission\");\n return permissions ? JSON.parse(permissions) : {};\n } catch (error) {\n console.error(\"Error parsing role permissions:\", error);\n return {};\n }\n }\n}\n\n// moduleAccessService.ts - Business logic for module access\nexport class ModuleAccessService {\n /**\n * Filters modules by allowed module names and adds dashboard sub-module\n * @param moduleNames - Array of allowed module names\n * @param userData - User data containing module access\n * @returns Filtered modules with dashboard added\n */\n static getAccessibleSubModules(\n moduleNames: string[],\n userData: UserData | null\n ): ModuleAccess[] {\n if (!userData?.module_access) {\n return [];\n }\n\n return userData.module_access\n .filter((module) => moduleNames.includes(module.module_name))\n .map((module) => ({\n ...module,\n sub_modules: [\n ...(module.sub_modules || []),\n { sub_module_name: \"dashboard\" }\n ]\n }));\n }\n\n /**\n * Extracts unique sub-module names from modules\n * @param modules - Array of module access objects\n * @returns Set of unique sub-module names\n */\n static extractSubModuleNames(modules: ModuleAccess[]): Set<string> {\n return new Set(\n modules.flatMap((module) => \n (module.sub_modules || []).map((subModule) => subModule.sub_module_name)\n )\n );\n }\n\n /**\n * Matches sub-module names with permission keys\n * @param subModuleNames - Set of sub-module names\n * @param permissions - Permission object\n * @returns Set of matching sub-module names\n */\n static getMatchingSubModules(\n subModuleNames: Set<string>,\n permissions: Permission\n ): Set<string> {\n const permissionKeys = Object.keys(permissions);\n \n const matchingModules = Array.from(subModuleNames).filter((subModuleName) => {\n const lastPart = subModuleName.split(\"/\").pop() || \"\";\n return permissionKeys.some((permKey) => permKey.startsWith(lastPart));\n });\n\n return new Set(matchingModules);\n }\n}\n\n// menuFilterService.ts - Menu filtering logic\nexport class MenuFilterService {\n /**\n * Recursively filters menu items based on accessible sub-modules\n * @param menu - Array of menu items\n * @param accessibleSubModules - Set of accessible sub-module names\n * @returns Filtered menu array\n */\n static filterMenuByAccess(\n menu: MenuItem[],\n accessibleSubModules: Set<string>\n ): MenuItem[] {\n return menu.filter((item) => {\n const hasValidSubModule = \n item.bacSubModuleName && accessibleSubModules.has(item.bacSubModuleName);\n\n let hasValidSubmenu = false;\n \n if (item.submenu && item.submenu.length > 0) {\n item.submenu = this.filterMenuByAccess(item.submenu, accessibleSubModules);\n hasValidSubmenu = item.submenu.length > 0;\n }\n\n return hasValidSubModule || hasValidSubmenu;\n });\n }\n}\n\n// menuFilter.ts - Main filter orchestrator\nexport class MenuFilter {\n /**\n * Filters menu based on user permissions and module access\n * @param menu - Menu items to filter\n * @param allowedModules - Array of allowed module names\n * @returns Filtered menu items\n */\n static filterByModuleAccess(\n menu: MenuItem[],\n allowedModules: string[]\n ): MenuItem[] {\n // Retrieve user data and permissions\n const userData = StorageUtils.getUserData();\n const permissions = StorageUtils.getRolePermissions();\n\n // Get accessible sub-modules\n const accessibleModules = ModuleAccessService.getAccessibleSubModules(\n allowedModules,\n userData\n );\n\n // Extract sub-module names\n const subModuleNames = ModuleAccessService.extractSubModuleNames(\n accessibleModules\n );\n\n // Match with permissions\n const matchingSubModules = ModuleAccessService.getMatchingSubModules(\n subModuleNames,\n permissions\n );\n\n // Filter menu\n return MenuFilterService.filterMenuByAccess(menu, matchingSubModules);\n }\n}\n\n// Usage example in your module\n// manufacturing.ts\n// import { MenuFilter } from './menuFilter';\n// import { MenuItem } from './types';\n\n// export const getFilteredManufacturingMenu = (\n// menuData: MenuItem[]\n// ): MenuItem[] => {\n// const allowedModules = [\"manufacturing\", \"inventory\", \"sales\"];\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };\n\n// // sales.ts\n// export const getFilteredSalesMenu = (\n// menuData: MenuItem[]\n// ): MenuItem[] => {\n// const allowedModules = [\"sales\", \"inventory\"];\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };\n\n// // Generic usage with dynamic modules\n// export const getFilteredMenu = (\n// menuData: MenuItem[],\n// allowedModules: string[]\n// ): MenuItem[] => {\n// return MenuFilter.filterByModuleAccess(menuData, allowedModules);\n// };","import { Helmet } from \"react-helmet\";\nimport propTypes from \"prop-types\";\n\nconst MetaComponent = (props: any) => {\n const canonicalURL = props.location\n ? `${props.location.protocol}//${props.location.host}${window.location.pathname}`\n : \"\";\n\n return (\n <Helmet>\n <title>{props.title}</title>\n <meta name=\"description\" content={props.description} />\n <meta name=\"keywords\" content={props.keywords} />\n {props.location && <link rel=\"canonical\" href={`${canonicalURL}`} />}\n\n {/* {props.schema && <JsonLd data={props.schema} />} */}\n </Helmet>\n );\n};\n\nconst JsonLd = ({ data }: any) => {\n return data.map((schema: any, index: number) => {\n return (\n <script\n key={index}\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}\n />\n );\n });\n};\n\nMetaComponent.propTypes = {\n title: propTypes.string,\n keywords: propTypes.string,\n description: propTypes.string,\n image: propTypes.string,\n schema: propTypes.arrayOf(propTypes.object),\n location: propTypes.object,\n};\n\nJsonLd.propTypes = {\n data: propTypes.arrayOf(propTypes.object),\n};\n\nexport { MetaComponent };\nexport default MetaComponent;\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}; ","const fileSize = (size: number) => {\n let sizeCategory;\n const absSize = Math.abs(size);\n\n switch (true) {\n case absSize < 1024:\n sizeCategory = `${(size / 1024).toFixed(2)} Byte`;\n break;\n case absSize >= 1024 && absSize < 1024 * 1024:\n sizeCategory = `${(size / 1024).toFixed(2)} KB`;\n break;\n case absSize >= 1024 * 1024 && absSize < 1024 * 1024 * 1024:\n sizeCategory = `${(size / (1024 * 1024)).toFixed(2)} MB`;\n break;\n default:\n sizeCategory = `${(size / (1024 * 1024 * 1024)).toFixed(2)} GB`;\n }\n\n return sizeCategory;\n};\n\nexport { fileSize };\nexport default fileSize;\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","i18n","use","i18nBackend","initReactI18next","init","fallbackLng","lng","DEFAULT_LANG","fallbackNS","returnNull","returnEmptyString","interpolation","escapeValue","debug","saveMissing","missingKeyHandler","missingKeyNoValueFallbackToKey","resources","resource","saveMissingTo","keySeparator","nsSeparator","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","MetaComponent","props","canonicalURL","location","protocol","host","window","pathname","Helmet","children","jsx","title","name","content","description","keywords","rel","href","propTypes","string","image","schema","arrayOf","object","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","size","sizeCategory","absSize","Math","abs","toFixed","code","Intl","DisplayNames","type","of","routes","updatedRoutes","forEach","key","redirectionLink","idField","redirectionPathWithId","tableConfig","pathWithIdField","rest"],"mappings":"8zBAAO,MCmBDA,EAAmB,CACvBC,SAAU,mBACVC,YAAa,4BACbC,SAAU,6BACVC,WAAY,+BACZC,gBAAiB,8BACjBC,SAAU,+CAONC,EAAgB,CAACC,EAAYC,IAC7BC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