@erpsquad/common 1.10.8-test → 1.10.9-test
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/chunks/{ai-summary-D9QajB4_.js → ai-summary-4NVNEHfi.js} +2 -2
- package/dist/chunks/{ai-summary-D9QajB4_.js.map → ai-summary-4NVNEHfi.js.map} +1 -1
- package/dist/chunks/{ai-summary-FqAUpafL.esm.js → ai-summary-f8clWLbW.esm.js} +65 -44
- package/dist/chunks/{ai-summary-FqAUpafL.esm.js.map → ai-summary-f8clWLbW.esm.js.map} +1 -1
- package/dist/chunks/{android-12-switch-BVabRCje.esm.js → android-12-switch-BUbQYnRQ.esm.js} +53 -35
- package/dist/chunks/{android-12-switch-BVabRCje.esm.js.map → android-12-switch-BUbQYnRQ.esm.js.map} +1 -1
- package/dist/chunks/android-12-switch-CphTHRb8.js +2 -0
- package/dist/chunks/{android-12-switch-DMaoWQwq.js.map → android-12-switch-CphTHRb8.js.map} +1 -1
- package/dist/chunks/{appbar-6Ucw59ku.js → appbar-C6Es9HGk.js} +2 -2
- package/dist/chunks/{appbar-6Ucw59ku.js.map → appbar-C6Es9HGk.js.map} +1 -1
- package/dist/chunks/{appbar-mDf1LZ0u.esm.js → appbar-CKrHdx9n.esm.js} +2 -2
- package/dist/chunks/{appbar-mDf1LZ0u.esm.js.map → appbar-CKrHdx9n.esm.js.map} +1 -1
- package/dist/chunks/{default-data-CwLgBvlI.esm.js → default-data-BsZWgQGR.esm.js} +3 -3
- package/dist/chunks/{default-data-CwLgBvlI.esm.js.map → default-data-BsZWgQGR.esm.js.map} +1 -1
- package/dist/chunks/{default-data-D2cqOmp4.js → default-data-Dsjlvwev.js} +2 -2
- package/dist/chunks/{default-data-D2cqOmp4.js.map → default-data-Dsjlvwev.js.map} +1 -1
- package/dist/chunks/{fullScreen-VlXxoepU.js → fullScreen-BBpaDn-A.js} +2 -2
- package/dist/chunks/{fullScreen-VlXxoepU.js.map → fullScreen-BBpaDn-A.js.map} +1 -1
- package/dist/chunks/{fullScreen-B9d2_kak.esm.js → fullScreen-Dn-3Tkwm.esm.js} +2 -2
- package/dist/chunks/{fullScreen-B9d2_kak.esm.js.map → fullScreen-Dn-3Tkwm.esm.js.map} +1 -1
- package/dist/chunks/index-B9CFxEZ9.js +2 -0
- package/dist/chunks/index-B9CFxEZ9.js.map +1 -0
- package/dist/chunks/{index-iPYNYnNP.esm.js → index-wf5q5BST.esm.js} +73 -66
- package/dist/chunks/{index-iPYNYnNP.esm.js.map → index-wf5q5BST.esm.js.map} +1 -1
- package/dist/chunks/{migration-utils-TYitNMC7.js → migration-utils-9IXhe_fj.js} +2 -2
- package/dist/chunks/{migration-utils-TYitNMC7.js.map → migration-utils-9IXhe_fj.js.map} +1 -1
- package/dist/chunks/{migration-utils-BRjncD-b.esm.js → migration-utils-DGoEzQUj.esm.js} +2 -2
- package/dist/chunks/{migration-utils-BRjncD-b.esm.js.map → migration-utils-DGoEzQUj.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-DJREtRnK.js → sidebar-B3SExDRU.js} +2 -2
- package/dist/chunks/{sidebar-DJREtRnK.js.map → sidebar-B3SExDRU.js.map} +1 -1
- package/dist/chunks/{sidebar-D_3INLNa.esm.js → sidebar-n9Y25HU-.esm.js} +2 -2
- package/dist/chunks/{sidebar-D_3INLNa.esm.js.map → sidebar-n9Y25HU-.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-CUf5Onkp.js → sidebarScreen-Dxb_e58p.js} +2 -2
- package/dist/chunks/{sidebarScreen-CUf5Onkp.js.map → sidebarScreen-Dxb_e58p.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-CLjYZOzQ.esm.js → sidebarScreen-_Zt2pSOx.esm.js} +3 -3
- package/dist/chunks/{sidebarScreen-CLjYZOzQ.esm.js.map → sidebarScreen-_Zt2pSOx.esm.js.map} +1 -1
- package/dist/components/index.esm.js +121 -103
- package/dist/components/index.js +1 -1
- package/dist/index.esm.js +218 -200
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +1 -1
- package/dist/src/components/index.d.ts +18 -1
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/views/index.esm.js +5 -5
- package/dist/views/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/android-12-switch-DMaoWQwq.js +0 -2
- package/dist/chunks/index-BQ2NBHDS.js +0 -2
- package/dist/chunks/index-BQ2NBHDS.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android-12-switch-DMaoWQwq.js","sources":["../../src/components/accordion/accordion.tsx","../../src/components/view-modal/view-modal.tsx","../../src/components/header-card/header-card.tsx","../../src/components/toggle/toggle.tsx","../../src/components/filter/components/combinator-select.tsx","../../src/components/filter/components/remove-action.tsx","../../src/components/filter/components/field-select.tsx","../../src/components/filter/components/add-filter.tsx","../../src/components/filter/components/add-group.tsx","../../src/components/date-picker/date-picker.tsx","../../src/components/checkbox/checkbox.tsx","../../src/components/form-control/form-builder/form-builder-element/chip-or-placeholder.tsx","../../src/components/radio/radio.tsx","../../src/components/form-control/form-builder/form-builder-element/radio-button.tsx","../../src/components/parties-modal/utils/constant.ts","../../src/hooks/useSetDefaultConfig.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-select.tsx","../../src/components/phone-input/phone-input.tsx","../../src/components/form-control/form-builder/form-builder-element/phone.tsx","../../src/components/date-time-picker/date-time-picker.tsx","../../src/components/upload-media/upload-media.tsx","../../src/components/material-table/components/inline-edit-fields.tsx","../../src/components/material-table/material-table.tsx","../../src/components/loaders/modal-loader.tsx","../../src/components/parties-modal/parties-modal.tsx","../../src/components/parties-modal/validator.tsx","../../src/components/form-control/form-builder/form-builder-element/select.tsx","../../src/components/form-control/form-builder/form-builder-element/button.tsx","../../src/components/form-control/form-builder/form-builder-element/checkbox.tsx","../../src/components/form-control/form-builder/form-builder-element/date.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-currency-input.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-element-hoc.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-input-select.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-tags-input.tsx","../../src/components/info-card/info-card.tsx","../../src/components/form-control/form-builder/form-builder-element/info.tsx","../../src/components/form-control/form-builder/form-builder-element/media.tsx","../../src/components/form-control/form-builder/form-builder-element/section.tsx","../../node_modules/flatted/esm/index.js","../../src/components/form-control/form-builder/form-builder-element/table.tsx","../../src/components/time-picker/time-picker.tsx","../../src/components/form-control/form-builder/form-builder-element/time.tsx","../../src/components/toggle-switch/toggle-switch.tsx","../../src/components/form-control/form-builder/form-builder-element/toggle-button.tsx","../../src/components/tabs/tabs.tsx","../../src/components/alert/alert.tsx","../../src/components/chip-generator/chip-generator.tsx","../../src/components/location-select.tsx","../../src/components/form-control/form-parser/form-switcher.tsx","../../src/components/form-control/form-parser/form-section.tsx","../../src/components/form-control/form-parser/form-parser.tsx","../../src/components/team-add-modal.tsx","../../src/components/department-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/location-add-modal/location-add-modal.tsx","../../src/components/designation-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/fixed-asset-item-add-modal/fixed-asset-item-add-modal.tsx","../../src/components/brand-add-modal.tsx","../../src/components/category-add-modal.tsx","../../src/components/source-type-add-modal/source-type-add-modal.tsx","../../src/components/journal-type-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/select-configuration.tsx","../../src/components/industry-add-modal.tsx","../../src/components/searchable-select.tsx","../../src/components/filter/components/value-editor.tsx","../../src/components/filter/components/operator-select.tsx","../../src/components/filter/components/delete-group.tsx","../../src/components/save-filter-modal/save-filter-modal.tsx","../../src/components/filter/filter.tsx","../../src/components/dropdown-button/dropdown-button.tsx","../../src/components/title-dropdown-button/title-dropdown-button.tsx","../../src/components/upload-excel/upload-excel.tsx","../../src/components/action-bar/action-bar.tsx","../../src/components/bread-crumb/bread-crumb.tsx","../../src/components/pagination/pagination.tsx","../../src/components/page-navigator/components/add-page-modal.tsx","../../src/components/page-navigator/components/shared-page-view.tsx","../../src/components/page-navigator/components/shared-page-modal.tsx","../../src/components/page-navigator/components/add-page.tsx","../../src/components/share-modal/share-modal.tsx","../../src/views/beforeAuth/components/share-modal-data/share-modal-data.ts","../../src/components/page-navigator/components/page-action.tsx","../../src/components/page-navigator/page-navigator.tsx","../../src/components/footer/footer.tsx","../../src/components/switches/android-12-switch.tsx","../../src/components/color-picker-input/color-picker-input.tsx","../../src/components/fallback/fallback.tsx","../../src/components/form-header/form-header.tsx","../../src/components/loader.tsx","../../src/components/module-button/module-button.tsx"],"sourcesContent":["import {\r\n AccordionDetails,\r\n Accordion as MUIAccordion,\r\n AccordionSummary,\r\n styled,\r\n AccordionProps as MUIAccordionProps,\r\n} from \"@mui/material\";\r\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\r\nimport { memo } from \"react\";\r\n\r\ninterface AccordionProps {\r\n title: string | JSX.Element;\r\n children?: React.ReactNode;\r\n accordionProps?: Partial<MUIAccordionProps>\r\n}\r\nconst Accordion = memo((props: AccordionProps) => {\r\n const { title, children, accordionProps: accordianProps } = props;\r\n\r\n return (\r\n <StyledAccordion {...accordianProps} >\r\n <AccordionSummary\r\n expandIcon={<ExpandMoreIcon />}\r\n aria-controls=\"panel1-content\"\r\n id=\"panel1-header\"\r\n >\r\n {title}\r\n </AccordionSummary>\r\n <AccordionDetails>{children}</AccordionDetails>\r\n </StyledAccordion>\r\n );\r\n});\r\n\r\n\r\nconst StyledAccordion = styled(MUIAccordion)(({ theme: { palette } }) => ({\r\n color: palette.theme?.secondary[1000],\r\n fontSize: \" 0.875rem\",\r\n boxShadow: \"none\",\r\n \".MuiAccordionSummary-root\": {\r\n padding: \"0.625rem 1.5rem\",\r\n minHeight: \"0px !important\",\r\n borderBottomWidth: \"2px\",\r\n borderBottomStyle: \"solid\",\r\n borderBottomColor: palette.theme?.secondary[200],\r\n },\r\n \".MuiAccordionSummary-content\": {\r\n margin: \"0\",\r\n \"&.Mui-expanded\": {\r\n margin: \"0rem\",\r\n },\r\n \"&.MuiButtonBase-root\": {\r\n margin: \"0\",\r\n \"&.MuiAccordionSummary-content.Mui-expanded\": {\r\n margin: \"0\",\r\n },\r\n },\r\n },\r\n \".MuiAccordionDetails-root\": {\r\n padding: \"0\",\r\n },\r\n}));\r\n\r\nexport { Accordion };\r\nexport default Accordion;\r\n","import Button from \"../button/button\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport \"./view-modal.scss\";\nimport { useState } from \"react\";\nimport Modal from \"../modal/modal\";\nimport {\n DialogActions,\n DialogTitle,\n IconButton,\n MenuItem,\n Tab,\n Tabs,\n useMediaQuery,\n useTheme,\n} from \"@mui/material\";\nimport Typography from \"../typography/typography\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport logo from \"../../assets/images\";\nimport Select from \"../select/select\";\nimport viewTypes from \"../../constants/action-bar\";\n\ninterface ActionData {\n label: string;\n position: number;\n}\ninterface ModalPropsType {\n setData: React.Dispatch<React.SetStateAction<ActionData[]>>;\n data: Array<object>;\n setActive: React.Dispatch<React.SetStateAction<string>>;\n disabledViews?: string[]\n}\n\nconst ViewModal = (props: ModalPropsType) => {\n const { data, setData, setActive, disabledViews = [] } = props;\n const [openModal, setOpenModal] = useState(false);\n const [value, setValue] = useState(\"Table\");\n const [disable, setDisable] = useState(false);\n const theme = useTheme();\n const isMdUp = useMediaQuery(theme.breakpoints.up('lg'));\n const handleTabChange = (_: React.SyntheticEvent, newValue: string) => {\n setValue(newValue);\n setDisable(\n Boolean(\n data.find(\n (item: any) => item.label.toLowerCase() === newValue.toLowerCase(),\n ),\n ),\n );\n };\n\n const TabData = [\n {\n label: \"Table\",\n icon: <logo.TableIcon />,\n desc: \"Easily manage, update, and organize your tasks with Table view.\",\n image: <img src={logo.table} />,\n },\n {\n label: \"Grid\",\n icon: <logo.GridIcon />,\n desc: \"Grid of cards, use for mood boards, index cards, and recipes\",\n image: <img src={logo.grid} />,\n },\n // {\n // label: \"Kanban\",\n // icon: <logo.KanbanIcon />,\n // desc: \"Build your perfect Board and easily drag-and-drop tasks between columns.\",\n // image: <img src={logo.kanban} />,\n // },\n // {\n // label: \"Calendar\",\n // icon: <logo.CalenderIcon />,\n // desc: \"Calendar view is your place for planning, scheduling, and resource management.\",\n // image: <img src={logo.calendar} />,\n // },\n // {\n // label: \"Gantt\",\n // icon: <logo.GanttIcon />,\n // desc: \"Plan time, manage resources, visualize dependencies and more with Gantt view.\",\n // image: <img src={logo.gantt} />,\n // },\n ];\n\n const handleSubmit = () => {\n const selectedTabData = TabData.find(\n (data) => data.label.toLowerCase() === value.toLowerCase(),\n );\n if (selectedTabData?.label) {\n if (\n !data.some(\n (item: any) => item.label.toLowerCase() === value.toLowerCase(),\n )\n ) {\n setData([\n ...(data as ActionData[]),\n { label: selectedTabData.label, position: data.length },\n ]);\n\n setActive(selectedTabData?.label);\n setOpenModal(false);\n }\n }\n };\n\n return (\n <div className=\"view-modal\">\n <div className=\"view-modal--Header\">\n |\n <Button\n variant=\"text\"\n startIcon={<AddIcon />}\n sx={isMdUp ? {} : { pr:0 }}\n onClick={() => {\n setOpenModal(true);\n setDisable(\n Boolean(\n data.find(\n (item: any) =>\n item.label.toLowerCase() === value.toLowerCase(),\n ),\n ),\n );\n }}\n >\n {isMdUp ? 'View' : ''}\n </Button>\n </div>\n <Modal\n open={openModal}\n onClose={() => setOpenModal(false)}\n className=\"view-modal\"\n >\n <DialogTitle className=\"view-modal--Head\">\n <Typography type=\"s3\" weight=\"medium\" color=\"#000\">\n Add View\n </Typography>\n <IconButton onClick={() => setOpenModal(false)}>\n <CloseIcon fontSize=\"small\"/>\n </IconButton>\n </DialogTitle>\n\n <div className=\"view-modal--TabsContent\">\n <Tabs\n orientation=\"vertical\"\n value={value}\n onChange={handleTabChange}\n className=\"view-modal--Tab\"\n >\n {TabData &&\n TabData?.map((data) => (\n <Tab\n key={data.label}\n label={`${data?.label} View`}\n iconPosition=\"start\"\n icon={data?.icon}\n value={data.label}\n className=\"view-modal--Tabs\"\n disabled={Boolean(disabledViews?.includes(data.label))}\n />\n ))}\n </Tabs>\n {TabData.map((data) => (\n <div\n key={data.label}\n hidden={value !== data.label}\n className=\"view-modal--TabData\"\n >\n {data.image}\n <div className=\"view-modal--Desc\">\n <Typography type=\"s1\" color={\"theme.secondary.1000\"}>\n {data?.label} Views\n </Typography>\n <Typography type=\"s4\" color={\"theme.secondary.800\"}>\n {data.desc}\n </Typography>\n {(data?.label === viewTypes.KANBAN ||\n data?.label === viewTypes.CALENDAR) && (\n <div className=\"view-modal--BoardContainer\">\n <Typography type=\"s4\" color=\"theme.secondary.900\">\n Group Board by\n </Typography>\n <Select\n placeholder=\"Status\"\n size={\"small\"}\n defaultValue={1}\n className=\"view-modal--Select\"\n variant=\"outlined\"\n >\n <MenuItem value={1}>option 1</MenuItem>\n <MenuItem value={2}>option 2</MenuItem>\n </Select>\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n <DialogActions\n className=\"view-modal--Actions\"\n sx={{ backgroundColor: \"theme.secondary.200\" }}\n >\n <Button variant=\"text\" onClick={() => setOpenModal(false)}>\n Cancel\n </Button>\n <Button variant=\"contained\" onClick={handleSubmit} disabled={disable}>\n Add {value} View\n </Button>\n </DialogActions>\n </Modal>\n </div>\n );\n};\n\nexport { ViewModal };\nexport default ViewModal;\n","import Typography from \"../typography/typography\";\nimport \"./header-card.scss\";\nimport logo from \"../../assets/images\";\nimport viewTypes from \"../../constants/action-bar\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\ninterface HeaderCard {\n title: string;\n active: string;\n onClick: () => void;\n key: number;\n}\n\nconst HeaderCard = (props: HeaderCard) => {\n const { title, active, onClick, key, ...rest } = props;\n const theme = useTheme();\n const isMdUp = useMediaQuery(theme.breakpoints.up('lg'));\n\n return (\n <div\n key={key}\n className={\n active && title.includes(active)\n ? \"header-card header-card--Active\"\n : \"header-card\"\n }\n onClick={onClick}\n {...rest}\n >\n {title && title === viewTypes.TABLE ? (\n <logo.TableIcon />\n ) : title === viewTypes.GRID ? (\n <logo.GridIcon />\n ) : title === viewTypes.GANTT ? (\n <logo.GanttIcon />\n ) : title === viewTypes.CALENDAR ? (\n <logo.CalenderIcon />\n ) : title === viewTypes.KANBAN ? (\n <logo.KanbanIcon />\n ) : title === viewTypes.CHART ? (\n <logo.ChartIcon />\n ) : (\n \"\"\n )}\n {isMdUp && \n <Typography type=\"s3\" color=\"inherit\">\n {title} View\n </Typography>\n }\n </div>\n );\n};\n\nexport { HeaderCard };\nexport default HeaderCard;\n","import { Box } from \"@mui/material\";\r\nimport \"./toggle.scss\";\r\nimport { styled } from '@mui/material/styles';\r\n\r\nconst ToggleWrapper = styled(Box)(({ theme: { palette } }) => ({\r\n \"& input:checked + .slider\": {\r\n backgroundColor: palette.theme.primary[700],\r\n },\r\n \"& .slider\": {\r\n backgroundColor: palette.theme.secondary[200],\r\n \":hover\": {\r\n backgroundColor: palette.theme.secondary[300],\r\n },\r\n },\r\n \"& input\": {\r\n display: \"none\",\r\n },\r\n}));\r\n\r\ninterface IToggle {\r\n checked: boolean;\r\n onChange: () => void;\r\n}\r\n\r\nconst Toggle = (props: IToggle) => {\r\n return (\r\n <ToggleWrapper>\r\n <label className=\"switch\">\r\n <input type=\"checkbox\" {...props} />\r\n <span className=\"slider round\"></span>\r\n </label>\r\n </ToggleWrapper>\r\n );\r\n};\r\n\r\nexport { Toggle };\r\nexport default Toggle;\r\n","import { MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\n\nconst CombinatorSelect = (props: any) => {\n const { handleOnChange, value, options, ...rest } = props;\n\n const showDropdown = props.path?.[0] === 1 || props.path?.[1] === 1;\n\n return (\n <>\n {!showDropdown ? (\n <Typography\n type=\"s4\"\n color=\"theme.secondary.1000\"\n className=\"combinator-value\"\n >\n {value}\n </Typography>\n ) : (\n <Select\n value={value}\n onChange={(e: any) => handleOnChange(e.target.value)}\n {...rest}\n className=\"combinator-list\"\n >\n {options?.map(({ name, label }: { name: string; label: string }) => (\n <MenuItem key={name} value={name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {label}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n )}\n </>\n );\n};\n\nexport { CombinatorSelect };\nexport default CombinatorSelect;\n","import { Box, IconButton } from \"@mui/material\";\nimport { ActionProps } from \"react-querybuilder\";\nimport { useLanguage } from \"../../../hooks/useLangauge\";\nimport { Trash } from \"../../icons\";\n\nconst RemoveAction = (props: ActionProps) => {\n const { isRtl } = useLanguage();\n const btnStyles = {\n ...(isRtl ? { marginRight:-1.5 } : {}),\n }\n const iconStyles = {\n color: 'theme.grey.600',\n '&:hover': {\n color: 'theme.error.600'\n }\n }\n return (\n <Box>\n <IconButton sx={btnStyles} size={\"small\"} onClick={props.handleOnClick} disableRipple>\n <Trash sx={{ fontSize: '1.35rem', ...iconStyles }} />\n </IconButton>\n </Box>\n );\n};\n\nexport { RemoveAction };\nexport default RemoveAction;\n","import { useEffect, useState } from \"react\";\nimport { Box, MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\nimport { FieldSelectorProps } from \"react-querybuilder\";\nimport SearchBar from \"../../search-bar/search-bar\";\nimport \"../filter.scss\";\nimport formatText from \"../../../utils/format-text\";\nimport { useTranslation } from \"react-i18next\";\n\nconst FieldSelect = (props: FieldSelectorProps) => {\n\n const { t } = useTranslation();\n\n const { handleOnChange, value, options, ...rest } = props;\n\n const [filteredOptions, setFilteredOptions] = useState<any[]>();\n\n const handleSearchEvent = (searchText: string) => {\n const ops = options?.filter(o => Boolean(o.label?.trim())) || []\n const filteredData = ops.filter((option: any) =>\n option.name.toLowerCase().includes(searchText.toLowerCase()),\n );\n setFilteredOptions(filteredData);\n };\n\n useEffect(() => {\n setFilteredOptions(options?.filter(o => Boolean(o.label?.trim())) || [])\n // eslint-disable-next-line react-hooks/exhaustive-deps\n },[options?.length])\n\n\n return (\n <Box width=\"100%\">\n <Select\n fullWidth\n value={value}\n onChange={(e: any) => handleOnChange(e.target.value)}\n {...rest}\n className=\"select-drps\"\n variant=\"outlined\"\n renderValue={(value: any) => formatText(t(filteredOptions?.find((opttion: any)=>opttion.name === value)?.label)?.replace(\"_id\", '')?.replaceAll(\"_\", \" \") || \"Select Default\")}\n onClose={() => setFilteredOptions(options?.filter(o => Boolean(o.label?.trim())) || [])}\n >\n <div className=\"searchbar-box-list new-searchbar\">\n <SearchBar\n placeholder={\"Search Attributes\"}\n handleSearch={(e) => handleSearchEvent(e)}\n />\n </div>\n {filteredOptions?.map((op: any) => (\n <MenuItem key={op.name} value={op.name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {formatText(t(op.label)?.replace(\"_id\", '')?.replaceAll(\"_\", \" \"))}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n </Box>\n );\n};\n\nexport { FieldSelect };\nexport default FieldSelect;\n","import { ActionProps } from \"react-querybuilder\";\r\nimport Button from \"../../button/button\";\r\nimport { styled } from '@mui/material/styles';\r\nimport { Add } from \"@mui/icons-material\";\r\n\r\nconst StyledAddButton = styled(Button)(({ theme: { palette } }) => ({\r\n \":hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n \"&.MuiButton-text\": {\r\n \":hover\": {\r\n color: palette.theme?.secondary[1000],\r\n },\r\n },\r\n}));\r\n\r\nconst AddFilterButton = (props: ActionProps) => {\r\n const { handleOnClick, ...rest } = props;\r\n return (\r\n <StyledAddButton\r\n onClick={handleOnClick}\r\n {...rest}\r\n className=\"add-filter\"\r\n variant=\"text\"\r\n startIcon={<Add/>}\r\n >\r\n Add Filter\r\n </StyledAddButton>\r\n );\r\n};\r\n\r\nexport { AddFilterButton };\r\nexport default AddFilterButton;\r\n","import { styled } from '@mui/material/styles';\r\nimport Button from \"../../button/button\";\r\nimport { ActionProps } from \"react-querybuilder\";\r\nimport { Add } from \"@mui/icons-material\";\r\n\r\nconst StyledAddButton = styled(Button)(({ theme: { palette } }) => ({\r\n \":hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n \"&.MuiButton-text\": {\r\n \":hover\": {\r\n color: palette.theme?.secondary[1000],\r\n },\r\n },\r\n}));\r\n\r\nconst AddGroupButton = (props: ActionProps) => {\r\n const { handleOnClick, ...rest } = props;\r\n return (\r\n <StyledAddButton\r\n onClick={handleOnClick}\r\n {...rest}\r\n className=\"add-group\"\r\n variant=\"text\"\r\n startIcon={<Add/>}\r\n >\r\n Add Group\r\n </StyledAddButton>\r\n );\r\n};\r\n\r\nexport { AddGroupButton };\r\nexport default AddGroupButton;\r\n","import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\r\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\r\nimport { DatePicker as Date } from '@mui/x-date-pickers/DatePicker';\r\nimport Typography from '../typography/typography';\r\nimport { styled } from '@mui/material/styles';\r\nimport logo from '../../assets/images';\r\nimport './date-picker.scss';\r\nimport dayjs from 'dayjs';\r\nimport { memo } from 'react';\r\n\r\nexport interface DatePickerProps {\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\terror?: boolean;\r\n\tname?: string;\r\n\tvalue?: string | number | Date;\r\n\thelperText?: string;\r\n\tdataPosition?: number;\r\n\tdataName?: string;\r\n\tdisableFutureDates?: boolean;\r\n\tplaceholder?: string;\r\n\trequired?: boolean;\r\n\tdisablePastDates?: boolean;\r\n\tdefaultValue?: string | number | Date | undefined;\r\n\ttextFieldProps?: any;\r\n\tformat?: string;\r\n\r\n}\r\n\r\nconst StyledDatePicker = styled(Date)(({ theme: { palette } }) => ({\r\n\t'& .MuiOutlinedInput-root': {\r\n\t\tpadding: '0',\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'& fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[400]\r\n\t\t},\r\n\t\t'&:hover fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[500]\r\n\t\t},\r\n\t\t'&.Mui-focused fieldset': {\r\n\t\t\tborderWidth: '0.0625rem',\r\n\t\t\tborderStyle: 'solid',\r\n\t\t\tborderColor: palette.theme?.primary[700]\r\n\t\t},\r\n\t\t'&.Mui-error fieldset': {\r\n\t\t\tborderColor: palette.theme?.error[600]\r\n\t\t},\r\n\t\t'&.Mui-disabled': {\r\n\t\t\tbackground: palette.theme?.secondary[200],\r\n\t\t\tcolor: palette.theme?.secondary[800]\r\n\t\t},\r\n\t\t'& .MuiInputBase-input::placeholder': {\r\n\t\t\tcolor: palette.theme?.secondary[800],\r\n\t\t\topacity: 1\r\n\t\t}\r\n\t},\r\n\t'& .MuiFormHelperText-root': {\r\n\t\tmarginLeft: 0,\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'&.Mui-error': {\r\n\t\t\tcolor: palette.theme?.error[600]\r\n\t\t}\r\n\t},\r\n\t'& .MuiIconButton-root': {\r\n\t\tmarginRight: 0\r\n\t},\r\n\t'& .MuiPickersCalendarHeader-labelContainer': {\r\n\t\tfontWeight: 600\r\n\t}\r\n}));\r\n\r\nconst DatePicker = memo((props: DatePickerProps) => {\r\n\tconst {\r\n\t\tlabel,\r\n\t\tdisabled,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tdataName,\r\n\t\tdataPosition,\r\n\t\tdisableFutureDates = false,\r\n\t\tplaceholder,\r\n\t\trequired = false,\r\n\t\tdisablePastDates = false,\r\n\t\tdefaultValue,\r\n\t\ttextFieldProps,\r\n\t\tformat,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<LocalizationProvider dateAdapter={AdapterDayjs}>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}>\r\n\t\t\t\t\t{label} {required && <span className='requiredStar'>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n\t\t\t<StyledDatePicker\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tdisableFuture={disableFutureDates}\r\n\t\t\t\tdisablePast={disablePastDates}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\thelperText: helperText,\r\n\t\t\t\t\t\terror: error,\r\n\t\t\t\t\t\tplaceholder: placeholder || 'MM/DD/YYYY',\r\n\t\t\t\t\t\t...textFieldProps\r\n\t\t\t\t\t\t// required: required,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdesktopPaper: {\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\t'& .MuiButtonBase-root.Mui-selected': {\r\n\t\t\t\t\t\t\t\tcolor: 'theme.primary.900',\r\n\t\t\t\t\t\t\t\tbgcolor: '#B6E9D6 !important'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t'& .MuiButtonBase-root:hover': {\r\n\t\t\t\t\t\t\t\tcolor: 'theme.primary.900',\r\n\t\t\t\t\t\t\t\tbgcolor: '#B6E9D6 !important'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tformat={format || 'DD-MM-YYYY'}\r\n\t\t\t\tslots={{ openPickerIcon: logo.CalenderIcon }}\r\n\t\t\t\t{...rest}\r\n\t\t\t\t\r\n\t\t\t\tdefaultValue={defaultValue ? dayjs(defaultValue) : undefined}\r\n\t\t\t\tclassName='datePicker'\r\n\t\t\t/>\r\n\t\t</LocalizationProvider>\r\n\t);\r\n});\r\n\r\nexport { DatePicker };\r\nexport default DatePicker;\r\n","import { CheckboxProps, Checkbox as MUICheckbox, styled } from '@mui/material';\r\nimport { CheckBoxIcon, RecgtangleIcon } from '../icons';\r\nimport { memo } from 'react';\r\n\r\nconst StyledCheckbox = styled(MUICheckbox)(({ theme: { palette } }) => ({\r\n\tpadding: '0rem',\r\n\tcolor: palette.theme?.secondary[300],\r\n\tborderRadius: '.625rem',\r\n\t'&.Mui-checked': {\r\n\t\tcolor: palette.theme?.primary[600],\r\n\t\t'&:hover': {\r\n\t\t\tcolor: palette.theme?.primary[500]\r\n\t\t}\r\n\t},\r\n\t'&.Mui-disabled': {\r\n\t\tcolor: palette.theme?.secondary[400]\r\n\t}\r\n}));\r\n\r\nconst Checkbox = memo((props: CheckboxProps) => {\r\n\treturn (\r\n\t\t<StyledCheckbox\r\n\t\t\ticon={<RecgtangleIcon fontSize={props?.size || 'small'} />}\r\n\t\t\tcheckedIcon={<CheckBoxIcon fontSize={props?.size || 'small'} />}\r\n\t\t\tdisableRipple\r\n\t\t\t{...props}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\nexport { Checkbox };\r\nexport default Checkbox;\r\n","import React from 'react';\n// import { Close } from '@mui/icons-material';\nimport { ChipProps } from '@mui/material';\nimport Chip from '../../../chip/chip';\nimport Typography from '../../../typography/typography';\n\ninterface ChipOrPlaceholderProps {\n\tdata: string[];\n\tplaceholder: string;\n\tonDelete?: () => void;\n\tchipProps?: Omit<ChipProps, 'label'>;\n\tdisabled?: boolean;\n\tselectedLabel?: string;\n}\n\nconst ChipOrPlaceholder: React.FC<ChipOrPlaceholderProps> = ({\n\tdata,\n\tplaceholder,\n\tonDelete,\n\tchipProps,\n\tdisabled,\n\tselectedLabel = 'Item'\n}) => (\n\t<>\n\t\t{data.length ? (\n\t\t\t<Chip\n\t\t\t\t// variant='outlined'\n\t\t\t\ttype='normal'\n\t\t\t\tlabel={\n\t\t\t\t\t<Typography color='theme.secondary.1000' type='s5'>\n\t\t\t\t\t\t{data.length} {selectedLabel} Selected\n\t\t\t\t\t</Typography>\n\t\t\t\t}\n\t\t\t\t// deleteIcon={<Close fontSize='large' />}\n\t\t\t\tonDelete={onDelete}\n\t\t\t\tonMouseDown={(event) => event.stopPropagation()}\n\t\t\t\tdisabled={Boolean(disabled)}\n\t\t\t\t{...chipProps}\n\t\t\t\tsx={{\n\t\t\t\t\t...chipProps?.sx,\n\t\t\t\t\t'& .MuiChip-deleteIcon': {\n\t\t\t\t\t\tcolor: 'theme.primary.800',\n\t\t\t\t\t\tfontSize: '1rem',\n\t\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\t\tcolor: 'theme.primary.900'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : (\n\t\t\t<Typography color='inherit' type='s3'>\n\t\t\t\t{placeholder}\n\t\t\t</Typography>\n\t\t)}\n\t</>\n);\n\nexport default ChipOrPlaceholder;\n","import { Radio as MUIRadio, RadioProps } from '@mui/material';\nimport { BlankCircle, FilledCircle } from '../icons';\nimport { memo } from 'react';\n\nconst Radio = memo((props: RadioProps) => {\n\tconst { color, ...rest } = props;\n\n\treturn (\n\t\t<>\n\t\t\t<MUIRadio\n\t\t\t\tdisableRipple\n\t\t\t\tsx={{\n\t\t\t\t\t'&, &.Mui-checked': {\n\t\t\t\t\t\tcolor: color || 'theme.primary.700'\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ticon={<BlankCircle color='theme.secondary.300' fontSize='large'/>}\n\t\t\t\tcheckedIcon={<FilledCircle fontSize='large'/>}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</>\n\t);\n});\n\nexport { Radio };\nexport default Radio;\n","import React, { memo } from 'react';\r\nimport { Control, Controller } from 'react-hook-form';\r\nimport Typography from '../../../typography/typography';\r\nimport Radio from '../../../radio/radio';\r\nimport { FormControlLabel, RadioGroup, Box } from '@mui/material';\r\nimport { styled } from '@mui/material/styles';\r\n\r\ninterface IDynamicRadioButton {\r\n\tformControl: Control<any>;\r\n\tfieldArrayName: string;\r\n\tname: string;\r\n\tlabel: string;\r\n\ttitlePosition?: string;\r\n\tposition: number;\r\n\toptions: {\r\n\t\tlabel: string;\r\n\t\tvalue: string;\r\n\t}[];\r\n\tdisabled?: boolean;\r\n\ttypeOfField?: string;\r\n\tdisplay?: 'row' | 'column';\r\n\ttitle?: string;\r\n\tbordered?: boolean;\r\n\tdefaultValue?: string; // Optional defaultValue prop\r\n}\r\n\r\nconst BorderedOption = styled(Box, {\r\n\tshouldForwardProp: (prop) => prop !== 'bordered' && prop !== 'isSelected'\r\n})<{ bordered?: boolean; isSelected: boolean }>(({ theme, bordered }) => ({\r\n\tdisplay: 'flex',\r\n\talignItems: 'center',\r\n\tpadding: 0,\r\n\tmargin: 0,\r\n\t...(bordered && {\r\n\t\tborder: `1px solid ${theme.palette.divider}`,\r\n\t\tborderRadius: theme.shape.borderRadius,\r\n\t\tmargin: theme.spacing(0, 3, 0, 0),\r\n\t\tpadding: theme.spacing(0, 5, 0, 1),\r\n\t\theight: '36px',\r\n\t\talignContent: 'left',\r\n\t\t'&:hover': {\r\n\t\t\tbackgroundColor: theme.palette.action.hover\r\n\t\t}\r\n\t})\r\n}));\r\n\r\nexport const DynamicRadioButton: React.FC<IDynamicRadioButton> = memo(\r\n\t({\r\n\t\tformControl,\r\n\t\tfieldArrayName,\r\n\t\tname,\r\n\t\toptions,\r\n\t\tdisplay,\r\n\t\tlabel,\r\n\t\tposition,\r\n\t\tdisabled,\r\n\t\ttitle,\r\n\t\ttitlePosition,\r\n\t\tbordered = false,\r\n\t\tdefaultValue = ''\r\n\t}) => {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\tdata-position={position}\r\n\t\t\t\t\tsx={{ mb: 0.5 }}>\r\n\t\t\t\t\t{label}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Controller\r\n\t\t\t\t\tcontrol={formControl}\r\n\t\t\t\t\tname={`${fieldArrayName}.${name}`}\r\n\t\t\t\t\t// disabled={disabled}\r\n\t\t\t\t\tdefaultValue={defaultValue} // Set defaultValue to 'item' if none provided\r\n\t\t\t\t\trender={({ field, fieldState: { error } }) => (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t<RadioGroup\r\n\t\t\t\t\t\t\t\tvalue={field.value ?? defaultValue} // Ensure 'item' if value is undefined\r\n\t\t\t\t\t\t\t\tonChange={(e) => field.onChange(e.target.value)}\r\n\t\t\t\t\t\t\t\trow={display === 'row'}\r\n\t\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t{title && titlePosition === 'start' && (\r\n\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\ttype='s4'\r\n\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\t\t\t\t\t\tweight='medium'>\r\n\t\t\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t{options.map((option) => (\r\n\t\t\t\t\t\t\t\t\t<BorderedOption\r\n\t\t\t\t\t\t\t\t\t\tkey={option.value}\r\n\t\t\t\t\t\t\t\t\t\tbordered={bordered}\r\n\t\t\t\t\t\t\t\t\t\tisSelected={field.value == option.value}>\r\n\t\t\t\t\t\t\t\t\t\t<FormControlLabel\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ margin: 0, opacity: disabled ? 0.5 : 1 }}\r\n\t\t\t\t\t\t\t\t\t\t\tvalue={option.value}\r\n\t\t\t\t\t\t\t\t\t\t\tcontrol={<Radio checked={field.value == option.value} />}\r\n\t\t\t\t\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype='s5'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tweight='medium'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</BorderedOption>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t{title && titlePosition === 'end' && (\r\n\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\ttype='s4'\r\n\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\t\t\t\t\t\tweight='medium'>\r\n\t\t\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</RadioGroup>\r\n\t\t\t\t\t\t\t{error && (\r\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\r\n\t\t\t\t\t\t\t\t\t{error.message}\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nexport default DynamicRadioButton;\r\n","import _ from \"lodash\";\r\nimport { MaterialTableColumnProps } from \"../../material-table/material-table\";\r\n\r\nexport const PARTIES_FORM_ARRAY_NAME = 'parties';\r\n\r\nexport const PARTIES_FIELDS = {\r\n TYPE: 'account_type',\r\n\r\n FIRST_NAME: 'first_name',\r\n LAST_NAME: 'last_name',\r\n\r\n COMPANY_NAME: 'company_name',\r\n VAT_NUMBER: 'vat_number',\r\n CRN: 'crn',\r\n\r\n // COMPANY: 'company_id',\r\n COMPANY: 'companies',\r\n CURRENCY: 'currencies',\r\n CONTACT_NO: 'contact_no',\r\n EMAIL_IDS: 'email_ids',\r\n RESPONSIBLE_PERSON : 'responsible_person',\r\n\r\n ADDRESS: 'addresses',\r\n CONTACTS: 'contacts',\r\n\r\n RECEIVABLE_ACCOUNT: 'account_id',\r\n TAX_TEMPLATE: 'default_tax_template'\r\n}\r\n\r\nexport const partyType = [\r\n { label: 'Individual', value: 'Individual' },\r\n { label: 'Company', value: 'Company' }\r\n];\r\n\r\nexport const addressPayload = {\r\n parties_id: null,\r\n address_type: null,\r\n contact_name: null,\r\n street_1: null,\r\n street_2: null,\r\n city: null,\r\n zip_code: null,\r\n state: null,\r\n country: null,\r\n email: null,\r\n mobile: null,\r\n phone: null,\r\n street_3: null,\r\n summary: null,\r\n default_shipping_address: 0,\r\n default_billing_address: 0,\r\n country_code: null\r\n};\r\nexport const contactPayload = {\r\n parties_id: null,\r\n name: null,\r\n country_code: null,\r\n contact_no: null,\r\n email: null\r\n};\r\n\r\n/* Address columns & rows */\r\nexport const addressColumns: MaterialTableColumnProps[] = [\r\n {\r\n header: 'common.party.table.addressType_header',\r\n accessorKey: 'address_type',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n placeholder: 'Select Address Type',\r\n field_name: 'address_type',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Address Type is required',\r\n msg_ar: 'Address Type is required'\r\n }\r\n ]\r\n },\r\n editSelectOptions: [\r\n { label: 'Delivery', value: 'Delivery' },\r\n { label: 'Shipping', value: 'Shipping' },\r\n { label: 'Office', value: 'Office' }\r\n ]\r\n },\r\n {\r\n header: 'common.party.table.addressee_header',\r\n accessorKey: 'contact_name',\r\n visible: true,\r\n type: 'custom_link',\r\n editProperties: {\r\n placeholder: 'Enter Addressee',\r\n field_name: 'contact_name',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: false,\r\n msg_en: 'Contact name is required',\r\n msg_ar: 'Contact name is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.defaultShippingAddress_header',\r\n accessorKey: 'default_shipping_address',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'checkbox',\r\n editProperties: {\r\n field_name: 'default_shipping_address'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.defaultBillingAddress_header',\r\n accessorKey: 'default_billing_address',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'checkbox',\r\n editProperties: {\r\n field_name: 'default_billing_address'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.countryCode_header',\r\n accessorKey: 'country_code',\r\n visible: true,\r\n type: 'custom_link',\r\n enableEditing: false\r\n },\r\n {\r\n header: 'common.party.table.contactNumber_header',\r\n accessorKey: 'phone',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'phone',\r\n editProperties: {\r\n field_name: 'phone'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addrressOne_header',\r\n accessorKey: 'street_1',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_1',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: false,\r\n msg_en: 'Address is required',\r\n msg_ar: 'Address is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addressTwo_header',\r\n accessorKey: 'street_2',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_2',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addressThree_header',\r\n accessorKey: 'street_3',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_3',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.zipCode_header',\r\n accessorKey: 'zip_code',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n field_name: 'zip_code',\r\n placeholder: 'Enter Zip Code',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.country_header',\r\n accessorKey: 'country_name',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n field_name: 'country',\r\n placeholder: 'Select country',\r\n valueKey: 'country_id',\r\n apiType: 'countries',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Country is required',\r\n msg_ar: 'Country is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.state_header',\r\n accessorKey: 'state_name',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n field_name: 'state',\r\n placeholder: 'Select state',\r\n valueKey: 'state_id',\r\n apiType: 'states',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'State is required',\r\n msg_ar: 'State is required'\r\n }\r\n ],\r\n customeFilter: (row: any, values) => {\r\n const filter = values?.country_name ? { '&country_id.eq': values?.country_name } : null\r\n return filter\r\n }\r\n }\r\n },\r\n {\r\n header: 'common.party.table.city_header',\r\n accessorKey: 'city',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter City',\r\n field_name: 'city',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'City is required',\r\n msg_ar: 'City is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.summary_header',\r\n accessorKey: 'summary',\r\n visible: true,\r\n type: 'string',\r\n enableEditing: false\r\n // editProperties: {\r\n // \tplaceholder: 'Populated after filling address',\r\n // \tfield_name: 'summary'\r\n // \tdisabled\r\n // }\r\n }\r\n];\r\n\r\n/* contact columns & rows */\r\nexport const contactColumns: MaterialTableColumnProps[] = [\r\n {\r\n header: 'common.party.table.name_header',\r\n accessorKey: 'name',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Name',\r\n field_name: 'name',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Name is required',\r\n msg_ar: 'Name is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.email_header',\r\n accessorKey: 'email',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Email',\r\n field_name: 'email',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Email is required',\r\n msg_ar: 'Email is required'\r\n },\r\n {\r\n type: 'email',\r\n value: true,\r\n msg_en: 'Invalid Email',\r\n msg_ar: 'Invalid Email'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.countryCode_header',\r\n accessorKey: 'country_code',\r\n visible: true,\r\n type: 'custom_link',\r\n enableEditing: false\r\n },\r\n {\r\n header: 'common.party.table.contactNumber_header',\r\n accessorKey: 'contact_no',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'phone',\r\n editProperties: {\r\n field_name: 'contact_no'\r\n }\r\n }\r\n];\r\n\r\nexport const addressOmitKeys = [\r\n 'id',\r\n 'state_id',\r\n 'country_id',\r\n 'country_name',\r\n 'state_name',\r\n 'parties_id',\r\n 'state_data',\r\n 'country_data',\r\n 'summary'\r\n];\r\nexport const contactOmitKeys = ['id', 'summary'];\r\n\r\n\r\nexport const processPartiesPayload = (payload: any) => {\r\n const { addresses = [], contacts = [], ...rest } = payload || {}\r\n const addressPayload = addresses.map(address => (_.omit(address, ...addressOmitKeys)))\r\n const contactPayload = contacts.map(contact => (_.omit(contact, ...contactOmitKeys)))\r\n return {\r\n ...rest,\r\n addresses: addressPayload,\r\n contacts: contactPayload\r\n }\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { useAuth } from './useAuth';\r\nimport { auth } from '../constants/auth';\r\n\r\n/**\r\n * In MFE mode the AuthContext of the common-hub is not bridged from the\r\n * host app, so `useAuth()` returns `user: null`. As a fallback we read\r\n * the persisted user object directly from localStorage so that default\r\n * values (e.g. company_id) are always available.\r\n */\r\nconst getEffectiveUser = (contextUser: any): any => {\r\n if (contextUser) return contextUser;\r\n try {\r\n const stored = window.localStorage.getItem(auth.storageUserKeyName);\r\n return stored ? JSON.parse(stored) : null;\r\n } catch {\r\n return null;\r\n }\r\n};\r\n\r\nconst setCompany = (user: any) => {\r\n return {\r\n value: user?.company_id,\r\n options: [{\r\n // Fallback to company_id when company_data is not present in the\r\n // user object (common in MFE where the stored payload is leaner).\r\n label: user?.company_data?.name ?? user?.company_id,\r\n value: user?.company_id\r\n }]\r\n }\r\n}\r\n\r\nexport const configMapper: Record<string, any> = {\r\n 'company': {\r\n callBack: setCompany,\r\n },\r\n 'company_id': {\r\n callBack: setCompany,\r\n },\r\n}\r\n\r\nexport const getDefaultConfig = (props: any, user: any) => {\r\n const { apiType, name } = props;\r\n const config = configMapper[apiType || name];\r\n if (config) {\r\n return config.callBack(user)\r\n }\r\n return {\r\n value: null,\r\n options: []\r\n }\r\n}\r\n\r\nexport const useDefaultConfig = ({\r\n props,\r\n setValue,\r\n isInternalOptions\r\n}: {\r\n props: any;\r\n setValue?: any;\r\n isInternalOptions: boolean;\r\n}) => {\r\n const { user: authUser } = useAuth();\r\n const contextUser = getEffectiveUser(authUser);\r\n const [defaultOptions, setDefaultOptions] = useState<any>([]);\r\n\r\n useEffect(() => {\r\n const user = getEffectiveUser(contextUser);\r\n const { value, options } = getDefaultConfig(props, user);\r\n\r\n if (value === null || value === undefined) {\r\n return;\r\n }\r\n\r\n if (typeof setValue === 'function') {\r\n setValue(`${props.fieldArrayName}.${props.name}`, props?.is_multiselect ? [value] : value);\r\n }\r\n\r\n if (!isInternalOptions) {\r\n setDefaultOptions(options);\r\n }\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props?.name, props?.apiType, contextUser, setValue, isInternalOptions]);\r\n\r\n return {\r\n defaultOptions\r\n }\r\n}","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { Controller, useFormContext, useWatch, Control } from 'react-hook-form';\r\nimport { dynamicSelectAdd } from './select-configuration';\r\nimport {\r\n Box,\r\n CircularProgress,\r\n Divider,\r\n IconButton,\r\n InputAdornment,\r\n MenuItem,\r\n MenuItemProps,\r\n OutlinedInput,\r\n Tooltip\r\n} from '@mui/material';\r\nimport PropTypes from 'prop-types';\r\nimport { debounce } from 'lodash';\r\nimport { sortBy } from \"lodash\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Add, Close } from '@mui/icons-material';\r\n\r\nimport Select from '../../../select/select';\r\nimport ChipOrPlaceholder from './chip-or-placeholder';\r\nimport Checkbox from '../../../checkbox/checkbox';\r\nimport Typography from '../../../typography/typography';\r\nimport Chip from '../../../chip/chip';\r\nimport { MoreIcon } from '../../../icons';\r\nimport { fetchApi } from '../../../../utils/api';\r\nimport './element.scss';\r\nimport { useAuth, useLanguage } from '@/hooks';\r\nimport { useDefaultConfig } from '@/hooks/useSetDefaultConfig';\r\nimport { auth } from '../../../../constants/auth';\r\n\r\n// Types\r\ninterface IOption {\r\n id: string | number;\r\n value: string | number;\r\n label: string | React.ReactNode;\r\n disabled?: boolean;\r\n isGroup?: boolean;\r\n options?: IOption[];\r\n searchLabel?: string;\r\n}\r\n\r\n// Custom API fetch function type for parent components\r\ninterface CustomFetchApiParams {\r\n search?: string;\r\n filters?: any;\r\n limit: number;\r\n skip: number;\r\n select?: string;\r\n order?: string;\r\n}\r\n\r\ninterface CustomFetchApiResponse {\r\n data: IOption[];\r\n pagination?: {\r\n totalCount: number;\r\n };\r\n}\r\n\r\ninterface IMenuItemsProps extends MenuItemProps {\r\n options: IOption[];\r\n multiple: boolean;\r\n placeholder: string;\r\n with_checkboxes: boolean;\r\n values: string | string[];\r\n field: IDynamicSearchSelectProps;\r\n disabledIds: (string | number)[];\r\n onChange: (value: string | string[]) => void;\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent: boolean;\r\n t: (key: string) => string;\r\n // onFooterClick?: () => void;\r\n}\r\n\r\ninterface IDynamicSearchSelectProps {\r\n name: string;\r\n placeholder: string;\r\n label: string;\r\n size?: 'small' | 'medium';\r\n options: IOption[];\r\n formControl: Control<any>;\r\n defaultValue?: string | string[];\r\n fieldArrayName: string;\r\n id?: string;\r\n required?: boolean;\r\n is_multiselect?: boolean;\r\n position?: number;\r\n formType?: string;\r\n typeOfField?: string;\r\n disabled?: boolean;\r\n onChipRemove?: (value: string) => void;\r\n enable_footer?: boolean;\r\n footer_action?: string;\r\n onFooterClick?: () => void;\r\n is_loading?: boolean;\r\n selectedLabel?: string;\r\n isInternal?: boolean;\r\n disabledIds?: (string | number)[];\r\n getSelectedData?: (data: IOption | IOption[] | null, name: string) => void;\r\n attributes?: string[];\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent?: boolean;\r\n sortOrder?: string;\r\n apiType?: string;\r\n handleOptions?: (value: any) => void;\r\n filterKey?: string;\r\n customeFilter?: Record<string, any>;\r\n refresh?: boolean;\r\n addType?: string;\r\n showCancelButton?: boolean;\r\n /** Custom API function to fetch options from parent component */\r\n customFetchApi?: (params: CustomFetchApiParams) => Promise<CustomFetchApiResponse>;\r\n isMergeOptions?: boolean;\r\n showItemTooltip?: boolean;\r\n}\r\n\r\ninterface IPaginationState {\r\n page: number;\r\n hasMore: boolean;\r\n isLoadingMore: boolean;\r\n total: number;\r\n}\r\n\r\n// Helper function to generate menu items\r\nconst generateMenuItems = ({\r\n options,\r\n multiple,\r\n placeholder,\r\n with_checkboxes,\r\n values,\r\n // field,\r\n disabledIds,\r\n onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick\r\n}: IMenuItemsProps): React.ReactElement[] => {\r\n const itemDisabled = (id: string | number) => disabledIds?.includes(id);\r\n const items: React.ReactElement[] = [];\r\n\r\n if (!multiple) {\r\n items.push(\r\n <MenuItem disabled value='' key=\"placeholder\" sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\r\n <Typography type='s3' color='theme.secondary.1000'>\r\n <em>{t(placeholder)}</em>\r\n </Typography>\r\n </MenuItem>\r\n );\r\n }\r\n const selectedValues = (Array.isArray(values) && values?.length > 0) ? values?.filter((value) => value) : values;\r\n\r\n const handleParentChange = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n\r\n const isParentSelected = valueArray.includes(parentValue);\r\n const updatedValues = isParentSelected\r\n ? valueArray.filter((value) => value !== parentValue && !childValues.includes(value))\r\n : [...new Set([...valueArray, parentValue, ...childValues])];\r\n\r\n onChange(updatedValues);\r\n handleChange?.(updatedValues);\r\n };\r\n\r\n const isAllOptionsSelected = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.every((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n const isSomeOptionsSelected = (childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.some((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n if (Array.isArray(options) && options.length > 0) {\r\n options.forEach((option) => {\r\n items.push(\r\n <MenuItem\r\n value={option.value}\r\n key={option.value}\r\n disabled={Boolean(option.disabled) || itemDisabled(option.id || option.value)}\r\n className={option.isGroup ? 'select--MenuItemHeader' : ''}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={\r\n hasParent\r\n ? isAllOptionsSelected(option.value, option.options || [])\r\n : Boolean(Array.isArray(selectedValues) ? selectedValues.includes(option.value) : selectedValues == option.value)\r\n }\r\n indeterminate={\r\n hasParent && isSomeOptionsSelected(option.options || [])\r\n }\r\n onChange={() => hasParent ? handleParentChange(option.value, option.options || []) : handleChange?.(option.value)}\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(option.value)}\r\n >\r\n {option.label}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n\r\n if (option.isGroup && Array.isArray(option.options)) {\r\n option.options.forEach((opt) => {\r\n items.push(\r\n <MenuItem\r\n value={opt.value}\r\n disabled={Boolean(opt.disabled) || itemDisabled(opt.id || opt.value)}\r\n sx={{ pl: 5 }}\r\n key={`${option.value}-${opt.value}`}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={Boolean(Array.isArray(values) && values.includes(opt.value))}\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(String(opt.value))}\r\n >\r\n {opt.label == \"Payment Entries\" ? \"Payment and Collection Entries\" : opt.label || opt.value}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n });\r\n }\r\n });\r\n }\r\n\r\n // if (field.enable_footer) {\r\n\r\n // }\r\n\r\n if (!items.length || (items.length == 1 && !multiple)) {\r\n items.push(\r\n <MenuItem disabled key=\"no-data\">\r\n No data available\r\n </MenuItem>\r\n );\r\n }\r\n\r\n return items;\r\n};\r\n\r\n// Selected items component\r\nconst SelectedItems: React.FC<{\r\n data: (string | number)[];\r\n options: IOption[];\r\n}> = ({ data, options }) => {\r\n const displayTitle = data.map(\r\n (selectedItem) =>\r\n options?.find((option) => option.value == selectedItem)?.label || ''\r\n );\r\n const filteredDisplayTitle = displayTitle.filter(Boolean);\r\n\r\n return (\r\n <Typography\r\n type='s4'\r\n color='inherit'\r\n sx={{ display: 'flex', gap: 1, alignItems: 'center', mt: 0.5 }}\r\n >\r\n {filteredDisplayTitle.slice(0, 4).join(', ')}\r\n {data.length > 4 && (\r\n <Chip variant='outlined' type='normal' label={<MoreIcon />} />\r\n )}\r\n </Typography>\r\n );\r\n};\r\n\r\nconst Loading = () => (\r\n <Typography fontStyle='italic' color='inherit' type='s3'>Loading...</Typography>\r\n)\r\n\r\nconst DynamicSearchSelect: React.FC<IDynamicSearchSelectProps> = React.memo((props) => {\r\n const watchedValue = useWatch({\r\n control: props.formControl,\r\n name: `${props.fieldArrayName}.${props.name}`\r\n });\r\n\r\n // In MFE mode each federated module ships its own copy of react-hook-form,\r\n // so the FormContext created by the host's FormProvider is invisible here\r\n // and useFormContext() returns null.\r\n // The internal `control` object (passed as formControl prop) does NOT expose\r\n // setValue — that lives only on the useForm() return value. We build a\r\n // stable fallback using useCallback so that useDefaultConfig's useEffect\r\n // (which has setValue as a dependency) does NOT re-fire on every render.\r\n const formContext = useFormContext();\r\n const { setValue: contextSetValue } = formContext || {};\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mfeFallbackSetValue = useCallback((fieldPath: string, value: any) => {\r\n const ctrl = props.formControl as any;\r\n if (!ctrl) return;\r\n // Write into internal form values\r\n const parts = fieldPath.split('.');\r\n let obj = ctrl._formValues;\r\n for (let i = 0; i < parts.length - 1; i++) {\r\n if (!obj[parts[i]]) obj[parts[i]] = {};\r\n obj = obj[parts[i]];\r\n }\r\n obj[parts[parts.length - 1]] = value;\r\n // Notify RHF subscribers so React re-renders\r\n ctrl._subjects?.state?.next({ name: fieldPath, values: { ...ctrl._formValues } });\r\n // props.formControl is stable for the lifetime of the form\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props.formControl]);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const setValue: any = contextSetValue ?? mfeFallbackSetValue;\r\n const { t } = useTranslation();\r\n const { isRtl } = useLanguage();\r\n const { user: authUser } = useAuth();\r\n const contextUser = useMemo(() => {\r\n if (authUser) return authUser;\r\n try {\r\n const stored = window.localStorage.getItem(auth.storageUserKeyName);\r\n return stored ? JSON.parse(stored) : null;\r\n } catch {\r\n return null;\r\n }\r\n }, [authUser]);\r\n const selectRef = useRef<HTMLDivElement>(null);\r\n\r\n // State management\r\n const [options, setOptions] = useState<IOption[]>([]);\r\n const [selectedValue, setSelectedValue] = useState<any>(null);\r\n const [selectedOptions, setSelectedOptions] = useState<IOption[]>([]);\r\n const [loading, setLoading] = useState<boolean>(false);\r\n const [open, setOpen] = useState<boolean>(false);\r\n const [isAlreadyLoaded, setIsAlreadyLoaded] = useState<boolean>(false);\r\n const [prevFilter, setPrevFilter] = useState<any>(null);\r\n const [initialLoading, setInitialLoading] = useState<boolean>(false);\r\n const [searchQuery, setSearchQuery] = useState<string>(\"\");\r\n const [searchInitiate, setSearchInitiate] = useState<boolean>(false);\r\n const [addConfig, setAddConfig] = useState<any>(null);\r\n\r\n // Modal states\r\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\r\n const [isAddLoading, setIsAddLoading] = useState<boolean>(false);\r\n\r\n\r\n // Pagination state\r\n const [pagination, setPagination] = useState<IPaginationState>({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n\r\n // Props destructuring with defaults\r\n const {\r\n handleOptions,\r\n isInternal = false,\r\n disabledIds = [],\r\n getSelectedData,\r\n attributes = [],\r\n filterKey = 'id',\r\n customeFilter = {},\r\n refresh,\r\n handleChange,\r\n hasParent = false,\r\n sortOrder = 'id:-1',\r\n apiType,\r\n addType,\r\n showCancelButton = true,\r\n customFetchApi,\r\n isMergeOptions = false,\r\n } = props;\r\n\r\n const showItemTooltip = props.showItemTooltip ?? (apiType === 'salesItems');\r\n\r\n const limit = 25;\r\n\r\n // Memoized values\r\n // Memoized values\r\n const isInternalOptions = useMemo(() => {\r\n if (isMergeOptions && (apiType || customFetchApi)) return false;\r\n return (!apiType && !customFetchApi) || (isInternal ? (apiType || customFetchApi) && props.options?.length == 0 ? false : true : false);\r\n }, [isInternal, apiType, customFetchApi, props.options?.length, isMergeOptions]);\r\n\r\n\r\n //eslint-disable-next-line\r\n const cf = useMemo(() => customeFilter, [JSON.stringify(customeFilter)]);\r\n\r\n\r\n\r\n\r\n const { defaultOptions = [] } = useDefaultConfig({\r\n props,\r\n setValue,\r\n isInternalOptions\r\n });\r\n\r\n\r\n // Local search function\r\n const searchOptionsLocally = useCallback((searchTerm: string, value: any): IOption[] => {\r\n const currentOptions: IOption[] = (props.options && props.options.length > 0) ? props.options : (defaultOptions || []);\r\n if (!searchTerm) return currentOptions;\r\n\r\n const lowercasedSearchTerm = searchTerm.toLowerCase();\r\n\r\n const filteredOptions = hasParent\r\n ? currentOptions?.reduce((acc: IOption[], opt: IOption) => {\r\n const searchedOptions = opt.options?.filter((item: IOption) => {\r\n const label = React.isValidElement(item.label) ? item.searchLabel : String(item.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n });\r\n\r\n if (searchedOptions?.length) {\r\n acc.push({ ...opt, options: searchedOptions });\r\n }\r\n\r\n return acc;\r\n }, []) || []\r\n : currentOptions?.filter((opt: IOption) => {\r\n const label = React.isValidElement(opt.label) ? opt.searchLabel : String(opt.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n }) || [];\r\n\r\n //eslint-disable-next-line\r\n return sortBySelectedValues(filteredOptions, value);\r\n //eslint-disable-next-line\r\n }, [props.options, hasParent, defaultOptions]);\r\n\r\n // Get unique options\r\n const getUniqueOptions = useCallback((data: IOption[]): IOption[] => {\r\n const uniqueOptions = [\r\n ...new Map(data?.map(item => [item.value, item])).values()\r\n ];\r\n return uniqueOptions;\r\n }, []);\r\n\r\n // Sort by selected values\r\n const sortBySelectedValues = useCallback((arrayToSort: IOption[], value: any): IOption[] => {\r\n let selectedValues = Array.isArray(value) ? value : [value];\r\n selectedValues = selectedValues.map((item) => Number(item));\r\n const sortedValue = sortBy(arrayToSort, (item) => {\r\n const index = selectedValues.indexOf(item.id || item.value);\r\n return index == -1 ? Infinity : index;\r\n });\r\n return sortedValue;\r\n }, []);\r\n\r\n // Filtered options with pagination support\r\n const filteredOptions = useMemo(() => {\r\n if (isInternalOptions) {\r\n return searchOptionsLocally(searchQuery, watchedValue);\r\n }\r\n const apiOptions = sortBySelectedValues(getUniqueOptions([...options, ...selectedOptions]), watchedValue);\r\n if (isMergeOptions) {\r\n const localOptions = searchOptionsLocally(searchQuery, watchedValue);\r\n return getUniqueOptions([...localOptions, ...apiOptions]);\r\n }\r\n return apiOptions;\r\n //eslint-disable-next-line\r\n }, [options, selectedOptions, isInternalOptions, props.options, watchedValue, searchQuery, searchOptionsLocally, sortBySelectedValues, getUniqueOptions, isMergeOptions]);\r\n\r\n // Helper to get selected item data for tooltip\r\n const getSelectedDataOptions = useMemo(() => {\r\n if (!watchedValue || !filteredOptions.length) return null;\r\n const selected = filteredOptions.find(opt =>\r\n opt.id === watchedValue || opt.value === watchedValue\r\n );\r\n return selected || null;\r\n }, [watchedValue, filteredOptions]);\r\n\r\n // API Functions\r\n const fetchOptions = useCallback(async (searchTerm = '', flt = cf, page = 1, append = false) => {\r\n // Skip if neither apiType nor customFetchApi is provided\r\n if (!apiType && !customFetchApi) return [];\r\n\r\n setLoading(true);\r\n if (page > 1) {\r\n setPagination(prev => ({ ...prev, isLoadingMore: true }));\r\n }\r\n\r\n try {\r\n let data: IOption[] = [];\r\n let paginationResult: { totalCount?: number } = {};\r\n\r\n // Use custom API if provided, otherwise use default fetchApi\r\n if (customFetchApi) {\r\n const response = await customFetchApi({\r\n search: searchTerm,\r\n filters: flt,\r\n limit,\r\n skip: (page - 1) * limit,\r\n select: attributes?.join(','),\r\n order: sortOrder\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n } else {\r\n const response = await fetchApi({\r\n apiKey: apiType!,\r\n filters: {\r\n limit,\r\n skip: (page - 1) * limit,\r\n search: searchTerm,\r\n filters: flt,\r\n select: attributes,\r\n order: sortOrder\r\n }\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n }\r\n\r\n if (data && Array.isArray(data)) {\r\n const newOptions = append ? [...options, ...data] : data;\r\n\r\n updateOptions(newOptions, append);\r\n handleSelectedValue(data);\r\n // Update pagination\r\n setPagination(prev => ({\r\n ...prev,\r\n page,\r\n hasMore: (paginationResult?.totalCount || 0) > (page * limit),\r\n total: paginationResult?.totalCount || 0,\r\n isLoadingMore: false\r\n }));\r\n }\r\n\r\n return data || [];\r\n } catch (error) {\r\n console.error('Error fetching options:', error);\r\n setPagination(prev => ({ ...prev, isLoadingMore: false }));\r\n return [];\r\n } finally {\r\n setLoading(false);\r\n }\r\n //eslint-disable-next-line\r\n }, [apiType, customFetchApi, options, attributes, sortOrder, limit, cf]);\r\n\r\n // Handle scroll pagination\r\n const handleScroll = useCallback((event: React.UIEvent<HTMLDivElement>) => {\r\n const { scrollTop, scrollHeight, clientHeight } = event.currentTarget;\r\n const isBottom = scrollHeight - scrollTop <= clientHeight + 10;\r\n\r\n if (isBottom && pagination.hasMore && !pagination.isLoadingMore && !isInternalOptions) {\r\n const nextPage = pagination.page + 1;\r\n fetchOptions(searchQuery, cf, nextPage, true);\r\n }\r\n }, [pagination.hasMore, pagination.isLoadingMore, pagination.page, isInternalOptions, searchQuery, cf, fetchOptions]);\r\n\r\n // Update options\r\n const updateOptions = useCallback((newOptions: IOption[], append = false) => {\r\n const oldOptions = append ? options : selectedOptions;\r\n const uniqueOptions = getUniqueOptions([...oldOptions, ...newOptions]);\r\n setOptions(uniqueOptions);\r\n }, [options, selectedOptions, getUniqueOptions]);\r\n\r\n // Handle selected value\r\n const handleSelectedValue = useCallback(async (updateOptions: IOption[]) => {\r\n if (!watchedValue) return;\r\n let filterValue = props.is_multiselect ? watchedValue : [watchedValue];\r\n filterValue = Array.isArray(filterValue) ? filterValue?.filter(i => i) : [];\r\n filterValue = Array.isArray(filterValue) ? filterValue?.map((item) => Number(item)) : [];\r\n const isInOptions = updateOptions?.filter((item) =>\r\n Array.isArray(filterValue) ? filterValue.includes(item.id || item.value) : (item[filterKey] || item.value || item.id) == filterValue\r\n );\r\n\r\n if (Array.isArray(isInOptions) && isInOptions.length > 0) {\r\n getSelectedData?.(props.is_multiselect ? isInOptions : isInOptions[0], props.name);\r\n return true;\r\n }\r\n return false;\r\n //eslint-disable-next-line\r\n }, [props.is_multiselect, props.name, watchedValue, filterKey, getSelectedData, filteredOptions]);\r\n\r\n // Fetch options by ID\r\n const fetchIdOptions = useCallback(async () => {\r\n if (open) return;\r\n if (await handleSelectedValue(filteredOptions)) return;\r\n\r\n const condition = props.is_multiselect ?\r\n Array.isArray(watchedValue) && watchedValue.length > 0 :\r\n Boolean(watchedValue);\r\n\r\n if (condition) {\r\n setInitialLoading(true);\r\n const response = await fetchOptions('', { ...cf, '&id.in': watchedValue }, 1, false);\r\n setInitialLoading(false);\r\n\r\n if (response.length == 0 && setValue && !isInternalOptions) {\r\n // setValue(`${props.fieldArrayName}.${props.name}`, props.is_multiselect ? [] : null);\r\n }\r\n }\r\n //eslint-disable-next-line\r\n }, [open, watchedValue, JSON.stringify(cf)]);\r\n\r\n // Initial fetch\r\n const initialFetch = useCallback(async () => {\r\n const condition = JSON.stringify(cf) !== JSON.stringify(prevFilter);\r\n\r\n if (condition) {\r\n setPrevFilter(cf);\r\n setOptions([]);\r\n setIsAlreadyLoaded(false);\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n }\r\n\r\n if (!isInternalOptions && !isAlreadyLoaded) {\r\n await fetchOptions(searchQuery, cf, 1, false);\r\n setIsAlreadyLoaded(true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [cf, isInternalOptions, isAlreadyLoaded]);\r\n\r\n // Debounced search\r\n const debouncedSearch = useMemo(\r\n () => debounce(async (searchTerm: string) => {\r\n if (loading) return;\r\n\r\n if (!searchTerm && !isInternalOptions && searchInitiate) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions('', cf, 1, false);\r\n }\r\n if (searchTerm.length > 1 && !isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions(searchTerm, cf, 1, false);\r\n }\r\n }, 700),\r\n //eslint-disable-next-line\r\n [isInternalOptions, searchInitiate, cf]\r\n );\r\n\r\n // Reset value function\r\n const resetValue = useCallback((field: any) => {\r\n field.onChange(props.is_multiselect ? [] : null);\r\n if (getSelectedData) {\r\n getSelectedData(null, props.name);\r\n }\r\n }, [props.is_multiselect, props.name, getSelectedData]);\r\n\r\n // Handle close\r\n const handleClose = useCallback(() => {\r\n setOpen(false);\r\n if (searchQuery.length > 0) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n setSearchInitiate(false);\r\n setSearchQuery('');\r\n }, [searchQuery]);\r\n\r\n const handleModalOpen = useCallback(() => {\r\n setIsModalOpen(true);\r\n }, []);\r\n\r\n\r\n\r\n // Handle modal save\r\n const handleModalSave = useCallback(async (payload: any) => {\r\n if (!addConfig || !addConfig.api) {\r\n console.error('Add configuration is not properly set');\r\n return;\r\n }\r\n\r\n setIsAddLoading(true);\r\n try {\r\n const result = await addConfig.api(payload);\r\n setIsAddLoading(false);\r\n setIsModalOpen(false);\r\n if (!isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n setIsAlreadyLoaded(false);\r\n await fetchOptions('', cf, 1, false);\r\n }\r\n if (result && result.data) {\r\n const newValue = props.is_multiselect\r\n ? [...(watchedValue || []), result.data.id]\r\n : result.data.id;\r\n\r\n if (setValue) {\r\n setValue(`${props.fieldArrayName}.${props.name}`, newValue);\r\n }\r\n }\r\n } catch (error) {\r\n console.log(\"error\", error);\r\n setIsAddLoading(false);\r\n }\r\n\r\n\r\n }, [addConfig, isInternalOptions, fetchOptions, cf, props.is_multiselect, props.fieldArrayName, props.name, watchedValue, setValue]);\r\n\r\n // Effects\r\n useEffect(() => {\r\n if (handleOptions) {\r\n handleOptions(selectedValue);\r\n }\r\n }, [handleOptions, selectedValue]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n initialFetch();\r\n }\r\n }, [open, initialFetch]);\r\n\r\n useEffect(() => {\r\n fetchIdOptions();\r\n }, [fetchIdOptions]);\r\n\r\n useEffect(() => {\r\n if (refresh) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n fetchOptions('', cf, 1, false);\r\n }\r\n }, [refresh, fetchOptions, cf]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n debouncedSearch(searchQuery);\r\n }\r\n return () => debouncedSearch.cancel();\r\n }, [searchQuery, open, debouncedSearch]);\r\n\r\n useEffect(() => {\r\n if (watchedValue && !open) {\r\n const selectedData = options?.filter((item) =>\r\n props.is_multiselect ?\r\n Array.isArray(watchedValue) && watchedValue.includes(item.id || item.value) :\r\n (item.id || item.value) == watchedValue\r\n );\r\n setSelectedOptions(selectedData || []);\r\n }\r\n }, [watchedValue, options, props.is_multiselect]);\r\n\r\n const removeUndefined = useCallback((selectOptions: any[]) => {\r\n return Array.isArray(selectOptions) ? selectOptions.filter(Boolean) : [];\r\n }, []);\r\n\r\n useEffect(() => {\r\n const config = dynamicSelectAdd(addType);\r\n setAddConfig(config);\r\n }, [addType])\r\n\r\n\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={`${props.fieldArrayName}.${props.name}`}\r\n render={({ field, fieldState }) => (\r\n <>\r\n {props.placeholder == 'Select Currency' && setSelectedValue(field.value)}\r\n {showItemTooltip ? (\r\n <Tooltip\r\n title={getSelectedDataOptions?.label ? String(getSelectedDataOptions.label) : ''}\r\n placement='top'\r\n arrow\r\n slotProps={{\r\n popper: {\r\n modifiers: [{ name: 'offset', options: { offset: [0, -25] } }],\r\n },\r\n tooltip: {\r\n sx: { maxWidth: 500 },\r\n },\r\n }}\r\n >\r\n <span>\r\n <Select\r\n {...field}\r\n ref={selectRef}\r\n open={open}\r\n onOpen={() => {\r\n setOpen(true);\r\n setTimeout(() => {\r\n const searchInput = document.querySelector(\r\n `input[placeholder=\"Search ${props.label}\"]`\r\n ) as HTMLInputElement;\r\n console.log('Active Search input:', searchInput);\r\n searchInput?.focus();\r\n }, 150);\r\n }}\r\n onClose={handleClose}\r\n fullWidth\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n placeholder={props.placeholder}\r\n label={props.label}\r\n defaultValue={props.defaultValue || (props.is_multiselect ? [] : '')}\r\n searchValue={searchQuery}\r\n required={props.formType == 'builder' ? false : props.required}\r\n size={props.size || 'small'}\r\n multiple={props.is_multiselect || false}\r\n disabled={props.disabled}\r\n sx={(props.is_multiselect && field?.value?.length) ? { \"& .MuiSelect-select\": { padding: '5.5px !important' } } : {}}\r\n variant='outlined'\r\n value={\r\n initialLoading\r\n ? (props.is_multiselect ? [] : '')\r\n : (field.value?.id || field.value || (props.is_multiselect ? [] : ''))\r\n }\r\n className={\r\n props.is_multiselect && removeUndefined(field.value)?.length\r\n ? 'MultiSelect filter-select'\r\n : ''\r\n }\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 300 }\r\n }\r\n }}\r\n\r\n renderValue={(selected: any) => {\r\n if (Array.isArray(selected)) {\r\n return (\r\n <ChipOrPlaceholder\r\n selectedLabel={props.selectedLabel}\r\n data={removeUndefined(selected)}\r\n placeholder={(loading || props.is_loading) ? <Loading /> : `${t('common.search')} ${props.label}`}\r\n onDelete={props.onChipRemove}\r\n disabled={props.disabled}\r\n chipProps={{\r\n sx: {\r\n background: '#ebf9f2',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: '#289b64',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n );\r\n } else {\r\n const selectedOption = filteredOptions.find(\r\n (option) => (option.value?.id || option.value) == selected\r\n );\r\n return (loading || props.is_loading) ? <Loading /> : selectedOption?.label ||\r\n (typeof props.label == 'string' ?\r\n `${t('common.search')} ${props.label}` :\r\n props.placeholder);\r\n }\r\n }}\r\n searchPlaceholder={`${t('common.search')} ${props.label}`}\r\n handleSearch={(text: string) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || ''}\r\n onBlur={field.onBlur}\r\n input={\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n {(loading || props.is_loading) ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n !props.disabled &&\r\n (props.is_multiselect ?\r\n (Array.isArray(field.value) && field.value.length > 0) :\r\n Boolean(field.value)) && showCancelButton && (\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => resetValue(field)}\r\n edge='end'\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size='small'\r\n >\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n }\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(props.is_multiselect),\r\n placeholder: props.placeholder,\r\n values: field.value,\r\n with_checkboxes: true,\r\n field: props,\r\n disabledIds,\r\n onChange: field.onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick: () => {\r\n // if (props?.onFooterClick) {\r\n // props?.onFooterClick();\r\n // } else {\r\n // handleModalOpen();\r\n // }\r\n // }\r\n })}\r\n {props?.enable_footer &&\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={\r\n () => {\r\n if (props?.onFooterClick) {\r\n props?.onFooterClick();\r\n } else {\r\n handleModalOpen();\r\n }\r\n }\r\n\r\n }>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {props.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n </span>\r\n </Tooltip>\r\n ) : (\r\n <Select\r\n {...field}\r\n ref={selectRef}\r\n open={open}\r\n onOpen={() => {\r\n setOpen(true);\r\n setTimeout(() => {\r\n const searchInput = document.querySelector(\r\n `input[placeholder=\"Search ${props.label}\"]`\r\n ) as HTMLInputElement;\r\n console.log('Active Search input:', searchInput);\r\n searchInput?.focus();\r\n }, 150);\r\n }}\r\n onClose={handleClose}\r\n fullWidth\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n placeholder={props.placeholder}\r\n label={props.label}\r\n defaultValue={props.defaultValue || (props.is_multiselect ? [] : '')}\r\n searchValue={searchQuery}\r\n required={props.formType == 'builder' ? false : props.required}\r\n size={props.size || 'small'}\r\n multiple={props.is_multiselect || false}\r\n disabled={props.disabled}\r\n sx={(props.is_multiselect && field?.value?.length) ? { \"& .MuiSelect-select\": { padding: '5.5px !important' } } : {}}\r\n variant='outlined'\r\n value={\r\n initialLoading\r\n ? (props.is_multiselect ? [] : '')\r\n : (field.value?.id || field.value || (props.is_multiselect ? [] : ''))\r\n }\r\n className={\r\n props.is_multiselect && removeUndefined(field.value)?.length\r\n ? 'MultiSelect filter-select'\r\n : ''\r\n }\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 300 }\r\n }\r\n }}\r\n\r\n renderValue={(selected: any) => {\r\n if (Array.isArray(selected)) {\r\n return (\r\n <ChipOrPlaceholder\r\n selectedLabel={props.selectedLabel}\r\n data={removeUndefined(selected)}\r\n placeholder={(loading || props.is_loading) ? <Loading /> : `${t('common.search')} ${props.label}`}\r\n onDelete={props.onChipRemove}\r\n disabled={props.disabled}\r\n chipProps={{\r\n sx: {\r\n background: '#ebf9f2',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: '#289b64',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n );\r\n } else {\r\n const selectedOption = filteredOptions.find(\r\n (option) => (option.value?.id || option.value) == selected\r\n );\r\n return (loading || props.is_loading) ? <Loading /> : selectedOption?.label ||\r\n (typeof props.label == 'string' ?\r\n `${t('common.search')} ${props.label}` :\r\n props.placeholder);\r\n }\r\n }}\r\n searchPlaceholder={`${t('common.search')} ${props.label}`}\r\n handleSearch={(text: string) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || ''}\r\n onBlur={field.onBlur}\r\n input={\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n {(loading || props.is_loading) ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n !props.disabled &&\r\n (props.is_multiselect ?\r\n (Array.isArray(field.value) && field.value.length > 0) :\r\n Boolean(field.value)) && showCancelButton && (\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => resetValue(field)}\r\n edge='end'\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size='small'\r\n >\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n }\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(props.is_multiselect),\r\n placeholder: props.placeholder,\r\n values: field.value,\r\n with_checkboxes: true,\r\n field: props,\r\n disabledIds,\r\n onChange: field.onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick: () => {\r\n // if (props?.onFooterClick) {\r\n // props?.onFooterClick();\r\n // } else {\r\n // handleModalOpen();\r\n // }\r\n // }\r\n })}\r\n {props?.enable_footer &&\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={\r\n () => {\r\n if (props?.onFooterClick) {\r\n props?.onFooterClick();\r\n } else {\r\n handleModalOpen();\r\n }\r\n }\r\n\r\n }>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {props.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n )}\r\n\r\n {/* Modal for adding new items */}\r\n {addConfig && addConfig.component && (\r\n <>\r\n {React.createElement(addConfig.component, {\r\n isOpen: isModalOpen,\r\n setIsOpen: setIsModalOpen,\r\n isLoading: isAddLoading,\r\n onSave: handleModalSave,\r\n modalProps: {\r\n maxWidth: 'md',\r\n fullWidth: true\r\n },\r\n ...props?.modalComponentProps\r\n })}\r\n </>\r\n )}\r\n\r\n {props.is_multiselect && Array.isArray(field.value) && (\r\n <SelectedItems\r\n data={field.value}\r\n options={filteredOptions}\r\n />\r\n )}\r\n </>\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicSearchSelect.propTypes = {\r\n name: PropTypes.string.isRequired,\r\n placeholder: PropTypes.string.isRequired,\r\n label: PropTypes.string.isRequired,\r\n size: PropTypes.string,\r\n options: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\r\n value: PropTypes.any\r\n })\r\n ).isRequired,\r\n formControl: PropTypes.object.isRequired,\r\n defaultValue: PropTypes.any,\r\n fieldArrayName: PropTypes.string.isRequired,\r\n id: PropTypes.string,\r\n required: PropTypes.bool,\r\n is_multiselect: PropTypes.bool,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n typeOfField: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n onChipRemove: PropTypes.func,\r\n enable_footer: PropTypes.bool,\r\n footer_action: PropTypes.string,\r\n onFooterClick: PropTypes.func,\r\n is_loading: PropTypes.bool,\r\n selectedLabel: PropTypes.string,\r\n isInternal: PropTypes.bool,\r\n disabledIds: PropTypes.array,\r\n getSelectedData: PropTypes.func,\r\n attributes: PropTypes.array,\r\n handleChange: PropTypes.func,\r\n hasParent: PropTypes.bool,\r\n sortOrder: PropTypes.string,\r\n apiType: PropTypes.string,\r\n handleOptions: PropTypes.func,\r\n filterKey: PropTypes.string,\r\n customeFilter: PropTypes.object,\r\n refresh: PropTypes.bool,\r\n addType: PropTypes.string,\r\n modalComponentProps: PropTypes.object,\r\n showCancelButton: PropTypes.bool,\r\n customFetchApi: PropTypes.func\r\n};\r\n\r\nexport default DynamicSearchSelect;","/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable unused-imports/no-unused-vars */\r\nimport { styled } from '@mui/material/styles';\r\nimport Typography from \"../typography/typography\";\r\nimport ReactPhoneInput, { CountryData } from \"react-phone-input-2\";\r\nimport \"react-phone-input-2/lib/material.css\";\r\nimport { images } from \"../../assets/images\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { memo, useEffect } from \"react\";\r\n\r\nconst StyledInput = styled(ReactPhoneInput)<{ isRtl: boolean }>(({ theme: { palette }, isRtl }) => ({\r\n \"&:hover\": {\r\n border: \"none\",\r\n },\r\n \"&.react-tel-input\": {\r\n \".form-control\": {\r\n borderRadius: \"0.25rem\",\r\n padding: \"8px 8px 8px 55px\", // Ensure space for flag on the left\r\n border: `1px solid ${palette.theme?.secondary[300]}`,\r\n fontSize: \"0.875rem\",\r\n width: \"100%\",\r\n maxHeight: \"36.13px\",\r\n direction: \"ltr\", // Force LTR direction for input to start from left\r\n textAlign: \"left\", // Force left alignment for input value\r\n\r\n \":hover\": {\r\n border: `1px solid ${palette.theme?.secondary[400]}`,\r\n },\r\n\r\n \":focus\": {\r\n border: `1px solid ${palette.theme?.primary[600]}`,\r\n boxShadow: \"none\",\r\n },\r\n \":disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n\r\n \"&.invalid-number\": {\r\n border: `1px solid ${palette.theme?.error[600]}`,\r\n \":focus\": {\r\n boxShadow: \"none\",\r\n },\r\n },\r\n },\r\n\r\n \".flag-dropdown\": {\r\n left: \"0\",\r\n right: \"auto\",\r\n borderRadius: \"0.25rem 0 0 0.25rem\",\r\n\r\n \".selected-flag\": {\r\n borderRadius: \"0.25rem 0 0 0.25rem\",\r\n\r\n \"&:hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n },\r\n },\r\n\r\n \".country-list\": {\r\n left: isRtl ? \"auto\" : \"0\",\r\n right: isRtl ? \"0\" : \"auto\",\r\n\r\n \".search\": {\r\n padding: \"0.5rem 0.5rem 0.5rem 0.75rem\",\r\n borderBottom: \"1px solid #F3F2F2\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n\r\n \".search-emoji\": {\r\n position: \"absolute\",\r\n left: isRtl ? \"auto\" : \"1.25rem\",\r\n right: isRtl ? \"1.25rem\" : \"auto\",\r\n\r\n \":first-child\": {\r\n display: \"block\",\r\n color: \"transparent\",\r\n background: `url(${images.search})`,\r\n backgroundRepeat: \"no-repeat\",\r\n backgroundPosition: \"center\",\r\n },\r\n },\r\n\r\n \".search-box\": {\r\n width: \"100%\",\r\n marginLeft: \"0rem\",\r\n border: `1px solid ${palette.theme?.secondary[200]}`,\r\n backgroundColor: palette.theme?.secondary[100],\r\n borderRadius: \"0.5rem\",\r\n padding: \"0.4rem\",\r\n paddingLeft: isRtl ? \"0.4rem\" : \"2rem\",\r\n paddingRight: isRtl ? \"2rem\" : \"0.4rem\",\r\n fontSize: \"0.8125rem\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n textAlign: isRtl ? \"right\" : \"left\",\r\n\r\n \":hover\": {\r\n border: `1px solid ${palette.theme?.secondary[300]}`,\r\n },\r\n\r\n \":focus\": {\r\n border: `1px solid ${palette.theme?.primary[600]}`,\r\n },\r\n },\r\n },\r\n\r\n \".country\": {\r\n fontSize: \"0.8125rem\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n textAlign: isRtl ? \"right\" : \"left\",\r\n\r\n \".dial-code\": {\r\n fontSize: \"0.75rem\",\r\n position: \"absolute\",\r\n right: isRtl ? \"auto\" : \"0.5rem\",\r\n left: isRtl ? \"0.5rem\" : \"auto\",\r\n },\r\n },\r\n },\r\n },\r\n}));\r\n\r\ninterface IPhoneInput {\r\n error?: boolean;\r\n name?: string;\r\n dataPosition?: number;\r\n dataName?: string;\r\n label: string;\r\n required?: boolean;\r\n placeholder?: string;\r\n default_value?: string;\r\n onChange?: (e: any) => void;\r\n disabled?: boolean;\r\n setCountryCodeField?: (country: CountryData) => void;\r\n helperText?: string;\r\n isInlineEditing?: boolean\r\n}\r\n\r\nfunction fixPhoneDropdown() {\r\n let dropdown, input;\r\n\r\n const positionDropdown = () => {\r\n if (!dropdown || !input) return;\r\n const rect = input.getBoundingClientRect();\r\n\r\n dropdown.style.position = \"fixed\";\r\n dropdown.style.top = rect.bottom + \"px\";\r\n dropdown.style.left = rect.left + \"px\";\r\n dropdown.style.zIndex = \"2000\";\r\n };\r\n\r\n document.addEventListener(\"click\", () => {\r\n dropdown = document.querySelector(\".react-tel-input .country-list\");\r\n input = document.querySelector(\".react-tel-input input\");\r\n\r\n if (dropdown && input && !document.body.contains(dropdown)) {\r\n document.body.appendChild(dropdown);\r\n }\r\n\r\n positionDropdown();\r\n });\r\n\r\n // reposition on scroll (any container) and resize\r\n window.addEventListener(\"scroll\", positionDropdown, true); // true = capture all scrolls\r\n window.addEventListener(\"resize\", positionDropdown);\r\n}\r\n\r\n\r\nconst HelperTextWrapper = styled('div')(() => ({\r\n marginTop: '0.4rem',\r\n}));\r\n\r\nconst PhoneInput = memo(({\r\n name,\r\n error = false,\r\n dataName,\r\n dataPosition,\r\n label,\r\n required = false,\r\n placeholder,\r\n default_value,\r\n onChange,\r\n disabled,\r\n setCountryCodeField,\r\n helperText,\r\n isInlineEditing = false,\r\n ...rest\r\n}: IPhoneInput) => {\r\n const { isRtl } = useLanguage();\r\n\r\n useEffect(() => {\r\n if (isInlineEditing) {\r\n fixPhoneDropdown(isInlineEditing)\r\n }\r\n }, [isInlineEditing])\r\n\r\n useEffect(() => {\r\n if (typeof setCountryCodeField === \"function\") {\r\n setCountryCodeField?.({ dialCode: \"971\" } as CountryData);\r\n }\r\n }, [])\r\n\r\n return (\r\n <>\r\n <Typography\r\n type=\"s5\"\r\n weight=\"medium\"\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n <StyledInput\r\n dropdownContainer={document.body}\r\n isRtl={isRtl}\r\n specialLabel={\"\"}\r\n enableSearch\r\n searchPlaceholder=\"Search Country\"\r\n isValid={!error}\r\n country={\"ae\"}\r\n searchNotFound=\"Not Found!\"\r\n inputProps={{\r\n name: name,\r\n required: required,\r\n }}\r\n placeholder={placeholder}\r\n value={default_value || rest?.value}\r\n onChange={(value, country) => {\r\n setCountryCodeField?.(country as CountryData);\r\n onChange?.(value);\r\n }}\r\n disabled={disabled}\r\n />\r\n {helperText && (\r\n <HelperTextWrapper>\r\n <Typography\r\n type=\"s5\"\r\n color={error ? \"theme.error.600\" : \"theme.secondary.600\"}\r\n >\r\n {helperText}\r\n </Typography>\r\n </HelperTextWrapper>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nexport { PhoneInput };\r\nexport default PhoneInput;","import { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport PhoneInput from \"../../../phone-input/phone-input\";\nimport { memo } from \"react\";\n\nconst DynamicPhone = memo((props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field,fieldState }) => (\n <PhoneInput\n {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n required={props.formType === \"builder\" ? false : props.required}\n placeholder={props.placeholder}\n default_value={props.default_value}\n onChange={(val) => field.onChange(val)}\n error={Boolean(fieldState.error?.message)}\n disabled={props.disabled}\n helperText={fieldState.error?.message || \"\"}\n setCountryCodeField={props.setCountryCodeField}\n />\n )}\n />\n );\n});\n\nDynamicPhone.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n position: PropTypes.number,\n formType: PropTypes.string,\n placeholder: PropTypes.string,\n default_value: PropTypes.string,\n type: PropTypes.string,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n setCountryCodeField: PropTypes.func,\n};\n\nexport { DynamicPhone };\nexport default DynamicPhone;\n","import React from 'react';\r\n\r\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\r\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\r\nimport { DateTimePicker as Date } from '@mui/x-date-pickers/DateTimePicker';\r\nimport Typography from '../typography/typography';\r\nimport { styled } from '@mui/material/styles';\r\nimport logo from '../../assets/images';\r\nimport dayjs from 'dayjs';\r\nimport './date-time-picker.scss'\r\n\r\nexport interface DatePickerProps {\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\terror?: boolean;\r\n\tname?: string;\r\n\tvalue?: string | number | Date;\r\n\thelperText?: string;\r\n\tdataPosition?: number;\r\n\tdataName?: string;\r\n\tdisableFutureDates?: boolean;\r\n\tplaceholder?: string;\r\n\trequired?: boolean;\r\n\tdisablePastDates?: boolean;\r\n\tdefaultValue?: string | number | Date | undefined;\r\n\ttextFieldProps?: any;\r\n\tformat?: string;\r\n}\r\n\r\nconst StyledDatePicker = styled(Date)(({ theme: { palette } }) => ({\r\n\t'& .MuiOutlinedInput-root': {\r\n\t\tpadding: '0',\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'& fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[400]\r\n\t\t},\r\n\t\t'&:hover fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[500]\r\n\t\t},\r\n\t\t'&.Mui-focused fieldset': {\r\n\t\t\tborderWidth: '0.0625rem',\r\n\t\t\tborderStyle: 'solid',\r\n\t\t\tborderColor: palette.theme?.primary[700]\r\n\t\t},\r\n\t\t'&.Mui-error fieldset': {\r\n\t\t\tborderColor: palette.theme?.error[600]\r\n\t\t},\r\n\t\t'&.Mui-disabled': {\r\n\t\t\tbackground: palette.theme?.secondary[200],\r\n\t\t\tcolor: palette.theme?.secondary[800]\r\n\t\t},\r\n\t\t'& .MuiInputBase-input::placeholder': {\r\n\t\t\tcolor: palette.theme?.secondary[800],\r\n\t\t\topacity: 1\r\n\t\t}\r\n\t},\r\n\t'& .MuiFormHelperText-root': {\r\n\t\tmarginLeft: 0,\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'&.Mui-error': {\r\n\t\t\tcolor: palette.theme?.error[600]\r\n\t\t}\r\n\t},\r\n\t'& .MuiIconButton-root': {\r\n\t\tmarginRight: 0\r\n\t},\r\n\t'& .MuiPickersCalendarHeader-labelContainer': {\r\n\t\tfontWeight: 600\r\n\t}\r\n}));\r\n\r\nconst DateTimePicker = (props: DatePickerProps) => {\r\n\tconst {\r\n\t\tlabel,\r\n\t\tdisabled,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tdataName,\r\n\t\tdataPosition,\r\n\t\tdisableFutureDates = false,\r\n\t\tplaceholder,\r\n\t\trequired = false,\r\n\t\tdisablePastDates = false,\r\n\t\tdefaultValue,\r\n\t\ttextFieldProps,\r\n\t\tformat,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<LocalizationProvider dateAdapter={AdapterDayjs}>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}>\r\n\t\t\t\t\t{label} {required && <span className='requiredStar'>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n\t\t\t<StyledDatePicker\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tdisableFuture={disableFutureDates}\r\n\t\t\t\tdisablePast={disablePastDates}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\thelperText: helperText,\r\n\t\t\t\t\t\terror: error,\r\n\t\t\t\t\t\tplaceholder: placeholder || 'MM/DD/YYYY HH:mm:ss',\r\n\t\t\t\t\t\t...textFieldProps\r\n\t\t\t\t\t\t// required: required,\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tformat={format || 'MM/DD/YYYY HH:mm:ss'}\r\n\t\t\t\tslots={{ openPickerIcon: logo.CalenderIcon }}\r\n\t\t\t\t{...rest}\r\n\t\t\t\tdefaultValue={defaultValue ? dayjs(defaultValue) : undefined}\r\n\t\t\t\tclassName='datePicker'\r\n\t\t\t/>\r\n\t\t</LocalizationProvider>\r\n\t);\r\n};\r\n\r\nexport { DateTimePicker };\r\nexport default DateTimePicker;\r\n","import { Box, styled } from \"@mui/material\";\nimport logo from \"../../assets/images\";\nimport Button from \"../button/button\";\nimport Typography from \"../typography/typography\";\n// import { useEffect, useState } from \"react\";\nimport { Document } from \"../icons\";\nimport { enqueueSnackbar } from \"notistack\";\nimport { memo } from \"react\";\n// import Avatar from \"../avatar/avatar\";\n\nexport interface UploadImageProps {\n type?: string;\n label: string;\n disabled?: boolean;\n error?: boolean;\n dataPosition?: number;\n dataName?: string;\n required?: boolean;\n max_size?: number;\n name: string;\n value: string;\n onChange: (e: any) => any;\n multiple: boolean\n}\nconst UploadMedia = memo((props: UploadImageProps) => {\n const {\n type,\n label,\n disabled,\n error,\n dataName,\n dataPosition,\n required,\n max_size = 20,\n onChange,\n name,\n value,\n multiple,\n ...rest\n } = props;\n\n const VisuallyHiddenInput = styled(\"input\")({\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n height: 1,\n overflow: \"hidden\",\n position: \"absolute\",\n bottom: 0,\n left: 0,\n whiteSpace: \"nowrap\",\n width: 1,\n });\n\n // const [selectedFile, setSelectedFile] = useState<string | null>(null);\n const StyledButton = styled(Button)(({ theme: { palette } }) => ({\n marginBottom: 8,\n \"&.MuiButton-outlined\": {\n color: palette.theme?.primary[1000],\n },\n \"&.Mui-disabled\": {\n background: palette.theme?.secondary[200],\n color: palette.theme?.secondary[800],\n borderWidth: \"0.0625rem\",\n borderStyle: \"solid\",\n borderColor: palette.theme?.secondary[400],\n },\n }));\n\n const allowedImageTypes = [\n \"image/jpeg\", // JPG, JPEG\n \"image/png\", // PNG\n \"image/gif\", // GIF\n \"image/bmp\", // BMP\n \"image/webp\", // WebP\n \"image/svg+xml\", // SVG\n \"image/tiff\", // TIFF\n \"image/x-icon\", // ICO (icon files)\n \"image/heic\", // HEIC (High Efficiency Image Format)\n \"image/heif\"\n ]\n const allowedFileTypes = [\n \"application/pdf\",\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n 'application/vnd.ms-powerpoint',\n 'application/vnd.oasis.opendocument.text',\n 'text/csv',\n 'text/plain',\n 'application/rtf',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.presentation',\n \"image/jpeg\", // JPG, JPEG\n \"image/png\", // PNG\n \"image/gif\", // GIF\n \"image/bmp\", // BMP\n \"image/webp\", // WebP\n \"image/svg+xml\", // SVG\n \"image/tiff\", // TIFF\n \"image/x-icon\", // ICO (icon files)\n \"image/heic\", // HEIC (High Efficiency Image Format)\n \"image/heif\"\n ];\n\n const isValidFileType = (file: any) => {\n if (type === \"image\") {\n return allowedImageTypes.includes(file.type);\n } else if (type === 'file') {\n return allowedFileTypes.includes(file.type);\n }\n };\n\n\n const handleUpload = (e: any) => {\n const files = [...e.target.files];\n const filterredFiles = files.map(file => {\n if (file && file.size <= max_size * 1024 * 1024) {\n if (isValidFileType(file)) {\n return file\n } else {\n enqueueSnackbar(`Invalid file type for ${file.name}. Please upload a valid document.`, { variant: 'error' })\n return null\n }\n }\n })?.filter(Boolean)\n onChange(multiple ? (value?.length ? [...value, ...filterredFiles] : filterredFiles) : filterredFiles[0]);\n };\n\n const getFileName = (file) => {\n if (!file) return \"\"\n if (file instanceof File) {\n return file.name\n } else if(typeof file === 'string') { \n const parts = file?.split('/');\n return parts?.[parts?.length - 1];\n } else if(Array.isArray(file) && file?.length > 0) {\n return file.map(f => {\n const parts = f?.split('/');\n return parts?.[parts?.length - 1];\n }).join(', ')\n }\n }\n // const getImagePreview = (file) => {\n // if (!file) return \"\"\n // if (file instanceof File) {\n // let previewUrl:any = ''\n // const reader = new FileReader();\n // reader.onload = () => {\n // previewUrl = reader.result;\n // };\n // reader.readAsDataURL(file);\n\n // return previewUrl\n // } else {\n // return file.includes(S3_BUCKET_URL) ? file : S3_BUCKET_URL + file\n // }\n // }\n\n const getSelectedFiles = (files: any) => {\n\n if (files) {\n if (Array.isArray(files)) {\n return files.map(file => (\n <Box display=\"flex\" gap={1} mb={1} alignItems='center'>\n {type === 'file' && <Document fontSize=\"small\" />}\n {/* {type === 'image' && <Avatar src={getImagePreview(file)} />} */}\n <Typography\n type=\"s5\"\n weight=\"medium\"\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n noWrap\n >\n {getFileName(file)}\n </Typography>\n </Box>\n ))\n } else {\n return (\n <Box display=\"flex\" gap={1} alignItems='center'>\n {type === 'file' && <Document fontSize=\"small\" />}\n {/* {type === 'image' && <Avatar src={getImagePreview(files)} />} */}\n <Typography\n type=\"s5\"\n weight={\"medium\"}\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n noWrap\n >\n {getFileName(files)}\n </Typography>\n </Box>\n )\n }\n }\n }\n\n // useEffect(() => {\n // if(!multiple) {\n // const parts = value?.split('/');\n // // const documentPath = parts?.slice(3, parts.length - 1).join('/');\n // const filename = parts?.[parts?.length - 1];\n\n \n // if (value) setSelectedFile(filename)\n // }\n // }, [multiple, value])\n\n return (\n <>\n <Typography\n type=\"s5\"\n weight={\"medium\"}\n mb={0.5}\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n >\n {label} {required && \" *\"}\n </Typography>\n <div style={{ display: \"flex\" }}>\n <StyledButton\n component=\"label\"\n startIcon={\n <img\n src={type === \"image\" ? logo.uploadImage : logo.uploadDocument}\n />\n }\n variant=\"outlined\"\n disabled={disabled}\n >\n <Typography type='s5' weight=\"medium\" color=\"theme.secondary.1000\">Upload</Typography>\n <VisuallyHiddenInput\n type=\"file\"\n accept={type === \"file\" ? allowedFileTypes.join(\",\") : (type === 'image' ? allowedImageTypes.join(\",\") : undefined)}\n // required={required}\n onChange={handleUpload}\n name={name}\n multiple={multiple}\n {...rest}\n />\n </StyledButton>\n </div >\n {getSelectedFiles(value)}\n\n </>\n );\n})\n\nexport { UploadMedia };\nexport default UploadMedia;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\r\n\r\nimport { Box } from '@mui/material';\r\n\r\nimport Typography from '../../typography/typography';\r\nimport DatePicker from '../../date-picker/date-picker';\r\nimport DateTimePicker from '../../date-time-picker/date-time-picker';\r\nimport TextField from '../../text-field/text-field';\r\nimport UploadMedia from '../../upload-media/upload-media';\r\n\r\nimport * as yup from 'yup';\r\nimport _ from 'lodash';\r\nimport dayjs from 'dayjs';\r\nimport PhoneInput from '../../phone-input/phone-input';\r\nimport Checkbox from '../../checkbox/checkbox';\r\nimport SearchableSelect from '../../searchable-select';\r\n\r\ninterface IInlineEditFields {\r\n\tcell: any;\r\n\tcolumn: any;\r\n\trow: any;\r\n\ttable: any;\r\n\tcol: any;\r\n\tcallback: (value: any, column: any, rowId: any) => any;\r\n\terrors: any;\r\n\tvalidationSchema: any;\r\n\tsetValidationErrors: any;\r\n\tonChangeRowField?: (e: any, type: string, row: any) => any;\r\n\tgetSelectedData: any\r\n}\r\nconst InlineEditFields: React.FC<IInlineEditFields> = ({\r\n\t// cell,\r\n\tcolumn,\r\n\trow,\r\n\t// table,\r\n\tcol,\r\n\t// callback,\r\n\terrors,\r\n\tvalidationSchema,\r\n\tsetValidationErrors,\r\n\tonChangeRowField,\r\n\tgetSelectedData\r\n}) => {\r\n\r\n\tconst [inputValue, setInputValue] = useState<any>();\r\n\tconst [isInitialSet, setIsInitialSet] = useState<any>(false);\r\n\tconst customFilter = useRef(null)\r\n\t// ** Getting only editing enabled fields.\r\n\tconst editCols = row\r\n\t\t.getAllCells()\r\n\t\t.map((col: any) => col.column.columnDef)\r\n\t\t.filter(\r\n\t\t\t(col: any) =>\r\n\t\t\t\tcol?.enableEditing === undefined || col?.enableEditing === true\r\n\t\t);\r\n\r\n\tconst editVariant = col.editVariant;\r\n\tconst fieldProperties = column.columnDef?.editProperties || {};\r\n\r\n\t// ** Default and Dynamic disbaling a field with row data\r\n\tlet fieldDisbled = false;\r\n\tif (fieldProperties?.disable) {\r\n\t\tif (typeof fieldProperties.disable === 'function') {\r\n\t\t\tfieldDisbled = Boolean(fieldProperties?.disable(row, row._valuesCache));\r\n\t\t} else {\r\n\t\t\tfieldDisbled = Boolean(fieldProperties.disable);\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleCustomFilter = useCallback(async (row, values) => {\r\n\r\n\t\ttry {\r\n\t\t\tif (typeof fieldProperties.customeFilter === 'function') {\r\n\t\t\t\tconst filter = await fieldProperties.customeFilter(row, values);\r\n\t\t\t\tcustomFilter.current = filter;\r\n\t\t\t\treturn filter;\r\n\t\t\t} else {\r\n\t\t\t\tcustomFilter.current = fieldProperties?.customeFilter;\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [fieldProperties, row, row._valuesCache]);\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\thandleCustomFilter(row, row._valuesCache)\r\n\t}, [handleCustomFilter, row, row._valuesCache]);\r\n\t// ** Setting a default value for edit mode.\r\n\tconst valueKey = fieldProperties?.valueKey;\r\n\tlet defaultValue: any = '';\r\n\r\n\tif (editVariant === 'select' && fieldProperties?.is_multiple) {\r\n\t\tdefaultValue = valueKey ? _.get(row.original, valueKey, []) : [];\r\n\t} else {\r\n\t\tdefaultValue = valueKey\r\n\t\t\t? _.get(row.original, valueKey, row.original[column.id])\r\n\t\t\t: row.original[column.id];\r\n\t}\r\n\r\n\t// ** Validate a field with Material Table Validation Schema.\r\n\tconst validate = async (value: any) => {\r\n\t\ttry {\r\n\t\t\t// const v = await validationSchema.validateAt( // * * This line has commented for rerendering purpose\r\n\t\t\tawait validationSchema.validateAt(\r\n\t\t\t\tcolumn.id,\r\n\t\t\t\t{\r\n\t\t\t\t\t[column.id]: value\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t\t// if (v) { // * * The if condition has commented for rerendering purpose\r\n\t\t\tconst fe: any = {}; // field error\r\n\t\t\tfor (const e in errors) {\r\n\t\t\t\tif (e != column.id) {\r\n\t\t\t\t\tfe[e] = errors[e];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetValidationErrors(fe);\r\n\t\t\t// }\r\n\t\t} catch (err) {\r\n\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\tconst e: Record<string, string> = {};\r\n\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\te[error.path] = error.message;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tconst em = { ...errors, ...e };\r\n\t\t\t\tsetValidationErrors(em);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\t// ** Detect onChnage to perform the action on an input change.\r\n\tconst onChange = async (e: any, type: string, selectedData: any) => {\r\n\t\tconst data = selectedData\r\n\t\tlet value;\r\n\t\tswitch (type) {\r\n\t\t\tcase 'date':\r\n\t\t\tcase 'file':\r\n\t\t\tcase 'image':\r\n\t\t\tcase 'phone':\r\n\t\t\t\tvalue = e;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: e });\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'text':\r\n\t\t\tcase 'number':\r\n\t\t\t\tvalue = e.target.value;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: value });\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'checkbox':\r\n\t\t\t\tvalue = e.target.checked;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: value });\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tvalue = e.target.value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tsetInputValue({ ...inputValue, [column.id]: value });\r\n\r\n\t\tif (onChangeRowField) {\r\n\t\t\tconst v = await onChangeRowField(e, type, row, col, data);\r\n\t\t\tif (v) {\r\n\t\t\t\trow._valuesCache = { ...row._valuesCache, ...v };\r\n\t\t\t\tsetInputValue({ ...inputValue, ...v });\r\n\t\t\t}\r\n\t\t}\r\n\t\tsetInputValue({ ...inputValue, [column.id]: value });\r\n\t\trow._valuesCache = { ...row._valuesCache, [column.id]: value };\r\n\r\n\t\tawait validate(value);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetInputValue({ ...inputValue, ...row._valuesCache });\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [row._valuesCache]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isInitialSet) {\r\n\t\t\tconst editFields = Object.keys(row._valuesCache || {});\r\n\t\t\tconst dValues: any = {};\r\n\r\n\t\t\trow.getAllCells().forEach((cell) => {\r\n\t\t\t\tif (\r\n\t\t\t\t\tcell.column.columnDef?.enableEditing === undefined ||\r\n\t\t\t\t\tcell.column.columnDef?.enableEditing === true\r\n\t\t\t\t) {\r\n\t\t\t\t\tconst { is_multiple, valueKey } =\r\n\t\t\t\t\t\tcell.column.columnDef?.editProperties || {};\r\n\t\t\t\t\tif (editFields.includes(cell.column.id)) {\r\n\t\t\t\t\t\tconst vl = _.get(row.original, valueKey);\r\n\t\t\t\t\t\tif (editVariant === 'select' && is_multiple) {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = vl\r\n\t\t\t\t\t\t\t\t? Array.isArray(vl)\r\n\t\t\t\t\t\t\t\t\t? vl\r\n\t\t\t\t\t\t\t\t\t: [vl]\r\n\t\t\t\t\t\t\t\t: [];\r\n\t\t\t\t\t\t} else if (editVariant === 'date' || editVariant === 'date_time') {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = vl\r\n\t\t\t\t\t\t\t\t? dayjs(vl).isValid()\r\n\t\t\t\t\t\t\t\t\t? dayjs(vl)\r\n\t\t\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t\t\t\t: dayjs(row.original[cell.column.id]).isValid()\r\n\t\t\t\t\t\t\t\t\t? dayjs(row.original[cell.column.id])\r\n\t\t\t\t\t\t\t\t\t: undefined;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = _.get(\r\n\t\t\t\t\t\t\t\trow.original,\r\n\t\t\t\t\t\t\t\tvalueKey,\r\n\t\t\t\t\t\t\t\trow.original[cell.column.id]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t// setFieldsValues(dValues);\r\n\t\t\trow._valuesCache = dValues;\r\n\t\t\tsetInputValue(dValues);\r\n\t\t\tsetIsInitialSet(true);\r\n\t\t}\r\n\t}, [row, editVariant, isInitialSet]);\r\n\r\n\tconst handleMinDate = (state) => typeof state == 'function' ? state(row) : state\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{(!editVariant || editVariant === 'number') && (\r\n\t\t\t\t<TextField\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\t// onBlur={(e) => onBlur(e)}\r\n\t\t\t\t\t// onKeyDown={onKeyDown}\r\n\t\t\t\t\tonChange={(e) => onChange(e, editVariant)}\r\n\t\t\t\t\tvalue={inputValue?.[column.id]}\r\n\t\t\t\t\tautoFocus={editCols?.[0]?.accessorKey === column.id}\r\n\t\t\t\t\ttype={editVariant || 'text'}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tplaceholder={fieldProperties?.placeholder || ''}\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'select' && (\r\n\t\t\t\t<Box display='flex' flexDirection='column' width='100%'>\r\n\t\t\t\t\t<SearchableSelect\r\n\t\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\t\tplaceholder={fieldProperties?.placeholder || ''}\r\n\t\t\t\t\t\tsearchPlaceholder={`Search ${col.header}`}\r\n\t\t\t\t\t\tonChange={(e, row) => onChange(e, 'select', row)}\r\n\t\t\t\t\t\tapiType={fieldProperties?.apiType}\r\n\t\t\t\t\t\tautoFocus={editCols?.[0]?.accessorKey === column.id}\r\n\t\t\t\t\t\toptions={col?.editSelectOptions}\r\n\t\t\t\t\t\tcustomeFilter={customFilter.current}\r\n\t\t\t\t\t\tfilterKey={fieldProperties?.filterKey}\r\n\t\t\t\t\t\tlabelKey={fieldProperties?.labelKey}\r\n\t\t\t\t\t\tvalueKey={fieldProperties?.bindingKey}\r\n\t\t\t\t\t\tattributes={fieldProperties.attributes}\r\n\t\t\t\t\t\tisInternal={fieldProperties?.isInternal || !fieldProperties?.apiType}\r\n\t\t\t\t\t\tmultiple={fieldProperties?.is_multiple}\r\n\t\t\t\t\t\tvalue={\r\n\t\t\t\t\t\t\tfieldProperties?.is_multiple\r\n\t\t\t\t\t\t\t\t? Array.isArray(inputValue?.[column.id])\r\n\t\t\t\t\t\t\t\t\t? inputValue?.[column.id]\r\n\t\t\t\t\t\t\t\t\t: []\r\n\t\t\t\t\t\t\t\t: inputValue?.[column.id]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetSelectedData={(row) => getSelectedData(fieldProperties?.field_name, row)}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t{errors?.[column.id] && (\r\n\t\t\t\t\t\t<Typography color='theme.error.600' type='s5'>\r\n\t\t\t\t\t\t\t{errors?.[column.id]}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'date' && (\r\n\t\t\t\t<DatePicker\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'date')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={\r\n\t\t\t\t\t\tdayjs(row._valuesCache[column.id]).isValid()\r\n\t\t\t\t\t\t\t? dayjs(row._valuesCache[column.id])\r\n\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t\tminDate={() => handleMinDate(fieldProperties?.min_date)}\r\n\t\t\t\t\tmaxDate={() => handleMinDate(fieldProperties?.min_date)}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'date_time' && (\r\n\t\t\t\t<DateTimePicker\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'date')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={\r\n\t\t\t\t\t\tdayjs(row._valuesCache[column.id]).isValid()\r\n\t\t\t\t\t\t\t? dayjs(row._valuesCache[column.id])\r\n\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{(editVariant === 'file' || editVariant === 'image') && (\r\n\t\t\t\t<Box display='flex' flexDirection='column'>\r\n\t\t\t\t\t<UploadMedia\r\n\t\t\t\t\t\tname={fieldProperties?.field_name || 'table_file'}\r\n\t\t\t\t\t\tdataPosition={0}\r\n\t\t\t\t\t\tdataName='table_file'\r\n\t\t\t\t\t\tlabel=''\r\n\t\t\t\t\t\ttype={editVariant}\r\n\t\t\t\t\t\tmax_size={10}\r\n\t\t\t\t\t\tonChange={(v) => onChange(v, 'file')}\r\n\t\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\t\tmultiple={Boolean(column?.is_multiple)}\r\n\t\t\t\t\t\tvalue={row._valuesCache[column.id]}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{errors?.[column.id] && (\r\n\t\t\t\t\t\t<Typography color='theme.error.600' type='s5'>\r\n\t\t\t\t\t\t\t{errors?.[column.id]}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'phone' && (\r\n\t\t\t\t<PhoneInput\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefault_value={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'phone')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={row._valuesCache?.[column.id]}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t\tisInlineEditing={true}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'checkbox' && (\r\n\t\t\t\t<Checkbox\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultChecked={Boolean(defaultValue)}\r\n\t\t\t\t\t// checked={Boolean(defaultValue)}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'checkbox')}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={row._valuesCache?.[column.id]}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nexport default InlineEditFields;\r\n","/* eslint-disable unused-imports/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport React, { cloneElement, useCallback, useEffect, useState } from 'react';\r\nimport {\r\n\tMRT_ColumnDef,\r\n\tMRT_ColumnSizingInfoState,\r\n\tMRT_ColumnSizingState,\r\n\tMRT_Header,\r\n\tMRT_Row,\r\n\tMRT_RowData,\r\n\tMRT_RowSelectionState,\r\n\tMRT_SortingState,\r\n\tMRT_TableInstance,\r\n\tMRT_TableState,\r\n\tMaterialReactTable,\r\n\tMaterialReactTableProps,\r\n\tuseMaterialReactTable,\r\n\t// Cell\r\n} from 'material-react-table';\r\nimport { IPaginationModel } from '../../@types/pagination-model';\r\nimport {\r\n\tBox,\r\n\tstyled,\r\n\tMenuItem,\r\n\tIconButton,\r\n\tListItemIcon,\r\n\tListItemText,\r\n\tSvgIconProps,\r\n\tDivider\r\n} from '@mui/material';\r\nimport ChevronRightIcon from '@mui/icons-material/ChevronRight';\r\nimport ChevronLeftIcon from '@mui/icons-material/ChevronLeft';\r\nimport Menu from '../menu/menu';\r\nimport Typography from '../typography/typography';\r\nimport SearchBar from '../search-bar/search-bar';\r\nimport images from '../../assets/images';\r\n// import DeleteIcon from \"@mui/icons-material/Delete\";\r\n// import UpdateIcon from \"@mui/icons-material/Update\";\r\n// import PlayIcon from \"@mui/icons-material/PlayArrow\";\r\n\r\nimport './material-table.scss';\r\nimport {\r\n\tArrowUpDown,\r\n\tCheckBoxIcon,\r\n\tClose,\r\n\tEdit,\r\n\tRecgtangleIcon,\r\n\tSave,\r\n\tTrash\r\n} from '../icons';\r\n// import {\r\n// \tArrowDropDown /* , SaveOutlined */,\r\n// \tArrowDropUp\r\n// } from '@mui/icons-material';\r\nimport InlineEditFields from './components/inline-edit-fields';\r\nimport Tooltip from '../tooltip/Tooltip';\r\nimport Button from '../button/button';\r\nimport Add from '@mui/icons-material/Add';\r\nimport dayjs from 'dayjs';\r\nimport * as yup from 'yup';\r\nimport ConfirmPopUp from '../confirm-modal/confirm-modal';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport { useNavigate } from 'react-router-dom';\r\n// Module-specific pathname imports removed - should be passed as props or configured by consuming app\r\n// import { PathnameAccounting } from 'accounting/src/pathname.accounting';\r\n// import { PathnameInventory } from 'inventory/src/pathname.inventory';\r\n// import { PathnameManufacturing } from 'manufacturing/src/pathname.manufacturing';\r\n// import { PathnamePurchase } from 'procurement/src/pathname.procurement';\r\n// import { PathnameCrm } from 'crm/src/pathname.crm';\r\n// import { PathnameUsers } from 'user/src/pathname.user';\r\n// import { PathnameRental } from '../../../../rental/src/pathname.rental';\r\nimport { PathnameDocument } from '../../constants/pathnames/pathname.document';\r\nimport { PathnameAccounting } from '../../constants/pathnames/pathname.accounting';\r\nimport { PathnameInventory } from '../../constants/pathnames/pathname.inventory';\r\nimport { PathnameManufacturing } from '../../constants/pathnames/pathname.manufacturing';\r\nimport { PathnamePurchase } from '../../constants/pathnames/pathname.procurement';\r\nimport { PathnameCrm } from '../../constants/pathnames/pathname.crm';\r\nimport { PathnameUsers } from '../../constants/pathnames/pathname.user';\r\nimport { PathnameRental } from '../../constants/pathnames/pathname.rental';\r\nimport useDeepMemo from '../../hooks/use-deep-memo';\r\nimport { PageState } from '../../contexts/page-context';\r\n\r\ntype ExtraEditVariants =\r\n\t| 'file'\r\n\t| 'image'\r\n\t| 'date'\r\n\t| 'number'\r\n\t| 'time'\r\n\t| 'date_time'\r\n\t| 'phone'\r\n\t| 'checkbox';\r\n\r\ntype DisableFunction = (row: any, virtualRow?: any) => boolean;\r\n\r\nexport type TypeBooleanLabels = { 1: string; 0: string; true: string; false: string }\r\n\r\nexport interface MaterialTableColumnProps\r\n\textends Omit<MRT_ColumnDef<MRT_RowData>, 'editVariant'> {\r\n\tvisible?: boolean;\r\n\ttype?: string;\r\n\tshowDefaultCurrency?: boolean,\r\n\tvalueGet?: string;\r\n\tcustom_class?: string;\r\n\ttypeArrayAccessorKey?: string; //when type is an array of object\r\n\ttypeBooleanLabels?: TypeBooleanLabels; //when type is an boolean\r\n\teditVariant?: MRT_ColumnDef<MRT_RowData>['editVariant'] | ExtraEditVariants;\r\n\teditProperties?: {\r\n\t\tfield_name?: string;\r\n\t\tvalueKey?: string;\r\n\t\tplaceholder?: string;\r\n\t\tdateFormat?: string;\r\n\t\tvalidations?: any[];\r\n\t\tis_multiple?: boolean;\r\n\t\tis_multiline?: boolean;\r\n\t\tdisable?: boolean | DisableFunction;\r\n\t};\r\n\tredirectionPathWithId?: string;\r\n\thandleRowClick?: (row: any) => void;\r\n\tidField?: string;\r\n}\r\n\r\n\r\n\r\nexport interface MaterialTableColumnHeaderProps {\r\n\tcolumn: MRT_ColumnDef<any, any>;\r\n\theader: MRT_Header<any>;\r\n\ttable: MRT_TableInstance<any>;\r\n}\r\n\r\ntype rowSelectionCallback = (row: MRT_Row<any>) => boolean\r\n\r\ninterface MaterialTablePropsType {\r\n\tenablePagination?: boolean;\r\n\tdisableMaxHeight?: boolean;\r\n\trows: any;\r\n\ttotalPages: number;\r\n\tcolumns: any;\r\n\tpaginationModel: IPaginationModel;\r\n\tcolumnOrder?: string[];\r\n\tupdateData?: any;\r\n\thandleColumnOrdering?: (colOrder: any) => void;\r\n\tenableEditing?: boolean;\r\n\tenableColumnDragging?: boolean;\r\n\trowActionMenu?: any;\r\n\tdestructiveActionMenu?: any;\r\n\tgetRowId?: any;\r\n\tstates?: Partial<MRT_TableState<any>>;\r\n\tonSortingChange?: any;\r\n\tdisableDefaultActionColumn?: boolean;\r\n\tenableRowSelection?: boolean | rowSelectionCallback;\r\n\tdefaultActionColumnItems?: React.ReactElement[];\r\n\tenableBottomToolbar?: boolean;\r\n\tSetSelectedRowId?: any;\r\n\tisResetRow?: boolean;\r\n\tonCreateRow?: (data: any) => Promise<unknown>;\r\n\tonEditRow?: (data: any) => Promise<unknown>;\r\n\tonDeleteRow?: (data: any) => Promise<unknown>;\r\n\teditDisplayMode?: MaterialReactTableProps<any>['editDisplayMode'];\r\n\tenableRowCreate?: boolean;\r\n\tonChangeRowField?: (e: any, type: string, row: any) => void;\r\n\tonSelectRow?: (rows: any, prevSelected?: any) => any;\r\n\tenableColumnResizing?: boolean;\r\n\tselectedRowIds?: any[];\r\n\tonColumnVisibility?: (columns: MaterialTableColumnProps[]) => void\r\n\tgetSelectedData: any;\r\n\tenableAddCustomField?: boolean;\r\n\tdisabledDefaultActionColumnIcon?: boolean\r\n\tenableRowDragging?: boolean\r\n\thandleColumnResizing?: (sizes: MRT_ColumnSizingState) => void,\r\n\tcolumnSizes?: MRT_ColumnSizingState,\r\n\tshowPreview?: boolean;\r\n\thandlePreview?: (row: MRT_RowData) => void;\r\n}\r\n\r\nconst TableWrapper = styled(Box, {\r\n\tshouldForwardProp: (prop) => prop !== 'disableMaxHeight',\r\n})<{ disableMaxHeight?: boolean }>(({ theme: { palette }, disableMaxHeight }) => ({\r\n\t'.MuiTableCell-root': {\r\n\t\tborder: '1px solid #efefef',\r\n\t\tborderBottom: 0,\r\n\t\tborderLeft: 0,\r\n\t\tpadding: '0 0.5rem',\r\n\t\tlineHeight: '19px',\r\n\t\tfontSize: '14px',\r\n\t\tminHeight: 32,\r\n\t\t// '&:first-child': {\r\n\t\t// \tborderLeft: '1px solid #efefef'\r\n\t\t// },\r\n\t\t// '&:last-child': {\r\n\t\t// \tborderBottom: '1px solid #efefef'\r\n\t\t// }\r\n\r\n\t},\r\n\t'.MuiTableCell-head': {\r\n\t\tbackgroundColor: palette.theme?.secondary[100]\r\n\t},\r\n\t'.MuiTableContainer-root': {\r\n\t\t...(!disableMaxHeight && { maxHeight: 'clamp(350px, 100vh - 200px, 9999px) !important' }),\r\n\t},\r\n\r\n\t'.MuiPaper-root': {\r\n\t\tboxShadow: 'none',\r\n\r\n\t},\r\n\t'.MuiPaginationItem-root': {\r\n\t\t'&.Mui-selected': {\r\n\t\t\tbackgroundColor: palette?.theme?.primary[700],\r\n\t\t\tcolor: 'white'\r\n\t\t}\r\n\t},\r\n\t'.MuiTableRow-root': {\r\n\t\t'&.Mui-selected': {\r\n\t\t\tbackgroundColor: `${palette?.theme?.primary[100]} !important`,\r\n\t\t\tcolor: 'white'\r\n\t\t}\r\n\t},\r\n\t'.MuiCheckbox-indeterminate': {\r\n\t\tcolor: `${palette?.theme?.primary[700]} !important`,\r\n\t\t\"& svg\": {\r\n\t\t\theight: `20px !important`,\r\n\t\t\twidth: `20px !important`,\r\n\t\t}\r\n\t}\r\n}));\r\n\r\nexport const MaterialTable = React.memo(({\r\n\tenablePagination = false,\r\n\trows,\r\n\tcolumns,\r\n\ttotalPages,\r\n\tpaginationModel,\r\n\tcolumnOrder = ['mrt-row-select'],\r\n\tupdateData,\r\n\thandleColumnOrdering,\r\n\tenableEditing,\r\n\tenableColumnDragging,\r\n\tstates,\r\n\trowActionMenu,\r\n\tdestructiveActionMenu,\r\n\tdisableDefaultActionColumn,\r\n\tenableRowSelection,\r\n\tdefaultActionColumnItems = [],\r\n\tenableBottomToolbar,\r\n\tSetSelectedRowId,\r\n\tisResetRow,\r\n\tonCreateRow,\r\n\tonEditRow,\r\n\tonDeleteRow,\r\n\teditDisplayMode,\r\n\tenableRowCreate,\r\n\tonChangeRowField,\r\n\tonSelectRow,\r\n\tenableColumnResizing = true,\r\n\tselectedRowIds = [],\r\n\tonColumnVisibility,\r\n\tonSortingChange,\r\n\tgetSelectedData,\r\n\tdisabledDefaultActionColumnIcon = false,\r\n\tenableAddCustomField = true,\r\n\tenableRowDragging = false,\r\n\thandleColumnResizing = () => { },\r\n\tcolumnSizes = {},\r\n\tdisableMaxHeight = false,\r\n\tshowPreview = false,\r\n\thandlePreview = () => { },\r\n\t// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\r\n\t// getRowId,\r\n\t// onDelete,\r\n\t// onUpdate,\r\n\t...rest\r\n}: MaterialTablePropsType) => {\r\n\tconst { t } = useTranslation();\r\n\tconst { formData = null, updatePageInfo, activePage: aPage } = usePages()\r\n\tconst activePage = useDeepMemo<PageState>(aPage);\r\n\tconst { pageNo } = paginationModel;\r\n\tconst [row, setRow] = useState({});\r\n\tconst [tableColumns, setTableColumns] = useState(columns);\r\n\tconst [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst [popUpShow, setPopupShow] = useState<boolean>(false);\r\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst visibleColumns = tableColumns.filter((column: any) => column.visible);\r\n\tconst hiddenColumns = tableColumns.filter((column: any) => !column.visible);\r\n\tconst [filteredOptions, setFilteredOptions] = useState(hiddenColumns);\r\n\tconst [selectedRow, setSelectedRow] = useState<number | null>(null);\r\n\tconst [validationErrors, setValidationErrors] = useState<any>({});\r\n\tconst [validationSchema, setValidationSchema] = useState<any>([]);\r\n\tconst [isCreatingRow, setIsCreatingRow] = useState<boolean>(false);\r\n\tconst [isEditingRow, setIsEditingRow] = useState<boolean>(false);\r\n\tconst [isDeletingRow, setIsDeletingRow] = useState<boolean>(false);\r\n\tconst [rowToDelete, setRowToDelete] = useState<any>(null);\r\n\tconst [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});\r\n\tconst [isChecked, setIsChecked] = useState(false)\r\n\tconst [sorting, setSorting] = useState<MRT_SortingState>([]);\r\n\tconst [disableNextEdit, setDisableNextEdit] = useState(false);\r\n\tconst [columnSizing, setColumnSizing] = useState<MRT_ColumnSizingState>(activePage.column_sizes);\r\n\tconst [columnSizingInfo, setColumnSizingInfo] = useState<MRT_ColumnSizingInfoState>({\r\n\t\tcolumnSizingStart: [],\r\n\t\tdeltaOffset: null,\r\n\t\tdeltaPercentage: null,\r\n\t\tisResizingColumn: false,\r\n\t\tstartOffset: null,\r\n\t\tstartSize: null\r\n\t});\r\n\r\n\tconst navigate = useNavigate();\r\n\tconst currentModule = location.pathname.split('/')[2]\r\n\r\n\tlet redirectionPath = ''\r\n\tswitch (currentModule) {\r\n\t\tcase 'accounting':\r\n\t\t\tredirectionPath = PathnameAccounting.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'inventory':\r\n\t\t\tredirectionPath = PathnameInventory.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'manufacturing':\r\n\r\n\t\t\tredirectionPath = PathnameManufacturing.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'procurement':\r\n\t\t\tredirectionPath = PathnamePurchase.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'crm':\r\n\t\t\tredirectionPath = PathnameCrm.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'user':\r\n\t\t\tredirectionPath = PathnameUsers.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'rental':\r\n\t\t\tredirectionPath = PathnameRental.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'drive':\r\n\t\t\tredirectionPath = PathnameDocument.ADD_CUSTOM_FIELDS\r\n\t\t\tbreak;\r\n\t}\r\n\tconst path = `/dashboard/${currentModule}${redirectionPath}`\r\n\tconst getValidationType = (column: any) => {\r\n\t\tswitch (column.editVariant) {\r\n\t\t\tcase 'select':\r\n\t\t\t\treturn column?.editProperties?.is_multiple ? yup.array() : yup.string();\r\n\r\n\t\t\tcase 'number':\r\n\t\t\t\treturn yup.number().nullable().transform((value, originalValue) => (originalValue === \"\" ? null : value));\r\n\r\n\t\t\tcase 'url':\r\n\t\t\t\treturn yup\r\n\t\t\t\t\t.string()\r\n\t\t\t\t\t.matches(\r\n\t\t\t\t\t\t/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/,\r\n\t\t\t\t\t\t{ excludeEmptyString: true, message: 'Please enter valid URL.' }\r\n\t\t\t\t\t);\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn yup.string()\r\n\t\t}\r\n\t};\r\n\r\n\tconst validationReducer = (\r\n\t\tvalidations: any,\r\n\t\tvalidation: any,\r\n\t\tcolumn: any\r\n\t) => {\r\n\t\tlet vld = validations\r\n\t\tswitch (validation.type) {\r\n\t\t\tcase 'required':\r\n\t\t\t\tvld = validation.value\r\n\t\t\t\t\t? validations.required(validation.msg_en).typeError(validation.msg_en)\r\n\t\t\t\t\t: column?.editProperties?.is_multiple\r\n\t\t\t\t\t\t? validations.min(1, validation.msg_en)\r\n\t\t\t\t\t\t: validations;\r\n\t\t\t\tbreak\r\n\t\t\tcase 'min':\r\n\t\t\t\tvld = validations.min(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'email':\r\n\t\t\t\tvld = validations.email(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'max':\r\n\t\t\t\tvld = validations.max(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'positive':\r\n\t\t\t\tvld = validation.value === true ? validations.test('is-positive-number', 'Value must be a positive number', (value) => !value || value >= 0) : validations;\r\n\t\t\t\tbreak\r\n\t\t\tcase 'when':\r\n\t\t\t\treturn validations.when(validation.relation, {\r\n\t\t\t\t\tis: (val: any) => val === validation.values,\r\n\t\t\t\t\tthen: () =>\r\n\t\t\t\t\t\tvalidation?.thenValidations?.reduce(\r\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\r\n\t\t\t\t\t\t\tvalidations\r\n\t\t\t\t\t\t) || validations,\r\n\t\t\t\t\totherwise: () =>\r\n\t\t\t\t\t\tvalidation?.otherWiseValidations?.reduce(\r\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\r\n\t\t\t\t\t\t\tvalidations\r\n\t\t\t\t\t\t) || validations\r\n\t\t\t\t});\r\n\t\t\t// Add more cases for other validation types as needed\r\n\t\t\tdefault:\r\n\t\t\t\tvld = validations;\r\n\t\t\t\tbreak\r\n\t\t}\r\n\r\n\t\tif (validation.type == 'required' && validation.value && (!column?.editVariant || column?.editVariant == 'text')) {\r\n\t\t\tvld = validations.test('no-blank-spaces', 'Blank space is not allowed', (value) => {\r\n\t\t\t\treturn value && value.trim()?.length > 0;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn vld\r\n\r\n\t};\r\n\r\n\r\n\tconst generateValidationSchema = (columns: any[]) => {\r\n\t\tconst schema: any = {};\r\n\t\tcolumns.forEach((clm) => {\r\n\t\t\tif (clm?.editProperties?.validations?.length) {\r\n\t\t\t\tconst fieldValidations = clm?.editProperties?.validations.reduce(\r\n\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\tvalidationReducer(validations, validation, clm),\r\n\t\t\t\t\tgetValidationType(clm)\r\n\t\t\t\t);\r\n\t\t\t\tschema[clm.accessorKey] = fieldValidations;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn schema;\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetTableColumns(columns);\r\n\r\n\t\tconst schema: any = generateValidationSchema(columns);\r\n\t\tsetValidationSchema(yup.object().shape(schema));\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [columns]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!columnSizingInfo?.isResizingColumn) {\r\n\t\t\tupdatePageInfo({ column_sizes: { ...activePage.column_sizes, ...columnSizing } })\r\n\t\t\thandleColumnResizing?.(columnSizing)\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [columnSizingInfo?.isResizingColumn, columnSizing])\r\n\r\n\tconst handleHeaderClick = (event: any) => {\r\n\t\tsetAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleHeaderClose = () => {\r\n\t\tsetAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleVisibleColumn = (column: any) => {\r\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\tvisible: col.accessorKey === column.accessorKey ? false : col.visible\r\n\t\t}));\r\n\t\tsetTableColumns(updatedColumns);\r\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\r\n\t\tsetFilteredOptions([...filteredOptions, column]);\r\n\t\tsetAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleAddButtonClick = () => {\r\n\t\tsetPopupShow(true);\r\n\t};\r\n\r\n\tconst handleBackButtonClick = () => {\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleAddColumn = (column: any) => {\r\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\tvisible: col.accessorKey === column.accessorKey ? true : col.visible\r\n\t\t}));\r\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\r\n\t\tsetTableColumns(updatedColumns);\r\n\r\n\t\tconst updatedFilteredOptions = filteredOptions.filter(\r\n\t\t\t(option: any) => option.accessorKey !== column.accessorKey\r\n\t\t);\r\n\t\tsetFilteredOptions(updatedFilteredOptions);\r\n\t\tsetAnchorEl(null);\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleSearchEvent = (searchQuery: string) => {\r\n\t\tconst filteredColumns = hiddenColumns.filter((option: any) =>\r\n\t\t\toption.header.toLowerCase().includes(searchQuery.toLowerCase())\r\n\t\t);\r\n\t\tsetFilteredOptions(filteredColumns);\r\n\t};\r\n\r\n\tconst handleCustomAddColumn = () => {\r\n\t\tnavigate(path, { state: formData })\r\n\t\tsetAnchorEl(null);\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleRowClick = (rowId: number) => {\r\n\t\tsetSelectedRow(rowId); // Update selected row ID when a row is clicked\r\n\t};\r\n\r\n\tconst handlePreviewClick = (row: MRT_RowData) => {\r\n\t\thandlePreview?.(row);\r\n\t};\r\n\r\n\t// const handleDeleteClick = (event: any, data: any) => {\r\n\t// onDelete?.(data.id);\r\n\t// };\r\n\t// const handleUpdateClick = (event: any, data: any) => {\r\n\t// onUpdate?.(data.id);\r\n\t// };\r\n\r\n\tconst handleActionsClick = (event: any, data: any) => {\r\n\t\tsetRow(data);\r\n\t\tsetRowAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleActionsClose = () => {\r\n\t\tsetRowAnchorEl(null);\r\n\t};\r\n\r\n\tconst formtValues = (values: any, cells: any[]) => {\r\n\t\tconst v: any = {};\r\n\t\tObject.keys(values).forEach((vl) => {\r\n\t\t\tconst val = values[vl];\r\n\t\t\tv[vl] = val;\r\n\t\t\tconst cell = cells.find((c) => c.accessorKey == vl);\r\n\t\t\tif (val) {\r\n\t\t\t\tif (val instanceof File) {\r\n\t\t\t\t\tv[vl] = val.name;\r\n\t\t\t\t}\r\n\t\t\t\tif (cell && cell?.editVariant == 'date') {\r\n\t\t\t\t\tv[vl] = dayjs(val).format(cell?.dateFormat || 'DD-MM-YYYY');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn v;\r\n\t};\r\n\r\n\tconst handleRowDelete = async () => {\r\n\t\tsetIsDeletingRow(true);\r\n\t\tif (rowToDelete) {\r\n\t\t\tawait onDeleteRow?.(rowToDelete);\r\n\t\t\tsetRowToDelete(null);\r\n\t\t}\r\n\t\tsetIsDeletingRow(false);\r\n\t};\r\n\r\n\tconst checkRequired = useCallback((editProperties: any) => {\r\n\t\treturn editProperties?.validations?.some((validation: any) => validation.type === 'required')\r\n\t}, [])\r\n\tuseEffect(() => {\r\n\t\tconst selectedRows = {};\r\n\t\t// Build the selectedRows object\r\n\t\tif (!isChecked && selectedRowIds.length) {\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tif (selectedRowIds.includes(row.id)) {\r\n\t\t\t\t\tselectedRows[row.id] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsetRowSelection(selectedRows);\r\n\t\t\tsetIsChecked(true)\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [rows, selectedRowIds]); // Dependency only on rows and selectedRowIds\r\n\r\n\tuseEffect(() => {\r\n\t\tif (onSortingChange instanceof Function) {\r\n\t\t\tconst sortingArray = Array.isArray(sorting) ? sorting : [];\r\n\t\t\tonSortingChange(sortingArray[0] || null)\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [sorting])\r\n\r\n\r\n\tconst resetRowSelection = () => {\r\n\t\tsetRowSelection({});\r\n\t\tsetDisableNextEdit(false)\r\n\t}\r\n\tconst getTextWidth = (text: string) => {\r\n\t\tconst canvas = document.createElement(\"canvas\");\r\n\t\tconst ctx = canvas.getContext(\"2d\");\r\n\t\tif (!ctx) return 50;\r\n\t\treturn ctx.measureText(text).width + 5; // padding\r\n\t}\r\n\tconst table = useMaterialReactTable({\r\n\t\t// options:{\r\n\t\t// \ttableLayout: \"auto\", // 👈 important\r\n\t\t// \tpadding: \"dense\",\r\n\t\t// },\r\n\t\t// columns: visibleColumns,\r\n\t\tdefaultColumn: {\r\n\t\t\tminSize: 0, // 👈 remove default min width\r\n\t\t\tsize: undefined, // 👈 optional, default size\r\n\t\t},\r\n\t\tcolumns: [\r\n\t\t\t...visibleColumns.map((c: any) => {\r\n\t\t\t\tconst headerWidth = getTextWidth(c.header || '');\r\n\t\t\t\tconst maxCellWidth = Math.max(\r\n\t\t\t\t\t...rows.map(row => getTextWidth(String(row[c.accessorKey] ?? '')))\r\n\t\t\t\t);\r\n\t\t\t\tconst finalWidth = Math.max(headerWidth, maxCellWidth);\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...c,\r\n\t\t\t\t\t...(editDisplayMode === 'row'\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\tEdit: ({ cell, row, table, column }) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<InlineEditFields\r\n\t\t\t\t\t\t\t\t\t\tcell={cell}\r\n\t\t\t\t\t\t\t\t\t\tcolumn={column}\r\n\t\t\t\t\t\t\t\t\t\tcol={c}\r\n\t\t\t\t\t\t\t\t\t\trow={row}\r\n\t\t\t\t\t\t\t\t\t\ttable={table}\r\n\t\t\t\t\t\t\t\t\t\tcallback={(s) => console.log('Save', s)}\r\n\t\t\t\t\t\t\t\t\t\terrors={validationErrors}\r\n\t\t\t\t\t\t\t\t\t\tvalidationSchema={validationSchema}\r\n\t\t\t\t\t\t\t\t\t\tsetValidationErrors={setValidationErrors}\r\n\t\t\t\t\t\t\t\t\t\tonChangeRowField={onChangeRowField}\r\n\t\t\t\t\t\t\t\t\t\tgetSelectedData={(name, row) => getSelectedData?.(name, row)}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t: {}),\r\n\t\t\t\t\tHeader: (\r\n\t\t\t\t\t\t<Box display='flex' alignItems='center'>\r\n\t\t\t\t\t\t\t{c.header}\r\n\t\t\t\t\t\t\t{c?.required || checkRequired(c?.editProperties) && (\r\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\r\n\t\t\t\t\t\t\t\t\t*\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t),\r\n\t\t\t\t\tenableColumnDragging: c.id !== 'actions',\r\n\t\t\t\t\t// cellStyle: { ...c.cellStyle, width: finalWidth },\r\n\t\t\t\t\t// headerStyle: { ...c.headerStyle, width: finalWidth },\r\n\t\t\t\t\t// size: finalWidth\r\n\t\t\t\t\tsize: undefined,\r\n\t\t\t\t\t// minSize: 40,\r\n\t\t\t\t\tmaxSize: 800,\r\n\t\t\t\t};\r\n\t\t\t}),\r\n\t\t\t...(showPreview ? [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 'preview',\r\n\t\t\t\t\tenableEditing: false,\r\n\t\t\t\t\tsize: 70,\r\n\t\t\t\t\theader: (\r\n\t\t\t\t\t\t<IconButton size=\"small\" sx={{ ml: '20px', '&:hover': { backgroundColor: 'transparent' } }}>\r\n\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\r\n\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t),\r\n\t\t\t\t\tenableColumnDragging: false,\r\n\t\t\t\t\tvisible: true,\r\n\t\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\t\tclassName: 'pinned-column',\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\twhiteSpace: 'pre-wrap'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tCell: (props) =>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tsize=\"small\"\r\n\t\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\t\tonClick={() => handlePreviewClick(props.row.original)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tPreview\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t}\r\n\t\t\t] : []),\r\n\t\t\t...(!disableDefaultActionColumn\r\n\t\t\t\t? [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 'actions',\r\n\t\t\t\t\t\tenableEditing: false,\r\n\t\t\t\t\t\tsize: defaultActionColumnItems?.length > 1 ? 80 : 50,\r\n\t\t\t\t\t\theader: (\r\n\t\t\t\t\t\t\t<IconButton size=\"small\" sx={{ p: 0.5, '&:hover': { backgroundColor: 'transparent' } }} onClick={handleHeaderClick}>\r\n\t\t\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\tenableColumnDragging: false,\r\n\t\t\t\t\t\tvisible: true,\r\n\t\t\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tCell: (props) =>\r\n\t\t\t\t\t\t\tdefaultActionColumnItems?.length ? (\r\n\t\t\t\t\t\t\t\tdefaultActionColumnItems.map((item) => {\r\n\t\t\t\t\t\t\t\t\tconst updatedProps = {\r\n\t\t\t\t\t\t\t\t\t\t...item.props,\r\n\t\t\t\t\t\t\t\t\t\tonClick: () => item.props.onClick(props)\r\n\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\treturn cloneElement(item, updatedProps);\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t) : !disabledDefaultActionColumnIcon && (\r\n\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleActionsClick(e, props.row.original)} disabled={!rowActionMenu?.length && !destructiveActionMenu?.length}>\r\n\t\t\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t\t: [])\r\n\t\t],\r\n\t\tdata: rows,\r\n\t\tmuiTableContainerProps: {\r\n\t\t\tsx: {\r\n\t\t\t\t...(disableMaxHeight && { maxHeight: 'none !important' }),\r\n\t\t\t},\r\n\t\t},\r\n\t\tmuiTablePaperProps: {\r\n\t\t\tsx: {\r\n\t\t\t\ttableLayout: 'auto', // lets columns shrink to fit content\r\n\t\t\t},\r\n\t\t},\r\n\t\tcolumnResizeMode: 'onChange',\r\n\t\tonEditingRowSave: async (data) => {\r\n\t\t\ttry {\r\n\t\t\t\tawait validationSchema.validate(data.values, {\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t});\r\n\t\t\t\tsetValidationErrors({});\r\n\t\t\t\tsetIsEditingRow(true);\r\n\t\t\t\tsetDisableNextEdit(false)\r\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\r\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\r\n\r\n\t\t\t\tif (onEditRow) {\r\n\t\t\t\t\tawait onEditRow(data, 'edit');\r\n\t\t\t\t}\r\n\t\t\t\tsetIsEditingRow(false);\r\n\t\t\t\tdata.table.setEditingRow(null);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tsetIsEditingRow(false);\r\n\t\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\t\tconst errors: Record<string, string> = {};\r\n\r\n\t\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\t\terrors[error.path] = error.message;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetValidationErrors(errors);\r\n\t\t\t\t} else if (err instanceof Error) {\r\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonCreatingRowSave: async (data) => {\r\n\t\t\ttry {\r\n\t\t\t\tawait validationSchema.validate(data.values, {\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t});\r\n\t\t\t\tsetValidationErrors({});\r\n\t\t\t\tsetIsCreatingRow(true);\r\n\t\t\t\tsetDisableNextEdit(false)\r\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\r\n\r\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\r\n\r\n\t\t\t\tif (onCreateRow) {\r\n\t\t\t\t\tawait onCreateRow(data);\r\n\t\t\t\t}\r\n\t\t\t\tsetIsCreatingRow(false);\r\n\t\t\t\tdata.table.setCreatingRow(null);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tsetIsCreatingRow(false);\r\n\t\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\t\tconst errors: Record<string, string> = {};\r\n\r\n\t\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\t\terrors[error.path] = error.message;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetValidationErrors(errors);\r\n\t\t\t\t} else if (err instanceof Error) {\r\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonCreatingRowCancel: () => resetRowSelection(),\r\n\t\tonEditingRowCancel: () => resetRowSelection(),\r\n\t\tonSortingChange: states?.sorting ? onSortingChange : setSorting,\r\n\r\n\t\tdisplayColumnDefOptions: {\r\n\t\t\t'mrt-row-actions': {\r\n\t\t\t\t// size: onDeleteRow ? 80 : 50,\r\n\r\n\t\t\t\tHeader: (\r\n\t\t\t\t\t<IconButton onClick={handleHeaderClick} size='small'>\r\n\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\r\n\t\t\t\t\t</IconButton>\r\n\t\t\t\t),\r\n\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t'& .MuiBox-root': {\r\n\t\t\t\t\t\t\tgap: 0\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tonKeyUp: (e) => console.log(e)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t'mrt-row-expand': {\r\n\t\t\t\tsize: 70, // Set the size of the expand-collapse arrow column here\r\n\t\t\t},\r\n\t\t\t'mrt-row-select': {\r\n\t\t\t\tsize: 50, // Set the width of the checkbox column here\r\n\t\t\t},\r\n\t\t},\r\n\t\trenderRowActions: ({ row, table }) => (\r\n\t\t\t<>\r\n\t\t\t\t{rest?.enableExpanding ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{row?.parentId && (\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\r\n\t\t\t\t\t\t\t\t<Tooltip title='Edit'>\r\n\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => {\r\n\t\t\t\t\t\t\t\t\t\ttable.setEditingRow(row)\r\n\t\t\t\t\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t} size='small'>\r\n\t\t\t\t\t\t\t\t\t\t<Edit fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t\t{onDeleteRow && (\r\n\t\t\t\t\t\t\t\t\t<Tooltip title='Delete'>\r\n\t\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)} size='small'>\r\n\t\t\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\r\n\t\t\t\t\t\t<Tooltip title='Edit'>\r\n\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => {\r\n\t\t\t\t\t\t\t\ttable.setEditingRow(row)\r\n\t\t\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t<Edit fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t{onDeleteRow && (\r\n\t\t\t\t\t\t\t<Tooltip title='Delete'>\r\n\t\t\t\t\t\t\t\t<IconButton onClick={() => setRowToDelete(row)}>\r\n\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</>\r\n\t\t),\r\n\r\n\t\t...(Boolean(enableRowCreate) && {\r\n\t\t\trenderBottomToolbarCustomActions: ({ table }) => (\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\tstartIcon={<Add />}\r\n\t\t\t\t\tclassName='add-row-btn'\r\n\t\t\t\t\tdisabled={disableNextEdit}\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\ttable.setCreatingRow(true); //simplest way to open the create row modal with no default values\r\n\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t</Button>\r\n\t\t\t)\r\n\t\t}),\r\n\t\tonRowSelectionChange: setRowSelection,\r\n\t\tenableColumnOrdering: true,\r\n\t\tenableRowSelection: enableRowSelection ?? true,\r\n\t\tenableEditing: enableEditing instanceof Function ? enableEditing() : enableEditing ?? true,\r\n\t\teditDisplayMode: editDisplayMode ?? 'cell',\r\n\t\tcreateDisplayMode: 'row',\r\n\t\tenableColumnResizing: enableColumnResizing,\r\n\t\tenableRowDragging: enableRowDragging,\r\n\t\tenableTopToolbar: false,\r\n\t\tenableColumnActions: false,\r\n\t\tenableSorting: true,\r\n\t\tenableGrouping: true,\r\n\t\tenableBottomToolbar: enableBottomToolbar ?? false,\r\n\t\tenableColumnDragging: enableColumnDragging ?? true,\r\n\t\tenableStickyHeader: true,\r\n\t\tenableSortingRemoval: false,\r\n\t\t// column ordering\r\n\t\tstate: {\r\n\t\t\t// columnOrder: (!columnOrder || columnOrder.length <= 1) \r\n\t\t\t// ? [...internalColumnOrder] \r\n\t\t\t// : [...columnOrder],\r\n\t\t\tcolumnOrder: columnOrder,\r\n\t\t\tcolumnPinning: { left: ['actions', 'mrt-row-actions'] },\r\n\t\t\tisSaving: isCreatingRow || isEditingRow,\r\n\t\t\tshowProgressBars: false,\r\n\t\t\trowSelection,\r\n\t\t\t...states,\r\n\t\t\tsorting: Array.isArray(states?.sorting) ? states?.sorting :\r\n\t\t\t\tArray.isArray(sorting) ? sorting : [],\r\n\t\t\tcolumnSizing\r\n\r\n\t\t},\r\n\t\tgetRowId: (row) => row?.id,\r\n\t\t// table.getState().editingRow\r\n\t\tmuiTableBodyRowProps: ({ row }) => {\r\n\t\t\tconst editingRowId =\r\n\t\t\t\ttable.getState()?.editingRow?.id ||\r\n\t\t\t\ttable.getState()?.creatingRow?.id ||\r\n\t\t\t\tnull;\r\n\t\t\tconst isErrorRow = Boolean(row?.original?.has_error)\r\n\t\t\treturn {\r\n\t\t\t\tonClick: () => handleRowClick(row.id),\r\n\t\t\t\tsx: {\r\n\t\t\t\t\tcursor: 'pointer',\r\n\t\t\t\t\t// backgroundColor: !editingRowId\r\n\t\t\t\t\t// \t? (selectedRow === row.id\r\n\t\t\t\t\t// \t\t? '#e8e8e8'\r\n\t\t\t\t\t// \t\t: (isErrorRow ? 'theme.error.100' : 'inherit'))\r\n\t\t\t\t\t// \t: 'inherit',\r\n\t\t\t\t\tbackgroundColor: !editingRowId\r\n\t\t\t\t\t\t? (isErrorRow ? 'theme.error.100' : 'inherit')\r\n\t\t\t\t\t\t: 'inherit',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tbackgroundColor: editingRowId ? 'transparent' : (isErrorRow ? 'theme.error.200' : '#e8e8e8') // Removes hover effect globally\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'&:hover td:after': {\r\n\t\t\t\t\t\tbackgroundColor: 'transparent' // Removes the grey background applied via :after\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\t\tonColumnOrderChange: (colOrder: any) => {\r\n\t\t\tif (handleColumnOrdering) handleColumnOrdering(colOrder);\r\n\t\t},\r\n\t\tonColumnSizingChange: setColumnSizing,\r\n\t\tonColumnSizingInfoChange: setColumnSizingInfo,\r\n\r\n\t\trenderEmptyRowsFallback: () => (\r\n\t\t\t<Box className='no-data'>\r\n\t\t\t\t<img src={images.common.tableNoData} />\r\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t{/* sx={{ textAlign: 'center', pb: 4.75, pt: 4.75 }}> */}\r\n\t\t\t\t\t{t('common.noData')}\r\n\t\t\t\t</Typography>\r\n\t\t\t</Box>\r\n\t\t),\r\n\r\n\t\t// pagination\r\n\t\tenablePagination: enablePagination,\r\n\t\tpaginationDisplayMode: 'pages',\r\n\t\tmuiPaginationProps: {\r\n\t\t\tshape: 'rounded',\r\n\t\t\tpage: pageNo, // current page number\r\n\t\t\tcount: totalPages, // total pages\r\n\t\t\tshowRowsPerPage: false, // Hide rows per page options\r\n\t\t\tboundaryCount: 3\r\n\t\t},\r\n\r\n\t\tmuiEditTextFieldProps: ({ row, column }) => ({\r\n\t\t\tInputProps: {\r\n\t\t\t\tdisableUnderline: true\r\n\t\t\t},\r\n\t\t\tonBlur: (e) => {\r\n\t\t\t\tupdateData(e.target.value, column, row.id);\r\n\t\t\t},\r\n\t\t\t// onChange: (e) => {\r\n\t\t\t// \tupdateData(e.target.value, column, row.id);\r\n\t\t\t// },\r\n\t\t\tvariant: 'outlined',\r\n\t\t\tsx: ({ palette }) => ({\r\n\t\t\t\t'& .MuiOutlinedInput-root': {\r\n\t\t\t\t\t'& fieldset': {\r\n\t\t\t\t\t\tborderColor: `${palette.theme?.primary[700]} !important`\r\n\t\t\t\t\t\t// backgroundColor: palette.theme?.primary[700]\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}),\r\n\r\n\t\t/* Table loader style */\r\n\t\tmuiCircularProgressProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: '#289B64'\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Table header cell default styles\r\n\t\tmuiTableHeadCellProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tlineHeight: '140%',\r\n\t\t\t\tletterSpacing: '-0.28px',\r\n\t\t\t\tfontWeight: '500',\r\n\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t'& .Mui-TableHeadCell-Content': {\r\n\t\t\t\t\theight: '100%'\r\n\t\t\t\t},\r\n\t\t\t\t'& .Mui-TableHeadCell-Content-Labels': {\r\n\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\tjustifyContent: 'space-between'\r\n\t\t\t\t},\r\n\t\t\t\t'&.pinned-column': {\r\n\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t},\r\n\t\t\t\t'& .Mui-TableHeadCell-ResizeHandle-Wrapper': {\r\n\t\t\t\t\tpadding: 0,\r\n\t\t\t\t\tmargin: 0,\r\n\t\t\t\t\tright: '-5px',\r\n\t\t\t\t\topacity: 0\r\n\t\t\t\t},\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Table body cell default styles\r\n\t\tmuiTableBodyProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tzIndex: 500\r\n\t\t\t}\r\n\t\t},\r\n\t\tmuiTableHeadProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tzIndex: 600\r\n\t\t\t}\r\n\t\t},\r\n\t\tmuiTableBodyCellProps: (/* { cell, column, table , row } */) => ({\r\n\t\t\tsx: {\r\n\t\t\t\tlineHeight: '140%',\r\n\t\t\t\tletterSpacing: '-0.26px',\r\n\t\t\t\tfontWeight: '400',\r\n\t\t\t\tfontSize: '0.8125rem',\r\n\t\t\t\t'&.pinned-column': {\r\n\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t},\r\n\t\t\t\t'&:hover': {\r\n\t\t\t\t\tbackgroundColor: 'transparent' // Removes hover effect globally\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// onClick: () => {\r\n\t\t\t// \ttable.setEditingCell(cell); //set editing cell\r\n\t\t\t// \tqueueMicrotask(() => {\r\n\t\t\t// \t\tconst textField = table.refs.editInputRefs.current[column.id];\r\n\t\t\t// \t\tif (textField) {\r\n\t\t\t// \t\t\ttextField.focus();\r\n\t\t\t// \t\t\ttextField.select?.();\r\n\t\t\t// \t\t}\r\n\t\t\t// \t});\r\n\t\t\t// }\r\n\t\t\t// onKeyDown: (event) => {\r\n\t\t\t// \tif (event.key === 'Tab') {\r\n\t\t\t// \t\ttry {\r\n\t\t\t// \t\t\t\t// if (column.columnDef.editVariant === 'select') {\r\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id]?.node?.blur();\r\n\t\t\t// \t\t\t\t// } else {\r\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id].blur();\r\n\t\t\t// \t\t\t\t// }\r\n\r\n\t\t\t// \t\t\tconst rowIdx = row.index;\r\n\t\t\t// \t\t\tconst colIdx = columns.findIndex(\r\n\t\t\t// \t\t\t\t(col) => col.accessorKey === column.id\r\n\t\t\t// \t\t\t);\r\n\t\t\t// \t\t\tconst newColIdx = colIdx + 1;\r\n\t\t\t// \t\t\tconst clm = columns[newColIdx];\r\n\t\t\t// \t\t\tconst nextCell = row\r\n\t\t\t// \t\t\t\t.getAllCells()\r\n\t\t\t// \t\t\t\t.find((cl) => (cl.id = `${rowIdx}_${clm.accessorKey}`));\r\n\r\n\t\t\t// \t\t\tif (nextCell) {\r\n\t\t\t// \t\t\t\t// updateData(event.target.value, column, row.id);\r\n\t\t\t// \t\t\t\ttable.setEditingCell(nextCell);\r\n\t\t\t// \t\t\t\tqueueMicrotask(() => {\r\n\t\t\t// \t\t\t\t\tconst textField = table.refs.editInputRefs.current[column.id];\r\n\t\t\t// \t\t\t\t\tif (textField) {\r\n\t\t\t// \t\t\t\t\t\ttextField.focus();\r\n\t\t\t// \t\t\t\t\t\ttextField.select?.();\r\n\t\t\t// \t\t\t\t\t}\r\n\t\t\t// \t\t\t\t});\r\n\t\t\t// \t\t\t}\r\n\t\t\t// \t\t} catch (error) {\r\n\t\t\t// \t\t}\r\n\t\t\t// \t}\r\n\t\t\t// },\r\n\t\t\t// onBlur: () => {\r\n\t\t\t// \ttable.setEditingCell(null);\r\n\t\t\t// }\r\n\t\t}),\r\n\r\n\t\t// Checkbox styling\r\n\t\tmuiSelectCheckboxProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: 'theme.secondary.300',\r\n\t\t\t\t'&.Mui-checked': {\r\n\t\t\t\t\tcolor: 'theme.primary.600',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tcolor: 'theme.primary.500'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t'&.Mui-disabled': {\r\n\t\t\t\t\tcolor: 'theme.secondary.200'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\r\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\r\n\t\t},\r\n\t\tmuiSelectAllCheckboxProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: 'theme.secondary.300',\r\n\t\t\t\t'&.Mui-checked': {\r\n\t\t\t\t\tcolor: 'theme.primary.600',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tcolor: 'theme.primary.500'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t'&.Mui-disabled': {\r\n\t\t\t\t\tcolor: 'theme.secondary.600'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\r\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\r\n\t\t},\r\n\t\tmuiBottomToolbarProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tboxShadow: 'none',\r\n\t\t\t\t'& .MuiBox-root': {\r\n\t\t\t\t\tpaddingLeft: 0\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tlayoutMode: 'grid',\r\n\t\ticons: {\r\n\t\t\tArrowDownwardIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<ArrowUpDown fontSize='medium' {...props} />\r\n\t\t\t),\r\n\t\t\tSortIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<ArrowUpDown fontSize='medium' {...props} />\r\n\t\t\t),\r\n\t\t\tSyncAltIcon: () => <ArrowUpDown fontSize='medium' />,\r\n\t\t\tCancelIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<Close fontSize='small' {...props} sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t),\r\n\t\t\tSaveIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<Save {...props} fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t)\r\n\t\t},\r\n\r\n\t\t...rest\r\n\t});\r\n\r\n\tuseEffect(() => {\r\n\t\tif (enableRowSelection) {\r\n\t\t\tif (table?.getSelectedRowModel()?.rows) {\r\n\t\t\t\tSetSelectedRowId?.(table?.getSelectedRowModel()?.rows);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [enableRowSelection]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (onSelectRow) {\r\n\t\t\tif (rest?.enableExpanding) {\r\n\t\t\t\tconst selectedRowModels: any[] = [];\r\n\t\t\t\tconst selection = table.getState().rowSelection; // e.g., { 0.0: true }\r\n\t\t\t\tconst traverseRows = (rows, parentKey = '') => {\r\n\t\t\t\t\trows.forEach((row, index) => {\r\n\t\t\t\t\t\tconst rowKey = parentKey ? `${parentKey}.${index}` : `${row.id}`;\r\n\t\t\t\t\t\tif (selection[rowKey]) {\r\n\t\t\t\t\t\t\tselectedRowModels.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check for sub-rows and traverse further\r\n\t\t\t\t\t\tif (row.subRows?.length) {\r\n\t\t\t\t\t\t\ttraverseRows(row.subRows, rowKey);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\r\n\t\t\t\ttraverseRows(table.getRowModel().rows);\r\n\t\t\t\tonSelectRow(selectedRowModels, rowSelection);\r\n\t\t\t} else {\r\n\t\t\t\tonSelectRow(table.getSelectedRowModel().rows, rowSelection);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [rowSelection, table]);\r\n\r\n\t// useEffect(() => {\r\n\t// \tconst relativeContainer = document.getElementsByClassName(\r\n\t// \t\t'MuiTableContainer-root'\r\n\t// \t)[0];\r\n\t// \tconst fixedElement = document.getElementsByClassName('no-data')[0];\r\n\t// \trelativeContainer.addEventListener('scroll', () => {\r\n\t// \t\tconst scrollLeft = relativeContainer.scrollLeft;\r\n\t// \t\tfixedElement.style.left = `${scrollLeft + 100}px`;\r\n\t// \t});\r\n\t// }, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isResetRow) {\r\n\t\t\ttable?.resetRowSelection();\r\n\t\t}\r\n\t}, [isResetRow, table]);\r\n\treturn (\r\n\t\t<TableWrapper className='MRT-TableWrapper custom-table' disableMaxHeight={disableMaxHeight}>\r\n\t\t\t<MaterialReactTable table={table} />\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tanchorEl={anchorEl}\r\n\t\t\t\topen={Boolean(anchorEl)}\r\n\t\t\t\tonClose={handleHeaderClose}\r\n\t\t\t\tclassName='add-role-drp'>\r\n\t\t\t\t{popUpShow ? (\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tonClick={handleBackButtonClick}\r\n\t\t\t\t\t\t\tclassName='role-drp-list add-column-title'>\r\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t<ChevronLeftIcon />\r\n\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\r\n\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<div className='searchbar-box-list'>\r\n\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\tplaceholder={'Search User'}\r\n\t\t\t\t\t\t\t\thandleSearch={(e) => handleSearchEvent(e)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className='all-attribute-title'>\r\n\t\t\t\t\t\t\t<Typography variant='body2' color='text.secondary'>\r\n\t\t\t\t\t\t\t\t{t('common.allAttributes_label')}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t{filteredOptions.map((column: any) => (\r\n\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\r\n\t\t\t\t\t\t\t\tonClick={() => handleAddColumn(column)}>\r\n\t\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s3'>\r\n\t\t\t\t\t\t\t\t\t{column.header}\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tenableAddCustomField && <MenuItem onClick={handleCustomAddColumn} className='role-drp-list'>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t\t{t('common.addCustomField_label')}\r\n\t\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{visibleColumns.map((column: any) => (\r\n\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\r\n\t\t\t\t\t\t\t\tonClick={() => handleVisibleColumn(column)}\r\n\t\t\t\t\t\t\t\tclassName='role-drp-list'>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.dotsIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t\t<ListItemText className='title'>{column.header}</ListItemText>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='eye-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<MenuItem onClick={handleAddButtonClick} className='role-drp-list'>\r\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\r\n\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\tvariant='body2'\r\n\t\t\t\t\t\t\t\tcolor='text.secondary'\r\n\t\t\t\t\t\t\t\tclassName='eye-icon'>\r\n\t\t\t\t\t\t\t\t<ChevronRightIcon sx={{ fontSize: '1.25rem !important' }} />\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t</Menu>\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tanchorEl={rowAnchorEl}\r\n\t\t\t\topen={Boolean(rowAnchorEl)}\r\n\t\t\t\tonClose={handleActionsClose}>\r\n\t\t\t\t{rowActionMenu?.map((option: any) => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(option.label === 'Move' &&\r\n\t\t\t\t\t\t\t(row?.is_directory === true || row?.is_directory === 1)) ||\r\n\t\t\t\t\t\t(option.label === 'Download' &&\r\n\t\t\t\t\t\t\t(row?.is_directory === true ||\r\n\t\t\t\t\t\t\t\trow?.is_directory === 1 ||\r\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === true ||\r\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === 1))\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\t// return null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tonClick={async () => {\r\n\t\t\t\t\t\t\t\tawait option.handleAction(row);\r\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t? option.disabled(row)\r\n\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{option?.icon}\r\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t\t{destructiveActionMenu?.length > 0 &&\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<div className='dropdown-inner--DestructiveHeader'>\r\n\t\t\t\t\t\t\t{destructiveActionMenu?.map((option: any) => (\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\toption.handleAction(row);\r\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'\r\n\t\t\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled(row)\r\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</>\r\n\t\t\t\t}\r\n\t\t\t</Menu>\r\n\t\t\t<ConfirmPopUp\r\n\t\t\t\topen={Boolean(rowToDelete)}\r\n\t\t\t\tonClose={() => setRowToDelete(null)}\r\n\t\t\t\tonConfirm={() => handleRowDelete()}\r\n\t\t\t\ttitle='Delete Item'\r\n\t\t\t\tdescription={`Are you sure you want to delete entry ?`}\r\n\t\t\t\tloading={isDeletingRow}\r\n\t\t\t/>\r\n\t\t</TableWrapper>\r\n\t);\r\n});\r\n\r\nexport default MaterialTable;","import React from 'react';\r\nimport { Box, CircularProgress, CircularProgressProps } from '@mui/material';\r\nimport { styled } from '@mui/material/styles';\r\n\r\nconst Loader = styled(CircularProgress)(({ theme }) => ({\r\n\tcolor: theme.palette?.theme.primary[500]\r\n}));\r\n\r\nconst LoaderContainer = styled(Box)(() => ({\r\n\tposition: 'absolute',\r\n\tdisplay: 'flex',\r\n\twidth: '100%',\r\n\theight: '100%',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tbackgroundColor: '#ffffff96',\r\n\tzIndex: 3,\r\n\tleft: 0,\r\n\ttop: 0\r\n}));\r\n\r\nconst ModalLoader = (props: CircularProgressProps) => {\r\n\treturn (\r\n\t\t<LoaderContainer>\r\n\t\t\t<Loader size={50} {...props} />\r\n\t\t</LoaderContainer>\r\n\t);\r\n};\r\n\r\nexport { ModalLoader };\r\nexport default ModalLoader;\r\n","import { Box, DialogActions, DialogContent, DialogTitle, Divider, Grid, IconButton } from \"@mui/material\";\r\nimport Modal from '../modal/modal';\r\nimport Typography from \"../typography/typography\";\r\nimport DynamicInput from '../form-control/form-builder/form-builder-element/text';\r\nimport DynamicRadioButton from '../form-control/form-builder/form-builder-element/radio-button';\r\nimport { useForm, useWatch } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { generateValidationSchema, generateValidationSchema1 } from \"./validator\";\r\nimport DynamicSearchSelect from \"../form-control/form-builder/form-builder-element/dynamic-select\";\r\nimport DynamicPhone from '@/components/form-control/form-builder/form-builder-element/phone';\r\nimport Accordion from \"../accordion/accordion\";\r\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\r\nimport _ from \"lodash\";\r\nimport './parties-modal.scss';\r\nimport { useAccountingSetting } from \"../../hooks/useAccountSetting\";\r\nimport { useAuth } from '../../hooks/useAuth';\r\nimport {\r\n addressColumns,\r\n addressOmitKeys,\r\n addressPayload,\r\n contactColumns,\r\n contactOmitKeys,\r\n contactPayload,\r\n PARTIES_FIELDS,\r\n PARTIES_FORM_ARRAY_NAME,\r\n partyType,\r\n processPartiesPayload\r\n} from \"./utils/constant\";\r\nimport MaterialTable from \"../material-table/material-table\";\r\nimport parsePhoneNumberFromString from \"libphonenumber-js\";\r\nimport Checkbox from \"../checkbox/checkbox\";\r\nimport { transformTableColumns } from \"../../utils/common-utility\";\r\nimport { createParties } from \"../../redux/actionCreator\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { getErrorMessage } from \"../../utils/common\";\r\nimport ModalLoader from \"../loaders/modal-loader\";\r\nimport Button from \"../button/button\";\r\nimport { Close } from \"@mui/icons-material\";\r\n\r\ninterface CustomerVendorModalProps {\r\n isOpen: boolean;\r\n handleModalClose?: () => void;\r\n modalProps?: any;\r\n type?: string;\r\n partyCreated?: () => void;\r\n isLoading?: boolean;\r\n onSave?: (payload: any) => Promise<void>;\r\n setIsOpen?: (value: boolean) => void;\r\n}\r\n\r\ninterface LocationState {\r\n state: any;\r\n country: any;\r\n}\r\n\r\nconst defaultLocationState: LocationState = { state: '', country: '' };\r\n\r\nexport default function CustomerVendorModal({\r\n isOpen,\r\n handleModalClose,\r\n modalProps,\r\n type,\r\n partyCreated,\r\n isLoading,\r\n onSave,\r\n setIsOpen\r\n}: CustomerVendorModalProps) {\r\n\r\n //Hooks\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { user } = useAuth();\r\n\r\n //Refs\r\n const locationRef = useRef<LocationState>(defaultLocationState);\r\n\r\n //Local states\r\n const [addressRows, setAddressRows] = useState<any[]>([]);\r\n const [contactRows, setContactRows] = useState<any[]>([]);\r\n const [isCreating, setIsCreating] = useState(false);\r\n const [selectedCompanyData, setSelectedCompanyData] = useState<any[]>([]);\r\n\r\n //Form\r\n const {\r\n control,\r\n formState: { errors },\r\n trigger,\r\n getValues,\r\n handleSubmit,\r\n setValue,\r\n resetField,\r\n reset,\r\n watch,\r\n getFieldState\r\n\r\n } = useForm({\r\n defaultValues: {\r\n status: true,\r\n parties: {\r\n account_type: 'Company',\r\n },\r\n },\r\n mode: 'all',\r\n resolver: generateValidationSchema1()\r\n });\r\n\r\n const fieldToUpdate = {\r\n [PARTIES_FIELDS.RECEIVABLE_ACCOUNT]: 'receivable_account',\r\n [PARTIES_FIELDS.TAX_TEMPLATE]: 'default_tax',\r\n };\r\n\r\n useAccountingSetting({\r\n fieldToUpdate,\r\n companyField: PARTIES_FIELDS.COMPANY,\r\n fieldArrayName: PARTIES_FORM_ARRAY_NAME,\r\n formMethods: { control, setValue, watch, getFieldState },\r\n ...({ isUpdateAccount: true } as any),\r\n });\r\n\r\n\r\n const selectedType = useWatch({\r\n control,\r\n name: 'parties.account_type',\r\n });\r\n\r\n const responsiblePerson = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.RESPONSIBLE_PERSON}`,\r\n });\r\n\r\n const mainContactNo = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACT_NO}`,\r\n });\r\n\r\n const mainEmailIds = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.EMAIL_IDS}`,\r\n });\r\n\r\n //Call Back functions\r\n const tableColumns = useCallback(\r\n (columns: any, tableRows: any) => {\r\n const phoneNumberCache = new Map();\r\n\r\n return transformTableColumns({\r\n columns,\r\n currencySymbol: undefined,\r\n translationFn: t,\r\n enableFooter: false,\r\n redirectionLink: undefined,\r\n redirectionLinkState: undefined,\r\n rows: tableRows,\r\n statusClasses: undefined,\r\n customizeValue: (row, columnAccessorKey, value) => {\r\n switch (columnAccessorKey) {\r\n case 'default_shipping_address':\r\n case 'default_billing_address': {\r\n return (\r\n <Box sx={{ display: \"flex\", gap: 1 }}>\r\n <Checkbox\r\n checked={Boolean(value)}\r\n sx={{ pointerEvents: 'none' }}\r\n />\r\n </Box>\r\n );\r\n }\r\n\r\n case 'phone':\r\n case 'contact_no': {\r\n if (!value) return '';\r\n const phoneKey = `phone-${value}`;\r\n if (!phoneNumberCache.has(phoneKey)) {\r\n const parsed = parsePhoneNumberFromString(`+${value}`);\r\n phoneNumberCache.set(phoneKey, parsed?.nationalNumber || '');\r\n }\r\n return phoneNumberCache.get(phoneKey);\r\n }\r\n\r\n case 'country_code': {\r\n const phone = row?.original?.phone || row?.original?.contact_no;\r\n if (!phone) return '';\r\n const countryCodeKey = `country-${phone}`;\r\n if (!phoneNumberCache.has(countryCodeKey)) {\r\n const parsed = parsePhoneNumberFromString(`+${phone}`);\r\n phoneNumberCache.set(countryCodeKey,\r\n parsed?.countryCallingCode ? `+${parsed.countryCallingCode}` : ''\r\n );\r\n }\r\n return phoneNumberCache.get(countryCodeKey);\r\n }\r\n\r\n default:\r\n return value;\r\n }\r\n }\r\n });\r\n },\r\n [t]\r\n );\r\n\r\n //Methods\r\n\r\n const handleRowOperation = async (\r\n eData: any,\r\n state: any[],\r\n setState: React.Dispatch<React.SetStateAction<any[]>>,\r\n isAddress: boolean\r\n ) => {\r\n try {\r\n const { values, row } = eData;\r\n const editRow = row.index >= 0;\r\n const payload = isAddress ? addressPayload : contactPayload;\r\n\r\n const processedValues: any = {};\r\n for (const key in payload) {\r\n if (_.has(values, key)) {\r\n processedValues[key] = values?.[key] ? values[key] : null;\r\n }\r\n }\r\n\r\n if (isAddress) {\r\n const dropdowns = {\r\n c: locationRef.current?.country,\r\n s: locationRef.current?.state,\r\n };\r\n\r\n const validatedValues = await validateAddressDefaults(processedValues, state, row.index);\r\n const addressValues = {\r\n ...validatedValues,\r\n country_name: dropdowns.c?.name,\r\n country: dropdowns.c?.id,\r\n state_name: dropdowns.s?.name,\r\n state: dropdowns.s?.id,\r\n country_data: dropdowns.c,\r\n state_data: dropdowns.s,\r\n country_id: dropdowns.c?.id,\r\n state_id: dropdowns.s?.id,\r\n };\r\n\r\n if (editRow) {\r\n return setState(state.map((ar, i) => i === row.index ? { ...ar, ...addressValues } : ar));\r\n }\r\n return setState([...state, addressValues]);\r\n }\r\n\r\n if (editRow) {\r\n return setState(state.map((ar, i) => i === row.index ? { ...ar, ...processedValues } : ar));\r\n }\r\n return setState([...state, processedValues]);\r\n } catch (error) {\r\n return Promise.reject(error);\r\n }\r\n };\r\n\r\n const validateAddressDefaults = async (values: any, state: any[], index: number) => {\r\n let updatedValues = { ...values };\r\n const validate = (type: \"shipping\" | \"billing\") => {\r\n const u_data = [...state];\r\n const field = type === 'shipping' ? 'default_shipping_address' : 'default_billing_address';\r\n if (index >= 0) {\r\n u_data.splice(index, 1);\r\n }\r\n const hasDefault = u_data.some((d: any) => d?.[field]);\r\n\r\n if (hasDefault && values?.[field]) {\r\n throw new Error(\r\n `Another address is already marked as the default ${type} address. Please uncheck that before selecting this one`\r\n );\r\n }\r\n else if (!hasDefault) {\r\n updatedValues = {\r\n ...updatedValues,\r\n [field]: values?.[field] || state?.length == 0 ? 1 : 0,\r\n };\r\n }\r\n\r\n };\r\n\r\n await validate(\"shipping\");\r\n await validate(\"billing\");\r\n\r\n return updatedValues;\r\n };\r\n\r\n const deleteRow = async (\r\n state: any[],\r\n setState: React.Dispatch<React.SetStateAction<any[]>>,\r\n row: any\r\n ) => {\r\n const rowIndex = row.index;\r\n const updatedData = state.filter((_, i) => i !== rowIndex);\r\n setState(updatedData);\r\n return Promise.resolve();\r\n };\r\n\r\n const onChangeAddressTableField = async (e: any, t: any, r: any, col: any, selectedData: any) => {\r\n const fieldName = e?.target?.name;\r\n let updatedValues: any = null;\r\n\r\n if (col?.editProperties?.field_name) {\r\n locationRef.current = {\r\n ...locationRef.current,\r\n [col.editProperties.field_name]: selectedData,\r\n };\r\n }\r\n\r\n if (fieldName === 'country') {\r\n updatedValues = {\r\n ...r._valuesCache,\r\n country: selectedData.id,\r\n country_id: selectedData.id,\r\n state: null,\r\n state_id: null,\r\n state_name: null,\r\n };\r\n } else if (fieldName === 'state') {\r\n updatedValues = {\r\n ...r._valuesCache,\r\n state: selectedData.id,\r\n state_id: selectedData.id\r\n };\r\n } else if (fieldName === 'phone') {\r\n const p = parsePhoneNumberFromString(`+${e}`);\r\n updatedValues = {\r\n ...r._valuesCache,\r\n country_code: p?.countryCallingCode ? `+${p.countryCallingCode}` : '',\r\n };\r\n }\r\n\r\n const summaryFields = [\r\n 'contact_name',\r\n 'street_1',\r\n 'street_2',\r\n 'street_3',\r\n 'zip_code',\r\n 'city',\r\n 'state',\r\n 'country'\r\n ];\r\n\r\n if (r._valuesCache) {\r\n const fieldValues = summaryFields.map(field => {\r\n if (field === 'country') {\r\n return locationRef.current?.country?.name || '';\r\n } else if (field === 'state') {\r\n return locationRef.current?.state?.name || '';\r\n } else if (field === fieldName) {\r\n return e.target?.value || '';\r\n }\r\n return r._valuesCache?.[field] || '';\r\n });\r\n\r\n const summary = fieldValues.reduce((acc, val, idx) => {\r\n if (!val) return acc;\r\n if (!acc) return val;\r\n\r\n val = val?.name || val;\r\n acc = acc?.name || acc;\r\n\r\n return [2, 3].includes(idx) ? `${acc} ${val}` : `${acc}, \\n${val}`;\r\n }, '');\r\n\r\n r._valuesCache.summary = summary;\r\n }\r\n\r\n if (updatedValues) {\r\n r.getAllCells().forEach((c: any) => {\r\n if (_.has(updatedValues, c.column.id)) {\r\n r._valuesCache[c.column.id] = updatedValues[c.column.id];\r\n }\r\n });\r\n }\r\n\r\n return r._valuesCache;\r\n };\r\n\r\n\r\n\r\n const EMAIL_REGEX =\r\n /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\r\nconst onSubmit = async () => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n\r\n const values = getValues();\r\n const formValues = values?.[PARTIES_FORM_ARRAY_NAME];\r\n let emailArray: string[] = [];\r\n\r\n if (formValues?.email_ids) {\r\n emailArray = formValues?.email_ids\r\n ?.split(/\\s*,\\s*/)\r\n .map((email_id: any) => email_id?.replaceAll(',', '')?.trim())\r\n .filter((email_id: any) => email_id.match(EMAIL_REGEX));\r\n }\r\n\r\n const payload = {\r\n party: {\r\n ...processPartiesPayload(formValues),\r\n email_ids: emailArray,\r\n account_type: selectedType,\r\n status: 1,\r\n type,\r\n company_id: formValues?.[PARTIES_FIELDS.COMPANY] || null\r\n }\r\n };\r\n if (typeof onSave == 'function') {\r\n onSave?.(payload);\r\n return;\r\n }\r\n setIsCreating(true);\r\n try {\r\n\r\n const res = await dispatch(createParties(payload));\r\n\r\n if (res?.meta?.requestStatus === 'fulfilled') {\r\n enqueueSnackbar(`${type} ${t('common.party.msg.success')}`);\r\n closeModal();\r\n partyCreated();\r\n } else if (res?.meta?.requestStatus === 'rejected') {\r\n const errorMessage = getErrorMessage(res?.error?.message);\r\n enqueueSnackbar(errorMessage, { variant: 'error' });\r\n }\r\n } finally {\r\n setIsCreating(false);\r\n }\r\n };\r\n\r\n const closeModal = () => {\r\n resetForm()\r\n setAddressRows([]);\r\n setContactRows([]);\r\n handleModalClose?.();\r\n setIsOpen?.(false);\r\n }\r\n const resetForm = () => {\r\n reset();\r\n }\r\n\r\n //Use Effect\r\n useEffect(() => {\r\n const addressData = addressRows.map(a => _.omit(a, addressOmitKeys));\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.ADDRESS}`, addressData);\r\n }, [addressRows, setValue]);\r\n\r\n useEffect(() => {\r\n const contactData = contactRows.map(c => _.omit(c, contactOmitKeys));\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACTS}`, contactData);\r\n }, [contactRows, setValue]);\r\n\r\n useEffect(() => {\r\n setIsCreating(isLoading)\r\n }, [isLoading]);\r\n\r\n\r\n useEffect(() => {\r\n if (selectedType === 'Individual') {\r\n // Clear Company fields\r\n resetField('parties.company_name');\r\n resetField('parties.vat_number');\r\n resetField('parties.crn');\r\n }\r\n\r\n if (selectedType === 'Company') {\r\n // Clear Individual fields\r\n resetField('parties.first_name');\r\n resetField('parties.last_name');\r\n }\r\n }, [selectedType, resetField]);\r\n\r\n// Pre-fill company and currency from user data when modal opens\r\nuseEffect(() => {\r\n\t\tif (isOpen && user?.company_data) {\r\n\t\t\tconst companyId =\r\n\t\t\t\tuser?.entity_priority ||\r\n\t\t\t\tuser?.company_data?.id ||\r\n\t\t\t\t(Array.isArray(user?.company_data) && user?.company_data[0]?.id) ||\r\n\t\t\t\tnull;\r\n\r\n\r\n\t\t\tif (companyId) {\r\n\t\t\t\tsetValue('quotation.company_id', companyId);\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.COMPANY}`, companyId);\r\n\t\t\t}\r\n\t\t}\r\n }, [isOpen, user?.company_data, setValue]);\r\n\r\n useEffect(() => {\r\n if (isOpen && user?.company_currencies) {\r\n const currencies = Object.values(user.company_currencies);\r\n if (currencies.length > 0) {\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CURRENCY}`, [currencies[0].id]);\r\n }\r\n }\r\n }, [isOpen, user?.company_currencies , setValue]);\r\n\r\n // Auto fill first contact row\r\n useEffect(() => {\r\n const firstContactRow = contactRows[0];\r\n const parsedCountryCode = mainContactNo\r\n ? `+${parsePhoneNumberFromString(`+${mainContactNo}`)?.countryCallingCode || ''}`\r\n : '';\r\n\r\n const firstEmail = mainEmailIds\r\n ? mainEmailIds.split(/\\s*,\\s*/).map((e: string) => e.trim()).filter((e: string) => EMAIL_REGEX.test(e))[0] || ''\r\n : '';\r\n\r\n const updatedFirstRow = {\r\n name: responsiblePerson || '',\r\n contact_no: mainContactNo || '',\r\n email: firstEmail,\r\n country_code: parsedCountryCode,\r\n };\r\n\r\n if (firstContactRow) {\r\n const hasChanged = Object.keys(updatedFirstRow).some(\r\n (key) => firstContactRow[key] !== updatedFirstRow[key]\r\n );\r\n if (hasChanged) {\r\n const updatedRows = [...contactRows];\r\n updatedRows[0] = { ...updatedRows[0], ...updatedFirstRow };\r\n setContactRows(updatedRows);\r\n }\r\n } else {\r\n setContactRows([updatedFirstRow, ...contactRows]);\r\n }\r\n }, [responsiblePerson, mainContactNo, mainEmailIds]);\r\n\r\n // Auto fill first Address Row\r\n useEffect(() => {\r\n const firstRow = addressRows[0];\r\n const hasAddressDetails = firstRow?.address_type || firstRow?.street_1 || firstRow?.city;\r\n\r\n if (responsiblePerson && mainContactNo) {\r\n const parsedCountryCode = mainContactNo\r\n ? `+${parsePhoneNumberFromString(`+${mainContactNo}`)?.countryCallingCode || ''}`\r\n : '';\r\n\r\n // Create first row if doesn't exist yet\r\n if (!firstRow) {\r\n setAddressRows([{\r\n ...addressPayload,\r\n contact_name: responsiblePerson,\r\n phone: mainContactNo,\r\n country_code: parsedCountryCode,\r\n }]);\r\n return;\r\n }\r\n\r\n // Update first row ONLY if address details are not yet filled\r\n if (!hasAddressDetails) {\r\n const contactChanged = firstRow?.contact_name !== responsiblePerson;\r\n const phoneChanged = firstRow?.phone !== mainContactNo;\r\n\r\n if (contactChanged || phoneChanged) {\r\n setAddressRows(prev => prev.map((row, idx) =>\r\n idx === 0\r\n ? { ...row, contact_name: responsiblePerson, phone: mainContactNo, country_code: parsedCountryCode }\r\n : row\r\n ));\r\n }\r\n }\r\n }\r\n }, [responsiblePerson, mainContactNo]);\r\n\r\n const basicDetailsSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.basic_details\")}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid container spacing={2}>\r\n\r\n <Grid item xs={12} sm={12}>\r\n <DynamicRadioButton\r\n label=''\r\n name={PARTIES_FIELDS.TYPE}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n options={partyType}\r\n display='row'\r\n title={t(t('common.party.fields.type'))}\r\n titlePosition='start'\r\n position={2} />\r\n </Grid>\r\n\r\n {selectedType === \"Individual\" && (\r\n <>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.firstName_label')}\r\n name={PARTIES_FIELDS.FIRST_NAME}\r\n placeholder={t('common.party.fields.firstName_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.lastName_label')}\r\n name={PARTIES_FIELDS.LAST_NAME}\r\n placeholder={t('common.party.fields.lastName_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n </>\r\n )}\r\n\r\n\r\n {selectedType === \"Company\" && (\r\n <>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.company_name_label')}\r\n name={PARTIES_FIELDS.COMPANY_NAME}\r\n placeholder={t('common.party.fields.company_name_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.vat_number_label')}\r\n name={PARTIES_FIELDS.VAT_NUMBER}\r\n placeholder={t('common.party.fields.vat_number_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.crn_label')}\r\n name={PARTIES_FIELDS.CRN}\r\n placeholder={t('common.party.fields.crn_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n />\r\n </Grid>\r\n </>\r\n )}\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicPhone\r\n type=\"text\"\r\n label={t('common.party.fields.contact_label')}\r\n name={PARTIES_FIELDS.CONTACT_NO}\r\n placeholder={t('common.party.fields.contact_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.email_label')}\r\n name={PARTIES_FIELDS.EMAIL_IDS}\r\n placeholder={t('common.party.fields.email_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/*Entity Name */}\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.company_label')}\r\n apiType=\"company\"\r\n selectedLabel='Companies'\r\n name={PARTIES_FIELDS.COMPANY}\r\n placeholder={t('common.party.fields.company_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.currency_label')}\r\n apiType='currency'\r\n selectedLabel='Currency'\r\n name={PARTIES_FIELDS.CURRENCY}\r\n placeholder={t('common.party.fields.currency_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n is_multiselect\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.responsible_person_label')}\r\n name={PARTIES_FIELDS.RESPONSIBLE_PERSON}\r\n placeholder={t('common.party.fields.responsible_person_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n\r\n </Grid>\r\n </Accordion>\r\n ), [t, control, selectedType]);\r\n\r\n const accountingSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.accounting\")}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid container spacing={2}>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.receivable_account_label')}\r\n apiType=\"accounts\"\r\n selectedLabel='Account'\r\n name={PARTIES_FIELDS.RECEIVABLE_ACCOUNT}\r\n placeholder={t('common.party.fields.receivable_account_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n customeFilter={{ '&account_type.eq': 'Receivable' }}\r\n options={[]}\r\n />\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.tax_template_label')}\r\n apiType=\"taxTemplate\"\r\n selectedLabel='Tax Template'\r\n name={PARTIES_FIELDS.TAX_TEMPLATE}\r\n placeholder={t('common.party.fields.tax_template_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n ), [t, control]);\r\n\r\n const addressSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.address\")}\r\n <span className='errorIndicator'>*</span>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.ADDRESS] && (\r\n <span className='error'>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.ADDRESS]?.message}\r\n </span>\r\n )}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid spacing={4}>\r\n <Grid item xs={12}>\r\n <MaterialTable\r\n rows={[...addressRows]}\r\n columns={tableColumns(addressColumns)}\r\n paginationModel={{ pageNo: 1, limit: 10 }}\r\n totalPages={20}\r\n enableColumnDragging={false}\r\n isResetRow={false}\r\n columnOrder={['mrt-row-select']}\r\n enableRowSelection={false}\r\n enableBottomToolbar\r\n disableDefaultActionColumn\r\n editDisplayMode='row'\r\n enableRowCreate\r\n onCreateRow={(data) => handleRowOperation(data, addressRows, setAddressRows, true)}\r\n onEditRow={(data) => handleRowOperation(data, addressRows, setAddressRows, true)}\r\n onDeleteRow={(row) => deleteRow(addressRows, setAddressRows, row)}\r\n onChangeRowField={onChangeAddressTableField}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n // eslint-disable-next-line\r\n ), [t, addressRows, tableColumns, errors]);\r\n\r\n const contactSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.contact\")}\r\n <span className='errorIndicator'>*</span>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.CONTACTS] && (\r\n <span className='error'>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.CONTACTS]?.message}\r\n </span>\r\n )}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid spacing={4}>\r\n <Grid item xs={12}>\r\n\r\n <MaterialTable\r\n rows={[...contactRows]}\r\n columns={tableColumns(contactColumns)}\r\n paginationModel={{ pageNo: 1, limit: 10 }}\r\n totalPages={20}\r\n enableColumnDragging={false}\r\n isResetRow={false}\r\n columnOrder={['mrt-row-select']}\r\n enableRowSelection={false}\r\n enableBottomToolbar\r\n disableDefaultActionColumn\r\n editDisplayMode='row'\r\n enableRowCreate\r\n onCreateRow={(data) => handleRowOperation(data, contactRows, setContactRows, false)}\r\n onEditRow={(data) => {\r\n handleRowOperation(data, contactRows, setContactRows, false);\r\n\r\n if (data.row.index === 0) {\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.RESPONSIBLE_PERSON}`,\r\n data.values.name || ''\r\n );\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACT_NO}`,\r\n data.values.contact_no || ''\r\n );\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.EMAIL_IDS}`,\r\n data.values.email || ''\r\n );\r\n }\r\n }}\r\n onDeleteRow={(row) => {\r\n if (row.index === 0) {\r\n enqueueSnackbar(t('common.party.errors.cannotDeleteResponsiblePerson'), { variant: 'error' });\r\n return Promise.resolve();\r\n }\r\n return deleteRow(contactRows, setContactRows, row);\r\n }}\r\n onChangeRowField={onChangeAddressTableField}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n // eslint-disable-next-line\r\n ), [t, contactRows, tableColumns, errors]);\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={closeModal}\r\n maxWidth='lg'\r\n fullWidth\r\n sx={{ overflowY: 'hidden' }}\r\n {...modalProps}\r\n >\r\n {isCreating && <ModalLoader />}\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"scroll-container\" style={{ position: 'relative', overflow: 'auto' }}>\r\n <DialogTitle className='itemEntryModal--DialogTitle'\r\n >\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {`Add ${type}`}\r\n </Typography>\r\n <IconButton onClick={closeModal}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n\r\n <DialogContent>\r\n {basicDetailsSection}\r\n <Divider className='form--SectionDivider' />\r\n {addressSection}\r\n <Divider className='form--SectionDivider' />\r\n {contactSection}\r\n <Divider className='form--SectionDivider' />\r\n {accountingSection}\r\n </DialogContent>\r\n\r\n <DialogActions className='itemEntryModal--DialogAction' sx={{\r\n position: 'sticky',\r\n bottom: 0,\r\n backgroundColor: 'white',\r\n zIndex: 1,\r\n padding: '8px 24px',\r\n justifyContent: 'end'\r\n }}>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='itemEntryModal--DialogAction--WhiteBtn'\r\n onClick={closeModal}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button\r\n variant=\"contained\"\r\n onClick={handleSubmit(onSubmit)}\r\n >\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </Modal>\r\n );\r\n};\r\n","import * as Yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport { PARTIES_FIELDS, PARTIES_FORM_ARRAY_NAME } from './utils/constant';\r\n\r\nexport const generateValidationSchema = () => {\r\n\treturn yupResolver(\r\n\t\tYup.object().shape({\r\n\t\t\t[PARTIES_FORM_ARRAY_NAME]: Yup.object().shape({\r\n\t\t\t\t[PARTIES_FIELDS.FIRST_NAME]: Yup.string().required('First name is required'),\r\n\t\t\t\t[PARTIES_FIELDS.LAST_NAME]: Yup.string().required('Last name is required'),\r\n\t\t\t\t[PARTIES_FIELDS.COMPANY]: Yup.mixed().required('Company is required'),\r\n\t\t\t\t[PARTIES_FIELDS.CURRENCY]: Yup.array().required('Currency is required'),\r\n\t\t\t\t[PARTIES_FIELDS.ADDRESS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one address')\r\n\t\t\t\t\t.min(1, 'Please add atleast one address'),\r\n\t\t\t\t[PARTIES_FIELDS.CONTACTS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one Contact')\r\n\t\t\t\t\t.min(1, 'Please add atleast one Contact')\r\n\t\t\t})\r\n\t\t})\r\n\t);\r\n};\r\n\r\nexport const generateValidationSchema1 = () => {\r\n\treturn yupResolver(\r\n\t\tYup.object().shape({\r\n\t\t\t[PARTIES_FORM_ARRAY_NAME]: Yup.object().shape({\r\n\t\t\t\t[PARTIES_FIELDS.TYPE]: Yup.string().required('Customer type is required'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.FIRST_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Individual',\r\n\t\t\t\t\tthen: () => Yup.string().required('First name is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.LAST_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Individual',\r\n\t\t\t\t\tthen: () => Yup.string().required('Last name is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.COMPANY_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Company',\r\n\t\t\t\t\tthen: () => Yup.string().required('Company is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.VAT_NUMBER]: Yup.string().optional().nullable(),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.CRN]: Yup.string().optional().nullable() ,\r\n\r\n\t\t\t[PARTIES_FIELDS.COMPANY]: Yup.mixed().required('Company is required'),\r\n\r\n\t\t\t[PARTIES_FIELDS.CURRENCY]: Yup.array().required('Currency is required'),\r\n\t\t\t\t[PARTIES_FIELDS.RESPONSIBLE_PERSON]: Yup.string().required('Responsible Person is required'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.ADDRESS]: Yup.array().nullable().notRequired(),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.CONTACTS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one Contact')\r\n\t\t\t\t\t.min(1, 'Please add atleast one Contact'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.RECEIVABLE_ACCOUNT]: Yup.number().required('Receivable account is required'),\r\n\t\t\t\t[PARTIES_FIELDS.TAX_TEMPLATE]: Yup.number().required('Tax template is required')\r\n\t\t\t})\r\n\r\n\t\t})\r\n\t);\r\n}\r\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { Controller } from 'react-hook-form';\nimport {\n\tBox,\n\tDivider,\n\tIconButton,\n\tInputAdornment,\n\tMenuItem,\n\tMenuItemProps,\n\tOutlinedInput\n} from '@mui/material';\nimport PropTypes from 'prop-types';\n\nimport Select from '../../../select/select';\nimport ChipOrPlaceholder from './chip-or-placeholder';\nimport Checkbox from '../../../checkbox/checkbox';\nimport Typography from '../../../typography/typography';\nimport Chip from '../../../chip/chip';\nimport { MoreIcon } from '../../../icons';\nimport './element.scss';\nimport { Add, Close } from '@mui/icons-material';\nimport { useTranslation } from \"react-i18next\";\n\ninterface IMenuItems extends MenuItemProps {\n\toptions: any[];\n\tmultiple: boolean;\n\tplaceholder: string;\n\twith_checkboxes: boolean;\n\tvalues: string | string[];\n\tfield: any;\n}\n\nconst generateMenuItems = ({\n\toptions,\n\tmultiple,\n\tplaceholder,\n\twith_checkboxes,\n\tvalues,\n\tfield\n}: IMenuItems) => {\n\tconst items: React.ReactElement[] = [];\n\tif (!multiple) {\n\t\titems.push(\n\t\t\t<MenuItem disabled value='' sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\n\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t<em>{placeholder}</em>\n\t\t\t\t</Typography>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n\toptions?.forEach((option, index) => {\n\t\titems.push(\n\t\t\t<MenuItem\n\t\t\t\tvalue={option.value}\n\t\t\t\tkey={index}\n\t\t\t\tdisabled={Boolean(option.disabled)}\n\t\t\t\tclassName={option?.isGroup ? 'select--MenuItemHeader' : ''}>\n\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\n\t\t\t\t\t{multiple && with_checkboxes && (\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tchecked={Boolean(values && values?.indexOf(option.value) > -1)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t{option.label}\n\t\t\t\t\t</Typography>\n\t\t\t\t</Box>\n\t\t\t</MenuItem>\n\t\t);\n\t\tif (option?.isGroup && Array.isArray(option?.options)) {\n\t\t\toption.options.forEach((opt) => {\n\t\t\t\titems.push(\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tvalue={opt.value}\n\t\t\t\t\t\tdisabled={Boolean(opt.disabled)}\n\t\t\t\t\t\tsx={{ pl: 5 }}\n\t\t\t\t\t\tkey={`${option.value}-${opt.value}`}>\n\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\n\t\t\t\t\t\t\t{multiple && with_checkboxes && (\n\t\t\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\t\t\tchecked={Boolean(values && values?.indexOf(opt.value) > -1)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t\t\t{opt.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t});\n\tif (field.enable_footer) {\n\t\titems.push(\n\t\t\t<Box>\n\t\t\t\t<Divider flexItem />\n\t\t\t\t<MenuItem sx={{ gap: 1 }} onClick={field.onFooterClick}>\n\t\t\t\t\t<Add fontSize='small' />\n\t\t\t\t\t<Typography type='s4' color='theme.secondary.1000'>\n\t\t\t\t\t\tCreate New {field.label}\n\t\t\t\t\t</Typography>\n\t\t\t\t</MenuItem>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn items;\n};\nconst SelectedItems = ({\n\tdata,\n\toptions\n}: {\n\tdata: string[];\n\toptions: any[];\n}) => {\n\tconst displayTitle = data.map(\n\t\t(selectedItem) =>\n\t\t\toptions?.find((option: any) => option.value === selectedItem)?.label ||\n\t\t\tselectedItem\n\t);\n\tconst fDisplayTitle = displayTitle.filter(Boolean)\n\treturn (\n\t\t<Typography\n\t\t\ttype='s4'\n\t\t\tcolor='inherit'\n\t\t\tsx={{ display: 'flex', gap: 1, alignItems: 'center', mt: 0.5 }}>\n\t\t\t{fDisplayTitle.slice(0.4).join(', ')}\n\t\t\t{data.length > 4 && (\n\t\t\t\t<Chip variant='outlined' type='normal' label={<MoreIcon />} />\n\t\t\t)}\n\t\t</Typography>\n\t);\n};\n\nconst DynamicSelect = React.memo((props: any) => {\n\tconst [options, setOptions] = useState([]);\n\tconst [selectedValue, setSelectedValue] = useState(null);\n\tconst { handleOptions } = props;\n\tuseEffect(() => {\n\t\tif (handleOptions) {\n\t\t\thandleOptions(selectedValue);\n\t\t}\n\t}, [handleOptions, selectedValue]);\n\tconst handleSearch = (search: string) => {\n\t\tif (props.options?.length && search) {\n\t\t\tconst searchedOptions = props.options.filter((opt) =>\n\t\t\t\tReact.isValidElement(opt.label)\n\t\t\t\t\t? opt?.searchLabel?.toLowerCase()?.includes(search.toLowerCase())\n\t\t\t\t\t: opt.label.toLowerCase().includes(search.toLowerCase())\n\t\t\t);\n\t\t\tsetOptions(searchedOptions);\n\t\t} else {\n\t\t\tsetOptions(props.options);\n\t\t}\n\t};\n\n\tconst removeUndefine = (selectOptions: any[]) => {\n\t\treturn selectOptions?.filter((option) => option);\n\t};\n\tconst handleSetOptions = useCallback(() => {\n\t\tsetOptions(props.options);\n\t}, [props.options]);\n\n\tuseEffect(() => {\n\t\thandleSetOptions();\n\t}, [handleSetOptions]);\n\t\tconst { t } = useTranslation();\n\t\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={props.formControl}\n\t\t\tname={`${props.fieldArrayName}.${props.name}`}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<>\n\t\t\t\t\t{props.placeholder === 'Select Currency'\n\t\t\t\t\t\t? setSelectedValue(field.value)\n\t\t\t\t\t\t: setSelectedValue(null)}\n\t\t\t\t\t<Select\n\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t// onFocus={() => {\n\t\t\t\t\t\t// \tsetOptions(props.options);\n\t\t\t\t\t\t// }}\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tdataPosition={props.position}\n\t\t\t\t\t\tdataName={`${props.fieldArrayName}.${props.name}`}\n\t\t\t\t\t\tplaceholder={props.placeholder}\n\t\t\t\t\t\tlabel={props.label}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tfield.value?.id || field.value?.label || field.value || (props.is_multiselect ? [] : '')\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\tprops.defaultValue || (props.is_multiselect ? [] : '')\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired={props.formType === 'builder' ? false : props.required}\n\t\t\t\t\t\tsize={props.size || 'small'}\n\t\t\t\t\t\tmultiple={props.is_multiselect || false}\n\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\tvariant='outlined'\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tprops.is_multiselect && removeUndefine(field.value)?.length\n\t\t\t\t\t\t\t\t? 'MultiSelect'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\trenderValue={(selected: string | string[]) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{Array.isArray(selected) ? (\n\t\t\t\t\t\t\t\t\t<ChipOrPlaceholder\n\t\t\t\t\t\t\t\t\t\tselectedLabel={props.selectedLabel}\n\t\t\t\t\t\t\t\t\t\tdata={removeUndefine(selected)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={props.placeholder}\n\t\t\t\t\t\t\t\t\t\tonDelete={props?.onChipRemove}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\toptions?.find(\n\t\t\t\t\t\t\t\t\t\t(option: any) =>\n\t\t\t\t\t\t\t\t\t\t\t(option.value?.id || option.value) === selected\n\t\t\t\t\t\t\t\t\t)?.label ||\n\t\t\t\t\t\t\t\t\tselected ||\n\t\t\t\t\t\t\t\t\tprops.placeholder\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tsearchPlaceholder={`${t('common.search')} ${props.label}`}\n\t\t\t\t\t\thandleSearch={handleSearch}\n\t\t\t\t\t\terror={Boolean(fieldState.error?.message)}\n\t\t\t\t\t\thelperText={fieldState.error?.message || ''}\n\t\t\t\t\t\tonBlur={field.onBlur}\n\t\t\t\t\t\tinput={\n\t\t\t\t\t\t\t!props?.is_multiselect && !props.disabled && field?.value ? (\n\t\t\t\t\t\t\t\t<OutlinedInput\n\t\t\t\t\t\t\t\t\tlabel=''\n\t\t\t\t\t\t\t\t\tendAdornment={\n\t\t\t\t\t\t\t\t\t\t<InputAdornment position='end'>\n\t\t\t\t\t\t\t\t\t\t\t{field.value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-label='clear selection'\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => field.onChange(null)}\n\t\t\t\t\t\t\t\t\t\t\t\t\tedge='end'\n\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{ mr: 1.5 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize='small'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Close sx={{ fontSize: '1rem' }} />\n\t\t\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tloading={props?.is_loading}>\n\t\t\t\t\t\t{generateMenuItems({\n\t\t\t\t\t\t\toptions,\n\t\t\t\t\t\t\tmultiple: Boolean(props.is_multiselect),\n\t\t\t\t\t\t\tplaceholder: props.placeholder,\n\t\t\t\t\t\t\tvalues: field.value,\n\t\t\t\t\t\t\twith_checkboxes: true,\n\t\t\t\t\t\t\tfield: props\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Select>\n\t\t\t\t\t{props.is_multiselect && Array.isArray(field?.value) && (\n\t\t\t\t\t\t<SelectedItems data={field.value} options={options} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nDynamicSelect.propTypes = {\n\tname: PropTypes.string.isRequired,\n\tplaceholder: PropTypes.string.isRequired,\n\tlabel: PropTypes.string.isRequired,\n\tsize: PropTypes.string,\n\toptions: PropTypes.arrayOf(\n\t\tPropTypes.shape({\n\t\t\tlabel: PropTypes.string,\n\t\t\tvalue: PropTypes.string\n\t\t})\n\t).isRequired,\n\tformControl: PropTypes.shape({\n\t\tregister: PropTypes.func.isRequired,\n\t\tsetValue: PropTypes.func\n\t}).isRequired,\n\tdefaultValue: PropTypes.string,\n\tfieldArrayName: PropTypes.string,\n\tid: PropTypes.string,\n\trequired: PropTypes.bool,\n\tis_multiselect: PropTypes.bool,\n\tposition: PropTypes.number,\n\tformType: PropTypes.string,\n\ttypeOfField: PropTypes.string,\n\tdisabled: PropTypes.bool,\n\tonChipRemove: PropTypes.func,\n\tenable_footer: PropTypes.bool,\n\tfooter_action: PropTypes.string,\n\tonFooterClick: PropTypes.any,\n\tis_loading: PropTypes.bool,\n\tselectedLabel: PropTypes.string\n};\n\nexport { DynamicSelect };\nexport default DynamicSelect;\n","// import { Controller } from 'react-hook-form';\nimport PropTypes from \"prop-types\";\nimport Button from \"../../../button/button\";\n\n// { control, index }\n\nconst DynamicButton = (props: any) => {\n const { type, onClick, className, disable, ...rest } = props;\n\n return (\n <Button\n type={type}\n onClick={onClick}\n className={className}\n {...rest}\n disabled={disable}\n >\n {props.text}\n </Button>\n );\n};\n\nDynamicButton.propTypes = {\n text: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n type: PropTypes.string,\n style: PropTypes.object,\n variant: PropTypes.string,\n className: PropTypes.string,\n disable: PropTypes.bool,\n startIcon: PropTypes.node,\n};\n\nexport { DynamicButton };\nexport default DynamicButton;\n","import React from 'react';\nimport { Control, Controller } from 'react-hook-form';\nimport Checkbox from '../../../checkbox/checkbox';\nimport Typography from '../../../typography/typography';\nimport { CheckboxProps, Stack, StackProps } from '@mui/material';\nimport { useLanguage } from '../../../../hooks/useLangauge';\n\ninterface IDynamicCheckbox {\n\tformControl: Control<any>;\n\tfieldArrayName: string;\n\tname: string;\n\tlabel?: string;\n\tposition?: number;\n\tdisabled?: boolean;\n\ttitlePosition?: 'start' | 'end';\n\ttypeOfField?: string;\n\ttitle: string;\n\ttitleColor?: string; // New prop for title color\n\tcheckboxProps?: CheckboxProps;\n\tstackProps?: StackProps;\n}\n\nconst DynamicCheckBox: React.FC<IDynamicCheckbox> = ({\n\tformControl,\n\tfieldArrayName,\n\tname,\n\tlabel,\n\tposition,\n\tdisabled,\n\ttitlePosition = 'end',\n\ttitle,\n\ttitleColor = 'theme.secondary.800', // Default color\n\tcheckboxProps,\n\tstackProps,\n}) => {\n\tconst {isRtl}=useLanguage();\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={formControl}\n\t\t\tname={`${fieldArrayName}.${name}`}\n\t\t\trender={({ field }) => (\n\t\t\t\t<>\n\t\t\t\t\t{label && (\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\tdata-position={position}\n\t\t\t\t\t\t\tsx={{ mb: 0.5 }}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<Stack direction='row' spacing={isRtl?'':0.25} alignItems='center' {...stackProps}>\n\t\t\t\t\t\t{titlePosition === 'start' && (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor={titleColor}> {/* Use titleColor prop here */}\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tchecked={Boolean(field.value)}\n\t\t\t\t\t\t\tonChange={field.onChange}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\tsx={{ m: 1 }}\n\t\t\t\t\t\t\t{...checkboxProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{titlePosition === 'end' && (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor={titleColor}> {/* Use titleColor prop here */}\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n};\n\nexport default DynamicCheckBox;","/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport { Controller/* , useFormContext */ } from 'react-hook-form';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useMemo } from 'react';\r\nimport dayjs from 'dayjs';\r\n\r\nimport './element.scss';\r\nimport DatePicker from '../../../date-picker/date-picker';\r\n\r\ninterface DynamicDateProps {\r\n formControl: any;\r\n name: string;\r\n label: string;\r\n fieldArrayName?: string;\r\n required?: boolean;\r\n position?: number;\r\n formType?: string;\r\n placeholder?: string;\r\n defaultValue?: any;\r\n is_future_dates_allowed?: boolean;\r\n is_past_dates_allowed?: boolean;\r\n typeOfField?: string;\r\n disabled?: boolean;\r\n min_date?: any;\r\n max_date?: any;\r\n}\r\n\r\nconst DynamicDate = React.memo<DynamicDateProps>((props) => {\r\n // const formContext = useFormContext();\r\n\r\n // Memoize field name to prevent unnecessary recalculations\r\n const fieldName = useMemo(() =>\r\n `${props.fieldArrayName}.${props.name}`,\r\n [props.fieldArrayName, props.name]\r\n );\r\n\r\n // Memoize date calculations to prevent recalculation on every render\r\n const { minDate, maxDate } = useMemo(() => {\r\n const min = dayjs(props.min_date || null).isValid()\r\n ? dayjs(props.min_date)\r\n : null;\r\n\r\n const max = dayjs(props.max_date || null).isValid()\r\n ? dayjs(props.max_date)\r\n : null;\r\n\r\n return { minDate: min, maxDate: max };\r\n }, [props.min_date, props.max_date]);\r\n\r\n // Memoize required prop calculation\r\n const isRequired = useMemo(() =>\r\n props.formType === 'builder' ? false : props.required,\r\n [props.formType, props.required]\r\n );\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={fieldName}\r\n render={({ field, fieldState }) => (\r\n <DatePicker\r\n {...field}\r\n // {...props}\r\n dataPosition={props.position}\r\n dataName={fieldName}\r\n label={props.label}\r\n placeholder={props.placeholder}\r\n required={isRequired}\r\n defaultValue={props.defaultValue}\r\n disableFutureDates={props.is_future_dates_allowed}\r\n disablePastDates={props.is_past_dates_allowed}\r\n helperText={fieldState.error?.message}\r\n error={Boolean(fieldState.error)}\r\n disabled={props.disabled}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n {...(props?.views && { views: props?.views })}\r\n />\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicDate.displayName = 'DynamicDate';\r\n\r\nDynamicDate.propTypes = {\r\n formControl: PropTypes.shape({\r\n register: PropTypes.func.isRequired,\r\n setValue: PropTypes.func\r\n }).isRequired,\r\n name: PropTypes.string.isRequired,\r\n label: PropTypes.string.isRequired,\r\n fieldArrayName: PropTypes.string,\r\n required: PropTypes.bool,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n placeholder: PropTypes.string,\r\n defaultValue: PropTypes.any,\r\n is_future_dates_allowed: PropTypes.bool,\r\n is_past_dates_allowed: PropTypes.bool,\r\n typeOfField: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n min_date: PropTypes.any,\r\n max_date: PropTypes.any\r\n};\r\n\r\nexport { DynamicDate };\r\nexport default DynamicDate;","import { Controller } from \"react-hook-form\";\nimport TextField from \"../../../text-field/text-field\";\nimport PropTypes from \"prop-types\"\nimport { InputAdornment } from \"@mui/material\";\nconst DynamicCurrency = (props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n name={`${props.fieldArrayName}.${props.name}`}\n fullWidth\n label={props.label}\n defaultValue={props.default_value.replace(/[^0-9]/g, \"\")}\n placeholder={props.placeholder}\n multiline={props.is_multiline || false}\n disabled={props.disabled}\n required={props.is_required}\n inputProps={{\n step: props?.float_step || \"0\" , \n min : props.min_length || 0 , \n max : props.max_length || 1000 ,\n inputMode: 'numeric',\n pattern : `${props.is_negative}` ? '-?[0-9]*' : '[0-9]*' , \n \n }}\n InputProps={{\n startAdornment: (\n <InputAdornment\n position=\"start\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: '1px solid rgba(0, 0, 0, 0.23)',\n width: 50,\n height: '100%',\n borderBottomLeftRadius: 4, \n borderTopLeftRadius: 4,\n }}\n >\n {(props.currencyType !== null ? props.currencyType : \"-\")}\n </InputAdornment>\n )\n\n }}\n\n error={Boolean(fieldState.error?.message)}\n helperText={fieldState.error?.message || \"\"}\n onBlur = {field.onBlur}\n onChange ={(e : any) => {\n const numericValue = e.target.value.replace(/[^0-9]/g , \"\");\n field.onChange(numericValue)\n }}\n />\n )}\n />\n )\n}\nDynamicCurrency.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired\n }).isRequired,\n defaultValue: PropTypes.string,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiline: PropTypes.bool,\n min: PropTypes.number,\n max: PropTypes.number,\n min_length: PropTypes.number,\n max_length: PropTypes.number,\n float_step: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n disabled: PropTypes.bool,\n InputProps: PropTypes.object,\n placeholder : PropTypes.string , \n currencyType :PropTypes.string ,\n \n}\nexport { DynamicCurrency };\nexport default DynamicCurrency;\n\n\n\n","import PropTypes from \"prop-types\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Grid, Box } from \"@mui/material\";\nimport { useDrag, useDrop } from \"react-dnd\";\n\nimport \"./element.scss\";\nimport images from \"../../../../assets/images\";\n\nconst DynamicElementHOC = (props: any) => {\n const [, ref] = useDrag({\n type: \"element\",\n item: { index: props.index },\n });\n const [, drop] = useDrop({\n accept: \"element\",\n hover: (draggedElement: any) => {\n const draggedIndex = draggedElement.index;\n const dropIndex = props.index;\n if (dropIndex === draggedIndex) {\n return;\n }\n\n props.swap(draggedIndex, dropIndex);\n },\n drop: () => {\n props.elementSwap();\n },\n });\n\n \n const activeClassName = `${\n props.activeIndex\n ? \"form-element-wrapper--Active\"\n : \"form-element-wrapper--Element\"\n }`;\n const defaultClassName = `${\n props?.children?.props?.typeOfField === \"custom\"\n ? \"\"\n : \"form-element-wrapper--Default\"\n }`;\n\n return (\n <Grid\n item\n xs={props?.element === \"table\" ? 12 : 12}\n className={`${activeClassName} ${defaultClassName}`}\n ref={(node) => drop(ref(node))}\n >\n <Box sx={{ width: \"100%\" }} onClick={props.onClick}>\n {props.children}\n </Box>\n <div className=\"form-element-wrapper--Actions\">\n <img\n src={images.duplicate}\n onClick={() => props.handleDuplicate(props.index)}\n />\n {props?.children?.props?.typeOfField === \"custom\" && (\n <CloseIcon\n style={{ fontSize: \"1rem\", color: \"#656669\" }}\n onClick={() => {\n props.removeElement(props.index);\n props.setElementHoc();\n }}\n />\n )}\n </div>\n </Grid>\n );\n};\n\nDynamicElementHOC.propTypes = {\n removeElement: PropTypes.func.isRequired,\n index: PropTypes.number.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n swap: PropTypes.func,\n elementSwap: PropTypes.func,\n activeIndex: PropTypes.bool,\n handleDuplicate: PropTypes.func,\n setElementHoc: PropTypes.func,\n element: PropTypes.string,\n elementPerRow : PropTypes.number \n};\n\nexport { DynamicElementHOC };\nexport default DynamicElementHOC;\n","import { Controller } from \"react-hook-form\";\nimport TextField from \"../../../text-field/text-field\";\nimport PropTypes from \"prop-types\"\nimport { InputAdornment, Select, MenuItem } from \"@mui/material\";\nimport { useState } from \"react\";\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nconst DynamicInputSelect = (props: any) => {\n const [defaultOption, setSelectOption] = useState(props.options[0].value); //need to be update \n const handleOptionChange = (event: any) => {\n setSelectOption(event.target.value);\n };\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n name={`${props.fieldArrayName}.${props.name}`}\n fullWidth\n label={props.label}\n placeholder={props.placeholder}\n multiline={props.is_multiline || false}\n disabled={props.disabled}\n required={props.is_required}\n inputProps={{\n step: props?.float_step || \"0\",\n min: props.min_length || 0,\n max: props.max_length || 1000,\n inputMode: 'string',\n\n\n }}\n InputProps={{\n endAdornment: (\n <InputAdornment\n position=\"start\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderLeft: '1px solid rgba(0, 0, 0, 0.23)',\n padding: 1,\n height: '100%',\n borderBottomLeftRadius: 4,\n borderTopLeftRadius: 4,\n backgroundColor: 'rgba(245 , 245 , 245 )',\n margin: 0,\n boxSizing: 'border-box',\n borderRadius: 0,\n\n }}\n\n >\n <Select\n value={defaultOption}\n onChange={handleOptionChange}\n sx={{\n height: '100%',\n '&:focus': {\n backgroundColor: 'rgba(245 , 245 , 245 )' , // Prevent background color change on focus\n },\n '&:hover': {\n backgroundColor: 'rgba(245 , 245 , 245 )', // Prevent background color change on hover\n },\n '&:active': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on active\n },\n '&.Mui-focused': {\n backgroundColor: '#fff', // Override the focus background color\n },\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderColor: '#fff', // Prevent border color change on focus\n },\n }}\n variant=\"standard\"\n disableUnderline\n\n IconComponent={KeyboardArrowDownOutlinedIcon}\n\n >\n {props.options?.map((item: any, index: any) => (\n <MenuItem\n key={index}\n value={item.value}\n sx={{\n '&:hover': {\n backgroundColor: 'rgba(245 , 245 , 245 )', // Prevent background color change on hover\n },\n '&.Mui-selected': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on selection\n },\n '&.Mui-selected:hover': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on selection hover\n },\n }}\n >\n {item.label}\n </MenuItem>\n ))}\n </Select>\n\n </InputAdornment>\n )\n\n }}\n\n error={Boolean(fieldState.error?.message)}\n helperText={fieldState.error?.message || \"\"}\n onBlur={field.onBlur}\n onChange={(e: any) => {\n field.onChange(e.target.value)\n }}\n />\n )}\n />\n )\n}\nDynamicInputSelect.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired\n }).isRequired,\n defaultValue: PropTypes.string,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiline: PropTypes.bool,\n min: PropTypes.number,\n max: PropTypes.number,\n min_length: PropTypes.number,\n max_length: PropTypes.number,\n float_step: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n disabled: PropTypes.bool,\n InputProps: PropTypes.object,\n placeholder: PropTypes.string,\n\n\n}\nexport { DynamicInputSelect };\nexport default DynamicInputSelect;\n","import React, { useState } from 'react';\nimport { Controller, Control, FieldValues } from 'react-hook-form';\nimport PropTypes from 'prop-types';\nimport { Autocomplete } from '@mui/material';\nimport TextField from '../../../text-field/text-field';\nimport Chip from '../../../chip/chip';\n// import { Close } from '@mui/icons-material';\nimport Typography from '../../../typography/typography';\nimport './element.scss';\n\n// Define the type for props\ninterface DynamicTagsInputProps<TFieldValues extends FieldValues> {\n formControl: Control<TFieldValues>;\n name: string;\n fieldArrayName?: string;\n label: React.ReactNode;\n}\n\n// Define the component using generic type TFieldValues\nconst DynamicTagsInput = <TFieldValues extends FieldValues>({\n formControl,\n name,\n fieldArrayName = '',\n label,\n}: DynamicTagsInputProps<TFieldValues>) => {\n // Local state for managing the input value\n const [inputValue, setInputValue] = useState<string>('');\n\n return (\n <Controller\n control={formControl}\n name={`${fieldArrayName}.${name}`}\n render={({ field: { value = '', onChange } }) => {\n const tags = value ? value.split(',').map((tag: string) => tag.trim()) : [];\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Tab') {\n // Get the trimmed input value\n const trimmedInputValue = inputValue.trim();\n \n // Check if input is not empty and not already a tag\n if (trimmedInputValue && !tags.includes(trimmedInputValue)) {\n event.preventDefault(); // Prevent default tab action\n\n // Add new tag\n const newTags = [...tags, trimmedInputValue];\n const newValueString = newTags.join(', ');\n onChange(newValueString);\n setInputValue(''); // Clear the input field\n }\n }\n };\n\n return (\n <Autocomplete\n clearIcon={false}\n options={[]}\n freeSolo\n multiple\n fullWidth\n value={tags}\n onChange={(event: React.ChangeEvent<unknown>, newValue: string[] | null) => {\n const newValueString = newValue?.join(', ') || '';\n onChange(newValueString);\n }}\n renderTags={(value: string[], renderTagProps) =>\n value.map((option, index) => (\n <Chip\n key={index}\n // deleteIcon={<Close fontSize='large' />}\n // variant='outlined'\n type='normal'\n label={\n <Typography color='theme.secondary.1000' type='s4'>\n {option}\n </Typography>\n }\n {...renderTagProps({ index })}\n />\n ))\n }\n renderInput={(params) => (\n <TextField\n label={label}\n type=\"text\"\n {...params}\n value={inputValue}\n onChange={(event:any) => setInputValue(event.target.value)}\n onKeyDown={handleKeyDown}\n />\n )}\n />\n );\n }}\n />\n );\n};\n\n// Define PropTypes for runtime validation (optional)\nDynamicTagsInput.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n};\n\nexport { DynamicTagsInput };\nexport default DynamicTagsInput;\n\n","import Typography from \"../typography/typography\";\nimport logo from \"../../assets/images\";\nimport \"./info-card.scss\";\n\nexport interface InfoCardProps {\n label: string;\n dataPosition?: number;\n dataName?: string;\n value?: string;\n}\n\nconst InfoCard = (props: InfoCardProps) => {\n const { label, dataPosition, dataName, value } = props;\n return (\n <>\n <Typography\n type=\"s5\"\n weight=\"medium\"\n mb={0.5}\n color={\"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n className=\"infoCard\"\n >\n {label}\n <img src={logo.info} />\n </Typography>\n <Typography color={\"theme.secondary.1000\"}>{value ?? \"Info\"}</Typography>\n </>\n );\n};\n\nexport { InfoCard };\nexport default InfoCard;\n","import { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport InfoCard from \"../../../info-card/info-card\";\n\nconst DynamicInfo = (props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field }) => (\n <InfoCard\n {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n value={props.defaultValue || \"Info\"}\n />\n )}\n />\n );\n};\n\nDynamicInfo.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n defaultValue: PropTypes.string,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nexport { DynamicInfo };\nexport default DynamicInfo;\n","import React from \"react\";\nimport { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport UploadMedia from \"../../../upload-media/upload-media\";\nimport Typography from \"../../../typography/typography\";\n\nconst DynamicMedia = React.memo((props: any) => {\n\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState: { error } }) => (\n <>\n <UploadMedia\n // {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n required={props.formType === \"builder\" ? false : props.required}\n type={props.field_type}\n max_size={props?.max_size}\n disabled={props?.disabled}\n onChange={field?.onChange}\n name={props.name}\n value={field?.value || props?.value}\n multiple={Boolean(props?.is_multiple)}\n />\n {error &&\n <Typography color=\"theme.error.600\" type=\"s5\">{error.message}</Typography>\n }\n </>\n )}\n />\n );\n});\n\nDynamicMedia.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiple: PropTypes.bool,\n position: PropTypes.number,\n formType: PropTypes.string,\n placeholder: PropTypes.string,\n default_value: PropTypes.string,\n type: PropTypes.string,\n field_type: PropTypes.string,\n max_size: PropTypes.number,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nexport { DynamicMedia };\nexport default DynamicMedia;\n","import PropTypes from \"prop-types\";\nimport { Grid, /* Box, */ IconButton, Menu, MenuItem } from \"@mui/material\";\n\nimport \"./element.scss\";\nimport Typography from \"../../../typography/typography\";\nimport images from \"../../../../assets/images\";\nimport React from \"react\";\nimport Button from \"../../../button/button\";\nimport AddIcon from \"@mui/icons-material/Add\";\n\nconst DynamicSectionHOC = (props: any) => {\n const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\n\n const handleActionClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n return (\n <Grid\n className={\n props.className ? `formBuilder ${props.className}` : \"formBuilder\"\n }\n >\n <div className=\"formBuilder--Header\">\n <Typography\n type=\"s4\"\n fontWeight={\"medium\"}\n mb={0.5}\n color={\"theme.secondary.800\"}\n sx={{ cursor: \"pointer\", ...(!props.label?.trim() ? { fontStyle: 'italic' } : {}) }}\n onClick={props.onClick}\n data-position={props.position}\n data-name={`${props.fieldArrayName}.${props.name}`}\n >\n {props.label || \"(Unnamed Section)\"}\n </Typography>\n <div>\n <IconButton color=\"inherit\" size=\"small\" onClick={handleActionClick}>\n <img src={images.more} alt=\"more icon\" />\n </IconButton>\n <Menu\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={() => setAnchorEl(null)}\n >\n <MenuItem\n onClick={() => {\n props.handleAccordion();\n setAnchorEl(null);\n }}\n >\n Make this section accordion\n </MenuItem>\n {!props.remove_section && (\n <MenuItem\n sx={{ color: \"#F86060\" }}\n onClick={() => {\n props.removeSection();\n setAnchorEl(null);\n }}\n >\n Remove Section\n </MenuItem>\n )}\n </Menu>\n </div>\n </div>\n <div\n className={`${\n props.activeIndex ? \"formBuilder--Active\" : \"formBuilder--Section\"\n }`}\n >\n {/* <Box sx={{ width: \"100%\" }} className=\"formBuilder--GridLayout\">\n {props.children}\n </Box> */}\n <Grid container sx={{ mb: 2 }}>\n {props.children}\n </Grid>\n {!props.isFormSwitcher ? (\n <Button\n variant=\"outlined\"\n style={{ color: \"#292D32\", marginBottom: \"0.375rem\" }}\n startIcon={<AddIcon />}\n data-position={props.position}\n data-name={`${props.fieldArrayName}.${props.name}`}\n onClick={props.handleAddButton}\n >\n Add\n </Button>\n ) : null}\n </div>\n </Grid>\n );\n};\n\nDynamicSectionHOC.propTypes = {\n index: PropTypes.number.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n label: PropTypes.string,\n position: PropTypes.number,\n fieldArrayName: PropTypes.string,\n className: PropTypes.string,\n removeSection: PropTypes.func.isRequired,\n handleAccordion: PropTypes.func,\n activeIndex: PropTypes.bool,\n handleAddButton: PropTypes.func,\n remove_section: PropTypes.bool,\n isFormSwitcher: PropTypes.bool,\n};\n\nexport { DynamicSectionHOC };\nexport default DynamicSectionHOC;\n","/// <reference types=\"../types/index.d.ts\" />\n\n// (c) 2020-present Andrea Giammarchi\n\nconst {parse: $parse, stringify: $stringify} = JSON;\nconst {keys} = Object;\n\nconst Primitive = String; // it could be Number\nconst primitive = 'string'; // it could be 'number'\n\nconst ignore = {};\nconst object = 'object';\n\nconst noop = (_, value) => value;\n\nconst primitives = value => (\n value instanceof Primitive ? Primitive(value) : value\n);\n\nconst Primitives = (_, value) => (\n typeof value === primitive ? new Primitive(value) : value\n);\n\nconst resolver = (input, lazy, parsed, $) => output => {\n for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {\n const k = ke[y];\n const value = output[k];\n if (value instanceof Primitive) {\n const tmp = input[+value];\n if (typeof tmp === object && !parsed.has(tmp)) {\n parsed.add(tmp);\n output[k] = ignore;\n lazy.push({ o: output, k, r: tmp });\n }\n else\n output[k] = $.call(output, k, tmp);\n }\n else if (output[k] !== ignore)\n output[k] = $.call(output, k, value);\n }\n return output;\n};\n\nconst set = (known, input, value) => {\n const index = Primitive(input.push(value) - 1);\n known.set(value, index);\n return index;\n};\n\n/**\n * Converts a specialized flatted string into a JS value.\n * @param {string} text\n * @param {(this: any, key: string, value: any) => any} [reviver]\n * @returns {any}\n */\nexport const parse = (text, reviver) => {\n const input = $parse(text, Primitives).map(primitives);\n const $ = reviver || noop;\n\n let value = input[0];\n\n if (typeof value === object && value) {\n const lazy = [];\n const revive = resolver(input, lazy, new Set, $);\n value = revive(value);\n\n let i = 0;\n while (i < lazy.length) {\n // it could be a lazy.shift() but that's costly\n const {o, k, r} = lazy[i++];\n o[k] = $.call(o, k, revive(r));\n }\n }\n\n return $.call({'': value}, '', value);\n};\n\n/**\n * Converts a JS value into a specialized flatted string.\n * @param {any} value\n * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]\n * @param {string | number | undefined} [space]\n * @returns {string}\n */\nexport const stringify = (value, replacer, space) => {\n const $ = replacer && typeof replacer === object ?\n (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :\n (replacer || noop);\n const known = new Map;\n const input = [];\n const output = [];\n let i = +set(known, input, $.call({'': value}, '', value));\n let firstRun = !i;\n while (i < input.length) {\n firstRun = true;\n output[i] = $stringify(input[i++], replace, space);\n }\n return '[' + output.join(',') + ']';\n function replace(key, value) {\n if (firstRun) {\n firstRun = !firstRun;\n return value;\n }\n const after = $.call(this, key, value);\n switch (typeof after) {\n case object:\n if (after === null) return after;\n case primitive:\n return known.get(after) || set(known, input, after);\n }\n return after;\n }\n};\n\n/**\n * Converts a generic value into a JSON serializable object without losing recursion.\n * @param {any} value\n * @returns {any}\n */\nexport const toJSON = value => $parse(stringify(value));\n\n/**\n * Converts a previously serialized object with recursion into a recursive one.\n * @param {any} value\n * @returns {any}\n */\nexport const fromJSON = value => parse($stringify(value));\n","// import { MRT_ColumnDef, MRT_RowData } from 'material-react-table';\r\nimport { Add } from '@mui/icons-material';\r\nimport Button from '../../../button/button';\r\nimport MaterialTable, { MaterialTableColumnProps } from '../../../material-table/material-table';\r\nimport Typography from '../../../typography/typography';\r\nimport { Box } from '@mui/material';\r\nimport './element.scss';\r\nimport { parse, stringify } from 'flatted';\r\nimport React, { useCallback } from 'react';\r\nimport { useAuth } from '../../../../hooks/useAuth';\r\nimport { formatDate } from '../../../../utils/dateFormat';\r\nimport Chip from '../../../chip/chip';\r\nimport Checkbox from '../../../checkbox/checkbox';\r\nimport { MRT_Row } from 'material-react-table';\r\nimport _ from 'lodash';\r\nimport { formatAmount, getFileName, toFixedWithNumbers } from \"../../../../utils/common\";\r\nimport { useTranslation } from 'react-i18next';\r\nimport { formatLabel } from '../../../../utils/format-text';\r\nexport interface ICellChangeParam {\r\n\tvalue: any,\r\n\tdata: any,\r\n\tcol: MaterialTableColumnProps,\r\n\trow: MRT_Row<any>,\r\n\tname: string,\r\n\tuRows: any[]\r\n}\r\n\r\ninterface IDynamicTable {\r\n\tcolumns: any[];\r\n\trows?: any[];\r\n\tposition: number;\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\ttypeOfField?: string;\r\n\tonAddClick?: (name?: string) => void;\r\n\tname?: string;\r\n\tis_button?: boolean;\r\n\tdisableTableAddButton?: boolean;\r\n\totherButtons?: React.ReactNode[];\r\n\tdefaultActionColumnItems?: React.ReactElement[];\r\n\tonTableCellChange: ({ value, data, col, row }: ICellChangeParam) => void;\r\n\tcurrencySymbol?: string;\r\n}\r\n\r\nconst DynamicTable: React.FC<IDynamicTable> = React.memo(({\r\n\tcolumns,\r\n\tposition,\r\n\tlabel,\r\n\trows = [],\r\n\tonAddClick,\r\n\tname,\r\n\tis_button = true,\r\n\tdisableTableAddButton,\r\n\totherButtons,\r\n\tdefaultActionColumnItems,\r\n\tonTableCellChange,\r\n\tcurrencySymbol = '',\r\n\t...rest\r\n\t// disabled\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\tconst { user } = useAuth();\r\n\tconst cs = currencySymbol || user?.currency_data?.symbol || '';\r\n\tconst currencyFormat = user?.currency_data?.number_format || '';\r\n\tconst symbolPosition = user?.currency_data?.position || 'before';\r\n\tconst takeCurencyOrPercentage = useCallback((type: string, value: any) => {\r\n\t\tswitch (type) {\r\n\t\t\tcase 'Percentage':\r\n\t\t\t\treturn `${value}%`;\r\n\t\t\tcase 'Fixed Amount':\r\n\t\t\t\treturn `${cs}${value}`;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn value;\r\n\t\t}\r\n\t}, [cs]);\r\n\r\n\tconst isCellChangeAFunc = onTableCellChange instanceof Function\r\n\r\n\tconst tableColumns = useCallback(\r\n\t\t(columns: MaterialTableColumnProps[]) => {\r\n\t\t\treturn columns.map((column) => ({\r\n\t\t\t\t...column,\r\n\t\t\t\theader: t(column.header),\r\n\t\t\t\tCell: ({ renderedCellValue, row }: any) => {\r\n\t\t\t\t\tlet v = renderedCellValue;\r\n\t\t\t\t\tif (typeof v === 'number' && v && String(v)?.includes('.')) {\r\n\t\t\t\t\t\treturn v = toFixedWithNumbers(v)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tswitch (column.type) {\r\n\t\t\t\t\t\tcase 'formattedString':\r\n\t\t\t\t\t\t\tv = formatLabel(renderedCellValue) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'date':\r\n\t\t\t\t\t\t\tv = formatDate(\r\n\t\t\t\t\t\t\t\trenderedCellValue,\r\n\t\t\t\t\t\t\t\tcolumn.editProperties?.dateFormat || 'DD-MM-YYYY'\r\n\t\t\t\t\t\t\t) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t\tv = renderedCellValue ? `${formatAmount(renderedCellValue, currencyFormat, symbolPosition, cs)}` : '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'stringOrArray': {\r\n\t\t\t\t\t\t\tconst type = row.original?.promotion_map_data?.type;\r\n\t\t\t\t\t\t\tv = Array.isArray(renderedCellValue)\r\n\t\t\t\t\t\t\t\t? renderedCellValue.map((rcv) => (\r\n\t\t\t\t\t\t\t\t\trcv ? <Chip label={takeCurencyOrPercentage(type, rcv)} /> : null\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t\t: takeCurencyOrPercentage(type, renderedCellValue);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"checkbox\": {\r\n\t\t\t\t\t\t\tv = <Checkbox\r\n\t\t\t\t\t\t\t\tchecked={Boolean(renderedCellValue)}\r\n\t\t\t\t\t\t\t\tonClick={isCellChangeAFunc\r\n\t\t\t\t\t\t\t\t\t? (e) => onTableCellChange({\r\n\t\t\t\t\t\t\t\t\t\tvalue: e.target.checked,\r\n\t\t\t\t\t\t\t\t\t\tdata: row.original,\r\n\t\t\t\t\t\t\t\t\t\tcol: column,\r\n\t\t\t\t\t\t\t\t\t\trow: row,\r\n\t\t\t\t\t\t\t\t\t\tname: name,\r\n\t\t\t\t\t\t\t\t\t\tuRows: rows\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t/>;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"array\": {\r\n\t\t\t\t\t\t\tv = Array.isArray(renderedCellValue) && renderedCellValue.length ?\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0.5, alignItems: 'center', flexWrap: 'wrap' }}>\r\n\t\t\t\t\t\t\t\t\t{renderedCellValue.map(r => (<Chip type='normal' label={_.get(r, column?.valueGet, '')} active />))}\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t: '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"file\": {\r\n\t\t\t\t\t\t\tv = getFileName(renderedCellValue) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn v;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t},\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t\t[cs, takeCurencyOrPercentage, currencySymbol, rows]\r\n\t);\r\n\treturn (\r\n\t\t<Box data-position={position}>\r\n\t\t\t<Typography\r\n\t\t\t\ttype='s5'\r\n\t\t\t\tweight='medium'\r\n\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\tdata-position={position}\r\n\t\t\t\tsx={{ mb: 0.5 }}>\r\n\t\t\t\t{t(label)}\r\n\t\t\t</Typography>\r\n\t\t\t<Box /* sx={disabled ? { pointerEvents: 'none' } : {}} */>\r\n\t\t\t\t<MaterialTable\r\n\t\t\t\t\tcolumnOrder={['mrt-row-select']}\r\n\t\t\t\t\t// rows={parse(stringify(rows))}\r\n\t\t\t\t\trows={rows}\r\n\t\t\t\t\tcolumns={tableColumns(parse(stringify(columns)))}\r\n\t\t\t\t\ttotalPages={20}\r\n\t\t\t\t\tpaginationModel={{ pageNo: 1, limit: 10 }}\r\n\t\t\t\t\tenableEditing={false}\r\n\t\t\t\t\tenableColumnDragging={false}\r\n\t\t\t\t\tenableBottomToolbar={false}\r\n\t\t\t\t\tdefaultActionColumnItems={defaultActionColumnItems}\r\n\t\t\t\t\t{...rest}\r\n\t\t\t\t/>\r\n\t\t\t\t{is_button && !disableTableAddButton && (\r\n\t\t\t\t\t<Box\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\t\t\tjustifyContent: 'space-between',\r\n\t\t\t\t\t\t\tmt: 1\r\n\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\tonClick={() => onAddClick?.(name)}\r\n\t\t\t\t\t\t\tstartIcon={<Add />}\r\n\t\t\t\t\t\t\tclassName='table--AddButton'>\r\n\t\t\t\t\t\t\tAdd\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t{Boolean(otherButtons?.length) && otherButtons}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Box>\r\n\t\t</Box>\r\n\t);\r\n});\r\n\r\nexport default DynamicTable;\r\n","import { styled } from '@mui/material/styles';\r\nimport { AdapterDayjs } from \"@mui/x-date-pickers/AdapterDayjs\";\r\nimport { LocalizationProvider } from \"@mui/x-date-pickers/LocalizationProvider\";\r\nimport { TimePicker as Time } from \"@mui/x-date-pickers/TimePicker\";\r\nimport Typography from \"../typography/typography\";\r\nimport \"./time-picker.scss\";\r\nimport { memo } from \"react\";\r\n\r\nexport interface TimePickerProps {\r\n label: string;\r\n disabled?: boolean;\r\n error?: boolean;\r\n name?: string;\r\n value?: string | number | Date;\r\n helperText?: string;\r\n dataPosition?: number;\r\n dataName?: string;\r\n is24hrFormat?: boolean;\r\n placeholder?: string;\r\n required?: boolean;\r\n}\r\n\r\nconst StyledTimePicker = styled(Time)(({ theme: { palette } }) => ({\r\n \"& .MuiOutlinedInput-root\": {\r\n padding: \"0\",\r\n color: palette.theme?.secondary[800],\r\n \"& fieldset\": {\r\n borderColor: palette.theme?.secondary[400],\r\n },\r\n \"&:hover fieldset\": {\r\n borderColor: palette.theme?.secondary[500],\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n borderWidth: \"0.0625rem\",\r\n borderStyle: \"solid\",\r\n borderColor: palette.theme?.primary[700],\r\n },\r\n \"&.Mui-error fieldset\": {\r\n borderColor: palette.theme?.error[600],\r\n },\r\n \"&.Mui-disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n \"& .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.secondary[800],\r\n opacity: 1,\r\n },\r\n },\r\n \"& .MuiFormHelperText-root\": {\r\n marginLeft: 0,\r\n color: palette.theme?.secondary[800],\r\n \"&.Mui-error\": {\r\n color: palette.theme?.error[600],\r\n },\r\n },\r\n \"& .MuiIconButton-root\": {\r\n marginRight: 0,\r\n },\r\n \"& .MuiPickersCalendarHeader-labelContainer\": {\r\n fontWeight: 600,\r\n },\r\n}));\r\n\r\nconst TimePicker = memo((props: TimePickerProps) => {\r\n const {\r\n label,\r\n disabled,\r\n error,\r\n helperText,\r\n dataName,\r\n dataPosition,\r\n is24hrFormat = false,\r\n placeholder,\r\n required = false,\r\n ...rest\r\n } = props;\r\n return (\r\n <div>\r\n <LocalizationProvider dateAdapter={AdapterDayjs}>\r\n {label && (\r\n <Typography\r\n type=\"s4\"\r\n fontWeight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n <StyledTimePicker\r\n {...rest}\r\n disabled={disabled}\r\n slotProps={{\r\n textField: {\r\n helperText: helperText,\r\n error: error,\r\n placeholder: placeholder || \"HH:mm A\",\r\n // required: required,\r\n },\r\n }}\r\n format={is24hrFormat ? \"HH:MM\" : \"hh:mm a\"}\r\n className=\"timePicker\"\r\n />\r\n </LocalizationProvider>\r\n </div>\r\n );\r\n});\r\n\r\nexport { TimePicker };\r\nexport default TimePicker;\r\n","import { Controller } from 'react-hook-form';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport './element.scss';\r\nimport TimePicker from '../../../time-picker/time-picker';\r\nimport React from 'react';\r\n\r\nconst DynamicTime = React.memo((props: any) => {\r\n\r\n\treturn (\r\n\t\t<Controller\r\n\t\t\tcontrol={props.formControl}\r\n\t\t\tname={`${props.fieldArrayName}.${props.name}`}\r\n\t\t\trender={({ field, fieldState }) => (\r\n\t\t\t\t<TimePicker\r\n\t\t\t\t\t{...field}\r\n\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\tprops?.onChange(e);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tdataPosition={props.position}\r\n\t\t\t\t\tdataName={`${props.fieldArrayName}.${props.name}`}\r\n\t\t\t\t\tlabel={props.label}\r\n\t\t\t\t\tplaceholder={props.placeholder}\r\n\t\t\t\t\trequired={props.formType === 'builder' ? false : props.required}\r\n\t\t\t\t\tis24hrFormat={props.options === '24hr'}\r\n\t\t\t\t\tdisabled={props.disabled}\r\n\t\t\t\t\thelperText={fieldState.error?.message}\r\n\t\t\t\t\terror={Boolean(fieldState.error)}\r\n\t\t\t\t\t{...(props?.rest || {})}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\n\r\nDynamicTime.propTypes = {\r\n\tformControl: PropTypes.shape({\r\n\t\tregister: PropTypes.func.isRequired,\r\n\t\tsetValue: PropTypes.func\r\n\t}).isRequired,\r\n\tname: PropTypes.string.isRequired,\r\n\tlabel: PropTypes.string.isRequired,\r\n\tfieldArrayName: PropTypes.string,\r\n\trequired: PropTypes.bool,\r\n\tposition: PropTypes.number,\r\n\tformType: PropTypes.string,\r\n\toption: PropTypes.string,\r\n\tplaceholder: PropTypes.string,\r\n\ttypeOfField: PropTypes.string,\r\n\tdisabled: PropTypes.bool,\r\n\tonChange: PropTypes.func,\r\n\trest: PropTypes.object,\r\n};\r\n\r\nexport { DynamicTime };\r\nexport default DynamicTime;\r\n","import { styled } from \"@mui/material/styles\";\nimport Switch, { SwitchProps } from \"@mui/material/Switch\";\nimport Stack from \"@mui/material/Stack\";\nimport Typography, { ITypography } from \"../typography/typography\";\nimport { useLanguage } from \"../../hooks/useLangauge\";\nimport { memo } from \"react\";\n\nexport interface ISwitchProps extends SwitchProps {\n label?: string;\n labelPosition?: \"start\" | \"end\";\n typographyProps?: ITypography;\n}\n\nconst CustomisedSwitch = styled((props: ISwitchProps) => (\n <Switch focusVisibleClassName=\".Mui-focusVisible\" disableRipple {...props} />\n))(({ theme, size, checked }) => ({\n width: 24,\n height: 16,\n padding: 0,\n \"& .MuiSwitch-switchBase\": {\n padding: 0,\n margin: size === \"medium\" ? 2 : 1,\n transitionDuration: \"300ms\",\n \"&.Mui-checked\": {\n transform: size === \"medium\" ? \"translateX(16px)\" : \"translateX(8px)\",\n color: \"#fff\",\n \"& + .MuiSwitch-track\": {\n backgroundColor: theme.palette.mode === \"dark\" ? \"#2ECA45\" : \"#65C466\",\n opacity: 1,\n border: 0,\n },\n \"&.Mui-disabled + .MuiSwitch-track\": {\n opacity: 0.5,\n },\n },\n \"&.Mui-focusVisible .MuiSwitch-thumb\": {\n color: \"#33cf4d\",\n border: \"6px solid #fff\",\n },\n \"&.Mui-disabled .MuiSwitch-thumb\": {\n color:\n theme.palette.mode === \"light\"\n ? theme.palette.grey[100]\n : theme.palette.grey[600],\n },\n \"&.Mui-disabled + .MuiSwitch-track\": {\n opacity: theme.palette.mode === \"light\" ? 0.7 : 0.3,\n },\n },\n \"& .MuiSwitch-thumb\": {\n boxSizing: \"border-box\",\n width: 14,\n height: 14,\n border: checked ? 0 : `1px solid ${theme.palette.theme?.secondary[300]}`,\n },\n \"& .MuiSwitch-track\": {\n borderRadius: 26 / 2,\n backgroundColor: theme.palette.theme?.secondary[200],\n opacity: 1,\n transition: theme.transitions.create([\"background-color\"], {\n duration: 500,\n }),\n },\n ...(size === \"medium\" && {\n width: 42,\n height: 26,\n \"& .MuiSwitch-thumb\": {\n boxSizing: \"border-box\",\n width: 22,\n height: 22,\n border: checked ? 0 : `1px solid ${theme.palette.theme?.secondary[300]}`,\n },\n }),\n}));\n\nconst ToggleSwitch: React.FC<ISwitchProps> = memo(({\n label,\n labelPosition = \"end\",\n typographyProps,\n ...rest\n}) => {\n const {isRtl}=useLanguage();\n return (\n <Stack direction=\"row\" spacing={isRtl ? '' : 0.5} alignItems=\"center\">\n {labelPosition === \"start\" && (\n <Typography type=\"s3\" color=\"theme.secondary.1000\" {...typographyProps}>\n {label}\n </Typography>\n )}\n <CustomisedSwitch sx={{ m: 1 }} {...rest} />\n {labelPosition === \"end\" && (\n <Typography type=\"s3\" color=\"theme.secondary.1000\" {...typographyProps}>\n {label}\n </Typography>\n )}\n </Stack>\n );\n});\n\nexport default ToggleSwitch;\n","import { Control, Controller } from \"react-hook-form\";\nimport Typography from \"../../../typography/typography\";\nimport ToggleSwitch, {\n ISwitchProps,\n} from \"../../../toggle-switch/toggle-switch\";\nimport { memo } from \"react\";\n\ninterface IDynamicToggleButton {\n formControl: Control<any>;\n fieldArrayName: string;\n name: string;\n label: string;\n position: number;\n disabled?: boolean;\n titlePosition?: \"start\" | \"end\";\n typeOfField?: string;\n title: string;\n toggleSwitchProps?: ISwitchProps;\n}\n\nconst DynamicToggleButton: React.FC<IDynamicToggleButton> = memo(({\n formControl,\n fieldArrayName,\n name,\n label,\n position,\n disabled,\n titlePosition,\n title,\n toggleSwitchProps,\n}) => {\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={formControl}\n\t\t\tname={`${fieldArrayName}.${name}`}\n\t\t\trender={({ field }) => (\n\t\t\t\t<>\n\t\t\t\t\t<Typography\n\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\tdata-position={position}\n\t\t\t\t\t\tsx={{ mb: 0.5 }}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<ToggleSwitch\n\t\t\t\t\t\t{...toggleSwitchProps}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\tonChange={field.onChange}\n\t\t\t\t\t\tlabel={title}\n\t\t\t\t\t\tdisabled={Boolean(disabled)}\n\t\t\t\t\t\tlabelPosition={titlePosition}\t\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nexport default DynamicToggleButton;\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport React, { ReactNode, useEffect, useState } from \"react\";\nimport { Box, IconButton } from \"@mui/material\";\nimport Tab from \"@mui/material/Tab\";\nimport TabContext from \"@mui/lab/TabContext\";\nimport TabList from \"@mui/lab/TabList\";\nimport TabPanel from \"@mui/lab/TabPanel\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nimport \"./tabs.scss\";\nimport TextField from \"../text-field/text-field\";\nimport { useTranslation } from \"react-i18next\";\nimport Typography from \"../typography/typography\";\n\ninterface TabItem {\n tab_order: number;\n title: string;\n content?: string | ReactNode;\n data?: any;\n remove_tab?: boolean;\n}\nexport interface TabProps {\n tabs: TabItem[];\n activeValue?: number;\n setActiveValue?: React.Dispatch<React.SetStateAction<number | undefined>>;\n onEditTabTitle?: (tabId: number, newTitle: string) => void;\n handleTabChange?: () => void;\n handleRemoveTab?: (tabId: number) => void;\n isFormTabValid?: boolean ;\n isTabViewOnly?: boolean;\n activeTabs?: any[] ;\n setActiveTabs?: React.Dispatch<React.SetStateAction<number | undefined>>;\n containerProps?: any;\n}\n\nexport const TabBar = (props: TabProps) => {\n const { t } = useTranslation();\n const {\n tabs,\n onEditTabTitle,\n activeValue,\n setActiveValue,\n handleTabChange,\n handleRemoveTab,\n // isFormTabValid , \n isTabViewOnly,\n activeTabs, \n containerProps\n } = props; \n \n const [value, setValue] = useState<number>(activeValue || 0);\n const [editableTabId, setEditableTabId] = useState<number | null>(null);\n useEffect(()=>{\n activeValue && setValue(activeValue);\n\t} , [activeValue])\n\n const handleChange = (_event: React.SyntheticEvent, newValue: number) => {\n setValue(newValue);\n setActiveValue && setActiveValue(newValue);\n handleTabChange && handleTabChange();\n };\n\n const handleTabDoubleClick = (tabId: number) => {\n setEditableTabId(tabId);\n };\n\n const handleEditTabTitle = (\n event: React.ChangeEvent<HTMLInputElement>,\n tabId: number,\n ) => {\n onEditTabTitle && onEditTabTitle(tabId, event.target.value);\n };\n\n // useEffect(() => {\n // if (setActiveValue && Boolean(tabs?.length)) setActiveValue(value);\n // // eslint-disable-next-line\n // }, [tabs]);\n\n return (\n <Box mb={2} {...containerProps}>\n <TabContext value={activeValue ?? value }>\n <Box>\n <TabList className=\"account-payble-tabs-wrap\" onChange={handleChange} variant=\"scrollable\" scrollButtons=\"auto\" aria-label=\"scrollable tabs\" sx={{ overflowX: 'auto', maxWidth: '100%' }}>\n {tabs.map((tab: TabItem, index: any) => (\n <Tab\n className=\"account-payble-tab-items\"\n key={tab.tab_order}\n \n label={\n <Box display='flex' alignItems='center'>\n {\n onEditTabTitle && editableTabId === tab.tab_order ? (\n <TextField\n value={tab.title}\n autoFocus\n onBlur={() => setEditableTabId(null)}\n onChange={(e: any) =>\n handleEditTabTitle(e, tab.tab_order)\n }\n />\n ) : handleRemoveTab ? (\n <div className=\"Tabs--Title\">\n <Typography color='theme.secondary.1000' type='s3'>{t(tab.title)}</Typography>\n {!tab.remove_tab && (\n <IconButton size=\"small\" onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n handleRemoveTab(tab.tab_order);\n }}>\n <CloseIcon style={{ fontSize: \"15px\", cursor: \"pointer\" }}/>\n </IconButton>\n )}\n </div>\n ) : (\n <Typography color='theme.secondary.1000' type='s3'>{t(tab.title)}</Typography>\n )\n }\n </Box>\n }\n wrapped\n onDoubleClick={() => handleTabDoubleClick(tab.tab_order)}\n />\n ))}\n </TabList>\n </Box>\n {tabs.map(\n (tab: TabItem, index: number) =>\n tab.content && (\n <TabPanel value={index.toString()} key={tab.tab_order}>\n {value === index && tab.content}\n </TabPanel>\n ),\n )}\n </TabContext>\n </Box>\n );\n}\n\nexport default TabBar;","import { AlertProps, Alert as MUIAlert, styled } from \"@mui/material\";\r\n\r\nconst StyledAlert = styled(MUIAlert)(({ theme: { palette } }) => ({\r\n \"&.MuiAlert-root\": {\r\n fontSize: \"0.75rem\",\r\n fontWeight: \"500\",\r\n letterSpacing: \"-0.24px\",\r\n padding: \"0rem 0.75rem\",\r\n },\r\n \"&.MuiAlert-standardInfo\": {\r\n color: palette.theme?.secondary[900],\r\n backgroundColor: palette.theme?.secondary[200],\r\n },\r\n \"&.MuiAlert-standardSuccess\": {\r\n color: palette.theme?.primary[900],\r\n backgroundColor: palette.theme?.primary[100],\r\n },\r\n \"&.MuiAlert-standardError\": {\r\n color: palette.theme?.tertiary6[900],\r\n backgroundColor: palette.theme?.tertiary6[100],\r\n \"& .MuiAlert-icon\" : {\r\n color: palette.theme?.tertiary6[900],\r\n }\r\n },\r\n\r\n \".MuiAlert-action\": {\r\n svg: {\r\n fontSize: \"1rem\",\r\n },\r\n },\r\n}));\r\n\r\nconst Alert = (props: AlertProps) => {\r\n const { children, icon = false, ...rest } = props;\r\n\r\n return (\r\n <StyledAlert icon={icon} {...rest}>\r\n {children}\r\n </StyledAlert>\r\n );\r\n};\r\n\r\nexport { Alert };\r\nexport default Alert;\r\n","//eslint-disable @typescript-eslint/no-explicit-any\r\nimport React, { useState, useRef, KeyboardEvent, memo } from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport { \r\n Chip, \r\n Box, \r\n FormControl, \r\n FormHelperText,\r\n InputAdornment,\r\n styled\r\n} from '@mui/material';\r\nimport Typography from '../typography/typography';\r\n\r\n// interface ValidationRule {\r\n// type: 'email' | 'url' | 'phone' | 'custom';\r\n// pattern?: RegExp;\r\n// message: string;\r\n// validator?: (value: string) => boolean;\r\n// }\r\n\r\ninterface ChipGeneratorProps {\r\n name: string;\r\n control: any;\r\n label?: string;\r\n placeholder?: string;\r\n required?: boolean;\r\n disabled?: boolean;\r\n validation?: any[];\r\n maxChips?: number;\r\n allowDuplicates?: boolean;\r\n fieldArrayName?: string;\r\n endIcon?: React.ReactNode;\r\n helperText?: string;\r\n error?: boolean;\r\n onChipAdd?: (chip: string) => void;\r\n onChipRemove?: (chip: string, index: number) => void;\r\n customChipProps?: any;\r\n textFieldProps?: any;\r\n allowMultipleAdd?: boolean;\r\n delimiters?: string[];\r\n // New props for data type handling\r\n dataType?: 'array' | 'string';\r\n separator?: string;\r\n}\r\n\r\n// Styled components for inline chips\r\nconst ChipContainer = styled(Box)(({ theme }) => ({\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n alignItems: 'center',\r\n gap: theme.spacing(0.5),\r\n minHeight: '1.4375em',\r\n border: `1px solid #D3D3D4`,\r\n borderRadius: '0.25rem',\r\n cursor: 'text',\r\n fontSize: '0.875rem',\r\n// '&:hover': {\r\n// borderColor: theme.palette.text.primary,\r\n// },\r\n '&.focused': {\r\n borderColor:'#54CC96',\r\n borderWidth: '1px',\r\n },\r\n '&.error': {\r\n borderColor: theme.palette.error.main,\r\n },\r\n '&.disabled': {\r\n backgroundColor: theme.palette.action.disabledBackground,\r\n cursor: 'default',\r\n },\r\n paddingLeft: 3 \r\n}));\r\n\r\nconst InlineInput = styled('input')(({ theme }) => ({\r\n border: 'none',\r\n outline: 'none',\r\n backgroundColor: 'transparent',\r\n flexGrow: 1,\r\n minWidth: '120px',\r\n padding: '0.5rem',\r\n fontSize: '0.875rem',\r\n fontFamily: theme.typography.fontFamily,\r\n '&::placeholder': {\r\n color: theme.palette.text.secondary,\r\n opacity: 1,\r\n },\r\n '&:disabled': {\r\n cursor: 'default',\r\n }\r\n}));\r\n\r\nconst InlineChip = styled(Chip)(({theme: { palette }}) => ({\r\n height: '24px',\r\n fontSize: '0.875rem',\r\n borderColor:' #54CC96',\r\n backgroundColor: palette.theme.primary[50],\r\n color:'#2EB273',\r\n margin: '1px',\r\n '& .MuiChip-deleteIcon': {\r\n fontSize: '16px',\r\n color:'#2EB273',\r\n '&:hover': {\r\n color: '#2EB273',\r\n },\r\n },\r\n}));\r\n\r\nconst ChipGenerator: React.FC<ChipGeneratorProps> = memo(({\r\n name,\r\n control,\r\n label,\r\n placeholder = \"Type and press space to add\",\r\n required = false,\r\n disabled = false,\r\n validation,\r\n maxChips,\r\n allowDuplicates = false,\r\n fieldArrayName,\r\n endIcon,\r\n helperText,\r\n error: externalError,\r\n onChipAdd,\r\n onChipRemove,\r\n customChipProps = {},\r\n allowMultipleAdd = true,\r\n delimiters = [',', ';', '\\n', '\\t'],\r\n dataType = 'string',\r\n separator = ',',\r\n}) => {\r\n const [inputValue, setInputValue] = useState('');\r\n const [validationError, setValidationError] = useState('');\r\n const [focused, setFocused] = useState(false);\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n\r\n const validateChip = (value: string,validation: any): { isValid: boolean; error: string } => {\r\n if (!validation) return { isValid: true, error: '' };\r\n\r\n const trimmedValue = value.trim();\r\n if (!trimmedValue) return { isValid: false, error: 'Empty values are not allowed' };\r\n\r\n switch (validation.type) {\r\n case 'email': {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n const isValidEmail = emailRegex.test(trimmedValue);\r\n return {\r\n isValid: isValidEmail,\r\n error: isValidEmail ? '' : validation.message || 'Please enter a valid email address'\r\n };\r\n }\r\n\r\n // case 'url': {\r\n // const urlRegex = /^(https?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([\\/\\w .-]*)*\\/?$/;\r\n // const isValidUrl = urlRegex.test(trimmedValue);\r\n // return {\r\n // isValid: isValidUrl,\r\n // error: isValidUrl ? '' : validation.message || 'Please enter a valid URL'\r\n // };\r\n // }\r\n\r\n case 'phone': {\r\n const phoneRegex = /^[+]?[1-9][\\d]{0,15}$/;\r\n const isValidPhone = phoneRegex.test(trimmedValue.replace(/[\\s()-]/g, ''));\r\n return {\r\n isValid: isValidPhone,\r\n error: isValidPhone ? '' : validation.message || 'Please enter a valid phone number'\r\n };\r\n }\r\n\r\n case 'custom': {\r\n if (validation.pattern) {\r\n const isValid = validation.pattern.test(trimmedValue);\r\n return {\r\n isValid,\r\n error: isValid ? '' : validation.message\r\n };\r\n }\r\n if (validation.validator) {\r\n const isValid = validation.validator(trimmedValue);\r\n return {\r\n isValid,\r\n error: isValid ? '' : validation.message\r\n };\r\n }\r\n return { isValid: true, error: '' };\r\n }\r\n\r\n default:\r\n return { isValid: true, error: '' };\r\n }\r\n };\r\n\r\n // Convert between string and array formats\r\n const stringToArray = (str: string): string[] => {\r\n if (!str || typeof str !== 'string') return [];\r\n return str.split(separator).map(item => item.trim()).filter(Boolean);\r\n };\r\n\r\n const arrayToString = (arr: string[]): string => {\r\n return arr.join(separator + ' ');\r\n };\r\n\r\n // Parse input value by delimiters\r\n const parseMultipleValues = (inputStr: string): string[] => {\r\n if (!allowMultipleAdd) {\r\n return [inputStr.trim()].filter(Boolean);\r\n }\r\n\r\n const delimiterPattern = delimiters.map(d => \r\n d.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\r\n ).join('|');\r\n \r\n const regex = new RegExp(`[${delimiterPattern}]`);\r\n \r\n return inputStr\r\n .split(regex)\r\n .map(val => val.trim())\r\n .filter(Boolean);\r\n };\r\n\r\n const addChips = (inputStr: string, currentChips: string[]): { \r\n newChips: string[]; \r\n errors: string[]; \r\n addedCount: number;\r\n } => {\r\n const valuesToAdd = parseMultipleValues(inputStr);\r\n if (valuesToAdd.length === 0) {\r\n return { newChips: currentChips, errors: [], addedCount: 0 };\r\n }\r\n\r\n const newChips = [...currentChips];\r\n const errors: string[] = [];\r\n let addedCount = 0;\r\n\r\n for (const value of valuesToAdd) {\r\n if (maxChips && newChips.length >= maxChips) {\r\n errors.push(`Maximum ${maxChips} items allowed`);\r\n break;\r\n }\r\n \r\n if (validation?.length > 0) {\r\n const errorMessages = validation\r\n .map(val => validateChip(value, val))\r\n .filter(result => !result.isValid)\r\n .map(result => result.error);\r\n\r\n if (errorMessages.length > 0) {\r\n errors.push(`\"${value}\": ${errorMessages.join(', ')}`);\r\n continue;\r\n }\r\n }\r\n \r\n\r\n if (!allowDuplicates && newChips.includes(value)) {\r\n errors.push(`\"${value}\": Duplicate values are not allowed`);\r\n continue;\r\n }\r\n\r\n newChips.push(value);\r\n addedCount++;\r\n onChipAdd?.(value);\r\n }\r\n\r\n return { newChips, errors, addedCount };\r\n };\r\n\r\n const removeChip = (chipToRemove: string, index: number, currentChips: string[]) => {\r\n const newChips = currentChips.filter((_, i) => i !== index);\r\n onChipRemove?.(chipToRemove, index);\r\n setValidationError('');\r\n return newChips;\r\n };\r\n\r\n const processInput = (\r\n inputStr: string,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n const currentChips = Array.isArray(currentValue) ? currentValue : stringToArray(currentValue);\r\n const { newChips, errors } = addChips(inputStr, currentChips);\r\n \r\n if (errors.length > 0) {\r\n setValidationError(errors.join('; '));\r\n } else {\r\n setValidationError('');\r\n }\r\n \r\n if (newChips.length !== currentChips.length) {\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n setInputValue('');\r\n }\r\n };\r\n\r\n const handleKeyPress = (\r\n event: KeyboardEvent<HTMLInputElement>,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n if (event.key === ' ' || event.key === 'Enter') {\r\n event.preventDefault();\r\n if (inputValue.trim()) {\r\n processInput(inputValue, onChange, currentValue);\r\n }\r\n } else if (event.key === 'Backspace' && !inputValue) {\r\n const currentChips = Array.isArray(currentValue) ? currentValue : stringToArray(currentValue);\r\n if (currentChips.length > 0) {\r\n const lastIndex = currentChips.length - 1;\r\n const newChips = removeChip(currentChips[lastIndex], lastIndex, currentChips);\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n }\r\n }\r\n };\r\n\r\n const handleBlur = (\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n setFocused(false);\r\n if (inputValue.trim()) {\r\n processInput(inputValue, onChange, currentValue);\r\n }\r\n };\r\n\r\n const handlePaste = (\r\n event: React.ClipboardEvent<HTMLInputElement>,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n if (allowMultipleAdd) {\r\n event.preventDefault();\r\n const pastedText = event.clipboardData.getData('text');\r\n const combinedInput = inputValue + pastedText;\r\n processInput(combinedInput, onChange, currentValue);\r\n }\r\n };\r\n\r\n const handleContainerClick = () => {\r\n if (!disabled && inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const fieldName = fieldArrayName ? `${fieldArrayName}.${name}` : name;\r\n\r\n return (\r\n <Controller\r\n name={fieldName}\r\n control={control}\r\n defaultValue={dataType === 'string' ? '' : []}\r\n render={({ field: { onChange, value, ...field }, fieldState: { error } }) => {\r\n const currentChips = Array.isArray(value) ? value : stringToArray(value || '');\r\n const hasError = !!error || !!validationError || externalError;\r\n\r\n return (\r\n <FormControl fullWidth error={hasError}>\r\n {label && (\r\n <Typography\r\n type=\"s5\"\r\n weight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n\r\n <ChipContainer\r\n ref={containerRef}\r\n className={`${focused ? 'focused' : ''} ${hasError ? 'error' : ''} ${disabled ? 'disabled' : ''}`}\r\n onClick={handleContainerClick}\r\n >\r\n {currentChips.map((chip: string, index: number) => (\r\n <InlineChip\r\n key={`${chip}-${index}`}\r\n label={chip}\r\n onDelete={\r\n disabled\r\n ? undefined\r\n : (event) => {\r\n event.stopPropagation();\r\n const newChips = removeChip(chip, index, currentChips);\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n }\r\n }\r\n size=\"small\"\r\n // color=\"primary\"\r\n // variant=\"outlined\"\r\n {...customChipProps}\r\n />\r\n ))}\r\n \r\n <InlineInput\r\n {...field}\r\n ref={inputRef}\r\n value={inputValue}\r\n onChange={(e) => setInputValue(e.target.value)}\r\n onKeyDown={(e) => handleKeyPress(e, onChange, value)}\r\n onFocus={() => setFocused(true)}\r\n onBlur={() => handleBlur(onChange, value)}\r\n onPaste={(e) => handlePaste(e, onChange, value)}\r\n placeholder={currentChips.length === 0 ? placeholder : ''}\r\n disabled={disabled}\r\n style={{ \r\n width: inputValue ? `${Math.max(inputValue.length * 8, 120)}px` : '120px',\r\n }}\r\n />\r\n \r\n {endIcon && (\r\n <InputAdornment position=\"end\" sx={{ ml: 1 }}>\r\n {endIcon}\r\n </InputAdornment>\r\n )}\r\n </ChipContainer>\r\n\r\n {(helperText || error?.message || validationError) && (\r\n <FormHelperText>\r\n {error?.message || validationError || helperText}\r\n </FormHelperText>\r\n )}\r\n\r\n {maxChips && (\r\n <FormHelperText>\r\n {currentChips.length} / {maxChips} items\r\n </FormHelperText>\r\n )}\r\n\r\n \r\n </FormControl>\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nexport default ChipGenerator;","import {\r\n\tUseFormSetValue,\r\n\tFieldValues,\r\n\tuseFormContext,\r\n\tUseFormWatch,\r\n\tUseFormGetFieldState,\r\n\tControl\r\n} from 'react-hook-form';\r\nimport { useLocationFilter } from '../hooks/useLocationFilter';\r\nimport DynamicSearchSelect from './form-control/form-builder/form-builder-element/dynamic-select';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { memo, useEffect, useMemo, useRef } from 'react';\r\nimport _ from 'lodash';\r\n\r\n\r\nexport interface LocationSearchSelectProps<\r\n\tT extends FieldValues = FieldValues\r\n> {\r\n\tselectedCompany?: string[] | string | number | null | undefined;\r\n\tcontrol?: Control<T>;\r\n\tsetValue?: UseFormSetValue<T>;\r\n\tfieldArrayName: string;\r\n\tlocationFieldName?: string;\r\n\tlabel?: string;\r\n\tplaceholder?: string;\r\n\tresetValue?: any;\r\n\tfilterKey?: string;\r\n\t[key: string]: any;\r\n}\r\n\r\nexport interface LocationFilterType {\r\n\t[key: string]: string[] | string | number;\r\n}\r\n\r\nexport const LocationSearchSelect = memo(\r\n\t<T extends FieldValues = FieldValues>({\r\n\t\tselectedCompany,\r\n\t\tcontrol: propControl,\r\n\t\tsetValue: propSetValue,\r\n\t\tfieldArrayName,\r\n\t\tlocationFieldName = 'location_id',\r\n\t\tlabel,\r\n\t\tplaceholder,\r\n\t\tresetValue = undefined,\r\n\t\tfilterKey = '&company_id.in',\r\n\t\tfilterField = 'company_id',\r\n\t\t...dynamicSearchSelectProps\r\n\t}: LocationSearchSelectProps<T>): JSX.Element => {\r\n\t\tconst formContext = useFormContext();\r\n\t\tconst {\r\n\t\t\tcontrol: contextControl,\r\n\t\t\twatch: contextWatch,\r\n\t\t\tsetValue: contextSetValue,\r\n\t\t\tgetFieldState: contextGetFieldState\r\n\t\t} = formContext || {};\r\n\r\n\t\tconst controlToUse = propControl || contextControl;\r\n\t\tconst setValueToUse = propSetValue || contextSetValue;\r\n\t\tconst watchToUse: UseFormWatch<T> = contextWatch || (() => undefined);\r\n\t\tconst getFieldStateToUse: UseFormGetFieldState<T> =\r\n\t\t\tcontextGetFieldState || (() => ({}));\r\n\r\n\t\tconst filterFieldValue = watchToUse(`${fieldArrayName}.${filterField}`);\r\n\t\tconst isDirty = getFieldStateToUse(\r\n\t\t\t`${fieldArrayName}.${filterField}`\r\n\t\t)?.isDirty;\r\n\r\n\t\tconst prevFilterFieldValue = useRef<any>();\r\n\r\n\t\tconst { t } = useTranslation();\r\n\r\n\t\tconst isValueChanged = useMemo(() => {\r\n\t\t\treturn filterFieldValue && prevFilterFieldValue.current\r\n\t\t\t\t? !_.isEqual(prevFilterFieldValue.current, filterFieldValue)\r\n\t\t\t\t: false;\r\n\t\t}, [filterFieldValue]);\r\n\r\n\r\n\t\tuseEffect(() => {\r\n\t\t\tif (filterFieldValue) {\r\n\t\t\t\tprevFilterFieldValue.current = filterFieldValue;\r\n\t\t\t}\r\n\t\t}, [filterFieldValue]);\r\n\r\n\t\tconst locationFilter: LocationFilterType = useLocationFilter({\r\n\t\t\tselectedCompany: filterFieldValue || selectedCompany,\r\n\t\t\tsetValue: setValueToUse,\r\n\t\t\tfieldArrayName,\r\n\t\t\tlocationFieldName,\r\n\t\t\tresetValue,\r\n\t\t\tfilterKey,\r\n\t\t\tisDirty: isValueChanged || isDirty\r\n\t\t});\r\n\r\n\t\t// Now safely do the conditional render\r\n\t\tif (!controlToUse) {\r\n\t\t\tconsole.warn('LocationSearchSelect: No form control available.');\r\n\t\t\treturn <div>Location Search Select</div>;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<DynamicSearchSelect\r\n\t\t\t\tlabel={t(label) || t('crm.salesOrder.fields.location_label')}\r\n\t\t\t\tapiType='location'\r\n\t\t\t\taddType='location'\r\n\t\t\t\tenable_footer={true}\r\n\t\t\t\tname={locationFieldName}\r\n\t\t\t\tplaceholder={\r\n\t\t\t\t\tt(placeholder) || t('crm.salesOrder.fields.location_placeholder')\r\n\t\t\t\t}\r\n\t\t\t\tfieldArrayName={fieldArrayName}\r\n\t\t\t\tformControl={controlToUse}\r\n\t\t\t\tcustomeFilter={locationFilter}\r\n\t\t\t\t{...dynamicSearchSelectProps}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nLocationSearchSelect.defaultProps = {\r\n\tlocationFieldName: 'location_id',\r\n\tresetValue: undefined,\r\n\tfilterKey: '&company_id.in'\r\n};\r\n\r\nexport default LocationSearchSelect","// import React from \"react\";\nimport { Controller } from \"react-hook-form\";\nimport { RadioGroup } from \"@mui/material\";\nimport Typography from \"../../typography/typography\";\nimport { memo } from \"react\";\n\nconst FormSwitcher = memo(({\n children,\n isFormSwitcher,\n control,\n fieldArrayName,\n formSwitcherName,\n label,\n resetForm,\n}: any) => {\n if (isFormSwitcher) {\n return (\n <Controller\n control={control}\n name={`${fieldArrayName}.${formSwitcherName}`}\n render={({ field }) => (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"24px\",\n }}\n >\n {label ? (\n <Typography\n type=\"s5\"\n style={{ fontWeight: 500 }}\n color={\"theme.secondary.900\"}\n >\n {label}\n </Typography>\n ) : null}\n <RadioGroup\n value={field.value}\n onChange={(e) => {\n resetForm(e.target.value)\n field.onChange(e.target.value)\n }}\n row={true}\n >\n {children}\n </RadioGroup>\n </div>\n )}\n />\n );\n }\n return null;\n});\n\nexport { FormSwitcher };\nexport default FormSwitcher;\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { memo, useMemo, useCallback } from 'react';\r\nimport { Grid, Divider, FormControlLabel, Radio } from '@mui/material';\r\nimport DynamicInput from '../form-builder/form-builder-element/text';\r\nimport DynamicDate from '../form-builder/form-builder-element/date';\r\nimport DynamicTime from '../form-builder/form-builder-element/time';\r\nimport DynamicPhone from '../form-builder/form-builder-element/phone';\r\nimport DynamicSearchSelect from '../form-builder/form-builder-element/dynamic-select';\r\nimport DynamicMedia from '../form-builder/form-builder-element/media';\r\nimport DynamicInfo from '../form-builder/form-builder-element/info';\r\nimport DynamicToggleButton from '../form-builder/form-builder-element/toggle-button';\r\nimport DynamicCheckBox from '../form-builder/form-builder-element/checkbox';\r\nimport DynamicTable from '../form-builder/form-builder-element/table';\r\nimport DynamicRadioButton from '../form-builder/form-builder-element/radio-button';\r\nimport DynamicTagsInput from '../form-builder/form-builder-element/dynamic-tags-input';\r\nimport DynamicCurrency from '../form-builder/form-builder-element/dynamic-currency-input';\r\nimport DynamicInputSelect from '../form-builder/form-builder-element/dynamic-input-select';\r\nimport ChipGenerator from '../../chip-generator/chip-generator';\r\nimport { LocationSearchSelect } from '../../location-select';\r\nimport FormSwitcher from './form-switcher';\r\nimport Typography from '../../typography/typography';\r\nimport Accordion from '../../accordion/accordion';\r\n\r\n// Types for better type safety\r\ninterface Field {\r\n name?: string;\r\n label: string;\r\n field_type: string;\r\n is_fullwidth?: boolean;\r\n custom_width?: number;\r\n is_hidden?: boolean;\r\n is_required?: boolean;\r\n disabled?: boolean;\r\n placeholder?: string;\r\n value?: any;\r\n default_value?: any;\r\n title?: string;\r\n title_position?: string;\r\n table_columns?: any[];\r\n table_rows?: any[];\r\n component?: React.ReactNode;\r\n field_properties?: {\r\n apiType?: string;\r\n customeFilter?: any;\r\n attributes?: any;\r\n disabledIds?: any[];\r\n sortOrder?: string;\r\n maxChips?: number;\r\n allowDuplicates?: boolean;\r\n };\r\n validation?: any;\r\n filterField?: string;\r\n}\r\n\r\ninterface Section {\r\n label?: string;\r\n is_accordion?: boolean;\r\n disabled?: boolean;\r\n form_switcher_label?: string;\r\n}\r\n\r\ninterface FormSectionProps {\r\n section: Section;\r\n index: number;\r\n members?: Field[];\r\n switchForms?: any[];\r\n isFormSwitcher: boolean;\r\n control: any;\r\n fieldArrayName: string;\r\n formSwitcherName: string;\r\n displayAvtar?: boolean;\r\n isButton?: boolean;\r\n currencyOption?: any;\r\n values: any;\r\n onBlur?: (e: any, fieldName?: string) => void;\r\n setValue: (name: string, value: any) => void;\r\n onSelectFooterClick?: (field: Field) => void;\r\n getSelectedData?: (row: any, key: any) => void;\r\n setCurrencyOptions: (options: any) => void;\r\n refreshOptions: any;\r\n handleFieldCleanUp: (forms: any[]) => void;\r\n handleSetCountryCodeField: (country: any, field: Field, fieldArrayName: string, values: any) => void;\r\n handleTableAddClick: (field: Field) => void;\r\n onTableCellChange?: (data: any) => void;\r\n // setDetailsData: (data: any) => void;\r\n t: (key: string) => string;\r\n images: any;\r\n}\r\n\r\n// Memoized field component to prevent unnecessary re-renders\r\nconst MemoizedField = memo(({\r\n field,\r\n fieldName,\r\n sectionLabel,\r\n index,\r\n ...props\r\n}: {\r\n field: Field;\r\n fieldName: string;\r\n sectionLabel?: string;\r\n index: number;\r\n [key: string]: any;\r\n}) => {\r\n const gridSize = useMemo(() =>\r\n field.is_fullwidth ? 12 : (field.custom_width ?? 6),\r\n [field.is_fullwidth, field.custom_width]\r\n );\r\n\r\n const fieldKey = useMemo(() =>\r\n `${sectionLabel}-${fieldName}-${index}`,\r\n [sectionLabel, fieldName, index]\r\n );\r\n\r\n const commonProps = useMemo(() => ({\r\n ...field,\r\n key: fieldKey,\r\n name: fieldName,\r\n position: index,\r\n formControl: props.control,\r\n fieldArrayName: props.fieldArrayName,\r\n required: field.is_required,\r\n label: props.t(field.label),\r\n placeholder: props.t(field.placeholder),\r\n defaultValue: field.value || field.default_value,\r\n disabled: field.disabled\r\n }), [field, fieldName, index, fieldKey, props.control, props.fieldArrayName, props.t]);\r\n\r\n const handleBlur = useCallback((e: any) => {\r\n if (props.onBlur && typeof props.onBlur === 'function') {\r\n props.onBlur(e, fieldName);\r\n }\r\n }, [props.onBlur, fieldName]);\r\n\r\n const endIcon = useMemo(() => {\r\n const iconMap: Record<string, string> = {\r\n email: props.images.sms,\r\n url: props.images.url,\r\n currency: props.images.dollar,\r\n geoLocation: props.images.location\r\n };\r\n\r\n const iconSrc = iconMap[field.field_type];\r\n return iconSrc ? <img src={iconSrc} alt={field.field_type} /> : null;\r\n }, [field.field_type, props.images]);\r\n\r\n const relationLabel = useMemo(() => (\r\n field.field_type === \"relation\" ? (\r\n <span className=\"formSection--Relation\">\r\n {props.t(field.label)}\r\n <img src={props.images.relation} alt=\"relation\" />\r\n </span>\r\n ) : props.t(field.label)\r\n ), [field.field_type, field.label, props.t, props.images.relation]);\r\n\r\n // Render field based on type\r\n const renderField = () => {\r\n switch (field.field_type) {\r\n case \"text\":\r\n case \"email\":\r\n case \"url\":\r\n case \"currency\":\r\n case \"number\":\r\n case \"geoLocation\":\r\n case \"relation\":\r\n return (\r\n <DynamicInput\r\n {...commonProps}\r\n key={commonProps.key}\r\n label={relationLabel}\r\n onBlur={handleBlur}\r\n type={field.field_type}\r\n endIcon={endIcon}\r\n disabled={field.disabled || field.field_type === \"relation\"}\r\n />\r\n );\r\n\r\n case \"date\":\r\n return <DynamicDate {...commonProps} key={commonProps.key} />;\r\n\r\n case \"time\":\r\n return <DynamicTime {...commonProps} key={commonProps.key} />;\r\n\r\n case \"phone\":\r\n return (\r\n <DynamicPhone\r\n {...commonProps}\r\n key={commonProps.key}\r\n setCountryCodeField={(country: any) =>\r\n props.handleSetCountryCodeField(country, field, props.fieldArrayName, props.values)\r\n }\r\n />\r\n );\r\n\r\n case \"select\":\r\n return (\r\n <DynamicSearchSelect\r\n {...commonProps}\r\n key={commonProps.key}\r\n apiType={field.field_properties?.apiType}\r\n customeFilter={field.field_properties?.customeFilter}\r\n attributes={field.field_properties?.attributes}\r\n disabledIds={field.field_properties?.disabledIds}\r\n onChipRemove={() => props.setValue(`${props.fieldArrayName}.${fieldName}`, [])}\r\n {\r\n ...(!field?.addType || !field?.field_properties?.addType\r\n ? { onFooterClick: () => props.onSelectFooterClick?.(field) }\r\n : {})\r\n }\r\n handleOptions={props.setCurrencyOptions}\r\n getSelectedData={props.getSelectedData}\r\n refresh={props.refreshOptions}\r\n sortOrder={field.field_properties?.sortOrder}\r\n showCancelButton={field.field_properties?.showCancelButton}\r\n addType={field?.addType || field?.field_properties?.addType}\r\n modalComponentProps={field?.field_properties?.modalComponentProps}\r\n />\r\n );\r\n\r\n case \"file\":\r\n case \"image\":\r\n return <DynamicMedia {...commonProps} key={commonProps.key} />;\r\n\r\n case \"info\":\r\n return <DynamicInfo {...commonProps} key={commonProps.key} />;\r\n\r\n case \"toggleButton\":\r\n return (\r\n <DynamicToggleButton\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"checkbox\":\r\n return (\r\n <DynamicCheckBox\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"table\":\r\n return (\r\n <DynamicTable\r\n {...commonProps}\r\n key={commonProps.key}\r\n columns={field.table_columns}\r\n rows={field.table_rows}\r\n onAddClick={() => props.handleTableAddClick(field)}\r\n disableTableAddButton={Boolean(field.disableTableAddButton)}\r\n is_button={props.isButton}\r\n onTableCellChange={props.onTableCellChange}\r\n />\r\n );\r\n\r\n case \"radioButton\":\r\n return (\r\n <DynamicRadioButton\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"customComponent\":\r\n return field.component;\r\n\r\n case \"tagsInput\":\r\n return (\r\n <DynamicTagsInput\r\n {...commonProps}\r\n key={commonProps.key}\r\n label={relationLabel}\r\n type={field.field_type}\r\n endIcon={endIcon}\r\n />\r\n );\r\n\r\n case \"currency_with_amount\":\r\n return (\r\n <DynamicCurrency\r\n {...commonProps}\r\n key={commonProps.key}\r\n currencyType={props.currencyOption}\r\n />\r\n );\r\n\r\n case \"select_with_input\":\r\n return (\r\n <DynamicInputSelect\r\n {...commonProps}\r\n currencyType={props.currencyOption}\r\n />\r\n );\r\n\r\n case \"chipInput\":\r\n return (\r\n <ChipGenerator\r\n {...commonProps}\r\n key={commonProps.key}\r\n maxChips={field.field_properties?.maxChips}\r\n allowDuplicates={field.field_properties?.allowDuplicates}\r\n validation={field.validation}\r\n endIcon={endIcon}\r\n onChipAdd={(chip: any) => console.log('Chip added:', chip)}\r\n onChipRemove={(chip: any, index: number) => console.log('Chip removed:', chip, 'at index:', index)}\r\n />\r\n );\r\n\r\n case \"location_select\":\r\n return (\r\n <LocationSearchSelect\r\n fieldArrayName={props.fieldArrayName}\r\n filterField={field.filterField}\r\n getSelectedData={(row: any[]) => props.getSelectedData(row)}\r\n locationFieldName={field.name}\r\n addType=\"location\"\r\n enable_footer={true}\r\n />\r\n );\r\n\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n // For table fields, use full width\r\n if (field.field_type === \"table\" || field.field_type === \"customComponent\") {\r\n return (\r\n <Grid item xs={12}>\r\n {renderField()}\r\n </Grid>\r\n );\r\n }\r\n\r\n return (\r\n <Grid item xs={gridSize}>\r\n {renderField()}\r\n </Grid>\r\n );\r\n});\r\n\r\nMemoizedField.displayName = 'MemoizedField';\r\n\r\n// Memoized FormSwitcher component\r\nconst MemoizedFormSwitcher = memo(({\r\n section,\r\n switchForms,\r\n isFormSwitcher,\r\n control,\r\n fieldArrayName,\r\n formSwitcherName,\r\n handleFieldCleanUp,\r\n t\r\n}: {\r\n section: Section;\r\n switchForms?: any[];\r\n isFormSwitcher: boolean;\r\n control: any;\r\n fieldArrayName: string;\r\n formSwitcherName: string;\r\n handleFieldCleanUp: (forms: any[]) => void;\r\n t: (key: string) => string;\r\n}) => {\r\n const resetForm = useCallback(() => {\r\n handleFieldCleanUp(switchForms || []);\r\n }, [handleFieldCleanUp, switchForms]);\r\n\r\n if (!isFormSwitcher || !switchForms?.length) return null;\r\n\r\n return (\r\n <FormSwitcher\r\n {...section}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n label={t(section.form_switcher_label || '')}\r\n resetForm={resetForm}\r\n >\r\n {switchForms.map((forms: any) => (\r\n <FormControlLabel\r\n key={forms.id}\r\n value={forms.value || forms.name}\r\n control={<Radio />}\r\n slotProps={{ typography: { variant: \"body2\" } }}\r\n label={t(forms.name)}\r\n disabled={Boolean(section.disabled)}\r\n />\r\n ))}\r\n </FormSwitcher>\r\n );\r\n});\r\n\r\nMemoizedFormSwitcher.displayName = 'MemoizedFormSwitcher';\r\n\r\n// Main component\r\nconst FormSection = memo<FormSectionProps>(({\r\n section,\r\n index,\r\n members,\r\n switchForms,\r\n isFormSwitcher,\r\n control,\r\n fieldArrayName,\r\n formSwitcherName,\r\n displayAvtar,\r\n isButton,\r\n currencyOption,\r\n values,\r\n onBlur,\r\n setValue,\r\n onSelectFooterClick,\r\n getSelectedData,\r\n setCurrencyOptions,\r\n refreshOptions,\r\n handleFieldCleanUp,\r\n handleSetCountryCodeField,\r\n handleTableAddClick,\r\n onTableCellChange,\r\n setDetailsData,\r\n t,\r\n images\r\n}) => {\r\n // Memoize visible members to prevent recalculation\r\n const visibleMembers = useMemo(() =>\r\n members?.filter(f => !f.is_hidden) || [],\r\n [members]\r\n );\r\n\r\n // Memoize field names to prevent recalculation\r\n const fieldsWithNames = useMemo(() =>\r\n visibleMembers.map(field => ({\r\n ...field,\r\n fieldName: field.name || field.label.toLowerCase().split(\" \").join(\"_\")\r\n })),\r\n [visibleMembers]\r\n );\r\n\r\n // Memoize section header\r\n const sectionHeader = useMemo(() => {\r\n if (!section.label) return null;\r\n\r\n return (\r\n <div style={{ minHeight: \"16px\" }}>\r\n {index !== 0 && <Divider className='formParser--Section--SectionDivider' />}\r\n <Typography\r\n type=\"s3\"\r\n weight=\"medium\"\r\n mb={2}\r\n mt={4}\r\n color=\"theme.secondary.1000\"\r\n className='formParser--Section--SectionTitle'\r\n >\r\n {t(section.label)}\r\n </Typography>\r\n </div>\r\n );\r\n }, [section.label, index, t]);\r\n\r\n // Avatar component\r\n const avatarDisplay = useMemo(() =>\r\n displayAvtar ? <div className='avtarDisplay'>ERP</div> : null,\r\n [displayAvtar]\r\n );\r\n\r\n // Common props for field rendering\r\n const fieldProps = useMemo(() => ({\r\n control,\r\n fieldArrayName,\r\n isButton,\r\n currencyOption,\r\n values,\r\n onBlur,\r\n setValue,\r\n onSelectFooterClick,\r\n getSelectedData,\r\n setCurrencyOptions,\r\n refreshOptions,\r\n handleSetCountryCodeField,\r\n handleTableAddClick,\r\n onTableCellChange,\r\n setDetailsData,\r\n t,\r\n images\r\n }), [\r\n control, fieldArrayName, isButton, currencyOption, values,\r\n onBlur, setValue, onSelectFooterClick, getSelectedData,\r\n setCurrencyOptions, refreshOptions, handleSetCountryCodeField,\r\n handleTableAddClick, onTableCellChange, setDetailsData, t, images\r\n ]);\r\n\r\n if (section.is_accordion) {\r\n return (\r\n <section key={index} className='formParser--Section'>\r\n <div style={{ marginTop: '20px' }}>\r\n <Accordion title={t(section.label || '')}>\r\n <div className=\"formParser--Grid formParser--Accordion\">\r\n <MemoizedFormSwitcher\r\n section={section}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n t={t}\r\n />\r\n {fieldsWithNames.map((field, fieldIndex) => (\r\n <MemoizedField\r\n key={`${section.label}-${field.fieldName}-${fieldIndex}`}\r\n field={field}\r\n fieldName={field.fieldName}\r\n sectionLabel={section.label}\r\n index={fieldIndex}\r\n {...fieldProps}\r\n />\r\n ))}\r\n </div>\r\n </Accordion>\r\n </div>\r\n </section>\r\n );\r\n }\r\n\r\n return (\r\n <section key={index} className='formParser--Section'>\r\n {sectionHeader}\r\n\r\n <MemoizedFormSwitcher\r\n section={section}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n t={t}\r\n />\r\n\r\n <Grid container spacing={2}>\r\n {avatarDisplay}\r\n {fieldsWithNames.map((field, fieldIndex) => (\r\n <MemoizedField\r\n key={`${section.label}-${field.fieldName}-${fieldIndex}`}\r\n field={field}\r\n fieldName={field.fieldName}\r\n sectionLabel={section.label}\r\n index={fieldIndex}\r\n {...fieldProps}\r\n />\r\n ))}\r\n </Grid>\r\n </section>\r\n );\r\n});\r\n\r\nFormSection.displayName = 'FormSection';\r\n\r\nexport { FormSection };\r\nexport default FormSection;","import { FormProvider, useForm, useWatch } from \"react-hook-form\";\r\n// import { useLocation } from \"react-router-dom\";\r\nimport { Box } from \"@mui/material\";\r\n\r\n// import FullScreenLayout from \"../../../layout/fullScreen/fullScreen\";\r\n\r\nimport { useState, useEffect, useCallback } from \"react\";\r\nimport images from \"../../../assets/images\";\r\nimport \"./form-parser.scss\";\r\nimport TabBar from \"../../tabs/tabs\";\r\nimport formBuilderDeConversion from \"../../../utils/form-builder-deconversion\";\r\nimport { yupResolver } from \"@hookform/resolvers/yup\";\r\nimport * as yup from \"yup\";\r\nimport dayjs from \"dayjs\";\r\nimport { SECTION_TYPES } from '../../../utils/constant';\r\nimport { CountryData } from 'react-phone-input-2';\r\nimport Alert from '../../alert/alert';\r\nimport _ from \"lodash\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport FormSection from \"./form-section\";\r\nconst validationReducer = (validations: any, validation: any, field: any, translationFn: any) => {\r\n switch (validation.type) {\r\n case \"required\":\r\n return (field.field_properties?.is_multiselect ? validations.required(translationFn(validation.msg_en)).min(1, translationFn(validation.msg_en)) : validation.value\r\n ? validations.required(translationFn(validation.msg_en)).test('not-empty', translationFn(validation.msg_en), value => typeof value === 'string' ? value && value?.trim()?.length > 0 : true) : validations.nullable());\r\n case \"min_length\":\r\n return validations.min(validation.value, translationFn(validation.msg_en));\r\n case \"max_length\":\r\n return validations.max(validation.value, translationFn(validation.msg_en));\r\n case \"min_val\":\r\n return validations.min(validation.value, translationFn(validation.msg_en));\r\n case \"max_val\":\r\n return validations.max(validation.value, translationFn(validation.msg_en));\r\n case \"postive_number\":\r\n return validations.test('is-positive-number', translationFn(validation.msg_en), (value) => value >= 0)\r\n case 'email':\r\n return validations.email(validation.msg_en);\r\n case \"no_special_char\":\r\n return validations.test(\r\n \"no-special-char\",\r\n translationFn(validation.msg_en),\r\n value =>\r\n typeof value === \"string\"\r\n ? /^[^.\\-\\W_]+$/u.test(value) // allow letters/digits only\r\n : true\r\n );\r\n case \"when\":\r\n return validations.when(validation.relation, {\r\n is: (val: any) => val === validation.values,\r\n then: () => validation?.thenValidations?.reduce(\r\n (validations: any, validation: any) => validationReducer(validations, validation, field, translationFn),\r\n validations\r\n ) || validations,\r\n otherwise: () => validation?.otherWiseValidations?.reduce(\r\n (validations: any, validation: any) => validationReducer(validations, validation, field, translationFn),\r\n validations\r\n ) || validations,\r\n });\r\n // Add more cases for other validation types as needed\r\n default:\r\n return validations;\r\n }\r\n}\r\n\r\nconst FormParser = ({\r\n data,\r\n defaultValues,\r\n handleFormSubmit,\r\n fieldArrayName,\r\n mode,\r\n displayAvtar = false,\r\n onTableAddClick,\r\n handleFormValues,\r\n getFormMethods,\r\n setFields,\r\n onSelectFooterClick,\r\n setActiveTabValue,\r\n activeTab = 0,\r\n recieveTabDataLenght,\r\n recieveIsValidForm,\r\n activeTabs,\r\n onTableCellChange,\r\n containerStyles = undefined,\r\n isButton = true,\r\n getSelectedData,\r\n refreshOptions = false,\r\n onBlur,\r\n}: any) => {\r\n\r\n const { t } = useTranslation();\r\n\r\n function convertToNestedObject(dotNotationString: string, field: any, existingObject: any = {}) {\r\n const keys = dotNotationString.split('.');\r\n let currentLevel = existingObject;\r\n\r\n keys.forEach((key, index) => {\r\n if (index === keys.length - 1) {\r\n if (!currentLevel[key]) {\r\n const fieldValidations = field.validation.reduce(\r\n (validations: any, validation: any) => {\r\n switch (validation.type) {\r\n case \"required\":\r\n return validation.value\r\n ? validations.required(t(validation.msg_en)).test('not-empty', t(validation.msg_en), value => typeof value === 'string' ? value && value?.trim()?.length > 0 : true)\r\n : (field.field_properties?.is_multiselect ? validations.min(1, t(validation.msg_en)) : validations.nullable());\r\n case \"min_length\":\r\n return validations.min(validation.value, t(validation.msg_en));\r\n case \"max_length\":\r\n return validations.max(validation.value, t(validation.msg_en));\r\n case \"min_val\":\r\n return validations.min(validation.value, t(validation.msg_en));\r\n case \"max_val\":\r\n return validations.max(validation.value, t(validation.msg_en));\r\n // Add more cases for other validation types as needed\r\n default:\r\n return validations;\r\n }\r\n },\r\n getValidationType(field)\r\n );\r\n currentLevel[key] = fieldValidations;\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n } else {\r\n if (!currentLevel[key]) {\r\n currentLevel[key] = {};\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n currentLevel = currentLevel[key];\r\n\r\n }\r\n });\r\n\r\n return existingObject;\r\n }\r\n\r\n const getValidationType = (field: any) => {\r\n switch (field.field_type) {\r\n case 'select':\r\n return field.field_properties?.is_multiselect\r\n ? yup.array()\r\n : yup.string()\r\n\r\n case 'number':\r\n case 'currency':\r\n return yup.number().transform((value, originalValue) => (originalValue === '' ? undefined : value)).typeError('Please enter valid number').nullable()\r\n case 'currency_with_amount':\r\n return yup.number()\r\n case 'url':\r\n return yup.string().matches(/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/, { excludeEmptyString: true, message: \"Please enter valid URL.\" })\r\n\r\n default:\r\n return yup.string()\r\n }\r\n }\r\n\r\n const convertNestedFieldSchemaObject = (nestedFields: any) => {\r\n const schema: any = {};\r\n\r\n for (const key in nestedFields) {\r\n if (typeof nestedFields[key] === 'object' && !Object.hasOwn(nestedFields[key], 'tests')) {\r\n schema[key] = yup.object().shape(convertNestedFieldSchemaObject(nestedFields[key]));\r\n } else {\r\n schema[key] = nestedFields[key]\r\n }\r\n }\r\n return schema;\r\n }\r\n\r\n\r\n const generateValidationSchema = (data: any[]) => {\r\n const yupSchemaObject: any = {};\r\n let nestedFielvalidations: any = {},\r\n nestedYupSchemaObj: any = {};\r\n\r\n data &&\r\n data?.forEach((field: any) => {\r\n let fieldValidations: any;\r\n if (field.validation && field.validation.length > 0) {\r\n if (field.name?.includes(\".\")) {\r\n nestedFielvalidations = convertToNestedObject(field.name, field, nestedFielvalidations);\r\n } else {\r\n fieldValidations = field.validation.reduce((validations: any, validation: any) => validationReducer(validations, validation, field, t),\r\n getValidationType(field)\r\n );\r\n yupSchemaObject[field.name] = fieldValidations;\r\n }\r\n\r\n nestedYupSchemaObj = convertNestedFieldSchemaObject(nestedFielvalidations)\r\n }\r\n\r\n });\r\n\r\n return yup.object().shape({\r\n [fieldArrayName]: yup.object().shape({ ...yupSchemaObject, ...nestedYupSchemaObj }),\r\n });\r\n };\r\n\r\n const {\r\n control,\r\n handleSubmit,\r\n formState: { errors },\r\n setValue,\r\n reset,\r\n getValues,\r\n watch,\r\n resetField,\r\n unregister,\r\n trigger,\r\n getFieldState,\r\n ...rest\r\n } = useForm({\r\n ...(defaultValues && typeof defaultValues === 'object' ? { defaultValues } : {}),\r\n resolver: yupResolver(generateValidationSchema(data)),\r\n mode: \"all\",\r\n });\r\n\r\n const watchedValues = useWatch({\r\n control,\r\n name: fieldArrayName,\r\n });\r\n\r\n // Local States\r\n const [schema, setSchema] = useState<[]>([]);\r\n const [tabsData, setTabsData] = useState<any[]>([]);\r\n const [errorAlert, setErrorAlert] = useState<boolean>(false);\r\n const [currencyOption, setCurrencyOptions] = useState<string>('');\r\n const [isTabFormValid, setTabFormValid] = useState<boolean>(false);\r\n const [validateRequiredFields, setValidRequiredFields] = useState<any[]>([]);\r\n\r\n // Local Functions\r\n const handleTableAddClick = (tableName?: string) => {\r\n onTableAddClick?.(tableName)\r\n }\r\n\r\n const getSectionData = useCallback((section: any) => {\r\n const sectionMembers = section?.members?.map((ele: any) => ele) || []\r\n const values = getValues(fieldArrayName)\r\n const isFormSwitcher = section.section_type === SECTION_TYPES.FORM_SWITCH_SECTION\r\n const formSwitcherName =\r\n section?.form_switcher_name ||\r\n section?.form_switcher_label?.toLowerCase().split(\" \").join(\"_\");\r\n const switchForms = section?.switcher_forms?.map((form: any) => ({\r\n ...form,\r\n formMembers: sectionMembers.filter(\r\n (member: any) => member.section_form_id === form.id,\r\n )\r\n }));\r\n const selectedSectionForm =\r\n values?.[formSwitcherName] ?\r\n switchForms.find((ele: any) =>\r\n ele.name === values?.[formSwitcherName]\r\n ) : {};\r\n\r\n // When form switcher is active, include:\r\n // 1. Common fields (fields without section_form_id or is_form_switcher_section)\r\n // 2. Form-specific fields (fields with section_form_id matching the selected form)\r\n let members;\r\n if (isFormSwitcher) {\r\n const commonFields = sectionMembers.filter(\r\n (member: any) => !member.section_form_id && !member.is_form_switcher_section\r\n );\r\n const formSpecificFields = selectedSectionForm?.formMembers || [];\r\n members = [...commonFields, ...formSpecificFields];\r\n } else {\r\n members = section?.members;\r\n }\r\n\r\n return {\r\n isFormSwitcher,\r\n formSwitcherName,\r\n switchForms,\r\n selectedSectionForm,\r\n members,\r\n values\r\n }\r\n }, [fieldArrayName, getValues])\r\n\r\n const handleSetCountryCodeField = useCallback((country: CountryData, field: any, fieldArrayName: any, values: any) => {\r\n const oldVal = values?.[fieldArrayName]?.[field?.country_code_field_name]\r\n const newVal = `+${country.dialCode}`\r\n if (\r\n field?.is_country_code_separate &&\r\n field?.country_code_field_name &&\r\n oldVal !== newVal\r\n ) {\r\n setValue(\r\n `${fieldArrayName}.${field?.country_code_field_name}` as never,\r\n newVal as never\r\n )\r\n }\r\n }, [setValue])\r\n\r\n const handleFieldCleanUp = useCallback((switchForms: any) => {\r\n switchForms.forEach((form: any) => {\r\n form?.formMembers.forEach((member: any) => {\r\n const memberName = member?.name || member.label.toLowerCase().split(\" \").join(\"_\")\r\n const v = _.get(defaultValues, `${fieldArrayName}.${memberName}`, null)\r\n const newData = data.map((ele: any) => {\r\n if (member?.section_form_id === ele?.section_form_id) {\r\n delete ele.value\r\n }\r\n return ({\r\n ...ele,\r\n ...(v ? { value: v } : {}),\r\n })\r\n })\r\n if (!v) {\r\n resetField(`${fieldArrayName}.${memberName}` as never)\r\n unregister(`${fieldArrayName}.${memberName}` as never)\r\n }\r\n setFields?.(newData)\r\n })\r\n\r\n })\r\n }, [data, defaultValues, fieldArrayName, resetField, setFields, unregister])\r\n\r\n const createNestedObjectFromDot = useCallback((dotNotationString: string, field: any, existingObject: any = {}) => {\r\n const keys = dotNotationString.split('.');\r\n let currentLevel = existingObject;\r\n\r\n keys.forEach((key, index) => {\r\n if (index === keys.length - 1) {\r\n if (!currentLevel[key]) {\r\n let fieldValue = field.value\r\n if (fieldValue && (field.field_type !== 'image' || field.field_type !== 'file')) {\r\n if (field.field_type === 'date') {\r\n fieldValue = dayjs(fieldValue)\r\n } else if (field.field_type === 'time') {\r\n const [hours, minutes, seconds] = fieldValue.split(\":\").map(Number);\r\n fieldValue = dayjs().set('hour', hours).set('minute', minutes).set('second', seconds).set('millisecond', 0)\r\n } else if (field.name.includes('_id') && !Array.isArray(field?.value)) {\r\n fieldValue = Number(fieldValue)\r\n }\r\n }\r\n currentLevel[key] = fieldValue;\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n } else {\r\n if (!currentLevel[key]) {\r\n currentLevel[key] = {};\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n currentLevel = currentLevel[key];\r\n\r\n }\r\n });\r\n\r\n return existingObject;\r\n }, [])\r\n\r\n const removeMatchingKeyValuePairs = useCallback((obj1, obj2) => {\r\n _.forOwn(obj1, (value, key) => {\r\n if (_.has(obj2, key) && _.isEqual(value, obj2[key])) {\r\n delete obj1[key];\r\n }\r\n });\r\n return obj1;\r\n }, [])\r\n\r\n const validateRequiredSwitchFormData = useCallback((switchData: any) => {\r\n const requiredFields: string[] = [];\r\n if (switchData) {\r\n switchData && switchData[0]?.formMembers.forEach((member: any) => {\r\n if (member?.validation && Array.isArray(member?.validation)) {\r\n member?.validation.forEach((validation: any) => {\r\n if (validation?.thenValidations && Array.isArray(validation?.thenValidations)) {\r\n validation?.thenValidations.forEach((thenValidation: any) => {\r\n if (thenValidation?.type === \"required\" && thenValidation?.value === true) {\r\n if (member?.name) {\r\n requiredFields.push(member.name);\r\n }\r\n }\r\n });\r\n } else {\r\n const hasRequiredValidation = member.validation.some(\r\n (validation: any) => validation.type === 'required' && validation.value === true\r\n )\r\n if (hasRequiredValidation) {\r\n requiredFields.push(member.name);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n }\r\n if (requiredFields) {\r\n setValidRequiredFields(_.uniq(requiredFields))\r\n }\r\n\r\n }, [])\r\n\r\n const isEmpty = useCallback((value: any): boolean => {\r\n return (\r\n value === null ||\r\n value === undefined ||\r\n (Array.isArray(value) && value.length === 0) ||\r\n (typeof value === 'object' && Object.keys(value).length === 0)\r\n );\r\n }, [])\r\n\r\n const getMissingFields = useCallback((watchedFields: any, validationReqFields: string[]): string[] => {\r\n const missingFields: string[] = [];\r\n\r\n validationReqFields.forEach((fieldPath) => {\r\n const keys = fieldPath.split(\".\");\r\n let currentLevel = watchedFields;\r\n\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n\r\n if (!currentLevel?.[key] && currentLevel?.[key] !== 0) {\r\n // If any key in the path is missing, mark the field as missing\r\n missingFields.push(fieldPath);\r\n return;\r\n }\r\n\r\n // Move deeper into the object\r\n currentLevel = currentLevel[key];\r\n }\r\n\r\n // After navigating the full path, check if the final value is empty\r\n if (isEmpty(currentLevel)) {\r\n missingFields.push(fieldPath);\r\n }\r\n });\r\n\r\n\r\n return missingFields;\r\n }, [isEmpty])\r\n\r\n // Use Effects\r\n useEffect(() => {\r\n if (recieveTabDataLenght) {\r\n recieveTabDataLenght(tabsData.length)\r\n }\r\n }, [recieveTabDataLenght, tabsData])\r\n\r\n useEffect(() => {\r\n const handleMessage = (event: MessageEvent) => {\r\n if (event.origin !== window.origin) {\r\n return;\r\n }\r\n const { state } = event.data;\r\n\r\n if (state?.length) {\r\n const data: any = formBuilderDeConversion(state);\r\n\r\n if (data.tab) {\r\n setTabsData(data.tab);\r\n } else if (data.section) {\r\n setSchema(data.section);\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener(\"message\", handleMessage);\r\n\r\n return () => {\r\n window.removeEventListener(\"message\", handleMessage);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (data) {\r\n const formData = formBuilderDeConversion(data)\r\n if (formData?.tab) {\r\n // setSchema([])\r\n setTabsData(formData.tab);\r\n if (activeTab !== undefined) {\r\n setSchema(formData.tab[activeTab]?.data || []);\r\n }\r\n } else {\r\n setSchema(formData.section);\r\n // setTabsData([])\r\n }\r\n const dVals = _.get(defaultValues, fieldArrayName, {})\r\n const wVals = removeMatchingKeyValuePairs((watchedValues || {}), (dVals || {}))\r\n if (mode === 'edit' && !Object.keys(wVals)?.length) {\r\n let formValues: any = {};\r\n let nestedFormValues: any = {};\r\n data.forEach((field: any) => {\r\n const fieldValue = field.value\r\n if (field.name?.includes(\".\")) {\r\n nestedFormValues = createNestedObjectFromDot(field.name, field, nestedFormValues)\r\n } else {\r\n if (fieldValue && (field.field_type !== 'image' || field.field_type !== 'file')) {\r\n if (field?.is_section_field) {\r\n const fieldName = field?.form_switcher_name || field?.form_switcher_label;\r\n formValues = { ...formValues, [fieldName]: fieldValue }\r\n } else if (\r\n field?.name &&\r\n ['company_id', 'email_ids'].includes(field?.name) &&\r\n ['edit_customer', 'add_customer', 'edit_vendor', 'add_vendor'].includes(fieldArrayName)\r\n ) {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n } else if (field.field_type === 'date') {\r\n formValues = { ...formValues, [field.name]: dayjs(fieldValue) }\r\n } else if (field.field_type === 'time') {\r\n const [hours, minutes, seconds] = fieldValue.split(\":\").map(Number);\r\n formValues = { ...formValues, [field.name]: dayjs().set('hour', hours).set('minute', minutes).set('second', seconds).set('millisecond', 0) }\r\n } else if (field.name.includes('_id') && !Array.isArray(field?.value)) {\r\n if (fieldArrayName === \"edit_user\" && field.name === \"role_id\") {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n } else {\r\n formValues = { ...formValues, [field.name]: Number(fieldValue) }\r\n }\r\n } else {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n }\r\n }\r\n }\r\n })\r\n const finalFormValues = { ...formValues, ...nestedFormValues }\r\n reset({ [fieldArrayName]: { ...finalFormValues } })\r\n }\r\n getFormMethods?.({ control, handleSubmit, setValue, reset, resetField, getValues, unregister, trigger, watch, getFieldState, errors, ...rest })\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [data])\r\n\r\n useEffect(() => {\r\n if (activeTab?.toString()) {\r\n if (tabsData && tabsData[activeTab]) {\r\n setSchema(tabsData[activeTab].data);\r\n }\r\n }\r\n }, [activeTab, tabsData]);\r\n\r\n useEffect(() => {\r\n if (watchedValues && handleFormValues) {\r\n handleFormValues?.(watchedValues);\r\n }\r\n }, [handleFormValues, watchedValues])\r\n\r\n useEffect(() => {\r\n if (errors?.[fieldArrayName]) {\r\n setErrorAlert(true)\r\n } else {\r\n setErrorAlert(false)\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [fieldArrayName, JSON.stringify(errors)])\r\n\r\n useEffect(() => {\r\n const validatedFields: string[] = [];\r\n if (activeTab != undefined) {\r\n tabsData[activeTab]?.data.forEach((section: any) => {\r\n\r\n if (section.members && Array.isArray(section.members)) {\r\n\r\n section.members.forEach((member: any) => {\r\n if (member.validation && Array.isArray(member.validation)) {\r\n const hasRequiredValidation = member.validation.some(\r\n (validation: any) => validation.type === 'required' && validation.value === true\r\n )\r\n if (hasRequiredValidation) {\r\n // validatedFields.push(fieldArrayName + '.' + member.name);\r\n validatedFields.push(member.name);\r\n }\r\n }\r\n });\r\n }\r\n })\r\n setValidRequiredFields(validatedFields);\r\n }\r\n }, [tabsData, activeTab]);\r\n\r\n useEffect(() => {\r\n if (watchedValues?.account_type) {\r\n\r\n const switchFormData: any[] = [];\r\n schema && schema.forEach((section: any) => {\r\n const sectionMembers = schema && section?.members?.map((ele: any) => ele) || [];\r\n\r\n const switchForms = schema && section?.switcher_forms?.map((form: any) => ({\r\n ...form,\r\n formMembers: sectionMembers.filter(\r\n (member: any) => member.section_form_id === form.id,\r\n ),\r\n }));\r\n if (switchForms) {\r\n switchFormData.push(switchForms)\r\n }\r\n })\r\n\r\n const selectValue = watchedValues?.account_type || \"Individual\";\r\n const switchData = switchFormData && Array.isArray(switchFormData[0])\r\n ? switchFormData[0].filter((form: any) => form.name === selectValue)\r\n : [];\r\n\r\n if (switchData) {\r\n validateRequiredSwitchFormData(switchData)\r\n }\r\n\r\n }\r\n }, [watchedValues?.account_type, schema, validateRequiredSwitchFormData]);\r\n\r\n useEffect(() => {\r\n if (validateRequiredFields.length > 0) {\r\n const updatedRequiredFields = getMissingFields(watchedValues, validateRequiredFields)\r\n\r\n // const updatedRequiredFields = validateRequiredFields.filter((fieldPath) => {\r\n // const watchedValue = watchedFields[fieldPath] ;\r\n // return watchedValue === undefined || watchedValue === null || watchedValue === 0 ;\r\n // });\r\n\r\n updatedRequiredFields.length === 0 ? setTabFormValid(true) : setTabFormValid(false);\r\n } else {\r\n setTabFormValid(true)\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [validateRequiredFields, watchedValues, activeTab])\r\n\r\n useEffect(() => {\r\n if (recieveIsValidForm) {\r\n recieveIsValidForm(isTabFormValid)\r\n }\r\n }, [recieveIsValidForm, isTabFormValid])\r\n\r\n\r\n return (\r\n // <FullScreenLayout>\r\n <Box sx={{ width: \"100%\", padding: \"2rem\", ...containerStyles }}>\r\n <FormProvider {...{ control, handleSubmit, setValue, reset, resetField, getValues, unregister, trigger, watch, errors, ...rest }}>\r\n <form id={fieldArrayName} name={fieldArrayName} onSubmit={handleSubmit(handleFormSubmit)}>\r\n {Boolean(tabsData?.length) && (\r\n <>\r\n {errorAlert &&\r\n <Alert severity='error' onClose={() => setErrorAlert(false)}>\r\n Please fill all the required fields.\r\n </Alert>\r\n }\r\n <TabBar\r\n tabs={tabsData}\r\n activeTabs={activeTabs}\r\n activeValue={activeTab}\r\n setActiveValue={setActiveTabValue}\r\n isFormTabValid={isTabFormValid}\r\n />\r\n </>\r\n )}\r\n {schema &&\r\n schema.map((section: any, index: number) => {\r\n const {\r\n isFormSwitcher,\r\n formSwitcherName,\r\n switchForms,\r\n members,\r\n values,\r\n } = getSectionData(section)\r\n\r\n return (\r\n <FormSection\r\n section={section}\r\n index={index}\r\n members={members}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n displayAvtar={displayAvtar}\r\n isButton={isButton}\r\n currencyOption={currencyOption}\r\n values={values}\r\n onBlur={onBlur}\r\n setValue={setValue}\r\n onSelectFooterClick={onSelectFooterClick}\r\n getSelectedData={getSelectedData}\r\n setCurrencyOptions={setCurrencyOptions}\r\n refreshOptions={refreshOptions}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n handleSetCountryCodeField={handleSetCountryCodeField}\r\n handleTableAddClick={handleTableAddClick}\r\n onTableCellChange={onTableCellChange}\r\n // setDetailsData={setDetailsData}\r\n t={t}\r\n images={images}\r\n />\r\n );\r\n })}\r\n </form>\r\n </FormProvider>\r\n </Box>\r\n // </FullScreenLayout>\r\n );\r\n};\r\n\r\nexport default FormParser;","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React, { useMemo } from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n team: {\r\n name: string;\r\n department_id: string | null;\r\n team_lead_id: string | null;\r\n member_ids: string[] | null;\r\n description: string;\r\n };\r\n}\r\n\r\nconst teamValidationSchema = Yup.object().shape({\r\n team: Yup.object().shape({\r\n name: Yup.string().required('Team Name is required'),\r\n department_id: Yup.string().nullable(),\r\n team_lead_id: Yup.string().nullable().required('Team Lead is required'),\r\n member_ids: Yup.array().nullable(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nconst DEFAULT_VALUES = {\r\n team: {\r\n name: '',\r\n department_id: null,\r\n team_lead_id: null,\r\n member_ids: null,\r\n description: '',\r\n }\r\n};\r\n\r\nexport const TeamAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, watch } = useForm<IFormValues>({\r\n mode: 'all',\r\n resolver: yupResolver(teamValidationSchema),\r\n defaultValues: DEFAULT_VALUES\r\n });\r\n\r\n const selectedDepartmentId = watch('team.department_id');\r\n const selectedTeamLeadId = watch('team.team_lead_id');\r\n\r\n const handleModalClose = () => {\r\n reset(DEFAULT_VALUES);\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n await onSave(values);\r\n handleModalClose();\r\n };\r\n\r\n // Memoize filters to prevent unnecessary re-renders of DynamicSearchSelect\r\n const leadFilter = useMemo(() => ({\r\n '&department_id.eq': selectedDepartmentId || 0\r\n }), [selectedDepartmentId]);\r\n\r\n const membersFilter = useMemo(() => ({\r\n '&department_id.eq': selectedDepartmentId || 0,\r\n ...(selectedTeamLeadId ? { '&id.ne': selectedTeamLeadId } : {})\r\n }), [selectedDepartmentId, selectedTeamLeadId]);\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.teamModal.title', 'Add Team')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Team Name - Required */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.teamModal.name_label', 'Team Name')}\r\n name='name'\r\n fieldArrayName='team'\r\n placeholder={t('hrms.organization_structure.teamModal.name_placeholder', 'Enter Team Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Department - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.department_label', 'Department')}\r\n name='department_id'\r\n placeholder={t('hrms.organization_structure.teamModal.department_placeholder', 'Select Department')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='department'\r\n required={false}\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Team Lead - Required */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.team_lead_label', 'Team Lead')}\r\n name='team_lead_id'\r\n placeholder={t('hrms.organization_structure.teamModal.team_lead_placeholder', 'Select Team Lead')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='employees'\r\n required\r\n options={[]}\r\n customeFilter={leadFilter}\r\n />\r\n </Grid>\r\n\r\n {/* Members - Optional, multi-select */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.members_label', 'Members')}\r\n name='member_ids'\r\n placeholder={t('hrms.organization_structure.teamModal.members_placeholder', 'Select Members')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n is_multiselect\r\n customeFilter={membersFilter}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.teamModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='team'\r\n placeholder={t('hrms.organization_structure.teamModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='submit'>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, DynamicToggleButton, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n department: {\r\n company_id: string | null;\r\n department_code: string;\r\n name: string;\r\n parent_department_id: string | null;\r\n department_head_id: string | null;\r\n cost_code: string;\r\n status: boolean;\r\n description: string;\r\n };\r\n}\r\n\r\nconst departmentValidationSchema = Yup.object().shape({\r\n department: Yup.object().shape({\r\n company_id: Yup.string().nullable().required('Company is required'),\r\n department_code: Yup.string().required('Department Code is required'),\r\n name: Yup.string().required('Department Name is required'),\r\n parent_department_id: Yup.string().nullable(),\r\n department_head_id: Yup.string().nullable(),\r\n cost_code: Yup.string(),\r\n status: Yup.boolean(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nexport const DepartmentAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger, watch } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(departmentValidationSchema),\r\n defaultValues: {\r\n department: {\r\n company_id: null,\r\n department_code: '',\r\n name: '',\r\n parent_department_id: null,\r\n department_head_id: null,\r\n cost_code: '',\r\n status: true,\r\n description: '',\r\n }\r\n }\r\n });\r\n\r\n const rootCompanyId = watch('department.company_id');\r\n\r\n const handleModalClose = () => {\r\n reset({\r\n department: {\r\n company_id: null,\r\n department_code: '',\r\n name: '',\r\n parent_department_id: null,\r\n department_head_id: null,\r\n cost_code: '',\r\n status: true,\r\n description: '',\r\n }\r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.departmentModal.title', 'Add Department')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Company - Required */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.company_label', 'Company')}\r\n name='company_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.company_placeholder', 'Select Company')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='company'\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Department Code - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.code_label', 'Department Code')}\r\n name='department_code'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.code_placeholder', 'Enter Department Code')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Department Name - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.name_label', 'Department Name')}\r\n name='name'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.name_placeholder', 'Enter Department Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Parent Department - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.parent_department_label', 'Parent Department')}\r\n name='parent_department_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.parent_department_placeholder', 'Select Parent Department')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='department'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n 'is_parent.eq': true,\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Department Head - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.department_head_label', 'Department Head')}\r\n name='department_head_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.department_head_placeholder', 'Select Department Head')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Cost Code - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.cost_code_label', 'Cost Code')}\r\n name='cost_code'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.cost_code_placeholder', 'Enter Cost Code')}\r\n />\r\n </Grid>\r\n\r\n {/* Status Toggle */}\r\n <Grid item sm={6}>\r\n <DynamicToggleButton\r\n formControl={control as any}\r\n name='status'\r\n fieldArrayName='department'\r\n label={t('hrms.organization_structure.departmentModal.status_label', 'Status')}\r\n title={t('common.active', 'Active')}\r\n titlePosition='end'\r\n position={3}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } from 'react';\n\nimport Modal from '../../../../modal/modal';\nimport Typography from '../../../../typography/typography';\nimport DynamicInput from '../text';\nimport Button from '../../../../button/button';\nimport ModalLoader from '../../../../loaders/modal-loader';\nimport Toast from '../../../../toast/toast';\nimport { useTranslation } from 'react-i18next';\n\nimport {\n Box,\n DialogActions,\n DialogContent,\n DialogProps,\n DialogTitle,\n Grid,\n IconButton\n} from '@mui/material';\nimport Close from '@mui/icons-material/Close';\n\nimport { useForm } from 'react-hook-form';\nimport * as Yup from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\n\nimport './location-add-modal.scss';\nimport DynamicSearchSelect from '../dynamic-select';\ninterface BrandAddModalProps {\n isOpen: boolean;\n setIsOpen: () => void;\n modalProps?: DialogProps;\n onSave: (data: string) => void;\n isLoading?: boolean;\n}\n\ninterface IFormValues {\n location_data: {\n name: string;\n };\n}\n\ninterface IToast {\n type: 'normal' | 'alert';\n message: string;\n}\n\nconst validationSchema = Yup.object().shape({\n location_data: Yup.object().shape({\n name: Yup.string().required('Name is required')\n })\n});\n\nconst LocationAddModal: React.FC<BrandAddModalProps> = ({\n isOpen,\n setIsOpen,\n modalProps,\n onSave,\n isLoading\n}) => {\n const { t } = useTranslation();\n const [toast, setToast] = useState<IToast | null>(null);\n const { control, handleSubmit, reset } = useForm<any>({\n mode: 'all',\n resolver: yupResolver(validationSchema)\n });\n const handleModalClose = () => {\n reset({ location_data: undefined });\n setIsOpen();\n };\n\n const onSubmit = async (values: IFormValues) => {\n // handleModalClose();\n onSave(values?.location_data)\n };\n\n return (\n <Modal\n open={isOpen}\n onClose={handleModalClose}\n maxWidth='sm'\n fullWidth\n {...modalProps}>\n <>\n \n <form onSubmit={handleSubmit(onSubmit)}>\n {isLoading && (\n <ModalLoader />\n )}\n <DialogTitle className='brandAddModal--DialogTitle'>\n <Typography type='s3' color='inherit' weight='medium'>\n {t(\"inventory.item.locationModal.title\")}\n </Typography>\n <IconButton onClick={handleModalClose}>\n <Close fontSize='small' />\n </IconButton>\n </DialogTitle>\n <DialogContent className='brandAddModal--DialogContents'>\n \n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\n <Grid item sm={6}>\n <DynamicInput\n type='text'\n formControl={control}\n label={t(\"inventory.item.locationModal.location_name_label\")}\n name='name'\n fieldArrayName='location_data'\n placeholder={t(\"inventory.item.locationModal.location_name_placeholder\")}\n required\n />\n </Grid>\n <Grid item sm={6}>\n <DynamicInput\n type='text'\n formControl={control}\n label={t(\"inventory.item.locationModal.location_code_label\")}\n name='short_name'\n fieldArrayName='location_data'\n placeholder={t(\"inventory.item.locationModal.location_code_placeholder\")}\n required\n />\n </Grid>\n <Grid item sm={6}>\n <DynamicSearchSelect\n label={t(\n \"accounting.authorize_commission.fields.company_label\"\n )}\n name=\"company_id\"\n placeholder={t(\n \"accounting.authorize_commission.fields.company_placeholder\"\n )}\n fieldArrayName='location_data'\n formControl={control}\n apiType='company'\n getSelectedData={(data: any) =>\n // setSelectedData(name, data)\n console.log(\"data\", data)\n }\n required={true}\n />\n </Grid>\n </Grid>\n \n </DialogContent>\n <DialogActions className='brandAddModal--DialogAction'>\n <span></span>\n <Box display='flex' gap={1.5}>\n <Button\n className='brandAddModal--DialogAction--WhiteBtn'\n onClick={handleModalClose}>\n {t(\"common.cancel\")}\n </Button>\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\n </Box>\n </DialogActions>\n </form>\n </>\n <Toast\n open={Boolean(toast)}\n type={toast?.type}\n message={toast?.message}\n handleClose={() => setToast(null)}\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\n />\n </Modal>\n );\n};\n\nexport default LocationAddModal;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, DynamicToggleButton, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n designation: {\r\n company_id: string | null;\r\n designation_code: string;\r\n name: string;\r\n reports_to: string | null;\r\n level: string;\r\n status: boolean;\r\n description: string;\r\n };\r\n}\r\n\r\nconst designationValidationSchema = Yup.object().shape({\r\n designation: Yup.object().shape({\r\n company_id: Yup.string().nullable().required('Company is required'),\r\n designation_code: Yup.string(),\r\n name: Yup.string().required('Designation Name is required'),\r\n reports_to: Yup.string().nullable(),\r\n level: Yup.number().nullable().typeError('Level must be a number'),\r\n status: Yup.boolean(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nexport const DesignationAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger, watch } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(designationValidationSchema),\r\n defaultValues: {\r\n designation: {\r\n company_id: null,\r\n designation_code: '',\r\n name: '',\r\n reports_to: null,\r\n level: null,\r\n status: true,\r\n description: '',\r\n }\r\n }\r\n });\r\n\r\n const rootCompanyId = watch('designation.company_id');\r\n\r\n const handleModalClose = () => {\r\n reset({\r\n designation: {\r\n company_id: null,\r\n designation_code: '',\r\n name: '',\r\n reports_to: null,\r\n level: null,\r\n status: true,\r\n description: '',\r\n }\r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.designationModal.title', 'Add Designation')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Company - Required */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.designationModal.company_label', 'Company')}\r\n name='company_id'\r\n placeholder={t('hrms.organization_structure.designationModal.company_placeholder', 'Select Company')}\r\n fieldArrayName='designation'\r\n formControl={control as any}\r\n apiType='company'\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Designation Code */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.code_label', 'Designation Code')}\r\n name='designation_code'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.code_placeholder', 'Enter Designation Code')}\r\n />\r\n </Grid>\r\n\r\n {/* Designation Name - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.name_label', 'Designation Name')}\r\n name='name'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.name_placeholder', 'Enter Designation Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Reports To - Optional (employees) */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.designationModal.reports_to_label', 'Reports To')}\r\n name='reports_to'\r\n placeholder={t('hrms.organization_structure.designationModal.reports_to_placeholder', 'Select Reports To')}\r\n fieldArrayName='designation'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Level - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='number'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.level_label', 'Level')}\r\n name='level'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.level_placeholder', 'Enter Level')}\r\n />\r\n </Grid>\r\n\r\n {/* Status Toggle */}\r\n <Grid item sm={6}>\r\n <DynamicToggleButton\r\n formControl={control as any}\r\n name='status'\r\n fieldArrayName='designation'\r\n label={t('hrms.organization_structure.designationModal.status_label', 'Status')}\r\n title={t('common.active', 'Active')}\r\n titlePosition='end'\r\n position={3}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { useState, useEffect, useCallback } from 'react';\r\n\r\nimport Modal from '../../../../modal/modal';\r\nimport Typography from '../../../../typography/typography';\r\nimport DynamicInput from '../text';\r\nimport Button from '../../../../button/button';\r\nimport ModalLoader from '../../../../loaders/modal-loader';\r\nimport Toast from '../../../../toast/toast';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\n\r\nimport { FormProvider, useForm, useWatch } from 'react-hook-form';\r\nimport * as Yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\n\r\nimport DynamicSearchSelect from '../dynamic-select';\r\nimport DynamicSelect from '../select';\r\nimport { IModalComponentProps } from '../../index';\r\nimport { fetchOptions, skuGenerator } from '../../../../../utils/common';\r\n\r\nimport './fixed-asset-item-add-modal.scss';\r\n\r\ninterface IFormValues {\r\n inventory_fixed_asset_item: {\r\n name: string;\r\n sku: string;\r\n category: number | null;\r\n base_unit: number | null;\r\n company: number[];\r\n unit_of_measurement: number | null;\r\n stock_unit: number | null;\r\n purchase_unit: number | null;\r\n sales_unit: number | null;\r\n costing_method: string;\r\n depreciation_method: string;\r\n computation_method: string;\r\n default_tax_id: number | null;\r\n income_account_id: number | null;\r\n asset_account_id: number | null;\r\n cogs_account_id: number | null;\r\n fixed_asset_account_id: number | null;\r\n depreciation_account_id: number | null;\r\n declining_factor: number | null;\r\n };\r\n}\r\n\r\ninterface IToast {\r\n type: 'normal' | 'alert';\r\n message: string;\r\n}\r\n\r\nconst COSTING_METHODS = [\r\n { label: 'FIFO', value: 'FIFO' },\r\n { label: 'LIFO', value: 'LIFO' },\r\n { label: 'Weighted Average Cost', value: 'Weighted Average Cost' }\r\n];\r\n\r\nconst DEPRECIATION_METHODS = [\r\n { label: 'Straight line', value: 'Straight line' },\r\n { label: 'Declining', value: 'Declining' }\r\n];\r\n\r\nconst COMPUTATION_METHODS = [\r\n { label: 'Constant periods', value: 'Constant periods' },\r\n { label: 'Based on days per period', value: 'Based on days per period' }\r\n];\r\n\r\nconst validationSchema = Yup.object().shape({\r\n inventory_fixed_asset_item: Yup.object().shape({\r\n name: Yup.string().required('Name is required'),\r\n sku: Yup.string().required('SKU is required'),\r\n category: Yup.mixed().required('Category is required'),\r\n base_unit: Yup.mixed().required('Base Unit is required'),\r\n company: Yup.array().min(1, 'At least one company is required').required('Company is required'),\r\n unit_of_measurement: Yup.mixed().required('Unit of Measurement is required'),\r\n stock_unit: Yup.mixed().nullable(),\r\n purchase_unit: Yup.mixed().nullable(),\r\n sales_unit: Yup.mixed().nullable(),\r\n costing_method: Yup.string().required('Costing Method is required'),\r\n depreciation_method: Yup.string().required('Depreciation Method is required'),\r\n computation_method: Yup.string().required('Computation Method is required'),\r\n default_tax_id: Yup.mixed().required('Default Tax is required'),\r\n income_account_id: Yup.mixed().required('Income Account is required'),\r\n asset_account_id: Yup.mixed().required('Asset Account is required'),\r\n cogs_account_id: Yup.mixed().required('COGS Account is required'),\r\n fixed_asset_account_id: Yup.mixed().required('Fixed Asset Account is required'),\r\n depreciation_account_id: Yup.mixed().required('Depreciation Account is required'),\r\n declining_factor: Yup.number()\r\n .nullable()\r\n .when('depreciation_method', {\r\n is: 'Declining',\r\n then: (schema) => schema.required('Declining Factor is required').min(0, 'Must be positive'),\r\n otherwise: (schema) => schema.nullable(),\r\n }),\r\n })\r\n});\r\n\r\nconst FixedAssetItemAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n modalProps,\r\n onSave,\r\n isLoading\r\n}) => {\r\n const { t } = useTranslation();\r\n const [toast, setToast] = useState<IToast | null>(null);\r\n const [selectedCategoryData, setSelectedCategoryData] = useState<any>(null);\r\n const unitFields = ['stock_unit', 'purchase_unit', 'sales_unit', 'consumption_unit', 'base_unit'];\r\n const defaultValues = {\r\n inventory_fixed_asset_item: {\r\n name: '',\r\n sku: '',\r\n category: null,\r\n base_unit: null,\r\n company: [],\r\n unit_of_measurement: null,\r\n stock_unit: null,\r\n purchase_unit: null,\r\n sales_unit: null,\r\n costing_method: '',\r\n depreciation_method: '',\r\n computation_method: '',\r\n default_tax_id: null,\r\n income_account_id: null,\r\n asset_account_id: null,\r\n cogs_account_id: null,\r\n fixed_asset_account_id: null,\r\n depreciation_account_id: null,\r\n declining_factor: null,\r\n status: 1\r\n }\r\n }\r\n\r\n const methods = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(validationSchema),\r\n defaultValues: defaultValues,\r\n });\r\n const { control, handleSubmit, reset, setValue, trigger } = methods || {};\r\n\r\n // Watch name and category for auto-generating SKU\r\n const [watchedName, watchedCategory, watchedUom, watchedDepreciationMethod] = useWatch({\r\n control, name:\r\n ['inventory_fixed_asset_item.name',\r\n 'inventory_fixed_asset_item.category',\r\n 'inventory_fixed_asset_item.unit_of_measurement',\r\n 'inventory_fixed_asset_item.depreciation_method']\r\n });\r\n\r\n\r\n // Auto-generate SKU when name or category changes\r\n useEffect(() => {\r\n if (watchedName && selectedCategoryData?.category_name) {\r\n const generatedSku = skuGenerator({\r\n name: watchedName,\r\n category: selectedCategoryData.category_name\r\n });\r\n setValue('inventory_fixed_asset_item.sku', generatedSku);\r\n }\r\n }, [watchedName, selectedCategoryData, setValue]);\r\n\r\n const handleModalClose = () => {\r\n reset(defaultValues);\r\n setSelectedCategoryData(null);\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave({\r\n ...values.inventory_fixed_asset_item as any,\r\n type: 'inventory-fixed-asset',\r\n status: 1\r\n });\r\n handleModalClose();\r\n };\r\n\r\n const handleCategorySelect = useCallback((data: any) => {\r\n setSelectedCategoryData(data);\r\n }, []);\r\n\r\n const updateUomFields = useCallback(async () => {\r\n if (!watchedUom) return\r\n const filter = {\r\n '&template_id.eq': watchedUom,\r\n '&is_base_unit.eq': 1\r\n }\r\n const uomData = await fetchOptions('uom', filter, [], false)\r\n unitFields.forEach((item) => {\r\n setValue(`inventory_fixed_asset_item.${item}`, uomData?.id)\r\n })\r\n }, [watchedUom])\r\n useEffect(() => {\r\n updateUomFields()\r\n }, [updateUomFields])\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='md'\r\n fullWidth\r\n {...modalProps}>\r\n <>\r\n <FormProvider {...methods}>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && (\r\n <ModalLoader />\r\n )}\r\n <DialogTitle className='fixedAssetItemAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.fixed_asset_items.modal.title\", \"Add Fixed Asset Item\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='fixedAssetItemAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Name */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.name_label\", \"Name\")}\r\n name='name'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.name_placeholder\", \"Enter Name\")}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* SKU - Auto-generated */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.sku_label\", \"SKU\")}\r\n name='sku'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sku_placeholder\", \"Auto-generated\")}\r\n required\r\n disabled\r\n />\r\n </Grid>\r\n\r\n {/* Category */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.category_label\", \"Category\")}\r\n name=\"category\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.category_placeholder\", \"Select Category\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='categoryItems'\r\n options={[]}\r\n required={true}\r\n getSelectedData={handleCategorySelect}\r\n />\r\n </Grid>\r\n\r\n\r\n {/* Company */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.company_label\", \"Company\")}\r\n name=\"company\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.company_placeholder\", \"Select Company\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='company'\r\n options={[]}\r\n is_multiselect={true}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Costing Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.costing_method_label\", \"Costing Method\")}\r\n name=\"costing_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.costing_method_placeholder\", \"Select Costing Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={COSTING_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Unit of Measurement Section Header */}\r\n <Grid item xs={12} pt={2}>\r\n <Typography type='s3' weight='medium' color='theme.neutral.900'>\r\n {t(\"inventory.fixed_asset_items.modal.uom_section\", \"Unit of Measurement\")}\r\n </Typography>\r\n </Grid>\r\n\r\n {/* UOM Template */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.unit_of_measurement_label\", \"UOM Template\")}\r\n name=\"unit_of_measurement\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.unit_of_measurement_placeholder\", \"Select UOM Template\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom_templates'\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Stock Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.stock_unit_label\", \"Stock Unit\")}\r\n name=\"stock_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.stock_unit_placeholder\", \"Select Stock Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Purchase Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.purchase_unit_label\", \"Purchase Unit\")}\r\n name=\"purchase_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.purchase_unit_placeholder\", \"Select Purchase Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Sales Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.sales_unit_label\", \"Consumption Unit\")}\r\n name=\"sales_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sales_unit_placeholder\", \"Select Sales Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.sales_unit_label\", \"Consumption Unit\")}\r\n name=\"consumption_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sales_unit_placeholder\", \"Select Sales Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.base_unit_label\", \"Base Unit\")}\r\n name=\"base_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.base_unit_placeholder\", \"Select Base Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n disabled\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0,\r\n '&is_base_unit.eq': 1\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Depreciation Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.depreciation_method_label\", \"Depreciation Method\")}\r\n name=\"depreciation_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.depreciation_method_placeholder\", \"Select Depreciation Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={DEPRECIATION_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Declining Factor */}\r\n {watchedDepreciationMethod === 'Declining' && (\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='number'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.declining_factor_label\", \"Declining Factor\")}\r\n name='declining_factor'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.declining_factor_placeholder\", \"Enter Declining Factor\")}\r\n required\r\n />\r\n </Grid>\r\n )}\r\n\r\n {/* Computation Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.computation_method_label\", \"Computation Method\")}\r\n name=\"computation_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.computation_method_placeholder\", \"Select Computation Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={COMPUTATION_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Accounting Section Header */}\r\n <Grid item xs={12} pt={2}>\r\n <Typography type='s3' weight='medium' color='theme.neutral.900'>\r\n {t(\"inventory.fixed_asset_items.modal.accounting_section\", \"Accounting\")}\r\n </Typography>\r\n </Grid>\r\n\r\n {/* Default Tax */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.default_tax_label\", \"Default Tax\")}\r\n name=\"default_tax_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.default_tax_placeholder\", \"Select Default Tax\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='taxTemplate'\r\n options={[]}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Income Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.income_account_label\", \"Income Account\")}\r\n name=\"income_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.income_account_placeholder\", \"Select Income Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.in': ['Income', 'Assets'] }}\r\n />\r\n </Grid>\r\n\r\n {/* Asset Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.asset_account_label\", \"Asset Account\")}\r\n name=\"asset_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.asset_account_placeholder\", \"Select Asset Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n\r\n {/* COGS Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.cogs_account_label\", \"COGS Account\")}\r\n name=\"cogs_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.cogs_account_placeholder\", \"Select COGS Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Fixed Asset Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.fixed_asset_account_label\", \"Fixed Asset Account\")}\r\n name=\"fixed_asset_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.fixed_asset_account_placeholder\", \"Select Fixed Asset Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n\r\n {/* Depreciation Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.depreciation_account_label\", \"Depreciation Account\")}\r\n name=\"depreciation_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.depreciation_account_placeholder\", \"Select Depreciation Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='fixedAssetItemAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='fixedAssetItemAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}>\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type=\"button\" onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </FormProvider>\r\n </>\r\n <Toast\r\n open={Boolean(toast)}\r\n type={toast?.type}\r\n message={toast?.message}\r\n handleClose={() => setToast(null)}\r\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\r\n />\r\n </Modal>\r\n );\r\n};\r\n\r\nexport default FixedAssetItemAddModal;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n brand_data: {\r\n name: string;\r\n };\r\n}\r\n\r\nconst brandValidationSchema = Yup.object().shape({\r\n brand_data: Yup.object().shape({\r\n name: Yup.string().required('Name is required')\r\n })\r\n});\r\n\r\nexport const BrandAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(brandValidationSchema),\r\n defaultValues: {\r\n brand_data: {\r\n name: '',\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ brand_data: { name: '' } });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values?.brand_data as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.item.brandModal.title\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.brandModal.brand_name_label\")}\r\n name='name'\r\n fieldArrayName='brand_data'\r\n placeholder={t(\"inventory.item.brandModal.brand_name_placeholder\")}\r\n required\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n category_data: {\r\n category_name: string;\r\n };\r\n}\r\n\r\nconst categoryValidationSchema = Yup.object().shape({\r\n category_data: Yup.object().shape({\r\n category_name: Yup.string().required('Category Name is required'),\r\n })\r\n});\r\n\r\nexport const CategoryAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(categoryValidationSchema),\r\n defaultValues: {\r\n category_data: {\r\n category_name: '',\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ category_data: { category_name: '' } });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave({\r\n category_data: {\r\n category_name: values.category_data.category_name,\r\n sku_prefix : values.category_data.sku_prefix,\r\n unique_items : values.category_data.unique_items,\r\n status: true,\r\n },\r\n attribute_data: [],\r\n } as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='categoryAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.item.categoryModal.title\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='categoryAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.category_name_label\")}\r\n name='category_name'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.category_name_placeholder\")}\r\n required\r\n />\r\n </Grid> \r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.sku_prefix_label\")}\r\n name='sku_prefix'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.sku_prefix_placeholder\")}\r\n />\r\n </Grid> \r\n\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.unique_items_label\")}\r\n name='unique_items'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.unique_items_placeholder\")}\r\n />\r\n </Grid> \r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='categoryAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='categoryAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React, { useState } from 'react';\r\nimport {\r\n\tBox,\r\n\tDialogActions,\r\n\tDialogContent,\r\n\tDialogTitle,\r\n\tGrid,\r\n\tIconButton,\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Button from '../button/button';\r\nimport { DynamicInput } from '../form-control';\r\nimport Modal from '../modal/modal';\r\nimport ModalLoader from '../loaders/modal-loader';\r\nimport Typography from '../typography/typography';\r\n\r\ninterface SourceTypeAddModalProps {\r\n\tisOpen: boolean;\r\n\tsetIsOpen: (isOpen?: boolean) => void;\r\n\tisLoading?: boolean;\r\n\tonSave: (data: any) => Promise<void> | void;\r\n\tmodalProps?: any;\r\n}\r\n\r\ninterface SourceTypeFormValues {\r\n\tsource_type: {\r\n\t\tname: string;\r\n\t\tdescription: string;\r\n\t};\r\n}\r\n\r\nconst validationSchema = Yup.object().shape({\r\n\tsource_type: Yup.object().shape({\r\n\t\tname: Yup.string()\r\n\t\t\t.trim()\r\n\t\t\t.required('common.source_type.source_type_name_required')\r\n\t\t\t.max(255, 'common.source_type.source_type_name_max'),\r\n\t\tdescription: Yup.string()\r\n\t\t\t.nullable()\r\n\t\t\t.max(1000, 'common.source_type.description_max'),\r\n\t}),\r\n});\r\n\r\nconst defaultValues: SourceTypeFormValues = {\r\n\tsource_type: {\r\n\t\tname: '',\r\n\t\tdescription: '',\r\n\t},\r\n};\r\n\r\nconst SourceTypeAddModal: React.FC<SourceTypeAddModalProps> = ({\r\n\tisOpen,\r\n\tsetIsOpen,\r\n\tisLoading = false,\r\n\tonSave,\r\n\tmodalProps,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\r\n\r\n\tconst { control, handleSubmit, reset } = useForm<SourceTypeFormValues>({\r\n\t\tmode: 'all',\r\n\t\tresolver: yupResolver(validationSchema),\r\n\t\tdefaultValues,\r\n\t});\r\n\r\n\tconst handleClose = () => {\r\n\t\treset(defaultValues);\r\n\t\tsetIsOpen(false);\r\n\t};\r\n\r\n\tconst onSubmit = async (values: SourceTypeFormValues) => {\r\n\t\tsetIsSubmitting(true);\r\n\t\ttry {\r\n\t\t\tawait onSave({\r\n\t\t\t\t...values.source_type,\r\n\t\t\t\tdescription: values.source_type.description?.trim() || null,\r\n\t\t\t});\r\n\t\t\thandleClose();\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(t('common.source_type.error_creating_source_type'), error);\r\n\t\t} finally {\r\n\t\t\tsetIsSubmitting(false);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleSubmitForm = (e: React.FormEvent<HTMLFormElement>) => {\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t\thandleSubmit(onSubmit)(e);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<Modal\r\n\t\t\topen={isOpen}\r\n\t\t\tonClose={handleClose}\r\n\t\t\tmaxWidth={modalProps?.maxWidth || 'sm'}\r\n\t\t\tfullWidth={modalProps?.fullWidth ?? true}\r\n\t\t\t{...modalProps}\r\n\t\t>\r\n\t\t\t<form onSubmit={handleSubmitForm}>\r\n\t\t\t\t{(isSubmitting || isLoading) && <ModalLoader />}\r\n\t\t\t\t<DialogTitle className=\"brandAddModal--DialogTitle\">\r\n\t\t\t\t\t<Typography type=\"s3\" color=\"inherit\" weight=\"medium\">\r\n\t\t\t\t\t\t{t('common.source_type.create_new_source_type')}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<IconButton onClick={(e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\thandleClose();\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Close fontSize=\"small\" />\r\n\t\t\t\t\t</IconButton>\r\n\t\t\t\t</DialogTitle>\r\n\t\t\t\t<DialogContent dividers>\r\n\t\t\t\t\t<Grid container spacing={2}>\r\n\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\tlabel={t('common.source_type.source_type_name')}\r\n\t\t\t\t\t\t\t\tname=\"name\"\r\n\t\t\t\t\t\t\t\tfieldArrayName=\"source_type\"\r\n\t\t\t\t\t\t\t\tplaceholder={t('common.source_type.enter_source_type_name')}\r\n\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\tlabel={t('common.source_type.description')}\r\n\t\t\t\t\t\t\t\tname=\"description\"\r\n\t\t\t\t\t\t\t\tfieldArrayName=\"source_type\"\r\n\t\t\t\t\t\t\t\tplaceholder={t('common.source_type.enter_description_optional')}\r\n\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\tis_multiline\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t</DialogContent>\r\n\t\t\t\t<DialogActions>\r\n\t\t\t\t\t<Box display=\"flex\" gap={1.5} width=\"100%\" justifyContent=\"flex-end\">\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\t\tonClick={(e) => {\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t\thandleClose();\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tdisabled={isSubmitting || isLoading}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.cancel')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant=\"contained\"\r\n\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\r\n\t\t\t\t\t\t\tloading={isSubmitting || isLoading}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.source_type.create_source_type')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</DialogActions>\r\n\t\t\t</form>\r\n\t\t</Modal>\r\n\t);\r\n};\r\n\r\nexport { SourceTypeAddModal };\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\nimport DynamicCheckBox from './form-control/form-builder/form-builder-element/checkbox';\r\n\r\ninterface IFormValues {\r\n journal_type_data: {\r\n name: string;\r\n is_payment: boolean;\r\n };\r\n}\r\n\r\nconst journalTypeValidationSchema = Yup.object().shape({\r\n journal_type_data: Yup.object().shape({\r\n name: Yup.string()\r\n .required('Name is required')\r\n .max(100, 'Name must be at most 100 characters'),\r\n is_payment: Yup.boolean()\r\n })\r\n});\r\n\r\nexport const JournalTypeAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(journalTypeValidationSchema),\r\n defaultValues: {\r\n journal_type_data: {\r\n name: '',\r\n is_payment: false\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ \r\n journal_type_data: { \r\n name: '', \r\n is_payment: false \r\n } \r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values?.journal_type_data as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='journalTypeAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"accounting.journalType.addModal.title\", \"Create New Journal Type\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='journalTypeAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"accounting.journalType.form.name_label\", \"Name\")}\r\n name='name'\r\n fieldArrayName='journal_type_data'\r\n placeholder={t(\"accounting.journalType.form.name_placeholder\", \"Enter journal type name\")}\r\n required\r\n />\r\n </Grid>\r\n <Grid item sm={12}>\r\n <DynamicCheckBox\r\n formControl={control}\r\n label={t(\"accounting.journalType.form.is_payment_label\", \"Is Payment\")}\r\n name='is_payment'\r\n fieldArrayName='journal_type_data'\r\n title={t(\"accounting.journalType.form.is_payment_label\", \"Is Payment\")}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='journalTypeAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='journalTypeAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\", \"Cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t(\"common.save\", \"Save\")}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","import { getErrorMessage, getToken } from '../../../../utils/common';\r\nimport { postV1WarehouseLocation, postV1InventoryFixedAssetItems, postV1CategoryItems, postV1Brand } from '../../../../api-client/api.inventory/api';\r\nimport { PostV1WarehouseLocationRequest } from '../../../../api-client/api.inventory/api-types';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { postV1Parties, postV1PartiesIndustry, postV1JournalTypes } from '../../../../api-client/api.accounting/api';\r\nimport { postV1Teams, postV1Designation, postV1Departments, postV1DepartmentsTeams } from '../../../../api-client/api.hrms/api';\r\nimport { postV1SourceTypes } from '../../../../api-client/api.sales/api';\r\nimport { CustomerVendorModal } from '@/components/parties-modal';\r\nimport { TeamAddModal } from '../../../team-add-modal';\r\nimport { DepartmentAddModal } from '@/components/department-add-modal';\r\nimport { LocationAddModal } from './location-add-modal';\r\nimport { DesignationAddModal } from '@/components/designation-add-modal';\r\nimport { FixedAssetItemAddModal } from './fixed-asset-item-add-modal';\r\nimport { DialogProps } from '@mui/material';\r\nimport { BrandAddModal } from '@/components/brand-add-modal';\r\nimport { CategoryAddModal } from '@/components/category-add-modal';\r\nimport { IndustryAddModal } from '@/components/industry-add-modal';\r\nimport { SourceTypeAddModal } from '@/components/source-type-add-modal/source-type-add-modal';\r\nimport { JournalTypeAddModal } from '@/components/journal-type-add-modal';\r\n\r\nexport const createApiThunk = async (api: (payload: any) => Promise<any>, payload: any) => {\r\n\ttry {\r\n\t\treturn await api({ ...payload, ...getToken() })\r\n\t} catch (error) {\r\n\t\tenqueueSnackbar(getErrorMessage(error?.message), { variant: 'error' });\r\n\t\tthrow error;\r\n\t}\r\n}\r\n\r\nexport interface IAddConfig {\r\n\tapi: (payload: any) => Promise<any>;\r\n\tcomponent: any;\r\n}\r\n\r\nexport interface IModalComponentProps {\r\n\tisOpen: boolean;\r\n\tsetIsOpen: () => void;\r\n\tmodalProps?: DialogProps;\r\n\tonSave: (data: string) => void;\r\n\tisLoading?: boolean;\r\n}\r\n\r\nconst addMapper: Record<string, IAddConfig> = {\r\n\tlocation: {\r\n\t\tapi: (payload: PostV1WarehouseLocationRequest) => createApiThunk(postV1WarehouseLocation, payload),\r\n\t\tcomponent: LocationAddModal,\r\n\t},\r\n\tparty: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Parties, payload),\r\n\t\tcomponent: CustomerVendorModal,\r\n\t},\r\n\tdepartment: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Departments, payload),\r\n\t\tcomponent: DepartmentAddModal,\r\n\t},\r\n\tteam: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1DepartmentsTeams, payload),\r\n\t\tcomponent: TeamAddModal,\r\n\t},\r\n\tdesignation: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Designation, payload),\r\n\t\tcomponent: DesignationAddModal,\r\n\t},\r\n\tfixedAssetItem: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1InventoryFixedAssetItems, payload),\r\n\t\tcomponent: FixedAssetItemAddModal,\r\n\t},\r\n\tbrand: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Brand, payload),\r\n\t\tcomponent: BrandAddModal,\r\n\t},\r\n\tcategory: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1CategoryItems, payload),\r\n\t\tcomponent: CategoryAddModal,\r\n\t},\r\n\tindustry: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1PartiesIndustry, payload),\r\n\t\tcomponent: IndustryAddModal,\r\n\t},\r\n\tsourceType: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1SourceTypes, payload),\r\n\t\tcomponent: SourceTypeAddModal,\r\n\t},\r\n\tjournalType: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1JournalTypes, payload),\r\n\t\tcomponent: JournalTypeAddModal,\r\n\t},\r\n\tjournal_type: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1JournalTypes, payload),\r\n\t\tcomponent: JournalTypeAddModal,\r\n\t},\r\n};\r\n\r\nexport const dynamicSelectAdd = (addType: string): IAddConfig | null => {\r\n\tconst config = addMapper[addType];\r\n\r\n\tif (!config) {\r\n\t\tconsole.warn(`No configuration found for addType: ${addType}`);\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn {\r\n\t\t...config\r\n\t};\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IndustryFormValues {\r\n\tindustry: {\r\n\t\tname: string;\r\n\t};\r\n}\r\n\r\ninterface IndustryAddModalProps extends IModalComponentProps {\r\n\ttype?: string;\r\n}\r\n\r\nexport const IndustryAddModal: React.FC<IndustryAddModalProps> = ({\r\n\tisOpen,\r\n\tsetIsOpen,\r\n\tonSave,\r\n\tisLoading,\r\n\tmodalProps,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\r\n\tconst validationSchema = Yup.object().shape({\r\n\t\tindustry: Yup.object().shape({\r\n\t\t\tname: Yup.string()\r\n\t\t\t\t.required('Industry name is required')\r\n\t\t\t\t.max(255, 'Industry name must be at most 255 characters'),\r\n\t\t}),\r\n\t});\r\n\r\n\tconst { control, handleSubmit, reset } = useForm<IndustryFormValues>({\r\n\t\tresolver: yupResolver(validationSchema),\r\n\t\tmode: 'all',\r\n\t\tdefaultValues: {\r\n\t\t\tindustry: {\r\n\t\t\t\tname: '',\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tconst handleClose = () => {\r\n\t\treset({\r\n\t\t\tindustry: {\r\n\t\t\t\tname: '',\r\n\t\t\t},\r\n\t\t});\r\n\t\tsetIsOpen(false);\r\n\t};\r\n\r\n\tconst handleFormSubmit = (event?: React.BaseSyntheticEvent) => {\r\n\t\tevent?.preventDefault();\r\n\t\tevent?.stopPropagation();\r\n\r\n\t\treturn handleSubmit(onSubmit)(event);\r\n\t};\r\n\r\n\tconst onSubmit = async (data: IndustryFormValues) => {\r\n\t\ttry {\r\n\t\t\tawait onSave(data.industry as any);\r\n\t\t\thandleClose();\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('❌ ~ Error saving industry:', error);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<Modal\r\n\t\t\topen={isOpen}\r\n\t\t\tonClose={handleClose}\r\n\t\t\tmaxWidth={modalProps?.maxWidth || 'sm'}\r\n\t\t\tfullWidth={modalProps?.fullWidth || true}\r\n\t\t\tclassName=\"industry-add-modal\"\r\n\t\t>\r\n\t\t\t<DialogTitle>\r\n\t\t\t\t<Typography type=\"h5\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n\t\t\t\t\t{t('crm.leads.fields.create_industry_label', 'Create New Industry')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<IconButton onClick={handleClose}>\r\n\t\t\t\t\t<Close fontSize='small' />\r\n\t\t\t\t</IconButton>\r\n\t\t\t</DialogTitle>\r\n\r\n\t\t\t<form onSubmit={handleFormSubmit}>\r\n\t\t\t\t<DialogContent>\r\n\t\t\t\t\t{isLoading ? (\r\n\t\t\t\t\t\t<ModalLoader />\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<Grid container spacing={3}>\r\n\t\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\t\tlabel={t('crm.leads.fields.industry_name_label', 'Industry Name')}\r\n\t\t\t\t\t\t\t\t\tname=\"name\"\r\n\t\t\t\t\t\t\t\t\tplaceholder={t('crm.leads.fields.industry_name_placeholder', 'Enter Industry Name')}\r\n\t\t\t\t\t\t\t\t\tfieldArrayName=\"industry\"\r\n\t\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</DialogContent>\r\n\r\n\t\t\t\t<DialogActions>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\tonClick={handleClose}\r\n\t\t\t\t\t\tdisabled={isLoading}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{t('common.cancel', 'Cancel')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\tvariant=\"contained\"\r\n\t\t\t\t\t\tdisabled={isLoading}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{t('common.save', 'Save')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</DialogActions>\r\n\t\t\t</form>\r\n\t\t</Modal>\r\n\t);\r\n};\r\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\r\nimport {\r\n Box,\r\n CircularProgress,\r\n Divider,\r\n IconButton,\r\n InputAdornment,\r\n MenuItem,\r\n OutlinedInput,\r\n} from \"@mui/material\";\r\nimport Select from \"./select/select\";\r\nimport Checkbox from \"./checkbox/checkbox\";\r\nimport Typography from \"./typography/typography\";\r\nimport { Close } from \"./icons\";\r\nimport { debounce, sortBy } from \"lodash\";\r\nimport { fetchApi } from \"../utils/api\";\r\nimport ChipOrPlaceholder from \"./form-control/form-builder/form-builder-element/chip-or-placeholder\";\r\nimport { Add } from \"@mui/icons-material\";\r\nimport { useLanguage } from \"../hooks/useLangauge\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { dynamicSelectAdd } from \"./form-control/form-builder/form-builder-element/select-configuration\";\r\nimport { useAuth } from \"../hooks/useAuth\";\r\n\r\ninterface IOption {\r\n id: string | number;\r\n value: string | number;\r\n label: string | React.ReactNode;\r\n disabled?: boolean;\r\n isGroup?: boolean;\r\n options?: IOption[];\r\n searchLabel?: string;\r\n}\r\n\r\ninterface IPaginationState {\r\n page: number;\r\n hasMore: boolean;\r\n isLoadingMore: boolean;\r\n total: number;\r\n}\r\n\r\ninterface IMenuItems {\r\n options: IOption[];\r\n multiple: boolean;\r\n placeholder: string;\r\n with_checkboxes: boolean;\r\n values: string | string[];\r\n field: any;\r\n disabledIds: any[];\r\n handleClear: () => void;\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent?: boolean;\r\n}\r\n\r\n// Custom API fetch function type for parent components\r\ninterface CustomFetchApiParams {\r\n search?: string;\r\n filters?: any;\r\n limit: number;\r\n skip: number;\r\n select?: string;\r\n order?: string;\r\n}\r\n\r\ninterface CustomFetchApiResponse {\r\n data: IOption[];\r\n pagination?: {\r\n totalCount: number;\r\n };\r\n}\r\n\r\ninterface SearchableSelectProps {\r\n labelId: string;\r\n label: string;\r\n value: any;\r\n onChange?: (event: any, selectedData?: any) => void;\r\n options: IOption[];\r\n multiple?: boolean;\r\n placeholder?: string;\r\n size?: \"small\" | \"medium\";\r\n searchPlaceholder?: string;\r\n CustomDropDownIcon: React.ReactNode;\r\n customStyle: any;\r\n name?: string;\r\n defaultValue?: any;\r\n apiType?: string;\r\n isInternal?: boolean;\r\n autoFocus?: any;\r\n error?: any;\r\n disabled: any;\r\n customeFilter?: string;\r\n attributes?: string;\r\n getSelectedData?: (row: any) => void;\r\n disabledIds: any[];\r\n labelKey?: string;\r\n valueKey?: string;\r\n inputStyle?: any;\r\n onChipRemove?: (value: string) => void;\r\n selectedLabel?: string;\r\n is_loading?: boolean;\r\n hasParent?: boolean;\r\n sortOrder?: string;\r\n handleChange?: (value: string | string[]) => void;\r\n enable_footer?: boolean;\r\n onFooterClick?: () => void;\r\n showCancelButton?: boolean;\r\n /** Custom API function to fetch options from parent component */\r\n customFetchApi?: (params: CustomFetchApiParams) => Promise<CustomFetchApiResponse>;\r\n addType?: string;\r\n isMergeOptions?: boolean;\r\n attributes?: string[];\r\n modalComponentProps?: any;\r\n}\r\n\r\nconst generateMenuItems = ({\r\n options,\r\n multiple,\r\n placeholder,\r\n with_checkboxes,\r\n values,\r\n field,\r\n disabledIds,\r\n handleClear,\r\n handleChange,\r\n hasParent = false,\r\n}: IMenuItems) => {\r\n const itemDisabled = (ls: any) => disabledIds?.includes(ls);\r\n const items: React.ReactElement[] = [];\r\n\r\n if (!multiple) {\r\n items.push(\r\n <MenuItem disabled value='' key=\"placeholder\" sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\r\n <Typography type='s3' color='theme.secondary.1000'>\r\n <em>{placeholder}</em>\r\n </Typography>\r\n </MenuItem>\r\n );\r\n }\r\n\r\n const selectedValues = Array.isArray(values) ? values?.filter((value) => value) : [];\r\n\r\n // Parent selection handlers\r\n const handleParentChange = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n\r\n const isParentSelected = valueArray.includes(parentValue);\r\n const updatedValues = isParentSelected\r\n ? valueArray.filter((value) => value !== parentValue && !childValues.includes(value))\r\n : [...new Set([...valueArray, parentValue, ...childValues])];\r\n\r\n handleChange?.(updatedValues);\r\n };\r\n\r\n const isAllOptionsSelected = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.every((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n const isSomeOptionsSelected = (childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.some((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n Array.isArray(options) && options?.length > 0 && options?.forEach((option, index) => {\r\n items.push(\r\n <MenuItem\r\n value={option?.value}\r\n key={`${option?.value}-${index}`}\r\n disabled={Boolean(option?.disabled) || itemDisabled(option?.value) || (hasParent && !multiple)}\r\n className={option?.isGroup ? 'select--MenuItemHeader' : ''}\r\n onClick={() => {\r\n if (values?.length == 1) {\r\n handleClear();\r\n }\r\n }}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={\r\n hasParent\r\n ? isAllOptionsSelected(option.value, option.options || [])\r\n : Boolean(Array.isArray(values) && values?.indexOf(option?.value) > -1)\r\n }\r\n indeterminate={\r\n hasParent && isSomeOptionsSelected(option.options || [])\r\n }\r\n onChange={() =>\r\n hasParent\r\n ? handleParentChange(option.value, option.options || [])\r\n : handleChange?.(option.value)\r\n }\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(option.value)}\r\n >\r\n {option?.label}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n\r\n // Handle child options for grouped items\r\n if (option?.isGroup && Array.isArray(option?.options)) {\r\n option.options.forEach((opt, index) => {\r\n items.push(\r\n <MenuItem\r\n id={`${option.value}-${opt.value} ${index}`}\r\n value={opt.value}\r\n disabled={Boolean(opt.disabled) || itemDisabled(opt.value)}\r\n sx={{ pl: 5 }}\r\n onClick={() => {\r\n if (values?.length == 1) {\r\n handleClear();\r\n }\r\n }}\r\n key={`${option.value}-${opt.value} ${index}`}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={Boolean(Array.isArray(values) && values?.indexOf(opt.value) > -1)}\r\n />\r\n )}\r\n <Typography\r\n id={`${option.value}-${opt.value} ${index}`}\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(String(opt.value))}\r\n >\r\n {opt.label == \"Payment Entries\" ? \"Payment and Collection Entries\" : opt.label || opt.value}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n });\r\n }\r\n });\r\n\r\n // Footer item\r\n if (field.enable_footer || field.addType) {\r\n items.push(\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={() => {\r\n if (field.onFooterClick) {\r\n field.onFooterClick();\r\n } else if (field.handleModalOpen) {\r\n field.handleModalOpen();\r\n }\r\n }}>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {field.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>\r\n );\r\n }\r\n\r\n // No data fallback\r\n if (!items.length || (items.length == 1 && !multiple)) {\r\n items.push(\r\n <MenuItem disabled key=\"no-data\">\r\n No data available\r\n </MenuItem>\r\n );\r\n }\r\n\r\n return items;\r\n};\r\n\r\nconst SearchableSelect: React.FC<SearchableSelectProps> = (props) => {\r\n const {\r\n labelId,\r\n label,\r\n value,\r\n onChange,\r\n options,\r\n multiple = false,\r\n size = \"small\",\r\n searchPlaceholder,\r\n placeholder,\r\n name,\r\n defaultValue,\r\n apiType,\r\n isInternal = false,\r\n autoFocus,\r\n error,\r\n disabled,\r\n customeFilter,\r\n attributes,\r\n getSelectedData,\r\n disabledIds,\r\n onChipRemove,\r\n selectedLabel,\r\n is_loading,\r\n customStyle = {},\r\n CustomDropDownIcon,\r\n labelKey,\r\n valueKey,\r\n inputStyle,\r\n hasParent = false,\r\n sortOrder = 'id:-1',\r\n handleChange,\r\n enable_footer = false,\r\n onFooterClick,\r\n showCancelButton = true,\r\n customFetchApi,\r\n addType,\r\n isMergeOptions = false,\r\n } = props;\r\n\r\n const [searchQuery, setSearchQuery] = useState(\"\");\r\n const [loading, setLoading] = useState<boolean>(false);\r\n const [dynamicOptions, setOptions] = useState<IOption[]>([]);\r\n const [selectedOptions, setSelectedOptions] = useState<IOption[]>([]);\r\n const [isAlreadyLoaded, setIsAlreadyLoaded] = useState(false);\r\n const [initailLoading, setInitialLoading] = useState(false);\r\n const [searchInitiate, setSearchInitiate] = useState(false);\r\n const [open, setOpen] = useState(false);\r\n const [prevFilter, setPrevFilter] = useState<any>(null);\r\n const [addConfig, setAddConfig] = useState<any>(null);\r\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\r\n const [isAddLoading, setIsAddLoading] = useState<boolean>(false);\r\n const { t } = useTranslation();\r\n\r\n // Pagination state\r\n const [pagination, setPagination] = useState<IPaginationState>({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n\r\n const { isRtl } = useLanguage();\r\n const limit = 25;\r\n\r\n const isInternalOptions = useMemo(() => {\r\n if (isMergeOptions && (apiType || customFetchApi)) return false;\r\n return isInternal || (!apiType && !customFetchApi);\r\n }, [isInternal, apiType, customFetchApi, isMergeOptions]);\r\n\r\n // Local search function for internal options\r\n const searchOptionsLocally = useCallback((searchTerm: string, value: any): IOption[] => {\r\n const currentOptions: IOption[] = (options && options.length > 0) ? options : [];\r\n if (!searchTerm) return currentOptions;\r\n\r\n const lowercasedSearchTerm = searchTerm.toLowerCase();\r\n\r\n const filteredOptions = hasParent\r\n ? options?.reduce((acc: IOption[], opt) => {\r\n const searchedOptions = opt.options?.filter((item) => {\r\n const label = React.isValidElement(item.label) ? item.searchLabel : String(item.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n });\r\n\r\n if (searchedOptions?.length) {\r\n acc.push({ ...opt, options: searchedOptions });\r\n }\r\n\r\n return acc;\r\n }, []) || []\r\n : options?.filter((opt) => {\r\n const label = React.isValidElement(opt.label) ? opt.searchLabel : String(opt.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n }) || [];\r\n\r\n return sortBySelectedValues(filteredOptions, value);\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [options, hasParent]);\r\n\r\n // Clear Selected Options\r\n const handleClear = () => {\r\n onChange?.({ target: { value: multiple ? [] : null } });\r\n if (getSelectedData && typeof getSelectedData === \"function\") {\r\n getSelectedData(null);\r\n }\r\n };\r\n\r\n // Get unique options\r\n const getUniqueOptions = useCallback((data: IOption[]): IOption[] => {\r\n const uniqueOptions = [\r\n ...new Map(data?.map(item => [item.value, item])).values()\r\n ];\r\n return uniqueOptions;\r\n }, []);\r\n\r\n // Sort by selected values\r\n const sortBySelectedValues = useCallback((arrayToSort: IOption[], value: any): IOption[] => {\r\n const selectedValues = Array.isArray(value) ? value : [value];\r\n const sortedValue = sortBy(arrayToSort, (item) => {\r\n const index = selectedValues.indexOf(item.id || item.value);\r\n return index === -1 ? Infinity : index;\r\n });\r\n return sortedValue;\r\n }, []);\r\n\r\n // Options with search and pagination support\r\n const filteredOptions = useMemo(() => {\r\n if (isInternalOptions) {\r\n return searchOptionsLocally(searchQuery, value);\r\n }\r\n const apiOptions = sortBySelectedValues(getUniqueOptions([...dynamicOptions, ...selectedOptions]), value);\r\n if (isMergeOptions) {\r\n const localOptions = searchOptionsLocally(searchQuery, value);\r\n return getUniqueOptions([...localOptions, ...apiOptions]);\r\n }\r\n return apiOptions;\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [searchQuery, dynamicOptions, options, value, isInternalOptions, selectedOptions, searchOptionsLocally, sortBySelectedValues, getUniqueOptions, isMergeOptions]);\r\n\r\n // Handle scroll pagination\r\n const handleScroll = useCallback((event: React.UIEvent<HTMLDivElement>) => {\r\n const { scrollTop, scrollHeight, clientHeight } = event.currentTarget;\r\n const isBottom = scrollHeight - scrollTop <= clientHeight + 10;\r\n\r\n if (isBottom && pagination.hasMore && !pagination.isLoadingMore && !isInternalOptions) {\r\n const nextPage = pagination.page + 1;\r\n fetchOptions(searchQuery, customeFilter, nextPage, true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [pagination.hasMore, pagination.isLoadingMore, pagination.page, isInternalOptions, searchQuery, JSON.stringify(customeFilter)]);\r\n\r\n // Update Options\r\n const updateOptions = useCallback((newOptions: IOption[], append = false) => {\r\n setOptions((prevOptions) => {\r\n const oldOptions = append ? prevOptions : selectedOptions;\r\n const uniqueOptions = getUniqueOptions([...oldOptions, ...newOptions]);\r\n return uniqueOptions;\r\n });\r\n }, [selectedOptions, getUniqueOptions]);\r\n\r\n // Fetch Options with pagination support\r\n const fetchOptions = useCallback(async (searchTerm: any = '', filters = customeFilter, page = 1, append = false) => {\r\n // Skip if neither apiType nor customFetchApi is provided\r\n if (!apiType && !customFetchApi) return [];\r\n\r\n setLoading(true);\r\n if (page > 1) {\r\n setPagination(prev => ({ ...prev, isLoadingMore: true }));\r\n }\r\n\r\n try {\r\n let data: IOption[] = [];\r\n let paginationResult: { totalCount?: number } = {};\r\n\r\n // Use custom API if provided, otherwise use default fetchApi\r\n if (customFetchApi) {\r\n const response = await customFetchApi({\r\n search: searchTerm,\r\n filters,\r\n limit,\r\n skip: (page - 1) * limit,\r\n select: attributes,\r\n order: sortOrder\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n } else {\r\n const response = await fetchApi({\r\n apiKey: apiType!,\r\n filters: {\r\n limit,\r\n skip: (page - 1) * limit,\r\n search: searchTerm,\r\n filters,\r\n select: attributes,\r\n order: sortOrder\r\n },\r\n labelKey,\r\n valueKey\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n }\r\n\r\n if (data && Array.isArray(data)) {\r\n updateOptions(data, append);\r\n\r\n // Update pagination\r\n setPagination(prev => ({\r\n ...prev,\r\n page,\r\n hasMore: (paginationResult?.totalCount || 0) > (page * limit),\r\n total: paginationResult?.totalCount || 0,\r\n isLoadingMore: false\r\n }));\r\n\r\n if (data?.length > 0) {\r\n setSelectedData();\r\n }\r\n }\r\n\r\n return data || [];\r\n } catch (error) {\r\n console.error('Error fetching options:', error);\r\n setPagination(prev => ({ ...prev, isLoadingMore: false }));\r\n return [];\r\n } finally {\r\n setLoading(false);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [apiType, customFetchApi, attributes, sortOrder, limit, updateOptions, dynamicOptions]);\r\n\r\n // Search Options with debounce\r\n const debounceSearch = useMemo(\r\n () => debounce(async (searchTerm: string) => {\r\n if (loading) return;\r\n\r\n if (!searchTerm && !isInternalOptions && searchInitiate) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions('', customeFilter, 1, false);\r\n }\r\n if (searchTerm?.length > 1 && !isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions(searchTerm, customeFilter, 1, false);\r\n }\r\n }, 700),\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n [isInternalOptions, searchInitiate, JSON.stringify(customeFilter)]\r\n );\r\n\r\n // Initial fetch with filter change detection\r\n const initialFetch = useCallback(async () => {\r\n const condition = JSON.stringify(customeFilter) !== JSON.stringify(prevFilter);\r\n\r\n if (condition && !isInternalOptions && !isAlreadyLoaded) {\r\n setPrevFilter(customeFilter);\r\n setOptions([]);\r\n setIsAlreadyLoaded(false);\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n }\r\n\r\n if (!isInternalOptions && !isAlreadyLoaded) {\r\n await fetchOptions(searchQuery, customeFilter, 1, false);\r\n setIsAlreadyLoaded(true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [JSON.stringify(customeFilter), isInternalOptions, isAlreadyLoaded]);\r\n\r\n // Set Selected Data\r\n const setSelectedData = useCallback(() => {\r\n let hasOptions = false;\r\n const isInOptions = filteredOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n );\r\n\r\n if ((Array.isArray(isInOptions) && isInOptions?.length > 0)) {\r\n getSelectedData?.(multiple ? isInOptions : isInOptions[0]);\r\n hasOptions = true;\r\n }\r\n\r\n return hasOptions;\r\n }, [JSON.stringify(filteredOptions), value, multiple]);\r\n\r\n // Fetch Options for Selected Id\r\n const fetchIdOptions = useCallback(async () => {\r\n if (await setSelectedData()) return;\r\n if (open) return;\r\n\r\n const fValue = multiple ? value && value?.filter(v => Boolean(Number(v))) : value ? value : null;\r\n const condition = (multiple ? fValue?.length > 0 : fValue) && !isInternalOptions;\r\n\r\n if (condition) {\r\n setInitialLoading(true);\r\n await fetchOptions('', { ...customeFilter, ...{ '&id.in': fValue } }, 1, false);\r\n setInitialLoading(false);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [open, value, JSON.stringify(customeFilter)]);\r\n\r\n const hasValue = multiple\r\n ? Array.isArray(value) && value.length > 0\r\n : value !== null && value !== undefined && value !== \"\";\r\n\r\n // Effects\r\n useEffect(() => {\r\n if (open) {\r\n debounceSearch(searchQuery);\r\n }\r\n return () => debounceSearch.cancel();\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [searchQuery, JSON.stringify(customeFilter), open, isAlreadyLoaded, debounceSearch]);\r\n\r\n useEffect(() => {\r\n setSelectedData();\r\n }, [setSelectedData]);\r\n\r\n useEffect(() => {\r\n fetchIdOptions();\r\n }, [fetchIdOptions]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n initialFetch();\r\n }\r\n }, [open, initialFetch]);\r\n\r\n useEffect(() => {\r\n const condition = JSON.stringify(customeFilter) !== JSON.stringify(prevFilter);\r\n if (customeFilter && condition) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n }, [customeFilter, prevFilter]);\r\n\r\n useEffect(() => {\r\n if (value && !open) {\r\n const currentOptions: IOption[] = (options && options.length > 0) ? options : [];\r\n const selectedData = currentOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n ) || [];\r\n setSelectedOptions(selectedData);\r\n }\r\n setSelectedOptions(filteredOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n ));\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [value, open, options, multiple]);\r\n\r\n const handleModalOpen = useCallback(() => {\r\n setIsModalOpen(true);\r\n }, []);\r\n\r\n // Handle modal save\r\n const handleModalSave = useCallback(async (payload: any) => {\r\n if (!addConfig || !addConfig.api) {\r\n console.error('Add configuration is not properly set');\r\n return;\r\n }\r\n\r\n setIsAddLoading(true);\r\n try {\r\n const result = await addConfig.api(payload);\r\n setIsAddLoading(false);\r\n setIsModalOpen(false);\r\n if (!isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n setIsAlreadyLoaded(false);\r\n await fetchOptions('', customeFilter, 1, false);\r\n }\r\n if (result && result.data) {\r\n const newValue = multiple\r\n ? [...(value || []), result.data.id]\r\n : result.data.id;\r\n }\r\n } catch (error) {\r\n console.log(\"error\", error);\r\n setIsAddLoading(false);\r\n }\r\n\r\n\r\n }, [addConfig, isInternalOptions, fetchOptions, customeFilter, multiple, name, value]);\r\n\r\n useEffect(() => {\r\n const config = dynamicSelectAdd(addType!);\r\n setAddConfig(config);\r\n }, [addType])\r\n\r\n const handleOnChange = (event: any) => {\r\n const { value } = event.target;\r\n if ((multiple && Array.isArray(value) && value?.filter(v => v).length == 0) || !value) return;\r\n\r\n const isSelected = (item: any) => {\r\n return multiple ? value?.includes(item?.value) : item?.value === value;\r\n };\r\n\r\n const selected = filteredOptions?.filter(isSelected);\r\n onChange?.(event, multiple ? selected : selected?.[0]);\r\n getSelectedData?.(multiple ? selected : selected?.[0]);\r\n\r\n };\r\n\r\n const removeUndefine = (selectOptions: any[]) => {\r\n return Array.isArray(selectOptions) && selectOptions?.length > 0 && selectOptions?.filter((option) => option);\r\n };\r\n\r\n const showGroupLabel = (item: any) => {\r\n if (!item?.length) {\r\n return undefined\r\n }\r\n const mergedOptions = item?.flatMap((i: any) => i?.options)\r\n return mergedOptions?.find((option: any) => option?.value === value)?.label\r\n }\r\n\r\n return (\r\n <Select\r\n labelId={labelId}\r\n name={name}\r\n defaultValue={defaultValue || (multiple ? [] : '')}\r\n placeholder={t(placeholder)}\r\n className=\"filter-select\"\r\n size={size}\r\n onOpen={() => setOpen(true)}\r\n onClose={() => {\r\n setOpen(false);\r\n if (searchQuery?.length > 0) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n setSearchInitiate(false);\r\n setSearchQuery('');\r\n }}\r\n onChange={handleOnChange}\r\n showCancelButton={showCancelButton}\r\n multiple={multiple}\r\n label={t(label)}\r\n fullWidth\r\n displayEmpty\r\n autoFocus={autoFocus}\r\n error={Boolean(error)}\r\n disabled={disabled}\r\n value={initailLoading ? (multiple ? [] : '') : value?.id || value || (multiple ? [] : '')}\r\n searchPlaceholder={searchPlaceholder}\r\n CustomDropdownIcon={CustomDropDownIcon}\r\n sx={(multiple && value?.length) ? { ...customStyle, \"& .MuiSelect-select\": { padding: '5.5px !important' } } : customStyle}\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 295, maxWidth: 250 }\r\n }\r\n }}\r\n input={\r\n !disabled ? (\r\n <OutlinedInput\r\n label=\"\"\r\n sx={inputStyle}\r\n endAdornment={\r\n <InputAdornment position=\"end\">\r\n {loading || is_loading ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n showCancelButton && hasValue && (\r\n <IconButton\r\n aria-label=\"clear selection\"\r\n onClick={handleClear}\r\n edge=\"end\"\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size=\"small\"\r\n >\r\n <Close fontSize=\"small\" color='theme.primary.800' />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n ) : undefined\r\n }\r\n renderValue={(selected?: string | string[]) => {\r\n return (\r\n <>\r\n {Array.isArray(selected) ? (\r\n <ChipOrPlaceholder\r\n selectedLabel={selectedLabel}\r\n data={removeUndefine(selected)}\r\n placeholder={placeholder}\r\n onDelete={onChipRemove}\r\n disabled={disabled}\r\n chipProps={{\r\n sx: {\r\n bgcolor: 'theme.primary.100',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: 'theme.primary.800',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n ) : (\r\n hasParent ? showGroupLabel(filteredOptions) :\r\n Array.isArray(filteredOptions) && filteredOptions?.length > 0 && filteredOptions?.find(\r\n (option: any) => option?.value == value\r\n )?.label || selected || placeholder\r\n )}\r\n </>\r\n );\r\n }}\r\n handleSearch={(text) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(multiple),\r\n placeholder,\r\n values: value,\r\n with_checkboxes: true,\r\n field: {\r\n ...props,\r\n enable_footer,\r\n onFooterClick,\r\n label,\r\n handleModalOpen\r\n },\r\n disabledIds,\r\n handleClear,\r\n handleChange,\r\n hasParent,\r\n t: (key: string) => key\r\n })}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n {/* Modal for adding new items */}\r\n {addConfig && addConfig.component && (\r\n <>\r\n {React.createElement(addConfig.component, {\r\n isOpen: isModalOpen,\r\n setIsOpen: setIsModalOpen,\r\n isLoading: isAddLoading,\r\n onSave: handleModalSave,\r\n modalProps: {\r\n maxWidth: 'md',\r\n fullWidth: true\r\n },\r\n ...props?.modalComponentProps\r\n })}\r\n </>\r\n )}\r\n </Select>\r\n );\r\n};\r\n\r\nexport default SearchableSelect;","import { useMemo, useCallback } from 'react';\r\nimport { Box } from '@mui/material';\r\nimport TextField from '../../text-field/text-field';\r\nimport { ValueEditorProps } from 'react-querybuilder';\r\nimport '../filter.scss';\r\nimport DatePicker from '../../date-picker/date-picker';\r\nimport dayjs from 'dayjs';\r\n\r\nimport SearchableSelect from '../../searchable-select';\r\nimport _ from 'lodash';\r\nimport { formatLabel } from '../../../utils/format-text';\r\nimport { getToken } from '@/utils';\r\nimport { getV1FilterFilterTable } from '../../../api-client/api.system-feature/api';\r\n\r\nconst getFilterTableFields = async (\r\n\ttableName: string,\r\n\tsearchText: string,\r\n\tlimit: number,\r\n\toffset: number = 0\r\n) => {\r\n\ttry {\r\n\t\tconst tokenObj = getToken();\r\n\t\tconst response = await getV1FilterFilterTable({\r\n\t\t\ttable: tableName,\r\n\t\t\tsearch: searchText,\r\n\t\t\tlimit: limit,\r\n\t\t\toffset: offset,\r\n\t\t\t'x-token': tokenObj['x-token'],\r\n\t\t\t'x-timezone': String(tokenObj['x-timezone'])\r\n\t\t});\r\n\r\n\t\t// response could be of several types, but use optional chaining and type narrowing\r\n\t\tif ('data' in response && response.data) {\r\n\t\t\tconst result: any[] = (response.data as any)?.result ?? [];\r\n\t\t\tconst totalCount: number = (response as any)?.pagination?.totalCount ?? result.length;\r\n\t\t\tconst items = result.map((r: any) => ({ label: r.name, value: r.id }));\r\n\t\t\treturn { items, totalCount };\r\n\t\t}\r\n\t\treturn { items: [], totalCount: 0 };\r\n\t} catch {\r\n\t\treturn { items: [], totalCount: 0 };\r\n\t}\r\n};\r\n\r\nconst ValueEditor = (props: ValueEditorProps) => {\r\n\t// eslint-disable-next-line\r\n\tlet { values, value, handleOnChange, fieldData, rule, ...rest } = props;\r\n\tconsole.log(\"🚀 ~ ValueEditor ~ values:\", values)\r\n\r\n\tif (!value && fieldData.inputType == 'select') {\r\n\t\tvalue = null;\r\n\t} else if (!Array.isArray(value) && fieldData.inputType == 'select') {\r\n\t\tvalue = [];\r\n\t}\r\n\r\n\tconst isDisabled = useMemo(() => {\r\n\t\treturn rule.operator === 'null' || rule.operator === 'notNull';\r\n\t}, [rule.operator]);\r\n\r\n\tconst customFetch = useCallback(\r\n\t\tasync (params: any) => {\r\n\t\t\tconst search = params?.search || '';\r\n\t\t\tconst limit = params?.limit || 25;\r\n\t\t\tconst offset = params?.skip || 0;\r\n\t\t\tif (fieldData.table) {\r\n\t\t\t\tconst data = await getFilterTableFields(fieldData.table, search, limit, offset);\r\n\t\t\t\tconst optionData = data.items.map((r: any) => ({ id: r.value, value: r.value, label: r.label }));\r\n\t\t\t\treturn { data: optionData, pagination: { totalCount: data.totalCount } };\r\n\t\t\t} else {\r\n\t\t\t\t// const searchedOptions =\r\n\t\t\t\t// \tvalues?.filter((opt) => opt.label?.toLowerCase().includes(search.toLowerCase())) ||\r\n\t\t\t\t// \t[];\r\n\t\t\t\tconst optionData = values?.map((item: any) => ({\r\n\t\t\t\t\t...item,\r\n\t\t\t\t\tvalue: item?.name,\r\n\t\t\t\t\tlabel: item.label ? formatLabel(item.label) : ''\r\n\t\t\t\t}));\r\n\t\t\t\treturn {\r\n\t\t\t\t\tdata: optionData,\r\n\t\t\t\t\tpagination: { totalCount: optionData.length }\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t},\r\n\t\t[fieldData.table, values]\r\n\t);\r\n\r\n\tconst renderOptions = () => {\r\n\t\tswitch (fieldData.inputType) {\r\n\t\t\tcase 'select':\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<SearchableSelect\r\n\t\t\t\t\t\tkey={fieldData.name}\r\n\t\t\t\t\t\tlabel=''\r\n\t\t\t\t\t\tname='insurance_account'\r\n\t\t\t\t\t\tplaceholder='Select'\r\n\t\t\t\t\t\tonChange={(e: any, selected: any) => {\r\n\t\t\t\t\t\t\tconsole.log(\"🚀 ~ renderOptions ~ selected:\", selected)\r\n\t\t\t\t\t\t\tconst mappedValue = selected?.map((i: any) => ({\r\n\t\t\t\t\t\t\t\t...i,\r\n\t\t\t\t\t\t\t\tname: i?.value\r\n\t\t\t\t\t\t\t}))\r\n\t\t\t\t\t\t\thandleOnChange(mappedValue)\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tvalue={value?.map(i => i?.value)}\r\n\t\t\t\t\t\tmultiple={true}\r\n\t\t\t\t\t\tcustomFetchApi={customFetch}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\tonChipRemove={() => handleOnChange([])}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase 'date':\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<DatePicker\r\n\t\t\t\t\t\tonChange={(val) =>\r\n\t\t\t\t\t\t\thandleOnChange(\r\n\t\t\t\t\t\t\t\tdayjs(val).isValid() ? dayjs(val).format('YYYY-MM-DD') : ''\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvalue={value ? dayjs(value) : null}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\tslotProps={{\r\n\t\t\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\t\t\tplaceholder: 'YYYY-MM-DD',\r\n\t\t\t\t\t\t\t\tclassName: 'select-drps'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tformat='YYYY-MM-DD'\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={(e: any) => {\r\n\t\t\t\t\t\t\thandleOnChange(e.target.value);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t{...rest}\r\n\t\t\t\t\t\tinputProps={{\r\n\t\t\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\t\t\tfontSize: '0.8125rem'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tclassName='select-drps'\r\n\t\t\t\t\t\ttype={fieldData.inputType}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\treturn <Box width='100%'>{renderOptions()}</Box>;\r\n};\r\n\r\nexport { ValueEditor };\r\nexport default ValueEditor;\r\n","import { Box, MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\nimport { OperatorSelectorProps } from \"react-querybuilder\";\nimport formatText from \"../../../utils/format-text\";\n\nconst OperatorSelect = (props: OperatorSelectorProps) => {\n const { handleOnChange, options, ...rest } = props;\n\n\n return (\n <Box width='100%'>\n <Select\n fullWidth\n {...rest}\n onChange={(e: any) => handleOnChange(e.target.value)}\n className=\"select-drps\"\n variant=\"outlined\"\n renderValue= {(selected: string) => {\n const dValue = options?.find(o => o.name==selected)?.label\n return dValue ? formatText(dValue) : selected\n }}\n >\n {options?.filter(o => Boolean(o.label?.trim()))?.map((op: any) => (\n <MenuItem key={op.name} value={op.name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {formatText(op.label)}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n </Box>\n );\n};\n\nexport { OperatorSelect };\nexport default OperatorSelect;\n","import Button from \"../../button/button\";\n// import Typography from \"../../typography/typography\";\nimport { ActionProps } from \"react-querybuilder\";\nimport { Trash } from \"../../icons\";\n\nconst RemoveGroupAction = (props: ActionProps) => {\n const { handleOnClick } = props;\n\n return (\n <Button\n className=\"filterGrp-remove-btn\"\n variant=\"outlined\"\n onClick={handleOnClick}\n sx={({palette}) => ({\n marginRight: \"0px\",\n marginLeft: \"auto\",\n color: `${palette.theme.error?.[600]} !important`\n })}\n startIcon={<Trash color=\"theme.error.600\" fontSize=\"small\"/>}\n >\n Delete Group\n </Button>\n );\n};\n\nexport { RemoveGroupAction };\nexport default RemoveGroupAction;\n","import {\n Box,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n} from \"@mui/material\";\nimport Close from \"@mui/icons-material/Close\";\nimport { useEffect, useState } from \"react\";\nimport Modal from \"../modal/modal\";\nimport Typography from \"../typography/typography\";\nimport TextField from \"../text-field/text-field\";\nimport Button from \"../button/button\";\nimport { FolderSave } from \"../icons\";\n\ninterface SaveFilter {\n open: boolean;\n onClose: () => void;\n handleSubmit: (name: string) => void;\n oldName?: string;\n}\n\nconst SaveFilterModal = ({\n open,\n onClose,\n handleSubmit,\n oldName,\n}: SaveFilter) => {\n const [name, setName] = useState<string>(\"\");\n\n useEffect(() => {\n if (oldName !== undefined) {\n setName(oldName);\n }\n }, [oldName]);\n\n const handleSave = async (name: string) => {\n if (name) {\n const saved = await handleSubmit(name);\n\n if(saved) {\n setName(\"\");\n onClose();\n }\n }\n\n };\n\n return (\n <>\n <Modal fullWidth onClose={onClose} open={open}>\n <DialogTitle>\n <Box sx={{ display: 'flex', alignItems: 'center', gap:0.5 }}>\n <FolderSave sx={{ fontSize: '1.25rem'}}/>\n <Typography type=\"s2\" weight=\"medium\" color={\"theme.secondary.1000\"}>\n Save active filters\n </Typography>\n </Box>\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\n <Close fontSize=\"inherit\" />\n </IconButton>\n </DialogTitle>\n <DialogContent dividers>\n <TextField\n label=\"Name\"\n fullWidth\n placeholder=\"Name Filter\"\n value={name}\n onChange={(e: any) => setName(e.target.value)}\n />\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"outlined\"\n onClick={onClose}\n style={{\n color: \"black\",\n }}\n >\n Cancel\n </Button>\n <Button onClick={() => handleSave(name)}>\n {oldName ? \"Rename\" : \"Save\"}\n </Button>\n </DialogActions>\n </Modal>\n </>\n );\n};\n\nexport { SaveFilterModal };\nexport default SaveFilterModal;\n","/* eslint-disable */\r\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\r\nimport type { RuleGroupType } from \"react-querybuilder\";\r\nimport \"react-querybuilder/dist/query-builder.scss\";\r\nimport { QueryBuilder /* , formatQuery */ } from \"react-querybuilder\";\r\nimport { QueryBuilderMaterial } from \"@react-querybuilder/material\";\r\nimport {\r\n Box,\r\n IconButton,\r\n MenuItem,\r\n Dialog,\r\n DialogTitle,\r\n DialogContent,\r\n DialogActions,\r\n OutlinedInput,\r\n InputAdornment,\r\n Alert,\r\n} from \"@mui/material\";\r\nimport \"./filter.scss\";\r\nimport Select from \"../select/select\";\r\nimport Typography from \"../typography/typography\";\r\nimport { Close } from \"@mui/icons-material\";\r\nimport CombinatorSelect from \"./components/combinator-select\";\r\nimport RemoveAction from \"./components/remove-action\";\r\nimport FieldSelect from \"./components/field-select\";\r\nimport AddFilterButton from \"./components/add-filter\";\r\nimport AddGroupButton from \"./components/add-group\";\r\nimport ValueEditor from \"./components/value-editor\";\r\nimport OperatorSelect from \"./components/operator-select\";\r\nimport Button from \"../button/button\";\r\nimport RemoveGroupAction from \"./components/delete-group\";\r\nimport SearchBar from \"../search-bar/search-bar\";\r\nimport SaveFilterModal from \"../save-filter-modal/save-filter-modal\";\r\n\r\nimport {\r\n putV1FilterId,\r\n deleteV1FilterId,\r\n} from \"../../api-client/api.system-feature/api\";\r\nimport type * as Types from \"../../api-client/api.system-feature/api-types\";\r\nimport { auth } from \"../../constants/auth\";\r\nimport { generateFields, generateQueryString, getErrorMessage } from \"../../utils/common\";\r\nimport { usePages } from \"../../hooks/use-pages\";\r\nimport _ from \"lodash\";\r\nimport { Edit, Trash } from \"../icons\";\r\nimport { enqueueSnackbar } from \"notistack\";\r\nimport { IResources, routeToResourceMap } from \"../../constants/route-page-map\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\n\r\ninterface IFilter {\r\n open: boolean;\r\n onClose: () => void;\r\n activeView?: string;\r\n savedFilters?: SavedFilter[];\r\n fetchSavedFilters?: () => Promise<void>;\r\n setFilterBar?: any;\r\n onSaveFilter?: (query: RuleGroupType) => void;\r\n onSelectedFilter?: (filterName: string) => void;\r\n fields: any;\r\n applyFilter: any;\r\n isUseFields?: boolean;\r\n}\r\n\r\ninterface SavedFilter {\r\n id: string;\r\n name: string;\r\n query: RuleGroupType;\r\n}\r\n\r\nconst initialQuery: RuleGroupType = { combinator: \"and\", rules: [] };\r\n\r\nconst Filter = ({\r\n open,\r\n onClose,\r\n // activeView,\r\n savedFilters,\r\n fetchSavedFilters,\r\n onSaveFilter,\r\n onSelectedFilter,\r\n applyFilter,\r\n fields = [],\r\n isUseFields = false\r\n}: IFilter) => {\r\n const location = useLocation();\r\n\r\n const token = localStorage.getItem(auth.storageTokenKeyName);\r\n const { updatePageInfo, activePage, schemaFields, setActivePage } = usePages()\r\n\r\n fields = isUseFields ? generateFields(fields) : (schemaFields.length ? generateFields(schemaFields) : fields)\r\n const [query, setQuery] = useState<RuleGroupType>(initialQuery);\r\n const [filteredSavedFilters, setFilteredSavedFilters] = useState<\r\n SavedFilter[]\r\n >(savedFilters ?? []);\r\n const [selectedFilter, setSelectedFilter] = useState<any>(null);\r\n const [openRenameFilter, setIsOpenRenameFilter] = useState<any>(null);\r\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\r\n const { isRtl } = useLanguage();\r\n const resources: IResources = useMemo(() => routeToResourceMap[location.pathname] || null, [location.pathname])\r\n\r\n useEffect(() => {\r\n savedFilters && setFilteredSavedFilters(savedFilters);\r\n }, [savedFilters]);\r\n\r\n\r\n const handleApplyFilter = useCallback((clear: boolean = false) => {\r\n let q = query\r\n const isInvalid = isDuplicatedFilters(q)\r\n if (isInvalid) {\r\n setErrorMessage(\"Invalid filter\")\r\n return\r\n }\r\n if (clear) {\r\n q = initialQuery\r\n setQuery(q)\r\n } else {\r\n const generatedSQLQuery = q ? generateQueryString(q) : q;\r\n updatePageInfo({ filters: q, filterQueryString: generatedSQLQuery })\r\n // applyFilter(generatedSQLQuery);\r\n onClose();\r\n }\r\n }, [query, applyFilter, onClose]);\r\n\r\n const handleQueryChange = (q: RuleGroupType) => {\r\n const updatedRules = q.rules.map((rule, i) => ({\r\n ...rule,\r\n value: rule.field !== query.rules?.[i]?.field || ['null', 'notNull'].includes(rule.operator) ? \"\" : rule.value\r\n }));\r\n let isValid = true;\r\n let errorMessage = '';\r\n\r\n // // Helper function to check for invalid aggregate usage, considering parent combinators\r\n // const checkForInvalidAggregateUsage = (rules: any[], combinator: string, parentCombinator: string | null): boolean => {\r\n // let hasAggregateField = false;\r\n // let hasNonAggregateField = false;\r\n\r\n // rules.forEach(rule => {\r\n // // Check nested groups\r\n // if (rule.rules) {\r\n // // If the current group or any parent has an 'OR', pass it down\r\n // const currentCombinator = combinator === 'or' || parentCombinator === 'or' ? 'or' : combinator;\r\n // checkForInvalidAggregateUsage(rule.rules, rule.combinator, currentCombinator);\r\n // } else {\r\n // // Find the field in the fields array and check if it's an aggregate\r\n // const field = fields.find((f: any) => f.name === rule.field);\r\n\r\n // if (field?.is_aggregate) {\r\n // hasAggregateField = true;\r\n // } else {\r\n // hasNonAggregateField = true;\r\n // }\r\n // }\r\n // });\r\n\r\n // // If any parent or current rule uses 'OR' with a mix of aggregate and non-aggregate fields, it's invalid\r\n // if ((combinator === 'or' || parentCombinator === 'or') && hasAggregateField && hasNonAggregateField) {\r\n // isValid = false;\r\n // errorMessage = 'Mixing aggregate and non-aggregate fields in OR conditions may lead to unexpected results.';\r\n // }\r\n\r\n // return isValid;\r\n // };\r\n\r\n // Start checking from the root level (no parent combinator initially)\r\n\r\n\r\n // Always set the query, regardless of validity\r\n setQuery({ ...q, rules: updatedRules });\r\n\r\n // Set error message if invalid, otherwise clear it\r\n if (!isValid) {\r\n setErrorMessage(errorMessage);\r\n } else {\r\n setErrorMessage(null);\r\n }\r\n\r\n // Always call onSaveFilter, if it exists\r\n if (onSaveFilter) {\r\n onSaveFilter(q);\r\n }\r\n };\r\n\r\n const handleFilterSwitch = (sf?: any) => {\r\n if (sf) {\r\n setSelectedFilter(sf);\r\n setQuery(sf.query);\r\n if (onSelectedFilter) {\r\n onSelectedFilter(sf);\r\n }\r\n } else {\r\n setSelectedFilter(null);\r\n setQuery(initialQuery);\r\n if (onSelectedFilter) {\r\n onSelectedFilter(null);\r\n }\r\n }\r\n };\r\n\r\n const handleSearchEvent = (searchText: string) => {\r\n const filteredFilters = savedFilters?.filter((filter: any) =>\r\n filter.name.toLowerCase().includes(searchText.toLowerCase())\r\n );\r\n if (filteredFilters) {\r\n setFilteredSavedFilters(filteredFilters);\r\n }\r\n };\r\n\r\n const handleRenameFilter = async (filterId: string, newName: string) => {\r\n const putFilterRequest: Types.PutV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: filterId,\r\n name: newName,\r\n module: resources?.fieldResource || resources?.pageResource\r\n };\r\n\r\n try {\r\n await putV1FilterId(putFilterRequest)\r\n // setSelectedFilter(newName);\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n enqueueSnackbar('Filters renamed successfully.')\r\n } catch (error) {\r\n let m: string = 'Something went wrong on saving filters'\r\n if (error instanceof Error) {\r\n m = getErrorMessage(error.message)\r\n }\r\n enqueueSnackbar(m, { variant: 'error' })\r\n return false\r\n }\r\n return true\r\n };\r\n const handleUpdateSelectedFilterQuery = async () => {\r\n if (selectedFilter) {\r\n\r\n const putFilterRequest: Types.PutV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: selectedFilter.id,\r\n data: query,\r\n };\r\n\r\n putV1FilterId(putFilterRequest)\r\n .then((response: any) => {\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n setActivePage((prev: any) => ({\r\n ...prev,\r\n filters: {\r\n ...prev.filters,\r\n rules: query.rules,\r\n combinator: query.combinator,\r\n name: selectedFilter.name\r\n\r\n }\r\n }));\r\n })\r\n .catch((err: any) => enqueueSnackbar(\"Error renaming saved filters:\", { variant: 'error' }));\r\n }\r\n };\r\n\r\n const handleSubmitRename = (name: string) => {\r\n if (openRenameFilter) {\r\n return handleRenameFilter(openRenameFilter.id, name);\r\n }\r\n };\r\n\r\n const handleDeleteFilter = async (filterId: string) => {\r\n const deleteFilterRequest: Types.DeleteV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: filterId,\r\n };\r\n\r\n deleteV1FilterId(deleteFilterRequest)\r\n .then((response: any) => {\r\n setSelectedFilter(null);\r\n setQuery(initialQuery);\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n\r\n })\r\n .catch((err: any) => console.log(\"Error deleting saved filters:\", err));\r\n };\r\n\r\n useEffect(() => {\r\n let q = initialQuery\r\n if (!_.isEmpty(activePage.filters)) {\r\n q = activePage.filters\r\n }\r\n setQuery(q)\r\n const selectedFilter = savedFilters?.find((f: any) => f.name === activePage?.filters?.name);\r\n setSelectedFilter(selectedFilter || null);\r\n }, [activePage?.filters, savedFilters]);\r\n\r\n const isDuplicatedFilters = (rule) => {\r\n let uniques: string[] = []\r\n rule?.rules?.forEach((r: any) => {\r\n if (uniques.includes(r.field) && rule.combinator == 'and') {\r\n return true\r\n }\r\n uniques.push(r.field)\r\n })\r\n return uniques.length !== rule?.rules?.length\r\n }\r\n\r\n\r\n const isRuleInvalid = (rule: any): boolean => {\r\n // If it's a group (has nested rules), recurse\r\n if (Array.isArray(rule.rules)) {\r\n return rule.rules.length ? rule.rules.some(isRuleInvalid) : !rule.rules.length;\r\n }\r\n\r\n // Otherwise, validate individual rule\r\n return (\r\n !rule.field ||\r\n (_.isEmpty(rule.value) && !['null', 'notNull'].includes(rule.operator))\r\n );\r\n };\r\n\r\n const disabled = useMemo(() => isRuleInvalid(query) || errorMessage, [query, errorMessage])\r\n // const disabled = isRuleInvalid(query) || errorMessage;\r\n\r\n return (\r\n <div>\r\n <Dialog\r\n open={open}\r\n onClose={onClose}\r\n maxWidth='md'\r\n fullWidth={true}\r\n PaperProps={{\r\n sx: { borderRadius: 2 }\r\n }}\r\n >\r\n <DialogTitle className=\"filter-header\">\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n Filters\r\n </Typography>\r\n <Box gap={1} display={\"flex\"}>\r\n <Select\r\n fullWidth\r\n size=\"small\"\r\n className=\"filter-dropdown\"\r\n value={selectedFilter ? selectedFilter.name : \"Saved Filters\"}\r\n onChange={(event: any) => {\r\n const sf = savedFilters?.find(f => f.name == event.target.value)\r\n handleFilterSwitch(sf)\r\n }}\r\n variant=\"outlined\"\r\n onClose={() => {\r\n setTimeout(() => {\r\n handleSearchEvent(\"\")\r\n }, 500);\r\n }}\r\n input={\r\n selectedFilter ? (\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => {\r\n handleFilterSwitch()\r\n }}\r\n edge='end'\r\n sx={{ mr: 1.5 }}\r\n size='small'>\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n </InputAdornment>\r\n }\r\n />\r\n ) : undefined\r\n }\r\n >\r\n <div className=\"searchbar-box-list\">\r\n <SearchBar\r\n placeholder={\"Search Filters\"}\r\n handleSearch={(e) => handleSearchEvent(e)}\r\n />\r\n </div>\r\n {/* <Typography\r\n color=\"theme.secondary.1000\"\r\n type=\"s4\"\r\n className=\"filter-title\"\r\n >\r\n Saved Filters\r\n </Typography> */}\r\n {filteredSavedFilters?.map((savedFilter: SavedFilter) => (\r\n <MenuItem\r\n key={savedFilter.id}\r\n value={savedFilter?.name}\r\n className=\"menu-list\"\r\n selected={selectedFilter?.name == savedFilter?.name}\r\n >\r\n <Typography color=\"theme.secondary.1000\" type=\"s3\">\r\n {savedFilter?.name}\r\n </Typography>\r\n\r\n <div className=\"icon-list\">\r\n <IconButton size=\"small\" onClick={(e) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n setIsOpenRenameFilter(savedFilter)\r\n }}>\r\n <Edit fontSize=\"small\" color={selectedFilter?.name == savedFilter?.name ? \"theme.primary.800\" : 'inherit'} />\r\n </IconButton>\r\n <IconButton size=\"small\" onClick={(e) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n handleDeleteFilter(savedFilter.id)\r\n }} color=\"error\">\r\n <Trash fontSize=\"small\" color=\"theme.error.600\" />\r\n </IconButton>\r\n </div>\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n <SaveFilterModal\r\n open={openRenameFilter !== null}\r\n onClose={() => setIsOpenRenameFilter(null)}\r\n handleSubmit={(name) => handleSubmitRename(name)}\r\n oldName={openRenameFilter?.name}\r\n />\r\n <Box>\r\n <IconButton size=\"small\" onClick={onClose}>\r\n <Close fontSize=\"small\" />\r\n </IconButton>\r\n </Box>\r\n </Box>\r\n </DialogTitle>\r\n <DialogContent className=\"content\">\r\n {/* Display error message */}\r\n {errorMessage && (\r\n <Alert severity=\"error\" sx={{ px: 1, pt: 0.5, mb: 1 }}>\r\n <Typography\r\n color=\"error\"\r\n type=\"s4\"\r\n >\r\n {errorMessage}\r\n </Typography>\r\n </Alert>\r\n )}\r\n <QueryBuilderMaterial>\r\n <QueryBuilder\r\n fields={fields || []}\r\n query={query}\r\n onQueryChange={handleQueryChange}\r\n showCombinatorsBetweenRules={true}\r\n controlClassnames={{\r\n header: \"actions\",\r\n }}\r\n controlElements={{\r\n addRuleAction: AddFilterButton,\r\n addGroupAction: AddGroupButton,\r\n combinatorSelector: CombinatorSelect,\r\n fieldSelector: FieldSelect,\r\n operatorSelector: OperatorSelect,\r\n removeRuleAction: RemoveAction,\r\n valueEditor: ValueEditor,\r\n removeGroupAction: RemoveGroupAction,\r\n }}\r\n />\r\n <Button\r\n variant=\"text\"\r\n className={isRtl ? 'remove-filters_rtl' : 'remove-filters'}\r\n onClick={() => {\r\n handleApplyFilter(true)\r\n }}\r\n disabled={disabled}\r\n >\r\n Clear all filters\r\n </Button>\r\n </QueryBuilderMaterial>\r\n </DialogContent>\r\n <DialogActions className=\"filter-footer\">\r\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: selectedFilter ? 'space-between' : 'flex-end', width: '100%' }}>\r\n {selectedFilter &&\r\n <Box>\r\n <Button onClick={handleUpdateSelectedFilterQuery}>\r\n Update Seleted filter\r\n </Button>\r\n </Box>\r\n }\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n <Button className=\"cancel-filter-btn\" onClick={onClose}>\r\n Cancel\r\n </Button>\r\n <Button\r\n disabled={disabled}\r\n onClick={() => handleApplyFilter()}\r\n >\r\n Apply\r\n </Button>\r\n </Box>\r\n </Box>\r\n </DialogActions>\r\n </Dialog>\r\n </div>\r\n );\r\n};\r\n\r\nexport { Filter };\r\nexport default Filter;\r\n","import * as React from 'react';\nimport ButtonGroup, { ButtonGroupProps } from '@mui/material/ButtonGroup';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport Grow from '@mui/material/Grow';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport MenuItem from '@mui/material/MenuItem';\nimport MenuList from '@mui/material/MenuList';\nimport Button from '../button/button';\nimport { ArrowDownTwo } from '../icons';\nimport Typography from '../typography/typography';\nimport { ButtonProps, CircularProgress, SxProps } from '@mui/material';\nimport { useLanguage } from '../../hooks/useLangauge';\n\nexport interface IDropdownMenuOption {\n\tlabel: string | JSX.Element;\n\tcallback: (event?: any, index?: number) => void;\n\tcolor?: string;\n\tdisableToggle?: boolean;\n}\n\ninterface DropdownButtonProps extends ButtonProps {\n\tchildren?: React.ReactNode;\n\toptions: IDropdownMenuOption[];\n\tisMenuThirdItemDisabled?: boolean;\n\tisOnlyDropDownButton?: boolean;\n\tonlyDropDownButtonProps?: {\n\t\tstyle?: SxProps;\n\t};\n\tbuttonGroupProps?: ButtonGroupProps;\n\tdropdownButtonProps?: ButtonGroupProps;\n\ttoggleCallback?: (e?: boolean) => void;\n\tloading?: boolean;\n}\n\nconst DropdownButton: React.FC<DropdownButtonProps> = ({\n\tchildren,\n\toptions,\n\tisMenuThirdItemDisabled,\n\tisOnlyDropDownButton = false,\n\tonlyDropDownButtonProps = null,\n\tbuttonGroupProps = null,\n\tdropdownButtonProps=null,\n\ttoggleCallback,\n\tloading = false,\n\t...rest\n}) => {\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorRef = React.useRef<HTMLDivElement>(null);\n const {isRtl}=useLanguage();\n\tconst handleToggle = () => {\n\t\tsetOpen((prevOpen) => !prevOpen);\n\t};\n\n\tconst handleClose = (event: Event) => {\n\t\tif (\n\t\t\tanchorRef.current &&\n\t\t\tanchorRef.current.contains(event.target as HTMLElement)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetOpen(false);\n\t};\n\n\tReact.useEffect(() => {\n\t\ttoggleCallback?.(open);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [open]);\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<ButtonGroup\n\t\t\t\tsx={loading ? { boxShadow: 'none' } : isRtl?{flexDirection:'row-reverse'}:{}}\n\t\t\t\t{...buttonGroupProps}\n\t\t\t\tref={anchorRef}\n\t\t\t\tdisabled={loading}>\n\t\t\t\t{isOnlyDropDownButton ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tborderRightColor: '#ffffff20 !important',\n\t\t\t\t\t\t\t...onlyDropDownButtonProps?.style\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={handleToggle}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\tsx={(theme) => ({\n\t\t\t\t\t\t\t\tborderRightColor: `${theme.palette.theme?.secondary[100]} !important`,\n\t\t\t\t\t\t\t\tborderRight: '1px solid',\n\t\t\t\t\t\t\t\tborderTopRightRadius: 0,\n\t\t\t\t\t\t\t\tborderBottomRightRadius: 0,\n\t\t\t\t\t\t\t\t...(typeof rest?.sx === 'function'\n\t\t\t\t\t\t\t\t\t? rest.sx(theme)\n\t\t\t\t\t\t\t\t\t: rest?.sx || {})\n\t\t\t\t\t\t\t})}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\taria-controls={open ? 'split-button-menu' : undefined}\n\t\t\t\t\t\t\taria-expanded={open ? 'true' : undefined}\n\t\t\t\t\t\t\taria-label='select merge strategy'\n\t\t\t\t\t\t\taria-haspopup='menu'\n\t\t\t\t\t\t\t{...dropdownButtonProps}\n\t\t\t\t\t\t\tsx={(theme) => ({\n\t\t\t\t\t\t\t\tp: 1,\n\t\t\t\t\t\t\t\tminWidth: 'unset !important',\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 0,\n\t\t\t\t\t\t\t\tborderBottomLeftRadius: 0,\n\t\t\t\t\t\t\t\t...(typeof dropdownButtonProps?.sx === 'function'\n\t\t\t\t\t\t\t\t\t? dropdownButtonProps.sx(theme)\n\t\t\t\t\t\t\t\t\t: dropdownButtonProps?.sx || {})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={handleToggle}>\n\t\t\t\t\t\t\t{loading ? (\n\t\t\t\t\t\t\t\t<CircularProgress size={15} color='inherit' />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ArrowDownTwo fontSize='small' />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</ButtonGroup>\n\t\t\t<Popper\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1\n\t\t\t\t}}\n\t\t\t\topen={open}\n\t\t\t\tanchorEl={anchorRef.current}\n\t\t\t\trole={undefined}\n\t\t\t\ttransition\n\t\t\t\tdisablePortal>\n\t\t\t\t{({ TransitionProps, placement }) => (\n\t\t\t\t\t<Grow\n\t\t\t\t\t\t{...TransitionProps}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransformOrigin:\n\t\t\t\t\t\t\t\tplacement === 'bottom' ? 'center top' : 'center bottom'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t<Paper elevation={0} sx={{ border: '1px solid', borderColor: 'grey.300', borderRadius: '8px', mt:0.25}}>\n\t\t\t\t\t\t\t<ClickAwayListener onClickAway={handleClose}>\n\t\t\t\t\t\t\t\t<MenuList id='split-button-menu' autoFocusItem>\n\t\t\t\t\t\t\t\t\t{options.map((option, index) => (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={isMenuThirdItemDisabled ? false : index === 2}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\toption.callback(event, index);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!option?.disableToggle) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleToggle();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}} >\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\toption.color ? option.color : 'theme.secondary.1000'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</MenuList>\n\t\t\t\t\t\t\t</ClickAwayListener>\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</Grow>\n\t\t\t\t)}\n\t\t\t</Popper>\n\t\t</React.Fragment>\n\t);\n};\n\nexport default DropdownButton;\n","import * as React from 'react';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport Grow from '@mui/material/Grow';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport MenuItem from '@mui/material/MenuItem';\nimport MenuList from '@mui/material/MenuList';\nimport { ArrowDownTwo } from '../icons';\nimport Typography from '../typography/typography';\nimport { ButtonProps } from '@mui/material';\n\nexport interface ITitleDropdownMenuOption {\n\tlabel: string | JSX.Element;\n\tcallback: (event?: any, index?: number) => void;\n\tcolor?: string;\n}\n\ninterface TitleDropdownButtonProps extends ButtonProps {\n\tchildren: React.ReactNode;\n\toptions: ITitleDropdownMenuOption[];\n\tisMenuThirdItemDisabled: boolean;\n\tcurrentTitle: string;\n}\n\nconst TitleDropdownButton: React.FC<TitleDropdownButtonProps> = ({\n\tchildren,\n\toptions,\n\tisMenuThirdItemDisabled,\n\tcurrentTitle = '',\n}) => {\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorRef = React.useRef<HTMLDivElement>(null);\n\n\tconst handleToggle = () => {\n\t\tsetOpen((prevOpen) => !prevOpen);\n\t};\n\n\tconst handleClose = (event: Event) => {\n\t\tif (\n\t\t\tanchorRef.current &&\n\t\t\tanchorRef.current.contains(event.target as HTMLElement)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetOpen(false);\n\t};\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div style={{ display: 'flex', alignItems: 'flex-end', gap: '10px' }} ref={anchorRef}>\n\t\t\t\t<Typography type=\"h3\" weight=\"medium\" color=\"theme.secondary.1000\">\n\t\t\t\t\t{children}\n\t\t\t\t</Typography>\n\t\t\t\t<div\n\t\t\t\t\taria-controls={open ? 'split-button-menu' : undefined}\n\t\t\t\t\taria-expanded={open ? 'true' : undefined}\n\t\t\t\t\taria-label='select merge strategy'\n\t\t\t\t\taria-haspopup='menu'\n\t\t\t\t\tstyle={{ minWidth: 'unset !important', cursor: 'pointer' }}\n\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t>\n\t\t\t\t\t<ArrowDownTwo fontSize='small' />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<Popper\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1\n\t\t\t\t}}\n\t\t\t\topen={open}\n\t\t\t\tanchorEl={anchorRef.current}\n\t\t\t\trole={undefined}\n\t\t\t\ttransition\n\t\t\t\tdisablePortal>\n\t\t\t\t{({ TransitionProps, placement }) => (\n\t\t\t\t\t<Grow\n\t\t\t\t\t\t{...TransitionProps}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransformOrigin:\n\t\t\t\t\t\t\t\tplacement === 'bottom' ? 'center top' : 'center bottom'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t<Paper elevation={0} sx={{ border: '1px solid', borderRadius: 2, borderColor: 'theme.grey.200'}}>\n\t\t\t\t\t\t\t<ClickAwayListener onClickAway={handleClose}>\n\t\t\t\t\t\t\t\t<MenuList autoFocusItem>\n\t\t\t\t\t\t\t\t\t{options.map((option, index) => (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={isMenuThirdItemDisabled ? false : (index === 2)}\n\t\t\t\t\t\t\t\t\t\t\tselected={currentTitle?.trim() === option.label?.trim()}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\toption.callback(event, index);\n\t\t\t\t\t\t\t\t\t\t\t\thandleToggle();\n\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\toption.color ? option.color : 'theme.secondary.1000'\n\t\t\t\t\t\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</MenuList>\n\t\t\t\t\t\t\t</ClickAwayListener>\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</Grow>\n\t\t\t\t)}\n\t\t\t</Popper>\n\t\t</React.Fragment>\n\t);\n};\n\nexport default TitleDropdownButton;\n","import React from \"react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\n\r\n\r\nimport Typography from \"../typography/typography\";\r\nimport Box from \"@mui/material/Box\";\r\nimport \"./upload-excel.scss\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport {\r\n CircularProgress,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Divider,\r\n Grow,\r\n IconButton,\r\n \r\n} from \"@mui/material\";\r\nimport RemoveIcon from \"@mui/icons-material/Remove\";\r\n// import Checkbox from \"../checkbox/checkbox\";\r\nimport Avatar from \"../avatar/avatar\";\r\nimport images from \"../../assets/images\";\r\nimport ModalLoader from '../loaders/modal-loader';\r\nimport {Trash} from '../icons';\r\n\r\nimport { KeyboardArrowDown, KeyboardArrowUp, Upload } from \"@mui/icons-material\";\r\nimport { postImportSheet } from \"../../utils/common\";\r\nimport Button from \"../button/button\";\r\n\r\n\r\ninterface UploadProps {\r\n open: boolean;\r\n title: string;\r\n multiple?: boolean;\r\n accept?: string;\r\n showCameraButton?: boolean;\r\n onClose: () => void;\r\n onConfirm: () => void;\r\n onSubmit?: (files: any[]) => void;\r\n existingDriveData?: any;\r\n importModuleName?: any;\r\n pageName?: any;\r\n handleSuccessImport?: (e?: any) => void;\r\n\r\n}\r\n\r\nconst formatBytes = (bytes: number, decimals = 2) => {\r\n if (bytes === 0) return \"0 Bytes\";\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\r\n};\r\n\r\nconst UploadExcel = (props: UploadProps) => {\r\n const {\r\n open,\r\n title,\r\n onClose,\r\n onConfirm,\r\n onSubmit,\r\n accept = \"*\",\r\n multiple = false,\r\n importModuleName,\r\n pageName,\r\n handleSuccessImport\r\n } = props;\r\n const [files, setFiles] = useState<\r\n {\r\n file: File;\r\n isPrivate: boolean;\r\n checkboxDisabled: boolean;\r\n status: string;\r\n uploadProgress: number;\r\n fileSize: number;\r\n fileName: string;\r\n fileType: string;\r\n location: string;\r\n message: string;\r\n }[]\r\n >([]);\r\n\r\n const [isCollapsed, setIsCollapsed] = useState(false);\r\n const [isDialogMinimized, setIsDialogMinimized] = useState(false);\r\n const [isDragOver, setIsDragOver] = useState(false);\r\n const [dataResult, setDataResult] = useState<any>(null);\r\n const [isLoading, setIsLoading] = useState<boolean>(false);\r\n \r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDropAccepted: (newFiles) => {\r\n setFiles([\r\n ...files,\r\n ...newFiles.map((file) => ({\r\n file,\r\n isPrivate: false,\r\n checkboxDisabled: false,\r\n status: \"pending\",\r\n uploadProgress: 0,\r\n fileSize: file.size,\r\n fileName: file.name,\r\n fileType: file.type,\r\n location: \"\",\r\n message: \"\",\r\n })),\r\n ]);\r\n setIsDragOver(false);\r\n },\r\n onDragEnter: () => {\r\n setIsDragOver(true);\r\n },\r\n onDragLeave: () => {\r\n setIsDragOver(false);\r\n },\r\n noClick: true,\r\n noKeyboard: true,\r\n multiple: multiple,\r\n accept: accept ? convertAcceptObject(accept) : accept,\r\n });\r\n\r\n const handleClose = () => {\r\n onClose()\r\n setDataResult(null);\r\n }\r\n\r\n const fileInputRef = useRef<HTMLInputElement>(null);\r\n\r\n // useEffect(() => {\r\n // const driveTitles = existingDriveData.map(item => item['title'])\r\n // setAllDriveData(driveTitles);\r\n // }, [existingDriveData]);\r\n\r\n\r\n useEffect(() => {\r\n const handleBeforeUnload = (event: any) => {\r\n \r\n const message =\r\n \"Are you sure you want to leave? Your uploads are not complete.\";\r\n event.returnValue = message; // Standard for most browsers\r\n return message; // For some older browsers\r\n \r\n };\r\n if (fileInputRef.current) {\r\n fileInputRef.current.multiple = multiple;\r\n }\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n\r\n return () => {\r\n // Clean up the event listener when the component unmounts\r\n window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n };\r\n }, [ multiple]);\r\n\r\n \r\n\r\n function convertAcceptObject(types: string) {\r\n const accepts = types.split(\",\").map((item) => item.trim());\r\n const acceptObject = accepts.reduce((acc: any, type: string) => {\r\n acc[type] = [];\r\n return acc;\r\n }, {});\r\n return acceptObject;\r\n }\r\n\r\n const renderFileIcon = (file: any) => {\r\n const fileType = file?.type.split(\"/\")[0];\r\n switch (fileType) {\r\n case \"image\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#FFEBEB\" }}\r\n >\r\n <Avatar size={20} src={images.upload.documentPDF}></Avatar>\r\n </div>\r\n );\r\n case \"application\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#FFEBEB\" }}\r\n >\r\n <Avatar size={150} src={images.upload.documentPDF} alt={\"PDF\"}></Avatar>\r\n <Typography color=\"theme.secondary.1000\" weight=\"bold\" type=\"s2\">{file.name}</Typography>\r\n <Typography color=\"theme.secondary.800\" type=\"s5\">{formatBytes(file.size)}</Typography>\r\n </div>\r\n );\r\n case \"text\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#EBF9F2\" }}\r\n >\r\n <Avatar size={20} src={images.upload.docFile}></Avatar>\r\n </div>\r\n );\r\n default:\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#EBF9F2\" }}\r\n >\r\n <Avatar size={20} src={images.upload.docFile}></Avatar>\r\n </div>\r\n );\r\n }\r\n };\r\n\r\n \r\n\r\n const handleChipClick = () => {\r\n if (fileInputRef.current) {\r\n // If multiple is true, set input for multiple files\r\n if (props.multiple) {\r\n fileInputRef.current.setAttribute(\"multiple\", \"true\");\r\n } else {\r\n // If multiple is false, set input for a single file\r\n fileInputRef.current.removeAttribute(\"multiple\");\r\n }\r\n fileInputRef.current.click();\r\n }\r\n };\r\n\r\n const handleFileChange = (e: any) => {\r\n // importData(e.target.files[0]);\r\n const file = e.target.files?.[0] || null;\r\n const f = {\r\n file,\r\n isPrivate: false,\r\n checkboxDisabled: false,\r\n status: \"pending\",\r\n uploadProgress: 0,\r\n fileSize: file.size,\r\n fileName: file.name,\r\n fileType: file.type,\r\n location: \"\",\r\n message: \"\",\r\n }\r\n\r\n \r\n setFiles([\r\n ...files,\r\n ...[f],\r\n ]);\r\n };\r\n\r\n const removeFile = (indexToRemove: number) => {\r\n\r\n setFiles((prevFiles) =>\r\n prevFiles.filter((file, index) =>index !== indexToRemove\r\n ),\r\n );\r\n };\r\n\r\n // const toggleIsPrivate = (index: number) => {\r\n // setFiles((prevFiles) =>\r\n // prevFiles.map((item, i) =>\r\n // i === index ? { ...item, isPrivate: !item.isPrivate } : item,\r\n // ),\r\n // );\r\n // };\r\n\r\n const toggleCollapse = () => {\r\n setIsCollapsed((prevIsCollapsed) => !prevIsCollapsed);\r\n };\r\n\r\n const handleMinimizeClick = () => {\r\n setIsDialogMinimized(!isDialogMinimized);\r\n isDialogMinimized ? onConfirm() : onClose();\r\n };\r\n\r\n const importData = async () => {\r\n const file = files[0].file\r\n\t\tconst formData = new FormData();\r\n\t\tformData.append('file', file); // Ensure the field name is correct.\r\n\t\tsetIsLoading(true)\r\n\t\ttry {\r\n\t\t\tconst response = await postImportSheet(formData, importModuleName, pageName);\r\n\t\t\tif(response) {\r\n\t\t\t\tsetDataResult(response.data)\r\n setIsLoading(false)\r\n if(response?.data?.failed?.length == 0){\r\n handleClose()\r\n handleSuccessImport(response?.data);\r\n }\r\n\t\t\t} \r\n\t\t} catch (error) {\r\n setIsLoading(false)\r\n\t\t}\r\n\r\n\t}\r\n\r\n useEffect(() => {\r\n open && setFiles([]);\r\n }, [open]);\r\n\r\n\r\n\r\n return (\r\n <>\r\n <Dialog open={open} onClose={handleClose} className=\"upload\">\r\n <DialogTitle className=\"upload--head\">\r\n <Box className=\"upload--title\">\r\n <Typography\r\n type=\"s3\"\r\n ml={1}\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n >\r\n {title}\r\n </Typography>\r\n </Box>\r\n \r\n </DialogTitle>\r\n <Divider />\r\n <DialogContent className=\"upload--content\">\r\n {isLoading && <ModalLoader />}\r\n \r\n {files.length === 0 ? (\r\n <div\r\n className={`upload--fileContent ${isDragActive ? \"drag-active\" : \"\"\r\n }`}\r\n >\r\n <div {...getRootProps()} className=\"drop-view\">\r\n {!isDragOver ? (\r\n <>\r\n <input {...getInputProps()} ref={fileInputRef} />\r\n <p className=\"upload--text\">\r\n Drag and Drop files here or upload from\r\n </p>\r\n\r\n <div className=\"device-wrap\">\r\n <div className=\"select-button\" onClick={handleChipClick}>\r\n <img src={images.upload.monitor} />\r\n <Typography type=\"s5\">My Device</Typography>\r\n <input\r\n type=\"file\"\r\n {...getInputProps({ multiple: true })}\r\n ref={fileInputRef}\r\n style={{ display: \"none\" }}\r\n onChange={handleFileChange}\r\n accept={accept}\r\n />\r\n </div>\r\n \r\n </div>\r\n\r\n {dataResult?.successful?.length || dataResult?.failed?.length ? (\r\n <div className =\"mt-2\">\r\n {dataResult?.failed.length == 0 ? (\r\n <Typography type=\"s3\">\r\n All data imported successfully.\r\n </Typography> ) : (\r\n <Typography type=\"s4\" word-break=\"break-word\" color=\"theme.error.600\" weight=\"medium\">\r\n Failed to import the following records with IDs: {dataResult.failed?.map((item:any)=>item?.id).join(\", \")}\r\n </Typography> )\r\n } \r\n </div>\r\n ) : (\r\n \"\"\r\n )}\r\n </>\r\n ) : (\r\n <div className=\"after-drop\">\r\n <img src={images.upload.documentUpload} />\r\n <Typography type=\"s3\">\r\n Drag & Drop your files here\r\n </Typography>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n ) : (\r\n <Grow in={Boolean(files?.length)} timeout={500}>\r\n <Box>\r\n {files.map((file: any, index: number) => (\r\n <Box key={file?.file?.name} display='flex' width='100%' justifyContent='center' alignItems='center' flexDirection='column'>\r\n <Box className=\"icon-BG\">\r\n <IconButton onClick={() => removeFile(index)} className=\"remove-button\"><Trash fontSize='small' /> </IconButton>\r\n <Avatar size={150} src={images.upload.docFile} alt={\"PDF\"}></Avatar>\r\n </Box>\r\n <Typography type=\"s2\" weight=\"bold\" color='theme.secondary.1000'>{file?.file?.name}</Typography>\r\n <Typography type=\"s4\" color='theme.secondary.800'>{formatBytes(file?.file?.size)}</Typography>\r\n </Box>\r\n ))}\r\n {dataResult?.successful?.length || dataResult?.failed?.length ? (\r\n <div className =\"mt-2\">\r\n {dataResult?.failed.length == 0 ? (\r\n <Typography type=\"s3\">\r\n All data imported successfully.\r\n </Typography> ) : (\r\n <Typography type=\"s4\" word-break=\"break-word\" color=\"theme.error.600\" weight=\"medium\">\r\n Failed to import the following records with IDs: {dataResult?.failed?.map((item:any)=>item.id).join(\", \")}\r\n </Typography> )\r\n } \r\n </div>\r\n ) : (\r\n \"\"\r\n )}\r\n </Box>\r\n </Grow>\r\n )}\r\n </DialogContent>\r\n <DialogActions className=\"uploadActions\">\r\n <Button onClick={onSubmit ? ()=>{\r\n onSubmit(files)\r\n } : importData} startIcon={<Upload />}>Upload</Button>\r\n </DialogActions>\r\n </Dialog>\r\n {isDialogMinimized && (\r\n <div className=\"bottom-corner-box\">\r\n <div className=\"top-section\">\r\n <div className=\"top-text\">\r\n Uploading {files.length} Item{files.length !== 1 ? \"s\" : \"\"}\r\n </div>\r\n <div className=\"top-options\">\r\n <div className=\"btn\" onClick={handleMinimizeClick}>\r\n <RemoveIcon />\r\n </div>\r\n <div className=\"btn\" onClick={toggleCollapse}>\r\n <div className=\"arrow-btn\">\r\n {isCollapsed ? <KeyboardArrowUp /> : <KeyboardArrowDown />}\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n <div className=\"box-list\">\r\n {!isCollapsed &&\r\n files.map((file: any, index: number) => (\r\n <div className=\"bottom-section\">\r\n <div className=\"doc-icon\">{renderFileIcon(file?.file)}</div>\r\n <div className=\"file-detail\">\r\n <div className=\"file-name\">\r\n <div className=\"file-text\">\r\n {file?.file?.name}\r\n {index}\r\n </div>\r\n </div>\r\n <div className=\"file-status\">\r\n {file?.status !== \"canceled\" ? (\r\n <>\r\n {file.uploadProgress === 0 && (\r\n <div className=\"avatar-container\">\r\n <Avatar\r\n size={20}\r\n className=\"avatar\"\r\n src={images.upload.empty}\r\n ></Avatar>\r\n <Avatar\r\n size={20}\r\n onClick={() => removeFile(index)}\r\n src={images.upload.close}\r\n className=\"close-icon\"\r\n ></Avatar>\r\n </div>\r\n )}\r\n {file?.uploadProgress > 0 &&\r\n file?.uploadProgress < 100 && (\r\n <CircularProgress\r\n color=\"success\"\r\n variant=\"determinate\"\r\n value={file?.uploadProgress}\r\n />\r\n )}\r\n {file?.uploadProgress === 100 && (\r\n <div className=\"avatar-container\">\r\n <Avatar\r\n size={20}\r\n className=\"avatar\"\r\n src={images.upload.tick}\r\n ></Avatar>\r\n <Avatar\r\n size={20}\r\n src={images.upload.folder}\r\n className=\"close-icon\"\r\n ></Avatar>\r\n </div>\r\n )}\r\n </>\r\n ) : (\r\n <Typography type=\"s4\" className=\"canceled-text\">\r\n Upload Canceled\r\n </Typography>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport { UploadExcel };\r\nexport default UploadExcel;\r\n","import Button from '../button/button';\r\nimport Typography from '../typography/typography';\r\n/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport './action-bar.scss';\r\nimport {\r\n\t/* IconButton, */ Box,\r\n\tDivider,\r\n\tIconButton,\r\n\tMenu,\r\n\tMenuItem,\r\n\tuseMediaQuery,\r\n\tuseTheme\r\n} from '@mui/material';\r\nimport AddIcon from '@mui/icons-material/Add';\r\nimport ViewModal from '../view-modal/view-modal';\r\nimport HeaderCard from '../header-card/header-card';\r\nimport SearchBar from '../search-bar/search-bar';\r\nimport { useEffect, useMemo, useState } from 'react';\r\nimport images from '../../assets/images';\r\nimport Toggle from '../toggle/toggle';\r\nimport Filter from '../filter/filter';\r\nimport Select from '../select/select';\r\nimport { RuleGroupType } from 'react-querybuilder';\r\nimport SaveFilterModal from '../save-filter-modal/save-filter-modal';\r\nimport {\r\n\tsetBaseUrl,\r\n\tpostV1Filter,\r\n\tgetV1FilterResource\r\n} from '../../api-client/api.system-feature/api';\r\nimport type * as Types from '../../api-client/api.system-feature/api-types';\r\nimport { auth } from '../../constants/auth';\r\nimport DropdownButton from '../dropdown-button/dropdown-button';\r\nimport TitleDropdownButton from '../title-dropdown-button/title-dropdown-button';\r\nimport { useAppDispatch, useAppSelector } from '../../redux/hooks';\r\nimport { getToken } from '../../utils/common';\r\nimport React from 'react';\r\nimport UploadExcel from '../upload-excel/upload-excel';\r\nimport { generateQueryString, getErrorMessage, getExcelTemplateGenerateTemplate, getOperatorLabel, getExcelExportTemplate, getPdfExportTemplate } from '../../utils/common';\r\nimport { initialFilter, ViewType } from '../../contexts/page-context';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport Chip from '../chip/chip';\r\nimport formatText, { formatLabel } from '../../utils/format-text';\r\nimport { Cancel } from '@mui/icons-material';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { IResources, routeToResourceMap } from '../../constants/route-page-map';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FilterRemove, Filter as FilterIcon, Search, FolderSave, Export, Import, DocumentDownload } from '../icons';\r\nimport { co } from 'node_modules/@fullcalendar/core/internal-common';\r\n\r\ninterface ActionData {\r\n\tlabel: string;\r\n\tposition: number;\r\n}\r\ninterface ActionBarPropsType {\r\n\ttitle: string;\r\n\tdata: ActionData[];\r\n\tsetData: React.Dispatch<React.SetStateAction<ActionData[]>>;\r\n\tactive: string;\r\n\tsetActive: (view: ViewType) => void;\r\n\thandleAddButton?: (e?: any) => void;\r\n\tbutton?: boolean;\r\n\thandleSearch?: (value: string) => void;\r\n\tfilters?: string;\r\n\tdisabledViews?: string[];\r\n\tisDropdownMenuButton?: boolean;\r\n\titemListingDropdownOptions?: any;\r\n\tisTitleMenu?: boolean;\r\n\ttitleMenus?: any;\r\n\tfolderData?: any;\r\n\ttype?: any;\r\n\tfields?: any;\r\n\tapplyFilter?: any;\r\n\tsavedFilters?: SavedFilter;\r\n\tsetSavedFilters?: (view: SavedFilter) => void;\r\n\tisToggleButton?: boolean;\r\n\thandleToggleButton?: (e?: any) => void;\r\n\tshowView?: boolean;\r\n\tshowSearch?: boolean;\r\n\tshowFilter?: boolean;\r\n\tcustomButtons?: React.ReactNode[] | JSX.Element[];\r\n\tactionBtn?: React.ReactNode[] | JSX.Element[];\r\n\tpageName?: string;\r\n\timportModuleName?: string;\r\n\tsearchText?: string;\r\n\tselectedIds?: any;\r\n\tisUseFields?: boolean;\r\n\thandleSuccessImport?: (e?: any) => void;\r\n}\r\n\r\ninterface SavedFilter {\r\n\tid: string;\r\n\tname: string;\r\n\tquery: RuleGroupType;\r\n}\r\n\r\nconst ActionBar = React.memo((props: ActionBarPropsType) => {\r\n\tconst token = localStorage.getItem(auth.storageTokenKeyName) || undefined;\r\n\tconst location = useLocation();\r\n\r\n\tconst {\r\n\t\ttitle,\r\n\t\tdata,\r\n\t\tsetData,\r\n\t\tactive,\r\n\t\tsetActive,\r\n\t\thandleAddButton,\r\n\t\thandleSearch,\r\n\t\tbutton = true,\r\n\t\tdisabledViews,\r\n\t\tisDropdownMenuButton = false,\r\n\t\titemListingDropdownOptions = [],\r\n\t\tisTitleMenu = false,\r\n\t\ttitleMenus = [],\r\n\t\ttype,\r\n\t\tfields = [],\r\n\t\tapplyFilter,\r\n\t\t// setSavedFilters,\r\n\t\t// savedFilters,\r\n\t\tisToggleButton = false,\r\n\t\thandleToggleButton,\r\n\t\tshowSearch = true,\r\n\t\tshowFilter = true,\r\n\t\tshowView = true,\r\n\t\tcustomButtons,\r\n\t\tpageName,\r\n\t\tactionBtn,\r\n\t\timportModuleName,\r\n\t\tselectedIds,\r\n\t\tsearchText,\r\n\t\tisUseFields,\r\n\t\thandleSuccessImport\r\n\t} = props;\r\n\tconst dispatch = useAppDispatch();\r\n\tconst [isToggled, setIsToggled] = useState<boolean>(false);\r\n\tconst [isToggledForItem, setIsToggledForItem] = useState<boolean>(false);\r\n\tconst [openFilterPopup, setOpenFilterPopup] = useState<boolean>(false);\r\n\tconst [status, setStatus] = useState<string>('');\r\n\tconst [openSaveFilter, setIsOpenSaveFilter] = useState<boolean>(false);\r\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst [isUploadModalOpen, setIsUploadModalOpen] = useState(false);\r\n\tconst [savedFilters, setSavedFilters] = useState<any[]>([]);\r\n\t// const [selectedSavedFilter, setSelectedSavedFilter] = useState<any>(null);\r\n\tconst [searchedText, setSearchedText] = useState<string>(\"\");\r\n\tconst { t } = useTranslation();\r\n\tconst theme = useTheme();\r\n\tconst isLgUp = useMediaQuery(theme.breakpoints.up('xl'));\r\n\tconst { activePage, updatePageInfo, schemaFields, setActivePage } = usePages();\r\n\tconst { filters } = activePage;\r\n\r\n\tconst resources: IResources = useMemo(() => routeToResourceMap[location.pathname] || null, [location.pathname])\r\n\r\n\t// const { filterBar, filterQuery } = useAppSelector((store) => {\r\n\t// \treturn store?.drive;\r\n\t// });\r\n\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\tfetchSavedFilters();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tconst fetchSavedFilters = async (): Promise<void> => {\r\n\t\tif (resources?.pageResource || resources?.fieldResource) {\r\n\t\t\tgetV1FilterResource({ ...getToken(), resource: resources?.pageResource || resources?.fieldResource })\r\n\t\t\t\t.then((response: any) => {\r\n\t\t\t\t\tconst savedFilters = response.data.result.map((e: any) => {\r\n\t\t\t\t\t\treturn { id: e._id, name: e.name, query: e.data };\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tsetSavedFilters?.(savedFilters);\r\n\t\t\t\t})\r\n\t\t\t\t.catch((err: any) => console.log('Error fetching saved filters:', err));\r\n\t\t} else {\r\n\t\t\tsetSavedFilters([])\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tconst handleFilterHide = () => {\r\n\t\t// dispatch(setFilterBar(false));\r\n\t\treturn\r\n\t};\r\n\r\n\tconst handleStatusChange = (event: any) => {\r\n\t\tsetStatus(event.target.value);\r\n\t};\r\n\r\n\tconst handleSaveFilterClick = () => {\r\n\t\tif (filters?.rules) {\r\n\t\t\tsetIsOpenSaveFilter(true);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleImportClick = (event: any) => {\r\n\t\tsetRowAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleActionsClose = () => {\r\n\t\tsetRowAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleSaveFilter = (query: RuleGroupType) => {\r\n\t\t// dispatch(setFilterQuery(query));\r\n\t\treturn\r\n\t};\r\n\r\n\tconst handleSave = async (name: string, filterQuery: RuleGroupType) => {\r\n\r\n\t\t// dispatch(setFilterBar(false));\r\n\r\n\t\tconst postFilterRequest: Types.PostV1FilterRequest = {\r\n\t\t\t'x-token': token,\r\n\t\t\tmodule: resources?.pageResource || resources?.fieldResource || 'erp-common',\r\n\t\t\tname: name,\r\n\t\t\tis_applied: true,\r\n\t\t\tdata: filterQuery\r\n\t\t};\r\n\t\ttry {\r\n\t\t\tawait postV1Filter(postFilterRequest)\r\n\t\t\tenqueueSnackbar('Filters saved successfully.')\r\n\t\t\tsetActivePage((prev: any) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prev.filters,\r\n\t\t\t\t\tname,\r\n\t\t\t\t\trules: filterQuery.rules\r\n\t\t\t\t},\r\n\t\t\t\tfilterQueryString: generateQueryString(filterQuery)\r\n\t\t\t}));\r\n\t\t\tsetIsOpenSaveFilter(false);\r\n\t\t} catch (error) {\r\n\t\t\tlet m: string = 'Something went wrong on saving filters'\r\n\t\t\tif (error instanceof Error) {\r\n\t\t\t\tm = getErrorMessage(error.message)\r\n\t\t\t}\r\n\t\t\tenqueueSnackbar(m, { variant: 'error' })\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn true\r\n\t};\r\n\r\n\tconst handleToggle = () => {\r\n\t\tsetIsToggled((prev) => !prev);\r\n\t\talert('Toggled');\r\n\t};\r\n\r\n\tconst handleChangeToggleButton = () => {\r\n\t\tsetIsToggledForItem((prev) => !prev);\r\n\t\thandleToggleButton?.();\r\n\t};\r\n\r\n\tconst handleCloseFilter = () => {\r\n\t\tsetOpenFilterPopup(false);\r\n\t};\r\n\r\n\tconst handleActiveHeaderCard = (data: ActionData) => {\r\n\t\tsetActive(data?.label);\r\n\t};\r\n\r\n\tconst downloadTemplate = async (moduleName: string) => {\r\n\t\tconst templateURL: any = await getExcelTemplateGenerateTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tresource: moduleName\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.xlsx`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst exportExcel = async (moduleName: string, filterQueryString: string, selectedIds: any, title: string) => {\r\n\t\tconst templateURL: any = await getExcelExportTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tactivePage: activePage,\r\n\t\t\tfilterQueryString: filterQueryString,\r\n\t\t\tselectedIds: selectedIds,\r\n\t\t\ttitle: title\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.xlsx`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst exportPdf = async (moduleName: string, filterQueryString: string, selectedIds: any, title: string) => {\r\n\t\tconst columns = activePage.visible_columns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\theader: t(col.header) \r\n\t\t}));\r\n\t\tconst templateURL: any = await getPdfExportTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tactivePage: activePage,\r\n\t\t\tfilterQueryString: filterQueryString,\r\n\t\t\tselectedIds: selectedIds,\r\n\t\t\ttitle: title,\r\n\t\t\tcolumns: columns\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.pdf`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst openImportTemplate = () => {\r\n\t\tsetIsUploadModalOpen(true);\r\n\t};\r\n\tconst rowActionMenu = [];\r\n\tif (pageName && (!importModuleName || selectedIds)) {\r\n\t\trowActionMenu.push({\r\n\t\t\tlabel: 'Export Excel',\r\n\t\t\thandleAction: (moduleName: string) => exportExcel(moduleName, activePage.filterQueryString, selectedIds, title),\r\n\t\t\ticon: <Export fontSize='small' />\r\n\t\t})\r\n\t}\r\n\tif(pageName && (!importModuleName || selectedIds)){\r\n\t\trowActionMenu.push({\r\n\t\t\tlabel: 'Export PDF',\r\n\t\t\thandleAction: (moduleName: string) => exportPdf(moduleName, activePage.filterQueryString, selectedIds, title),\r\n\t\t\ticon: <Export fontSize='small'/>\r\n\t\t})\r\n\t}\r\n\tif (pageName && importModuleName) {\r\n\t\t{\r\n\t\t\trowActionMenu.push({\r\n\t\t\t\tlabel: 'Download Template ',\r\n\t\t\t\thandleAction: (moduleName: string) => downloadTemplate(moduleName),\r\n\t\t\t\ticon: <DocumentDownload fontSize='small' />\r\n\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Import Template',\r\n\t\t\t\t\thandleAction: (moduleName: string) => openImportTemplate(moduleName),\r\n\t\t\t\t\ticon: <Import fontSize='small' />\r\n\t\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\tconst getFilterChipLabels = (rule: any) => {\r\n\t\trule = { ...rule, field: rule.field?.replace(\"__replaceKey\", '') }\r\n\t\tlet label = schemaFields.find((f: any) => f.key === rule.field)?.label || rule.field;\r\n\t\tlabel = formatLabel(label?.replace('_id', ' '));\r\n\t\tconst opLabel = getOperatorLabel(rule, schemaFields);\r\n\r\n\t\tlet value = rule.value;\r\n\t\tif (Array.isArray(rule.value)) {\r\n\t\t\trule.value = rule.value.map(rv => formatLabel(typeof rv === 'object' ? (rv.label) : rv))\r\n\t\t\tvalue = rule.value.join(', ');\r\n\t\t}\r\n\r\n\t\treturn <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\r\n\t\t\t<Typography type='s5' color='theme.secondary.800' weight='medium'>{label}</Typography>\r\n\t\t\t<Divider orientation='vertical' flexItem />\r\n\t\t\t<Typography type='s5' color='theme.primary.800' weight='medium'>{formatText(opLabel)} {value}</Typography>\r\n\t\t</Box>\r\n\t\t// `${label}: ${value}`;\r\n\t};\r\n\r\n\tconst getFilterChip = (rr: any, index: any) => {\r\n\t\treturn (\r\n\t\t\t<Chip\r\n\t\t\t\tlabel={getFilterChipLabels(rr)}\r\n\t\t\t\tvariant='outlined'\r\n\t\t\t\tactive\r\n\t\t\t\tsx={({ palette }) => ({\r\n\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\tborderColor: `${palette.grey[300]} !important`,\r\n\t\t\t\t\topacity: 0.8,\r\n\t\t\t\t\t'&:hover': { backgroundColor: `${palette.grey[200]} !important` },\r\n\t\t\t\t\tflexDirection: 'row-reverse',\r\n\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\tgap: 0.75,\r\n\t\t\t\t\tcursor: 'unset'\r\n\t\t\t\t})}\r\n\t\t\t\tdeleteIcon={\r\n\t\t\t\t\t<Cancel\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tfontSize: '1rem !important',\r\n\t\t\t\t\t\t\tcolor: '#919294 !important',\r\n\t\t\t\t\t\t\tmarginRight: 'auto !important',\r\n\t\t\t\t\t\t\tmarginLeft: `0 !important`,\r\n\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\tcolor: 'inherit !important'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tonDelete={() => removeSignleFilter(index)}\r\n\t\t\t\tclickable={false}\r\n\t\t\t/>\r\n\t\t)\r\n\t}\r\n\r\n\tconst removeSignleFilter = (ruleIndex: number) => {\r\n\t\tconst uRules: any[] = filters.rules.filter(\r\n\t\t\t(_, index) => index !== ruleIndex\r\n\t\t);\r\n\t\tconst uFilters = { ...filters, rules: uRules };\r\n\t\tconst filterQueryString = generateQueryString(uFilters);\r\n\r\n\t\tupdatePageInfo({\r\n\t\t\tfilters: uFilters,\r\n\t\t\tfilterQueryString\r\n\t\t});\r\n\t};\r\n\r\n\tconst isFilterApplied = (flt: any): boolean => Boolean(flt?.rules?.length);\r\n\tconst [searchAnchorEl, setSearchAnchorEl] = useState<HTMLElement | null>(null);\r\n\t// useEffect(() => {\r\n\t// \tif(activePage?.active_view ){\r\n\t// \t\tconst updateViews=activePage?.views?.length?activePage.views:[{\r\n\t// \t\t\tlabel:activePage?.active_view,\r\n\t// \t\t\tposition:0\r\n\t// \t\t}]\r\n\t// \t\tsetData(updateViews)\r\n\t// \t}\t\t\r\n\t// \t//eslint-disable-next-line\r\n\t// },[isCreatePage,activePage?.active_view])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (activePage?.search) {\r\n\t\t\tsetSearchedText(activePage?.search)\r\n\t\t}\r\n\t}, [activePage?.search])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (searchedText) {\r\n\t\t\thandleSearch?.(searchedText);\r\n\t\t\tupdatePageInfo({ search: searchedText });\r\n\t\t}\r\n\t\t//eslint-disable-next-line\r\n\t}, [searchedText])\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t<div className='action-bar'>\r\n\t\t\t\t<div className='action-bar--LeftContent'>\r\n\t\t\t\t\t{isTitleMenu ? (\r\n\t\t\t\t\t\t<div style={{ zIndex: 999 }}>\r\n\t\t\t\t\t\t\t<TitleDropdownButton\r\n\t\t\t\t\t\t\t\tonClick={handleAddButton}\r\n\t\t\t\t\t\t\t\toptions={titleMenus}\r\n\t\t\t\t\t\t\t\tisMenuThirdItemDisabled={true}\r\n\t\t\t\t\t\t\t\tcurrentTitle={title}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t</TitleDropdownButton>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<Typography type='h3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t<div className='action-bar--HeaderCard'>\r\n\t\t\t\t\t\t{Boolean(data) &&\r\n\t\t\t\t\t\t\tdata\r\n\t\t\t\t\t\t\t\t.map((ele) => ele)\r\n\t\t\t\t\t\t\t\t.sort((a, b) => a.position - b.position)\r\n\t\t\t\t\t\t\t\t.map((item: ActionData) => (\r\n\t\t\t\t\t\t\t\t\t<HeaderCard\r\n\t\t\t\t\t\t\t\t\t\tkey={item?.position}\r\n\t\t\t\t\t\t\t\t\t\ttitle={item?.label}\r\n\t\t\t\t\t\t\t\t\t\tactive={active}\r\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleActiveHeaderCard(item)}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t{showView && (\r\n\t\t\t\t\t\t\t<ViewModal\r\n\t\t\t\t\t\t\t\tsetData={setData}\r\n\t\t\t\t\t\t\t\tdata={data}\r\n\t\t\t\t\t\t\t\tsetActive={setActive}\r\n\t\t\t\t\t\t\t\tdisabledViews={disabledViews}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div className='action-bar--RightContent' style={{ gap: isLgUp ? `1rem` : `0.5rem` }}>\r\n\t\t\t\t\t{isToggleButton && (\r\n\t\t\t\t\t\t<div className='item--VariantDisplay'>\r\n\t\t\t\t\t\t\t<div className='item--VariantHeading'>Variant:</div>\r\n\t\t\t\t\t\t\t<div className='item--VariantToggal'>\r\n\t\t\t\t\t\t\t\t<Toggle\r\n\t\t\t\t\t\t\t\t\tchecked={isToggledForItem}\r\n\t\t\t\t\t\t\t\t\tonChange={handleChangeToggleButton}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{showSearch && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{isLgUp ?\r\n\t\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\t\tplaceholder='Search'\r\n\t\t\t\t\t\t\t\t\thandleSearch={(e) => {\r\n\t\t\t\t\t\t\t\t\t\tsetSearchedText(e);\r\n\t\t\t\t\t\t\t\t\t\thandleSearch?.(e);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdebounceTime={1000}\r\n\t\t\t\t\t\t\t\t\tisDrivePage={true}\r\n\t\t\t\t\t\t\t\t\tsearchText={searchedText}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t<IconButton size='small' onClick={(e) => setSearchAnchorEl(e.currentTarget)}><Search fontSize='small' color='grey.1000' /> </IconButton>\r\n\t\t\t\t\t\t\t\t\t<Menu\r\n\t\t\t\t\t\t\t\t\t\tanchorEl={searchAnchorEl}\r\n\t\t\t\t\t\t\t\t\t\topen={Boolean(searchAnchorEl)}\r\n\t\t\t\t\t\t\t\t\t\tonClose={() => setSearchAnchorEl(null)}\r\n\t\t\t\t\t\t\t\t\t\tanchorOrigin={{\r\n\t\t\t\t\t\t\t\t\t\t\tvertical: 'top',\r\n\t\t\t\t\t\t\t\t\t\t\thorizontal: 'right',\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\ttransformOrigin={{\r\n\t\t\t\t\t\t\t\t\t\t\tvertical: 'top',\r\n\t\t\t\t\t\t\t\t\t\t\thorizontal: 'right',\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\tsx={{ '& ul': { p: 0 }, '& .MuiMenu-paper': { boxShadow: `0px 4px 6px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.06);` } }}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder='Search'\r\n\t\t\t\t\t\t\t\t\t\t\thandleSearch={(e) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetSearchedText(e);\r\n\t\t\t\t\t\t\t\t\t\t\t\thandleSearch?.(e);\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tdebounceTime={1000}\r\n\t\t\t\t\t\t\t\t\t\t\tisDrivePage={true}\r\n\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText || searchedText}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</Menu>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{showFilter && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{isLgUp ?\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t// sx={{display:\"none\"}}\r\n\t\t\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\t\t\tstartIcon={<FilterIcon fontSize='small' />}\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tsetOpenFilterPopup(true);\r\n\t\t\t\t\t\t\t\t\t\tfetchSavedFilters();\r\n\t\t\t\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t\t\t\t{t('common.filter')}\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\t\t<IconButton onClick={() => {\r\n\t\t\t\t\t\t\t\t\tsetOpenFilterPopup(true);\r\n\t\t\t\t\t\t\t\t\tfetchSavedFilters();\r\n\t\t\t\t\t\t\t\t}} size='small'>\r\n\t\t\t\t\t\t\t\t\t<FilterIcon fontSize='small' color='grey.1000' />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{customButtons}\r\n\t\t\t\t\t{actionBtn}\r\n\t\t\t\t\t{button && (\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\t\t\tstartIcon={<AddIcon />}\r\n\t\t\t\t\t\t\tonClick={handleAddButton}>\r\n\t\t\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{isDropdownMenuButton && (\r\n\t\t\t\t\t\t<div style={{ zIndex: 999 }}>\r\n\t\t\t\t\t\t\t<DropdownButton\r\n\t\t\t\t\t\t\t\tonClick={handleAddButton}\r\n\t\t\t\t\t\t\t\toptions={itemListingDropdownOptions}\r\n\t\t\t\t\t\t\t\tstartIcon={<AddIcon />}\r\n\t\t\t\t\t\t\t\tisMenuThirdItemDisabled={true}>\r\n\t\t\t\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t\t\t\t</DropdownButton>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{pageName ? (\r\n\t\t\t\t\t\t<IconButton onClick={(e) => handleImportClick(e)}>\r\n\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\r\n\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t''\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t<Menu\r\n\t\t\t\t\t\tanchorEl={rowAnchorEl}\r\n\t\t\t\t\t\topen={Boolean(rowAnchorEl)}\r\n\t\t\t\t\t\tonClose={handleActionsClose}>\r\n\t\t\t\t\t\t{rowActionMenu?.map((option: any) => {\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\toption.handleAction(pageName);\r\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\r\n\t\t\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled()\r\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t\t{option?.icon}\r\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t\t\t{option.label}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t</Menu>\r\n\r\n\t\t\t\t\t<Filter\r\n\t\t\t\t\t\topen={openFilterPopup}\r\n\t\t\t\t\t\tonClose={handleCloseFilter}\r\n\t\t\t\t\t\tactiveView={active}\r\n\t\t\t\t\t\tsavedFilters={savedFilters}\r\n\t\t\t\t\t\tfetchSavedFilters={fetchSavedFilters}\r\n\t\t\t\t\t\tonSaveFilter={handleSaveFilter}\r\n\t\t\t\t\t\ttype={type}\r\n\t\t\t\t\t\tisUseFields={isUseFields}\r\n\t\t\t\t\t\tfields={fields}\r\n\t\t\t\t\t\tonSelectedFilter={f => setSelectedSavedFilter(f)}\r\n\t\t\t\t\t\tapplyFilter={applyFilter}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\r\n\t\t\t{/* Applied Filters view (Start) */}\r\n\t\t\t{isFilterApplied(filters) && (\r\n\t\t\t\t<Box\r\n\t\t\t\t\tmb={1}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\tjustifyContent: 'space-between'\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t<Box\r\n\t\t\t\t\t\tmb={1}\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\tmaxWidth: 400\r\n\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{t('common.filters')}:{' '}\r\n\t\t\t\t\t\t</Typography>\r\n\r\n\t\t\t\t\t\t{filters?.rules?.map((r, rIndex) => (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{r?.rules?.length ? (\r\n\t\t\t\t\t\t\t\t\tr?.rules?.map((rr, rrIndex) => (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{getFilterChip(rr, rrIndex)}\r\n\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t\t) : <>\r\n\t\t\t\t\t\t\t\t\t{getFilterChip(r, rIndex)}\r\n\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t\t<Box>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tstartIcon={<FolderSave fontSize='small' />}\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t<span> {t('common.saveFilter')}</span>\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t{/* {selectedSavedFilter && \r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tstartIcon={<img src={images.common.saveFilterIcon} alt='Add Icon' />}\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t\t<Typography type='s3' color=\"theme.secondary.1000\" weight='medium'>\r\n\t\t\t\t\t\t\t\t\tUpdate Filter <Typography type='s3' weight='medium'>{`(${selectedSavedFilter.name})`}</Typography>\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t} */}\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tstartIcon={<FilterRemove fontSize='small' />}\r\n\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\tupdatePageInfo({\r\n\t\t\t\t\t\t\t\t\tfilters: initialFilter,\r\n\t\t\t\t\t\t\t\t\tfilterQueryString: ''\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t{t('common.clearFilter')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{/* Applied Filters view (End) */}\r\n\r\n\t\t\t{/* {filterBar && (\r\n\t\t\t\t<div className='filter-bar'>\r\n\t\t\t\t\t<div className='filter-bar--LeftContent'>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<Select\r\n\t\t\t\t\t\t\t\tfullWidth\r\n\t\t\t\t\t\t\t\tplaceholder='Placeholder'\r\n\t\t\t\t\t\t\t\tsize={'small'}\r\n\t\t\t\t\t\t\t\tclassName='status-changes-drp'\r\n\t\t\t\t\t\t\t\tvalue={status}\r\n\t\t\t\t\t\t\t\tonChange={handleStatusChange}\r\n\t\t\t\t\t\t\t\tvariant='outlined'>\r\n\t\t\t\t\t\t\t\t<MenuItem value={'Status'}>{t('common.status')}</MenuItem>\r\n\t\t\t\t\t\t\t\t<MenuItem value={'Show'}>{t('common.show')}</MenuItem>\r\n\t\t\t\t\t\t\t</Select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<Typography className='subtask-switch' variant='h6'>\r\n\t\t\t\t\t\t\t{t('common.subtask')}\r\n\t\t\t\t\t\t\t<Toggle checked={isToggled} onChange={handleToggle} />\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t|\r\n\t\t\t\t\t\t<Button className='hide-btn' onClick={handleFilterHide}>\r\n\t\t\t\t\t\t\t{t('common.hide')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className='filter-bar--RightContent'>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t<img src={images.common.saveFilterIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t<span>{t('common.saveFilter')}</span>\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t)} */}\r\n\t\t\t<SaveFilterModal\r\n\t\t\t\topen={openSaveFilter}\r\n\t\t\t\tonClose={() => setIsOpenSaveFilter(false)}\r\n\t\t\t\thandleSubmit={(name: any) =>\r\n\t\t\t\t\thandleSave(name, filters as RuleGroupType)\r\n\t\t\t\t}\r\n\t\t\t/>\r\n\t\t\t<UploadExcel\r\n\t\t\t\topen={isUploadModalOpen}\r\n\t\t\t\tshowCameraButton={false}\r\n\t\t\t\tonClose={() => setIsUploadModalOpen(false)}\r\n\t\t\t\tonConfirm={() => setIsUploadModalOpen(true)}\r\n\t\t\t\ttitle='Upload'\r\n\t\t\t\tmultiple={false}\r\n\t\t\t\timportModuleName={importModuleName}\r\n\t\t\t\tpageName={importModuleName}\r\n\t\t\t\thandleSuccessImport={handleSuccessImport}\r\n\t\t\t\taccept='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n});\r\n\r\nexport { ActionBar };\r\nexport default ActionBar;\r\n","import { Box, Breadcrumbs, BreadcrumbsProps } from '@mui/material';\nimport Typography from '../typography/typography';\nimport { Link } from 'react-router-dom';\n\ninterface BreadCrumbSlot {\n\tlink?: string;\n\tlabel: string | JSX.Element;\n\tlinkState?: any;\n\tonClick?: () => void;\n}\n\ninterface PropsType extends BreadcrumbsProps {\n\tpath: BreadCrumbSlot[];\n}\n\nconst BreadCrumb = (props: PropsType) => {\n\tconst { path } = props;\n\n\treturn (\n\t\t<>\n\t\t\t<Breadcrumbs\n\t\t\t\tsx={{\n\t\t\t\t\t'& .MuiBreadcrumbs-separator': {\n\t\t\t\t\t\tcolor: 'theme.secondary.600'\n\t\t\t\t\t}\n\t\t\t\t}}>\n\t\t\t\t{path?.map((slot, index) => (\n\t\t\t\t\t<Box key={index}>\n\t\t\t\t\t\t{index < path?.length - 1 ? (\n\t\t\t\t\t\t\t// <Link\n\t\t\t\t\t\t\t// \tto={String(slot?.link) ?? undefined}\n\t\t\t\t\t\t\t// \tstyle={{ display: 'block' }}>\n\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\tcolor='theme.secondary.600'\n\t\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\t\tcomponent={slot?.link ? Link : undefined}\n\t\t\t\t\t\t\t\t\tto={String(slot?.link) ?? undefined}\n\t\t\t\t\t\t\t\t\tstate={slot?.linkState}\n\t\t\t\t\t\t\t\t\tonClick={slot?.onClick} style={{ display: 'block' }}>\n\t\t\t\t\t\t\t\t\t{slot?.label}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t// </Link>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor='theme.secondary.1000'>\n\t\t\t\t\t\t\t\t{slot?.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Box>\n\t\t\t\t))}\n\t\t\t</Breadcrumbs>\n\t\t</>\n\t);\n};\n\nexport { BreadCrumb };\nexport default BreadCrumb;\n","import { Box, IconButton, MenuItem, SelectChangeEvent, TextField } from \"@mui/material\";\r\nimport Typography from \"../typography/typography\";\r\nimport Select from \"../select/select\";\r\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\r\nimport ChevronRightICon from \"@mui/icons-material/ChevronRight\";\r\nimport \"./pagination.scss\";\r\nimport { IPaginationModel } from \"../../@types/pagination-model\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { usePages } from \"../../hooks/use-pages\";\r\nimport { useEffect } from \"react\";\r\n\r\ninterface IPagination {\r\n paginationModel: IPaginationModel;\r\n handlePaginationModel: (model: IPaginationModel) => void;\r\n totalPages: number;\r\n}\r\n\r\nconst Pagination = ({\r\n paginationModel,\r\n totalPages,\r\n handlePaginationModel,\r\n}: IPagination) => {\r\n const { pageNo, limit } = paginationModel;\r\n const skip=limit*(pageNo-1)\r\n const pageSizeOptions = [10, 20, 50];\r\n const {isRtl}=useLanguage();\r\n const {setIsChanged,setActivePage,activePage}=usePages();\r\n const handleLimitChange = (e: SelectChangeEvent<unknown>) => {\r\n const newModel = {\r\n ...paginationModel,\r\n page: 1,\r\n pageNo: 1,\r\n limit: e?.target?.value as number,\r\n };\r\n handlePaginationModel(newModel);\r\n };\r\n\r\n const handleNextPage = () => {\r\n if (pageNo < totalPages) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(pageNo) + 1,\r\n };\r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n };\r\n const handlePrevPage = () => {\r\n if (pageNo > 1) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(pageNo) - 1,\r\n };\r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n };\r\n\r\n const handleEnterKey = (event) => {\r\n if (event.key === 'Enter') {\r\n const value = event.target.value;\r\n if (parseInt(value) > 0 && parseInt(value) <= totalPages) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(value),\r\n }; \r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n \r\n }\r\n };\r\n\r\n useEffect(()=>{\r\n setActivePage({...activePage,skip,pageNo})\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n },[pageNo])\r\n\r\n\r\n\r\n return (\r\n <Box className=\"pagination\" borderTop={\"2px solid theme.secondary.200\"}>\r\n <Typography color=\"theme.secondary.800\" type=\"s4\">\r\n Items per page :\r\n </Typography>\r\n <Select\r\n value={limit}\r\n size=\"small\"\r\n className=\"page-size-select page-size-select-pagination\"\r\n onChange={handleLimitChange}\r\n variant=\"outlined\"\r\n MenuProps={{\r\n sx:{\r\n maxWidth:\"unset\"\r\n }\r\n }}\r\n >\r\n {pageSizeOptions?.map((size) => (\r\n <MenuItem key={size} value={size}>\r\n {size}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n\r\n <Typography color=\"theme.secondary.800\" type=\"s4\">\r\n Go To :\r\n </Typography>\r\n\r\n <TextField\r\n type=\"number\"\r\n className=\"goto-box\"\r\n id=\"outlined-required\"\r\n defaultValue=\"\"\r\n onKeyDown={handleEnterKey}\r\n />\r\n\r\n <IconButton onClick={handlePrevPage} size=\"small\" disabled={paginationModel.pageNo === 1}>\r\n {isRtl ? <ChevronRightICon /> : <ChevronLeftIcon />} \r\n </IconButton>\r\n <Typography\r\n sx={{\r\n ...(isRtl ? { ml: 0.5 } : { mr: 0.5 })\r\n }}\r\n type=\"s4\"\r\n weight=\"normal\"\r\n color=\"theme.secondary.700\"\r\n >\r\n Page{\" \"}\r\n </Typography>\r\n {/* <input value={pageNo} type=\"number\" className=\"page-input\" />{\" \"} */}\r\n <Typography type=\"s4\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {pageNo}{\" \"}\r\n </Typography>\r\n <Typography\r\n mx={0.5}\r\n type=\"s4\"\r\n weight=\"normal\"\r\n color=\"theme.secondary.700\"\r\n >\r\n of{\" \"}\r\n </Typography>\r\n <Typography type=\"s4\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {totalPages || 1}\r\n </Typography>\r\n {/* </Box> */}\r\n <IconButton onClick={handleNextPage} size=\"small\" disabled={paginationModel.pageNo === totalPages}>\r\n {isRtl ? <ChevronLeftIcon /> :<ChevronRightICon />}\r\n </IconButton>\r\n </Box>\r\n );\r\n};\r\n\r\nexport { Pagination };\r\nexport default Pagination;\r\n","import {\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n IconButton,\r\n} from \"@mui/material\";\r\nimport Close from \"@mui/icons-material/Close\";\r\nimport Typography from \"../../typography/typography\";\r\nimport TextField from \"../../text-field/text-field\";\r\nimport Button from \"../../button/button\";\r\nimport Modal from \"../../modal/modal\";\r\nimport { useEffect, useMemo, useState } from \"react\";\r\nimport { IPage } from \"../../../@types/page\";\r\n\r\ninterface IAddPage {\r\n open: boolean;\r\n onClose: () => void;\r\n page?: IPage;\r\n handleSubmit: (page: IPage) => void;\r\n pages?: IPage[];\r\n}\r\n\r\nconst AddPageModal = ({ open, onClose, page, handleSubmit, pages }: IAddPage) => {\r\n const [name, setName] = useState<string>();\r\n const [error, setError] = useState<string>(\"\");\r\n const pageNames = useMemo(() => pages?.map((page) => page?.name || \"\"), [pages])\r\n\r\n useEffect(() => {\r\n setName(page?.name);\r\n }, [page]);\r\n\r\n useEffect(() => {\r\n setError(\"\")\r\n }, []);\r\n\r\n const handleSave = () => {\r\n let newPage: any = {};\r\n if (page) {\r\n newPage = {\r\n ...page,\r\n };\r\n }\r\n newPage[\"name\"] = name;\r\n\r\n handleSubmit(newPage);\r\n setName(\"\");\r\n onClose();\r\n };\r\n\r\n const handleInputChange = (e: any) => {\r\n const value = e.target.value\r\n\r\n setName(value)\r\n if (pageNames?.includes(value.trim())) {\r\n setError(\"Page name already in use\")\r\n } else if (!value.trim()) {\r\n setError(\"Page name can not be empty\")\r\n } else {\r\n setError(\"\")\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <Modal fullWidth onClose={onClose} open={open}>\r\n <DialogTitle>\r\n <Typography type=\"s3\" weight=\"medium\" color={\"theme.secondary.1000\"}>\r\n {page ? \"Edit\" : \"Add\"} New View\r\n </Typography>\r\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent dividers>\r\n <TextField\r\n label=\"View Name\"\r\n fullWidth\r\n placeholder=\"Enter view name\"\r\n error={error}\r\n helperText={error}\r\n value={name}\r\n onChange={handleInputChange}\r\n />\r\n </DialogContent>\r\n <DialogActions>\r\n <Button\r\n variant=\"outlined\"\r\n onClick={()=>{\r\n onClose();\r\n setName(\"\");\r\n }}\r\n style={{\r\n color: \"black\",\r\n }}\r\n >\r\n Cancel\r\n </Button>\r\n <Button disabled={error || !name} onClick={handleSave}>Save</Button>\r\n </DialogActions>\r\n </Modal>\r\n </>\r\n );\r\n};\r\n\r\nexport { AddPageModal };\r\nexport default AddPageModal;\r\n","import Typography from \"../../typography/typography\";\nimport images from \"../../../assets/images\";\nimport { Box, Tab, Tabs } from \"@mui/material\";\nimport { SyntheticEvent, useState } from \"react\";\n\nfunction SharedPageView(props: any) {\n const { pageValue, pages, onChange } = props;\n const [value, setValue] = useState(pages[pageValue]?.viewStyle - 1);\n\n const handleChange = (_event: SyntheticEvent, newValue: number) => {\n setValue(newValue);\n onChange(newValue + 1);\n };\n\n const renderContentView = () => {\n switch (value) {\n case 0:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.kanbanView}\n alt=\"Kanban View\"\n />\n );\n case 1:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.calendarView}\n alt=\"Gantt View\"\n />\n );\n case 2:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.tableView}\n alt=\"Grid View\"\n />\n );\n case 3:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.ganttView}\n alt=\"Table View\"\n />\n );\n case 4:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.gridView}\n alt=\"Calendar View\"\n />\n );\n default:\n return null;\n }\n };\n\n const renderViewName = (index: number) => {\n switch (index) {\n case 0:\n return value === 0 ? \"Kanban View\" : \"1\";\n case 1:\n return value === 1 ? \"Calendar View\" : \"2\";\n case 2:\n return value === 2 ? \"List View\" : \"3\";\n case 3:\n return value === 3 ? \"Timeline View\" : \"4\";\n case 4:\n return value === 4 ? \"Grid\" : \"5\";\n default:\n return \"\";\n }\n };\n\n return (\n <>\n <div className=\"shared-img-wrap\">\n <Typography>{renderContentView()}</Typography>\n <div className=\"shared-img-tab\">\n <Box sx={{ width: \"100%\" }}>\n <Tabs value={value} onChange={handleChange} centered>\n <Tab key={0} label={renderViewName(0)} />\n <Tab key={1} label={renderViewName(1)} />\n <Tab key={2} label={renderViewName(2)} />\n <Tab key={3} label={renderViewName(3)} />\n <Tab key={4} label={renderViewName(4)} />\n </Tabs>\n </Box>\n </div>\n </div>\n </>\n );\n}\n\nexport { SharedPageView };\nexport default SharedPageView;\n","import {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n FormControlLabel,\r\n Grid,\r\n IconButton,\r\n Tab,\r\n Tabs,\r\n} from \"@mui/material\";\r\nimport Close from \"@mui/icons-material/Close\";\r\nimport Typography from \"../../typography/typography\";\r\nimport Button from \"../../button/button\";\r\nimport Modal from \"../../modal/modal\";\r\nimport \"./shared-page-modal.scss\";\r\nimport { useEffect, useState } from \"react\";\r\nimport SearchBar from \"../../search-bar/search-bar\";\r\nimport Toggle from \"../../toggle/toggle\";\r\nimport SharedPageView from \"./shared-page-view\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { setSharedPage } from \"../../../views/afterAuth/dashboard/redux/reducer\";\r\n\r\ninterface IAddPage {\r\n open: boolean;\r\n onClose: () => void;\r\n pages?: any;\r\n handleSubmit: (page: any) => void;\r\n}\r\n\r\ninterface TabPanelProps {\r\n children?: React.ReactNode;\r\n index: number;\r\n value: number;\r\n}\r\n\r\nfunction TabPanel(props: TabPanelProps) {\r\n const { children, value, index, ...other } = props;\r\n\r\n return (\r\n <div\r\n className=\"shared-tab\"\r\n role=\"tabpanel\"\r\n hidden={value !== index}\r\n id={`vertical-tabpanel-${index}`}\r\n aria-labelledby={`vertical-tab-${index}`}\r\n {...other}\r\n >\r\n {value === index && (\r\n <Box sx={{ p: 3 }}>\r\n <Typography>{children}</Typography>\r\n </Box>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nfunction a11yProps(index: number) {\r\n return {\r\n id: `vertical-tab-${index}`,\r\n \"aria-controls\": `vertical-tabpanel-${index}`,\r\n };\r\n}\r\n\r\nconst SharedPageModal = ({ open, onClose, pages, handleSubmit }: IAddPage) => {\r\n const [value, setValue] = useState(0);\r\n const [sharedPages, setSharedPages] = useState(pages);\r\n const [searchQuery, setSearchQuery] = useState(\"\");\r\n\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => {\r\n dispatch(setSharedPage(sharedPages));\r\n }, [dispatch, sharedPages]);\r\n\r\n const handleChange = (_event: React.SyntheticEvent, newValue: number) => {\r\n setValue(newValue);\r\n };\r\n\r\n const handleSave = () => {\r\n handleSubmit(pages[value]);\r\n };\r\n\r\n const renderTabs = () => {\r\n const filteredPages = sharedPages.filter((page: any) =>\r\n page.name.toLowerCase().includes(searchQuery.toLowerCase()),\r\n );\r\n\r\n return filteredPages.map((page: any, index: number) => (\r\n <Tab key={index} label={page.name} {...a11yProps(index)} />\r\n ));\r\n };\r\n\r\n const PageDescription = ({ page }: { page: any }) => {\r\n let viewsMessage = \"\",\r\n filtersMessage = \"\";\r\n\r\n if (page?.details?.views?.length === 1) {\r\n viewsMessage = `This page has 1 view, you can customize it`;\r\n } else if (page?.details?.views?.length) {\r\n viewsMessage = `This page has ${page?.details?.views?.length} different views, you can customize them`;\r\n } else {\r\n viewsMessage = `In this page you can add different views and customize them`;\r\n }\r\n\r\n if (page?.details?.filters?.length === 1) {\r\n filtersMessage = `, and it also have a saved filters to make things easier for you.`;\r\n } else if (page?.details?.filters?.length) {\r\n filtersMessage = `, and there are also ${page?.details?.filters?.length} saved filters to make things easier for you.`;\r\n } else {\r\n filtersMessage = `, and you can also add filters to make things easier for you`;\r\n }\r\n\r\n return <p>{viewsMessage + filtersMessage}</p>;\r\n };\r\n\r\n const handleToggle = () => {\r\n setSharedPages((prevPages: any) => {\r\n const updatedPages = prevPages.map((page: any, index: any) => {\r\n if (index === value) {\r\n return {\r\n ...page,\r\n isPinToDashboard: !page.isPinToDashboard,\r\n };\r\n }\r\n return page;\r\n });\r\n return updatedPages;\r\n });\r\n };\r\n\r\n const handleSharedView = (viewStyle: number) => {\r\n setSharedPages((prevPages: any) => {\r\n const updatedPages = prevPages.map((page: any, index: any) => {\r\n if (index === value) {\r\n return {\r\n ...page,\r\n viewStyle: viewStyle,\r\n };\r\n }\r\n return page;\r\n });\r\n return updatedPages;\r\n });\r\n };\r\n\r\n const handleSearchBar = (value: string) => {\r\n setSearchQuery(value);\r\n setValue(0);\r\n };\r\n return (\r\n <>\r\n <Modal\r\n fullWidth\r\n onClose={onClose}\r\n open={open}\r\n className=\"shared-pages-modal\"\r\n >\r\n <DialogTitle>\r\n <Typography type=\"s3\" weight=\"medium\" color={\"theme.secondary.1000\"}>\r\n Shared Views\r\n </Typography>\r\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent dividers>\r\n {sharedPages?.length ?\r\n <Box>\r\n <Grid container spacing={2}>\r\n <Grid item xs={4} className=\"tab-title-wrap\">\r\n <div className=\"tab-search-wrap\">\r\n <SearchBar\r\n placeholder={\"Search User\"}\r\n handleSearch={handleSearchBar}\r\n />\r\n </div>\r\n <Tabs\r\n orientation=\"vertical\"\r\n variant=\"scrollable\"\r\n value={value}\r\n onChange={handleChange}\r\n aria-label=\"Vertical tabs example\"\r\n sx={{ borderRight: 1, borderColor: \"divider\" }}\r\n >\r\n {renderTabs()}\r\n </Tabs>\r\n </Grid>\r\n <Grid className=\"shared-grid-wrap\" item xs={8}>\r\n {sharedPages\r\n .filter((page: any) =>\r\n page.name.toLowerCase().includes(searchQuery.toLowerCase()),\r\n )\r\n .map((page: any, index: number) => (\r\n <TabPanel value={value} index={index} key={index}>\r\n <div className=\"shared-pages-main\">\r\n <SharedPageView\r\n pageValue={index}\r\n pages={sharedPages}\r\n onChange={handleSharedView}\r\n />\r\n </div>\r\n <div className=\"tab-info-wrap\">\r\n <div className=\"tab-inner-info\">\r\n <div>\r\n <h1>{page.name}</h1>\r\n </div>\r\n <div className=\"tab-toggle\">\r\n <div>\r\n <FormControlLabel\r\n control={\r\n <Toggle\r\n checked={page.isPinToDashboard}\r\n onChange={handleToggle}\r\n />\r\n }\r\n label=\"Pined to dashboard\"\r\n labelPlacement=\"start\"\r\n />\r\n </div>\r\n <div className=\"owner-name-wrap\">\r\n <p>\r\n <span>Owner:</span> {page.owner}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"tab-content\">\r\n <PageDescription page={page} />\r\n </div>\r\n </div>\r\n </TabPanel>\r\n ))}\r\n </Grid>\r\n </Grid>\r\n </Box>\r\n : <Box display='flex' width='100%' height='100%' alignItems='center' justifyContent='center'><Typography type=\"s1\" color='theme.secondary.800'>No Views has been shared with you</Typography></Box>}\r\n </DialogContent>\r\n <DialogActions>\r\n <Button\r\n variant=\"outlined\"\r\n onClick={onClose}\r\n style={{\r\n color: \"black\",\r\n }}\r\n disabled={!sharedPages?.length}\r\n >\r\n Cancel\r\n </Button>\r\n <Button onClick={handleSave} disabled={!sharedPages?.length}>Duplicate</Button>\r\n </DialogActions>\r\n </Modal>\r\n </>\r\n );\r\n};\r\n\r\nexport { SharedPageModal };\r\nexport default SharedPageModal;\r\n","import React from \"react\";\r\nimport { IconButton, Menu, MenuItem } from \"@mui/material\";\r\nimport AddCircleOutlineRoundedIcon from \"@mui/icons-material/AddCircleOutlineRounded\";\r\nimport Typography from \"../../typography/typography\";\r\nimport AddPageModal from \"./add-page-modal\";\r\nimport KeyboardArrowRightIcon from \"@mui/icons-material/KeyboardArrowRight\";\r\nimport { IPage } from \"../../../@types/page\";\r\nimport SharedPageModal from \"./shared-page-modal\";\r\n\r\ninterface IAddPage {\r\n sharedPages: any;\r\n handleAddPage: (view: IPage) => void;\r\n pages?: IPage[];\r\n}\r\n\r\nconst AddPage = ({ sharedPages, handleAddPage, pages }: IAddPage) => {\r\n const [isAddMenuOpen, setIsAddMenuOpen] = React.useState<null | HTMLElement>(\r\n null,\r\n );\r\n const [isAddPageModalOpen, setIsAddPageModalOpen] = React.useState(false);\r\n const [isSharedPageModalOpen, setIsSharedPageModalOpen] =\r\n React.useState(false);\r\n\r\n const handleAddMenuOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n event.stopPropagation();\r\n setIsAddMenuOpen(event.currentTarget);\r\n };\r\n const handleAddMenuClose = () => setIsAddMenuOpen(null);\r\n\r\n const handleOpenAddPageModal = () => {\r\n handleAddMenuClose();\r\n setIsAddPageModalOpen(true);\r\n };\r\n const handleCloseAddPageModal = () => setIsAddPageModalOpen(false);\r\n\r\n const handleCloseSharedModal = () => {\r\n setIsSharedPageModalOpen(false);\r\n };\r\n const handleOpenSharedPageModal = () => {\r\n setIsSharedPageModalOpen(true);\r\n setIsAddMenuOpen(null);\r\n };\r\n const handleShared = (page: any) => {\r\n const newPage: any = { ...page.details, name: page.name };\r\n handleAddPage(newPage);\r\n setIsSharedPageModalOpen(false);\r\n };\r\n\r\n return (\r\n <>\r\n <IconButton size=\"small\" sx={{ ml: 1 }} onClick={handleAddMenuOpen}>\r\n <AddCircleOutlineRoundedIcon fontSize=\"inherit\" />\r\n </IconButton>\r\n <Menu\r\n open={Boolean(isAddMenuOpen)}\r\n anchorEl={isAddMenuOpen}\r\n onClose={handleAddMenuClose}\r\n >\r\n <MenuItem onClick={handleOpenAddPageModal}>\r\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\r\n Create New View\r\n </Typography>\r\n </MenuItem>\r\n <MenuItem onClick={handleOpenSharedPageModal}>\r\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\r\n Shared Views\r\n </Typography>\r\n <KeyboardArrowRightIcon fontSize=\"small\" />\r\n </MenuItem>\r\n </Menu>\r\n\r\n <AddPageModal\r\n pages={pages}\r\n open={isAddPageModalOpen}\r\n onClose={handleCloseAddPageModal}\r\n handleSubmit={handleAddPage}\r\n />\r\n <SharedPageModal\r\n open={isSharedPageModalOpen}\r\n pages={sharedPages || []}\r\n onClose={handleCloseSharedModal}\r\n handleSubmit={handleShared}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport { AddPage };\r\nexport default AddPage;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport {\n Box,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n List,\n ListItem,\n ListItemText,\n ListItemAvatar,\n MenuItem,\n FormControlLabel,\n} from \"@mui/material\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Typography from \"../typography/typography\";\n\nimport Button from \"../button/button\";\nimport Avatar from \"../avatar/avatar\";\nimport Select from \"../select/select\";\nimport \"./share-modal.scss\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { useAppDispatch, useAppSelector } from \"../../redux/hooks\";\nimport { getAllUserAndDepartmentDropdown } from \"./redux/actionCreator\";\nimport React from \"react\";\nimport Toggle from \"../toggle/toggle\";\nimport SearchableSelect from \"../searchable-select\";\nimport { flatMap } from \"lodash\";\nimport Checkbox from \"../checkbox/checkbox\";\n\ninterface SharePopUpProps {\n open: boolean;\n title: string;\n onClose: () => void;\n roles?: any;\n toggleSwitch: boolean;\n onSubmit: (selectedUsers: any) => void;\n value?: any;\n isPeopleAccessVisible?: boolean;\n}\ninterface UserDropdownData {\n isRoleVisible: boolean;\n selectedUsers: any[];\n}\n\nconst SharePopUp = (props: SharePopUpProps) => {\n const {\n open,\n title,\n onClose,\n roles,\n toggleSwitch,\n onSubmit,\n value = {},\n isPeopleAccessVisible = false,\n } = props;\n\n const { share } = useAppSelector((store) => store);\n\n const dispatch = useAppDispatch();\n\n const [isPublic, setIsPublic] = useState(value.isPublic || false);\n const [selectedOptions, setSelectedOptions] = useState(\n value.selectedUsers || [],\n );\n const [roleValue, setRoleValue] = useState([]);\n const [availableRole, setAvailableRole] = useState([]);\n\n const [userDropdownData, setUserDropdownData] = useState<UserDropdownData>({\n isRoleVisible: false,\n selectedUsers: [],\n });\n\nconst filteredOptions=useMemo(()=>userDropdownData?.isRoleVisible ? share.departments : share.users,[share,userDropdownData?.isRoleVisible])\nconst [selectedUsers, setSelectedUsers] = useState<any[]>([]);\n useEffect(() => {\n const role: any = [];\n const selRole: any = [];\n roles &&\n roles.map((item: any) => {\n const userRole: any = {};\n if (item.role !== \"Owner\") {\n role.push(item.role);\n userRole.id = item.id;\n userRole.role = item.role;\n selRole.push(userRole);\n }\n setAvailableRole(role);\n setRoleValue(selRole);\n });\n }, [roles]);\n\nuseEffect(()=>{\n if(!value?.selectedUsers?.length && !value?.role_id){\n resetOptions()\nreturn\n }\n userDropdownData.isRoleVisible=value.is_role\n setUserDropdownData(userDropdownData)\n setSelectedOptions({\n ...value,\n selectedUsers:value.is_role?value?.role_id:value?.selectedUsers\n })\n //eslint-disable-next-line\n},[value?.selectedUsers,open])\n\n const handleShareSubmit = () => {\n if(!selectedUsers?.length) return\n const uIds = flatMap(selectedUsers, 'userIds').filter(i=>i);\n let sOptions = selectedUsers\n if( Array.isArray(uIds) && uIds?.length) {\n sOptions = share.users?.filter(u => uIds.includes(u.id))\n \n }\n const sharedData = {\n is_private: !isPublic,\n selectedUsers: [...new Set(sOptions)],\n is_role:userDropdownData?.isRoleVisible,\n role_id:userDropdownData?.isRoleVisible?selectedUsers?.map((u: any) => u?.id):[],\n };\n onSubmit(sharedData);\n \n };\n\n const resetOptions=()=> {\n setSelectedOptions({\n ...value\n });\n setUserDropdownData((prevData) => ({\n ...prevData,\n selectedUsers: [],\n }));\n };\n\n\n\n const handleRoleChange = (event: any, id: any, user: any) => {\n const changeRole: any = roleValue.map((item: any) => {\n if (item.id === id) {\n item.role = event.target.value;\n }\n return item;\n });\n setRoleValue(changeRole);\n };\n\n const handleToggleChange = () => {\n setUserDropdownData((prevSettings) => ({\n ...prevSettings,\n isRoleVisible: !prevSettings.isRoleVisible,\n }));\n setSelectedOptions([]);\n setSelectedUsers(value.selectedUsers || []);\n };\n\n const handleChage=(value:any)=>{\n if(userDropdownData.isRoleVisible){\n setSelectedOptions({...selectedOptions,role_id:value})\n }\n setSelectedOptions({...selectedOptions,selectedUsers:value})\n }\n\n const toggleMakeItPublic = () => {\n setIsPublic(!isPublic);\n }\n \n useEffect(() => {\n if(!open)resetOptions()\n if (open) {\n dispatch(getAllUserAndDepartmentDropdown());\n }\n // eslint-disable-next-line\n }, [open]);\n\n\n\n return (\n <div>\n <Dialog open={open} onClose={onClose} className=\"share\">\n <DialogTitle className=\"share--head\">\n <Box className=\"share--title\">\n <Typography type=\"s3\" ml={1} className=\"dialog-box-title\">\n {title}\n </Typography>\n </Box>\n <IconButton disableRipple onClick={onClose}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n\n <Divider />\n\n <DialogContent className=\"share--content\">\n <Box m={1} display={'flex'} alignItems={'center'} justifyContent={'space-between'}>\n <Typography type=\"s3\" className=\"input-label\">\n Add users\n </Typography>\n <FormControlLabel\n control={<Box mb={0.5} mr={0.5}><Toggle checked={userDropdownData?.isRoleVisible} onChange={handleToggleChange} /></Box>}\n label={\n <Typography type=\"s3\" className=\"input-label\">Show only Roles</Typography>\n }\n />\n </Box>\n \n\n {toggleSwitch && (\n <>\n \n <Box mb={4} className=\"d-flex\">\n \n <SearchableSelect \n options={filteredOptions}\n multiple\n value={selectedOptions?.selectedUsers}\n onChange={(e) =>handleChage(e.target.value)}\n placeholder={\n selectedOptions && selectedOptions.length\n ? \"\"\n : \"Add people and roles\"\n }\n getSelectedData={row=>setSelectedUsers(row)}\n />\n </Box>\n </>\n )}\n \n {isPeopleAccessVisible && (\n <div className={ \"share--blurClass\"}>\n <Accordion className=\"people-access-accordion\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>People with access</Typography>\n </AccordionSummary>\n <AccordionDetails className=\"user-accordion-details\">\n <List className=\"accordion-list\">\n {roles &&\n roles.map((user: any) => {\n const userRole: any =\n roleValue?.length > 0 &&\n roleValue?.filter((item: any) => item.id === user.id);\n return (\n <ListItem alignItems=\"flex-start\">\n <ListItemAvatar>\n <Avatar size={40} alt=\"Person\" icon />\n </ListItemAvatar>\n <ListItemText\n className=\"primary-user-name\"\n primary={user.name}\n secondary={\n <Typography\n component=\"span\"\n variant=\"body2\"\n className=\"secondary-email-text\"\n >\n {user.email}\n </Typography>\n }\n />\n {user.role == \"Owner\" ? (\n <p className=\"owner-role-badge\">{user.role}</p>\n ) : (\n <div>\n <Select\n className=\"role-edit-select-box\"\n value={\n userRole?.length > 0 ? userRole[0].role : \"\"\n }\n onChange={(e: any) =>\n handleRoleChange(e, user.id, user)\n }\n variant=\"outlined\"\n >\n {availableRole.map((role: any) => (\n <MenuItem\n className=\"select-menu-items\"\n value={role}\n >\n {role}\n </MenuItem>\n ))}\n </Select>\n </div>\n )}\n </ListItem>\n );\n })}\n </List>\n </AccordionDetails>\n </Accordion>\n </div>\n )}\n\n <div className=\"checkbox\">\n <Checkbox\n checked={isPublic}\n onChange={toggleMakeItPublic}\n />\n <div className=\"checkbox-text\">Make it public</div>\n </div>\n </DialogContent>\n\n <Divider />\n\n <DialogActions className=\"share--actions\">\n <Button className=\"cancel-btn\" variant=\"text\" onClick={onClose}>\n Cancel\n </Button>\n <Button className=\"success-btn\" onClick={handleShareSubmit}>\n Save and Share\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n};\n\nexport { SharePopUp };\nexport default SharePopUp;\n","export const userRoles = [\r\n {\r\n id: 1,\r\n name: \"Prasun Singh\",\r\n email: \"prasun@goldenflitch.com\",\r\n role: \"Owner\",\r\n },\r\n {\r\n id: 2,\r\n name: \"Sidhant Chandel\",\r\n email: \"sidhant@goldenflitch.com\",\r\n role: \"Editor\",\r\n },\r\n {\r\n id: 3,\r\n name: \"Amrit Sonar\",\r\n email: \"amrit@goldenflitch.com\",\r\n role: \"Viewer\",\r\n },\r\n];\r\n","import { Divider, MenuItem } from \"@mui/material\";\nimport Menu from \"../../menu/menu\";\nimport Typography from \"../../typography/typography\";\nimport { useEffect, useState } from \"react\";\nimport AddPageModal from \"./add-page-modal\";\nimport { IPage } from \"../../../@types/page\";\nimport SharePopUp from \"../../share-modal/share-modal\";\nimport { userRoles } from \"../../../views/beforeAuth/components/share-modal-data/share-modal-data\";\nimport ConfirmPopUp from \"../../confirm-modal/confirm-modal\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { pinToDashboardList } from \"../../../views/afterAuth/dashboard/redux/reducer\";\nimport {\n // deleteV1DashboardId,\n // putV1DashboardId,\n} from \"../../../api-client/api.system-feature/api\";\n// import type * as Types from \"../../api-client/api.system-feature/api-types\";\nimport { sharePage } from \"../../share-modal/redux/actionCreator\";\nimport { useAppDispatch } from \"../../../redux/hooks\";\nimport { generateRandomId } from \"../../../utils/common\";\nimport { usePages } from \"../../../hooks/use-pages\";\n\ninterface IPageAction {\n open: null | HTMLElement;\n onClose: () => void;\n page?: IPage;\n pages: IPage[];\n setCurrentPage: React.Dispatch<React.SetStateAction<number>>;\n setPages: React.Dispatch<React.SetStateAction<IPage[]>>;\n resource: string;\n handlePageDelete: (pages: any[]) => void;\n}\n\nconst moveLeft = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n if (index === 0) return;\n\n const elementToShift = updatedArray.splice(index, 1)[0];\n updatedArray.splice(index - 1, 0, elementToShift);\n return updatedArray;\n};\n\nconst moveRight = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n if (index === updatedArray.length - 1) return;\n\n const elementToShift = updatedArray.splice(index, 1)[0];\n updatedArray.splice(index + 1, 0, elementToShift);\n return updatedArray;\n};\n\nconst deletePage = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n updatedArray.splice(index, 1);\n return updatedArray;\n};\n\nconst PageAction = ({\n open,\n onClose,\n page,\n pages,\n setCurrentPage,\n setPages,\n resource,\n handlePageDelete,\n}: IPageAction) => {\n \n const [isEditPageModalOpen, setIsEditPageModalOpen] = useState(false);\n const [isShareModalOpen, setIsShareModalOpen] = useState(false);\n const [isConfirmOpen, setIsConfirmOpen] = useState(false);\n const [deletePageNo, setDeletePageNo] = useState<any>({});\n const [defaultSharedData, setDefaultSharedData] = useState<any>({});\n const [pageSharedData, setPageSharedData] = useState<any>([]);\n const pinToDashboardStore = useSelector((state: any) => state);\n const [pinToDashboardData, setPinToDashboardData] = useState<any>(\n pinToDashboardStore?.dashboard?.pinToDashboardList || [],\n );\n\n\n const appDispatch = useAppDispatch();\n const dispatch = useDispatch();\n const {setIsCreatePage}=usePages()\n // const token = zI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OSwiaWF0IjoxNzA2NDcwNzQwfQ.6dtxBVGl4hF0TrNDanSBTiFtV_TUshjaiaYe9XT2Ld8\";\n useEffect(() => {\n dispatch(pinToDashboardList(pinToDashboardData));\n }, [dispatch, pageSharedData, pinToDashboardData]);\n\n useEffect(()=>{\n \n if(page){\n setPageSharedData([...pageSharedData,{\n page:{\n ...page,\n value:page?._id\n },\n isPublic: true,\n shareUsers:page?.selectedUsers,\n }])\n }\n //eslint-disable-next-line\n },[page])\n \n\n const handleOpenEditModal = () => {\n onClose();\n setIsEditPageModalOpen(true);\n };\n\n const handleCloseEditModal = () => {\n setIsEditPageModalOpen(false);\n };\n\n const handleShare = (pageData: any) => {\n pageData.pages = pages;\n appDispatch(sharePage(pageData)).then((res) => {\n if (res?.payload?.data?.pages?.length) {\n setPages(res?.payload?.data?.pages);\n }\n setIsShareModalOpen(false);\n });\n };\n\n const handleSharePage = (page: any) => {\n const defaultData = pageSharedData.find(\n (item: any) => item.page?.value === page?.value,\n );\n if (defaultData) {\n setDefaultSharedData({\n isPublic: defaultData.isPublic,\n selectedUsers: defaultData.shareUsers,\n \n });\n } else {\n setDefaultSharedData({\n isPublic: page?.selectedUsers?.length>0,\n ...page,\n });\n }\n setIsShareModalOpen(true);\n setIsShareModalOpen(true);\n };\n\n const handleDuplicatePage = (page: any) => {\n const labelExists = (label: string) =>\n pages.some((item) => item.name === label);\n const { uniqueNumberId: _id } = generateRandomId();\n let newLabel = page.name;\n\n if (labelExists(newLabel)) {\n let counter = 1;\n while (labelExists(`${page.name} ${counter}`)) {\n counter++;\n }\n newLabel = `${page.name} ${counter}`;\n }\n const updatedPage = [\n ...pages,\n { ...page, name: newLabel, _id, data: page.data, isShared: false },\n ];\n\n setPages(updatedPage);\n setIsCreatePage(true)\n };\n\n const handleEdit = (newPage: IPage) => {\n const updatedPages = pages.map((page) => {\n if (page._id === newPage._id) {\n return {\n ...page,\n name: newPage.name\n }\n }\n return page\n })\n\n setPages(updatedPages);\n setIsCreatePage(true)\n // const putDashboardRequest: Types.PutV1DashboardIdRequest = {\n // \"x-token\": token,\n // module: \"user\",\n // user_id: \"1\",\n // name: newPage.name,\n // id: newPage._id,\n // };\n // putV1DashboardId(putDashboardRequest)\n // .then((response: any) => {\n // const prevPages = [...pages];\n // const updatedPages = prevPages.map((page) =>\n // page._id === newPage._id ? newPage : page,\n // );\n // setPages(updatedPages);\n // updatePinToDashboardPage(updatedPages);\n // })\n // .catch((err: any) => console.log(\"Error in adding page\", err));\n };\n\n // const updatePinToDashboardPage = (updatedPages: any) => {\n // const currentPageLabel = updatedPages.find(\n // (item: any) => item.value === page?._id,\n // )?.label;\n\n // const updatedPinToDashboardData = pinToDashboardData.map((data: any) => ({\n // ...data,\n // label: data.value === page?._id ? currentPageLabel : data.label,\n // }));\n\n // setPinToDashboardData(updatedPinToDashboardData);\n // };\n\n const handleMoveLeft = (pageValue: any) => {\n const updatedArray = moveLeft(pages, pageValue?._id);\n if (updatedArray) setPages(updatedArray);\n };\n\n const handleMoveRight = (pageValue: any) => {\n const updatedArray = moveRight(pages, pageValue?._id);\n if (updatedArray) setPages(updatedArray);\n };\n\n const handleDeletePage = (pageValue: any) => {\n setIsConfirmOpen(true);\n setDeletePageNo(pageValue);\n };\n\n const handleConfirmDelete = () => {\n // if (!isNaN(deletePageNo._id)) {\n // const deleteDashboardRequest: Types.DeleteV1DashboardIdRequest = {\n // \"x-token\": token,\n // id: deletePageNo._id,\n // };\n // deleteV1DashboardId(deleteDashboardRequest)\n // .then((response: any) => {\n // })\n // .catch((err: any) => console.log(\"Error in deleting page\", err));\n // }\n \n const updatedArray = deletePage(pages, deletePageNo?._id);\n deletePinToDashboardPage();\n setDeletePageNo({});\n setIsConfirmOpen(false);\n if (updatedArray) {\n setCurrentPage(updatedArray[0]);\n setPages(updatedArray);\n handlePageDelete(updatedArray);\n } else {\n handlePageDelete([]);\n setPages([]);\n }\n };\n\n const deletePinToDashboardPage = () => {\n const updatedPinToDashboardData = pinToDashboardData.filter(\n (data: any) => data.value !== page?._id,\n );\n setPinToDashboardData(updatedPinToDashboardData);\n };\n\n const handleShareModal = (selectedUsers: any) => {\n\n let updatedData: any[] = [];\n const existingItem = pageSharedData.find(\n (item: any) => item.page.value === page?._id,\n );\n\n if (existingItem) {\n updatedData = pageSharedData.map((item: any) => {\n if (item.page.value === page?._id) {\n return {\n ...item,\n isPublic: selectedUsers.isPublic,\n shareUsers: selectedUsers.selectedUsers,\n };\n }\n return item;\n });\n } else {\n updatedData = [\n ...pageSharedData,\n {\n page: page,\n isPublic: selectedUsers.isPublic,\n shareUsers: selectedUsers.selectedUsers,\n viewStyle: 1,\n owner: 0,\n },\n ];\n }\n setPageSharedData(updatedData);\n handleShare({ ...selectedUsers, page: page, resource });\n };\n\n const handlePinToDashboard = () => {\n const index = pinToDashboardData.findIndex(\n (item: any) => item.value === page?._id,\n );\n\n if (index !== -1) {\n setPinToDashboardData((prevData: any) => {\n const updatedData = [...prevData];\n updatedData[index] = { ...updatedData[index], label: page?.name };\n return updatedData;\n });\n } else {\n setPinToDashboardData((prevData: any) => [...prevData, page]);\n }\n };\n\n const actions = [\n {\n label: \"Rename\",\n func: handleOpenEditModal,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Duplicate\",\n func: handleDuplicatePage,\n },\n {\n label: \"Share\",\n func: handleSharePage,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Pin to dashboard\",\n func: handlePinToDashboard,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Move Right\",\n func: handleMoveRight,\n disabled: (pages?.length <= 1) || Boolean(page?.isShared)\n },\n {\n label: \"Move Left\",\n func: handleMoveLeft,\n disabled: (pages?.length <= 1) || Boolean(page?.isShared)\n },\n ];\n\n const handleAction = (func: any) => {\n func(page);\n onClose();\n };\n\n return (\n <>\n <Menu open={Boolean(open)} anchorEl={open} onClose={onClose}>\n {actions?.map((action) => (\n <MenuItem\n key={action?.label}\n onClick={() => handleAction(action.func)}\n disabled={Boolean(action?.disabled)}\n >\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\n {action?.label}\n </Typography>\n </MenuItem>\n ))}\n <Divider sx={{ mt: `4px !important`, mb: `4px !important` }}/>\n <MenuItem onClick={() => handleAction(handleDeletePage)} disabled={Boolean(page?.isShared)}\n sx={{\n '&:hover': {\n backgroundColor: 'theme.error.100'\n }\n }}\n >\n <Typography color=\"theme.error.500\" type=\"s4\">\n Delete\n </Typography>\n </MenuItem>\n </Menu>\n\n <AddPageModal\n open={isEditPageModalOpen}\n page={page}\n pages={pages}\n onClose={handleCloseEditModal}\n handleSubmit={handleEdit}\n />\n\n <ConfirmPopUp\n open={isConfirmOpen}\n onClose={() => setIsConfirmOpen(false)}\n onConfirm={handleConfirmDelete}\n title=\"Delete Confirmation?\"\n description=\"Are you sure you want to delete this page ?\"\n />\n <SharePopUp\n open={isShareModalOpen}\n onClose={() => setIsShareModalOpen(false)}\n title={`Share page ${page?.name}`}\n roles={userRoles}\n toggleSwitch={true}\n value={defaultSharedData}\n onSubmit={handleShareModal}\n />\n </>\n );\n};\n\nexport { PageAction };\nexport default PageAction;\n","/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport { useCallback, useEffect, useState } from 'react';\r\nimport {\r\n\tTabs,\r\n\tTab as MUITab,\r\n\tstyled,\r\n\tIconButton,\r\n\tMenuItem,\r\n\tDivider,\r\n\tBox,\r\n\tCircularProgress\r\n} from '@mui/material';\r\nimport MenuIcon from '@mui/icons-material/Menu';\r\nimport KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown';\r\nimport Typography from '../typography/typography';\r\nimport Menu from '../menu/menu';\r\nimport AddPage from './components/add-page';\r\nimport PageAction from './components/page-action';\r\nimport Tooltip from '../tooltip/Tooltip';\r\nimport { IPage } from '../../@types/page';\r\nimport { defaultPageState } from '../../contexts/page-context';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport Button from '../button/button';\r\nimport _ from 'lodash';\r\nimport { Save, Share } from '@mui/icons-material';\r\nimport './page-navigator.scss';\r\nimport React from 'react';\r\n\r\nconst StyledTabs = styled(Tabs)(() => ({\r\n\tminHeight: 'fit-content',\r\n\r\n\t'.MuiTabs-indicator': {\r\n\t\theight: '0px !important'\r\n\t},\r\n\t'& .MuiTabs-flexContainer': {\r\n\t\tgap: '4px'\r\n\t}\r\n}));\r\n\r\nconst StyledTab = styled(MUITab)(({ theme: { palette } }) => ({\r\n\tminHeight: '2rem',\r\n\ttextTransform: 'none',\r\n\tpadding: '0rem 1rem',\r\n\tminWidth: 'fit-content',\r\n\tborderRadius: 4,\r\n\t'&.Mui-selected': {\r\n\t\tbackground: palette.theme?.primary[100],\r\n\t\tcolor: palette.theme?.primary[700],\r\n\t\tborderTop: `2px solid ${palette.theme?.primary[700]}`\r\n\t},\r\n\t'.MuiIconButton-root': {\r\n\t\tpadding: '0rem'\r\n\t},\r\n\t\"&:hover\": {\r\n\t\tbackground: palette.theme?.primary[100]\r\n\t}\r\n}));\r\n\r\nconst title = `successfully created, complete with your saved filters, sorting options, and views.`;\r\n\r\nexport interface IPageNavigator {\r\n\tpages: IPage[];\r\n\tsetPages: React.Dispatch<React.SetStateAction<IPage[]>>;\r\n\tcurrentPage: string | number;\r\n\tsetCurrentPage: React.Dispatch<React.SetStateAction<number>>;\r\n\tsharedPages: any;\r\n\tresource: string;\r\n\thandlePageDelete: (pages: any[]) => void;\r\n\tisPageSaving?: boolean;\r\n}\r\n\r\nexport const PageNavigator = ({\r\n\t// sharedPages,\r\n\tresource,\r\n\t// handlePageDelete\r\n}: IPageNavigator) => {\r\n\tconst { pages, setPages, setActivePage, activePage, savePages,setIsChanged, isSaving, generatedColumns, sharedPages, isChanged,deletePage,isCreatePage,setIsCreatePage ,addOrDeletePage} = usePages();\r\n\tconst shareTitle = (owner) => `shared by ${owner}`;\r\n\tconst [isActionsMenuOpen, setIsActionsMenuOpen] =\r\n\t\tuseState<null | HTMLElement>(null);\r\n\tconst [page, setPage] = useState<IPage>();\r\n\r\n\tconst [isAllPagesMenuOpen, setIsAllPagesMenuOpen] =\r\n\t\tuseState<null | HTMLElement>(null);\r\n\r\n\tconst handleChangePage = (_: React.SyntheticEvent, newValue: number) => {\r\n\t\tconst pg = pages.find((p) => p?._id == newValue);\r\n\t\tsetActivePage(pg);\r\n\t};\r\n\r\n\tconst handleOpenActionsMenu = (\r\n\t\tevent: React.MouseEvent<HTMLButtonElement>,\r\n\t\tclickedPage: IPage\r\n\t) => {\r\n\t\tevent.stopPropagation();\r\n\t\tsetPage(clickedPage);\r\n\t\tsetIsActionsMenuOpen(event.currentTarget);\r\n\t};\r\n\tconst handleCloseActionsMenu = () => setIsActionsMenuOpen(null);\r\n\r\n\tconst handleOpenAllPagesMenu = (\r\n\t\tevent: React.MouseEvent<HTMLButtonElement>\r\n\t) => {\r\n\t\tevent.stopPropagation();\r\n\t\tsetIsAllPagesMenuOpen(event.currentTarget);\r\n\t};\r\n\tconst handleCloseAllPagesMenu = () => setIsAllPagesMenuOpen(null);\r\n\r\n\tconst handleChangePageFromMenu = (val: number) => {\r\n\t\tsetActivePage(val);\r\n\t\thandleCloseAllPagesMenu();\r\n\t};\r\n\r\n\tconst handleAddPage = (newPage: IPage) => {\r\n\t\tconst nPage = {\r\n\t\t\t...defaultPageState,\r\n\t\t\t...newPage,\r\n\t\t\tname: newPage.name,\r\n\t\t\tvisible_columns: generatedColumns.columns,\r\n\t\t\tcolumn_order: _.uniq(generatedColumns.orderKeys),\r\n\t\t\t_id: pages.length + 1,\r\n\t\t\tactive_view:'Table',\r\n\t\t\tviews:[{\r\n\t\t\t\tlabel:'Table',\r\n\t\t\t\tposition:0\r\n\t\t\t}]\r\n\t\t};\r\n\t\tconst updatedPages: any = [\r\n\t\t\t...pages,\r\n\t\t\t...[nPage]\r\n\t\t];\r\n\t\tsetActivePage({...nPage});\r\n\t\tsetPages([...updatedPages]);\r\n\t\tsetIsCreatePage(true)\r\n\t\t\r\n\t};\r\n\r\n\tconst handlePageDeleteFunction=(pages:any[])=>{\r\n\t\t\r\n\t\tdeletePage(pages)\r\n\t}\r\n\r\n\r\n\tconst handleAddOrdeletePage =useCallback(async\t () => {\r\n\t\tif(isCreatePage){\r\n\t\t\tconst res=await addOrDeletePage();\r\n\t\t\tif(res.status_code===200){\r\n\t\t\t\tsetPages(res?.data?.pages);\r\n\t\t\t\tsetIsChanged(false)\r\n\t\t\t}}\r\n\t\tsetTimeout(()=>{\r\n\t\t\tsetIsCreatePage(false);\r\n\t\t\t\r\n\t\t},2000)\r\n\t\t//eslint-disable-next-line\r\n\t},[isCreatePage])\r\n\r\n\tuseEffect(()=>{\r\n\t\thandleAddOrdeletePage()\r\n\t\t//eslint-disable-next-line\r\n\t},[handleAddOrdeletePage])\r\n\r\n\treturn (\r\n\t\t<Box display=\"flex\" gap={2} alignItems={'center'} className='page-navigator-container'>\r\n\t\t\t<Box\r\n\t\t\t\tdisplay={'flex'}\r\n\t\t\t\tclassName='page-navigator'\r\n\t\t\t\tsx={{ display: 'flex', opacity: isSaving ? 0.5 : 1 }}>\r\n\t\t\t\t<IconButton\r\n\t\t\t\t\t// size='small'\r\n\t\t\t\t\tonClick={handleOpenAllPagesMenu}\r\n\t\t\t\t\tdisabled={isSaving}>\r\n\t\t\t\t\t<MenuIcon fontSize='small' />\r\n\t\t\t\t</IconButton>\r\n\t\t\t\t<StyledTabs\r\n\t\t\t\t\tvalue={activePage?._id}\r\n\t\t\t\t\tvariant='scrollable'\r\n\t\t\t\t\tonChange={handleChangePage}\r\n\t\t\t\t\taria-label='basic tabs example'>\r\n\t\t\t\t\t{pages?.map((page) => (\r\n\t\t\t\t\t\t<StyledTab\r\n\t\t\t\t\t\t\ticonPosition='end'\r\n\t\t\t\t\t\t\tdisableRipple\r\n\t\t\t\t\t\t\tkey={page}\r\n\t\t\t\t\t\t\ticon={\r\n\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\t\t\tedge='end'\r\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleOpenActionsMenu(e, page)}\r\n\t\t\t\t\t\t\t\t\tdisabled={isSaving}>\r\n\t\t\t\t\t\t\t\t\t<KeyboardArrowDown fontSize='small' color={activePage?._id === page?._id ? 'primary' : undefined}/>\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t<Tooltip\r\n\t\t\t\t\t\t\t\t\ttitle={`The '${page.name}' page has been ${page?.isShared ? shareTitle(page?.owner) : title}`}\r\n\t\t\t\t\t\t\t\t\tkey={page._id}\r\n\t\t\t\t\t\t\t\t\tplacement='top'\r\n\t\t\t\t\t\t\t\t\tarrow>\r\n\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap:1 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t{page?.isShared && <Share sx={{fontSize:'20px',color:'#4AC08C'}}/>}\r\n\t\t\t\t\t\t\t\t\t\t\t<span>{page.name}</span>\r\n\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={page?._id}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</StyledTabs>\r\n\r\n\t\t\t\t<Divider\r\n\t\t\t\t\torientation='vertical'\r\n\t\t\t\t\tvariant='middle'\r\n\t\t\t\t\tflexItem\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tml: 2,\r\n\t\t\t\t\t\tborderWidth: '1px'\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t\t<Box display=\"flex\" alignItems={'center'}>\r\n\t\t\t\t\t<AddPage\r\n\t\t\t\t\t\tpages={pages}\r\n\t\t\t\t\t\thandleAddPage={handleAddPage}\r\n\t\t\t\t\t\tsharedPages={sharedPages}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</Box>\r\n\r\n\t\t\t\t<PageAction\r\n\t\t\t\t\topen={isActionsMenuOpen}\r\n\t\t\t\t\tonClose={handleCloseActionsMenu}\r\n\t\t\t\t\tpage={page}\r\n\t\t\t\t\tsetPages={setPages}\r\n\t\t\t\t\tsetCurrentPage={setActivePage}\r\n\t\t\t\t\tpages={pages}\r\n\t\t\t\t\tresource={resource}\r\n\t\t\t\t\thandlePageDelete={handlePageDeleteFunction}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<Menu\r\n\t\t\t\t\topen={Boolean(isAllPagesMenuOpen)}\r\n\t\t\t\t\tanchorEl={isAllPagesMenuOpen}\r\n\t\t\t\t\tonClose={handleCloseAllPagesMenu}>\r\n\t\t\t\t\t{pages?.map((page) => (\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tselected={page._id === activePage?._id}\r\n\t\t\t\t\t\t\tkey={page._id}\r\n\t\t\t\t\t\t\tonClick={() => handleChangePageFromMenu(page)}>\r\n\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s4'>\r\n\t\t\t\t\t\t\t\t{page.name}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Menu>\r\n\t\t\t</Box>\r\n\t\t\t<Box display=\"flex\" alignItems={'center'}>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tsize='small'\r\n\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\tonClick={() => savePages()}\r\n\t\t\t\t\t// sx={{fontWeight:600, marginBottom:'2px',px:3}}\r\n\t\t\t\t\tendIcon={\r\n\t\t\t\t\t\tisSaving ? <CircularProgress size={15} color='inherit' /> : <Save fontSize='small'/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={!isChanged || isSaving}>\r\n\t\t\t\t\tSave\r\n\t\t\t\t</Button>\r\n\t\t\t</Box>\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default PageNavigator;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport { Box } from \"@mui/material\";\nimport Pagination from \"../pagination/pagination\";\nimport PageNavigator from \"../page-navigator/page-navigator\";\nimport \"./footer.scss\";\nimport { IPaginationModel } from \"../../@types/pagination-model\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IFooter {\n pages: any;\n setPages: any;\n currentPage: string | number;\n setCurrentPage: any;\n total: number;\n paginationModel: IPaginationModel;\n handlePaginationModel: (model: IPaginationModel) => void;\n sharedPages: any;\n resource: string;\n savePageConfiguration: () => void;\n handlePageDelete: (pages: any[]) => void;\n enablePages: boolean\n isPaginationDisplayed?: boolean\n isPageSaving?: boolean\n}\n\nconst Footer = React.memo(({\n pages,\n setPages,\n currentPage,\n setCurrentPage,\n total, // total number of pages in footer pagination\n paginationModel,\n handlePaginationModel,\n sharedPages,\n resource,\n savePageConfiguration,\n handlePageDelete,\n enablePages,\n isPaginationDisplayed = true,\n isPageSaving = false\n}: IFooter) => {\n const [isDrawerOpen, setIsDrawerOpen] = useState(\n window.localStorage.getItem('_is_drawer_open') === 'true'\n );\n\n useEffect(() => {\n const handleStorageChange = () => {\n setIsDrawerOpen(window.localStorage.getItem('_is_drawer_open') === 'true');\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n const interval = setInterval(handleStorageChange, 10); \n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n clearInterval(interval);\n };\n }, []);\n\n // useEffect(()=>{\n // handlePaginationModel({...paginationModel,pageNo:activePage?.pageNo})\n // //eslint-disable-next-line react-hooks/exhaustive-deps\n // },[activePage?.pageNo])\n\n return (\n <Box className={`${!isDrawerOpen?'footer--drawerContainer':'footer--Container'}`} sx={{justifyContent: enablePages? 'space-between': 'flex-end'}}>\n \n \n {Boolean(enablePages) && <PageNavigator\n pages={pages}\n setPages={setPages}\n currentPage={currentPage}\n setCurrentPage={setCurrentPage}\n resource={resource}\n sharedPages={sharedPages}\n handlePageDelete={handlePageDelete}\n />}\n <Box>\n {isPaginationDisplayed && (\n <Pagination\n paginationModel={paginationModel}\n handlePaginationModel={handlePaginationModel}\n totalPages={total}\n />\n )}\n </Box>\n </Box>\n );\n});\n\nexport { Footer };\nexport default Footer;\n","import { Switch, styled } from \"@mui/material\";\r\n\r\nconst Android12Switch = styled(Switch)(({ theme }) => ({\r\n padding: 8,\r\n '& .MuiSwitch-track': {\r\n borderRadius: 22 / 2,\r\n '&::before, &::after': {\r\n content: '\"\"',\r\n position: 'absolute',\r\n top: '50%',\r\n transform: 'translateY(-50%)',\r\n width: 16,\r\n height: 16,\r\n },\r\n '&::before': {\r\n backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 24 24\"><path fill=\"${encodeURIComponent(\r\n theme.palette.getContrastText(theme.palette.primary.main),\r\n )}\" d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\"/></svg>')`,\r\n left: 12,\r\n },\r\n '&::after': {\r\n backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 24 24\"><path fill=\"${encodeURIComponent(\r\n theme.palette.getContrastText(theme.palette.primary.main),\r\n )}\" d=\"M19,13H5V11H19V13Z\" /></svg>')`,\r\n right: 12,\r\n },\r\n },\r\n '& .MuiSwitch-thumb': {\r\n boxShadow: 'none',\r\n width: 16,\r\n height: 16,\r\n margin: 2,\r\n // color: theme.palette.theme.primary[800]\r\n },\r\n '& .Mui-checked': {\r\n color: `${theme.palette.theme.primary[800]} !important`,\r\n },\r\n '& .Mui-checked+.MuiSwitch-track': {\r\n backgroundColor: `${theme.palette.theme.primary[800]} !important`,\r\n },\r\n}));\r\n\r\nexport { Android12Switch };\r\nexport default Android12Switch;","import { InputAdornment } from \"@mui/material\";\nimport TextField from \"../text-field/text-field\";\nimport ColorLensIcon from '@mui/icons-material/ColorLens';\nimport _ from \"lodash\";\nimport React from \"react\";\n\nconst ColorPickerInput = ({value, onChange, label, ...props}) => {\n\n // Debounced function to update text\n const debouncedSetColor = (\n _.debounce((value) => {\n onChange(value)\n }, 500)\n );\n\n const handleColorChange = (e) => {\n debouncedSetColor(e.target.value);\n };\n\n return (\n <TextField\n label={label || ''}\n variant='outlined'\n type=\"color\"\n value={value}\n onChange={handleColorChange}\n size=\"small\"\n fullWidth\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <ColorLensIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n }}\n {...props}\n />\n );\n}\n \nexport { ColorPickerInput };\nexport default ColorPickerInput;","import Typography from \"../typography/typography\";\nimport { Box } from \"@mui/material\";\nimport \"./fallback.scss\";\n\ninterface FallbackProps {\n heading: string;\n subHeading: string;\n icon: React.ReactNode;\n children?: React.ReactNode;\n}\n\nconst Fallback = (props: FallbackProps) => {\n const { heading, subHeading, icon, children, ...rest } = props;\n return (\n <Box className=\"fallback\" {...rest}>\n {icon}\n <Typography\n type=\"h5\"\n weight=\"medium\"\n color=\"theme.secondary.1000\"\n className=\"fallback--Text\"\n >\n {heading}\n </Typography>\n <Typography\n type=\"s3\"\n weight=\"medium\"\n color=\"theme.secondary.800\"\n className=\"fallback--Text\"\n >\n {subHeading}\n </Typography>\n <div>{children}</div>\n </Box>\n );\n};\n\nexport { Fallback };\nexport default Fallback;\n","import React from \"react\";\nimport BreadCrumb from \"../bread-crumb/bread-crumb\";\nimport \"./form-header.scss\";\n\ninterface BreadCrumbSlot {\n link: string;\n label: string | JSX.Element;\n linkState?: any;\n}\n\ninterface FormHeaderProps {\n breadCrumbPath: BreadCrumbSlot[];\n children?: React.ReactNode;\n containerProps?:any;\n}\nconst FormHeader = (props: FormHeaderProps) => {\n const { breadCrumbPath, children, containerProps } = props;\n return (\n <div className=\"formHeader--Header\" {...containerProps}>\n <BreadCrumb path={breadCrumbPath} />\n <div>{children}</div>\n </div>\n );\n};\n\nexport { FormHeader };\nexport default FormHeader;\n","const Loader = () => {\n return (\n <div className=\"loader loader--style1\" title=\"0\">\n <svg\n version=\"1.1\"\n id=\"loader-1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n x=\"0px\"\n y=\"0px\"\n width=\"80px\"\n height=\"80px\"\n viewBox=\"0 0 40 40\"\n enableBackground=\"new 0 0 40 40\"\n >\n <path\n opacity=\"0.2\"\n fill=\"#333\"\n d=\"M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946\n s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634\n c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z\"\n />\n <path\n fill=\"#333\"\n d=\"M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0\n C22.32,8.481,24.301,9.057,26.013,10.047z\"\n >\n <animateTransform\n attributeType=\"xml\"\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 20 20\"\n to=\"360 20 20\"\n dur=\"0.9s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </svg>\n </div>\n );\n};\n\nexport { Loader };\nexport default Loader;\n","import { Link } from \"react-router-dom\";\nimport CardMedia from \"@mui/material/CardMedia\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"../typography/typography\";\nimport \"./module-button.scss\"; // Import the external CSS file\n\nexport interface IModuleTile {\n module: {\n bg: string;\n icon: string;\n label: string;\n link: string;\n };\n}\n\nexport const ModuleTile = (props: IModuleTile) => {\n const bgClass = props.module.bg === \"transparent\" ? \"transparent\" : \"\";\n\n return (\n <Link to={props.module.link}>\n <Box className=\"module-tile-container\">\n <Box\n className={`module-box ${bgClass}`}\n style={{ background: props.module.bg }}\n >\n <CardMedia\n component=\"img\"\n image={props.module.icon}\n alt={`${props.module.label} logo`}\n />\n </Box>\n <Typography type=\"s3\" className=\"module-label\">\n {props.module.label}\n </Typography>\n </Box>\n </Link>\n );\n}\n\nexport default ModuleTile;"],"names":["Accordion","memo","props","title","children","accordionProps","accordianProps","jsxs","StyledAccordion","jsx","AccordionSummary","expandIcon","ExpandMoreIcon","id","AccordionDetails","styled","MUIAccordion","theme","palette","color","_a","secondary","fontSize","boxShadow","padding","minHeight","borderBottomWidth","borderBottomStyle","borderBottomColor","_b","margin","ViewModal","data","setData","setActive","disabledViews","openModal","setOpenModal","useState","value","setValue","disable","setDisable","useTheme","isMdUp","useMediaQuery","breakpoints","up","TabData","label","icon","logo","TableIcon","desc","image","src","table","GridIcon","grid","className","Button","variant","startIcon","AddIcon","sx","pr","onClick","Boolean","find","item","toLowerCase","Modal","open","onClose","DialogTitle","Typography","type","weight","IconButton","CloseIcon","Tabs","orientation","onChange","_","newValue","map","Tab","iconPosition","disabled","includes","hidden","viewTypes","KANBAN","CALENDAR","Select","placeholder","size","defaultValue","MenuItem","DialogActions","backgroundColor","selectedTabData","some","position","length","HeaderCard","active","key","rest","TABLE","GRID","GANTT","GanttIcon","CalenderIcon","KanbanIcon","CHART","ChartIcon","ToggleWrapper","Box","primary","display","Toggle","CombinatorSelect","handleOnChange","options","showDropdown","path","Fragment","e","target","name","RemoveAction","isRtl","useLanguage","btnStyles","marginRight","handleOnClick","disableRipple","Trash","FieldSelect","t","useTranslation","filteredOptions","setFilteredOptions","useEffect","filter","o","trim","width","fullWidth","renderValue","formatText","_c","opttion","replace","replaceAll","SearchBar","handleSearch","searchText","filteredData","option","handleSearchEvent","op","StyledAddButton","AddFilterButton","Add","AddGroupButton","StyledDatePicker","Date","borderColor","borderWidth","borderStyle","_d","_e","error","background","_f","_g","_h","opacity","marginLeft","_i","_j","fontWeight","DatePicker","helperText","dataName","dataPosition","disableFutureDates","required","disablePastDates","textFieldProps","format","LocalizationProvider","dateAdapter","AdapterDayjs","mb","disableFuture","disablePast","slotProps","textField","desktopPaper","bgcolor","slots","openPickerIcon","dayjs","StyledCheckbox","MUICheckbox","borderRadius","Checkbox","RecgtangleIcon","checkedIcon","CheckBoxIcon","ChipOrPlaceholder","onDelete","chipProps","selectedLabel","Chip","onMouseDown","event","stopPropagation","Radio","MUIRadio","BlankCircle","FilledCircle","BorderedOption","shouldForwardProp","prop","bordered","alignItems","border","divider","shape","spacing","height","alignContent","action","hover","DynamicRadioButton","formControl","fieldArrayName","titlePosition","Controller","control","render","field","fieldState","RadioGroup","row","gap","isSelected","FormControlLabel","checked","message","PARTIES_FORM_ARRAY_NAME","PARTIES_FIELDS","partyType","addressPayload","parties_id","address_type","contact_name","street_1","street_2","city","zip_code","state","country","email","mobile","phone","street_3","summary","default_shipping_address","default_billing_address","country_code","contactPayload","contact_no","addressColumns","header","accessorKey","visible","editVariant","editProperties","field_name","validations","msg_en","msg_ar","editSelectOptions","enableEditing","valueKey","apiType","customeFilter","values","country_name","contactColumns","addressOmitKeys","contactOmitKeys","processPartiesPayload","payload","addresses","contacts","address","omit","contact","getEffectiveUser","contextUser","stored","window","localStorage","getItem","auth","storageUserKeyName","JSON","parse","setCompany","user","company_id","company_data","configMapper","company","callBack","generateMenuItems","multiple","with_checkboxes","disabledIds","handleChange","hasParent","itemDisabled","items","push","p","m","selectedValues","Array","isArray","isAllOptionsSelected","parentValue","childOptions","childValues","child","valueArray","every","childValue","isSomeOptionsSelected","forEach","isGroup","indeterminate","updatedValues","Set","handleParentChange","opt","pl","String","SelectedItems","filteredDisplayTitle","selectedItem","mt","slice","join","MoreIcon","Loading","fontStyle","DynamicSearchSelect","React","watchedValue","useWatch","formContext","useFormContext","contextSetValue","mfeFallbackSetValue","useCallback","fieldPath","ctrl","parts","split","obj","_formValues","i","_subjects","next","authUser","useAuth","useMemo","selectRef","useRef","setOptions","selectedValue","setSelectedValue","selectedOptions","setSelectedOptions","loading","setLoading","setOpen","isAlreadyLoaded","setIsAlreadyLoaded","prevFilter","setPrevFilter","initialLoading","setInitialLoading","searchQuery","setSearchQuery","searchInitiate","setSearchInitiate","addConfig","setAddConfig","isModalOpen","setIsModalOpen","isAddLoading","setIsAddLoading","pagination","setPagination","page","hasMore","isLoadingMore","total","handleOptions","isInternal","getSelectedData","attributes","filterKey","refresh","sortOrder","addType","showCancelButton","customFetchApi","isMergeOptions","showItemTooltip","limit","isInternalOptions","cf","stringify","defaultOptions","setDefaultOptions","config","getDefaultConfig","is_multiselect","useDefaultConfig","searchOptionsLocally","searchTerm","currentOptions","lowercasedSearchTerm","reduce","acc","searchedOptions","isValidElement","searchLabel","sortBySelectedValues","getUniqueOptions","Map","arrayToSort","Number","sortBy","index","indexOf","Infinity","apiOptions","localOptions","getSelectedDataOptions","fetchOptions","async","flt","append","prev","paginationResult","response","search","filters","skip","select","order","fetchApi","apiKey","newOptions","updateOptions","handleSelectedValue","totalCount","console","handleScroll","scrollTop","scrollHeight","clientHeight","currentTarget","nextPage","uniqueOptions","filterValue","isInOptions","fetchIdOptions","initialFetch","debouncedSearch","debounce","resetValue","handleClose","handleModalOpen","handleModalSave","api","result","log","cancel","selectedData","removeUndefined","selectOptions","dynamicSelectAdd","Tooltip","placement","arrow","popper","modifiers","offset","tooltip","maxWidth","ref","onOpen","setTimeout","searchInput","document","querySelector","focus","searchValue","formType","MenuProps","PaperProps","onScroll","style","maxHeight","selected","is_loading","onChipRemove","selectedOption","searchPlaceholder","text","onBlur","input","OutlinedInput","endAdornment","InputAdornment","CircularProgress","mr","edge","ml","Close","enable_footer","bottom","zIndex","Divider","flexItem","onFooterClick","justifyContent","component","createElement","isOpen","setIsOpen","isLoading","onSave","modalProps","modalComponentProps","propTypes","PropTypes","string","isRequired","arrayOf","oneOfType","node","any","object","bool","number","typeOfField","func","footer_action","array","StyledInput","ReactPhoneInput","direction","textAlign","left","right","borderBottom","images","backgroundRepeat","backgroundPosition","paddingLeft","paddingRight","_k","HelperTextWrapper","marginTop","PhoneInput","default_value","setCountryCodeField","isInlineEditing","dropdown","positionDropdown","rect","getBoundingClientRect","top","addEventListener","body","contains","appendChild","fixPhoneDropdown","dialCode","dropdownContainer","specialLabel","enableSearch","isValid","searchNotFound","inputProps","DynamicPhone","val","register","DateTimePicker","UploadMedia","max_size","VisuallyHiddenInput","clip","clipPath","overflow","whiteSpace","StyledButton","marginBottom","allowedImageTypes","allowedFileTypes","getFileName","file","File","f","uploadImage","uploadDocument","accept","filterredFiles","files","isValidFileType","enqueueSnackbar","Document","noWrap","getSelectedFiles","InlineEditFields","column","col","errors","validationSchema","setValidationErrors","onChangeRowField","inputValue","setInputValue","isInitialSet","setIsInitialSet","customFilter","editCols","getAllCells","columnDef","fieldProperties","fieldDisbled","_valuesCache","handleCustomFilter","current","is_multiple","get","original","v","validateAt","abortEarly","fe","err","yup","ValidationError","inner","em","validate","editFields","Object","keys","dValues","cell","vl","handleMinDate","TextField","autoFocus","flexDirection","SearchableSelect","labelKey","bindingKey","dateFormat","minDate","min_date","maxDate","defaultChecked","TableWrapper","disableMaxHeight","borderLeft","lineHeight","MaterialTable","enablePagination","rows","columns","totalPages","paginationModel","columnOrder","updateData","handleColumnOrdering","enableColumnDragging","states","rowActionMenu","destructiveActionMenu","disableDefaultActionColumn","enableRowSelection","defaultActionColumnItems","enableBottomToolbar","SetSelectedRowId","isResetRow","onCreateRow","onEditRow","onDeleteRow","editDisplayMode","enableRowCreate","onSelectRow","enableColumnResizing","selectedRowIds","onColumnVisibility","onSortingChange","disabledDefaultActionColumnIcon","enableAddCustomField","enableRowDragging","handleColumnResizing","columnSizes","showPreview","handlePreview","formData","updatePageInfo","activePage","aPage","usePages","useDeepMemo","pageNo","setRow","tableColumns","setTableColumns","anchorEl","setAnchorEl","popUpShow","setPopupShow","rowAnchorEl","setRowAnchorEl","visibleColumns","hiddenColumns","selectedRow","setSelectedRow","validationErrors","setValidationSchema","isCreatingRow","setIsCreatingRow","isEditingRow","setIsEditingRow","isDeletingRow","setIsDeletingRow","rowToDelete","setRowToDelete","rowSelection","setRowSelection","isChecked","setIsChecked","sorting","setSorting","disableNextEdit","setDisableNextEdit","columnSizing","setColumnSizing","column_sizes","columnSizingInfo","setColumnSizingInfo","columnSizingStart","deltaOffset","deltaPercentage","isResizingColumn","startOffset","startSize","navigate","useNavigate","currentModule","location","pathname","redirectionPath","PathnameAccounting","CUSTOM_FORM","PathnameInventory","PathnameManufacturing","PathnamePurchase","PathnameCrm","PathnameUsers","PathnameRental","PathnameDocument","ADD_CUSTOM_FIELDS","validationReducer","validation","vld","typeError","min","max","test","when","relation","is","then","thenValidations","otherwise","otherWiseValidations","schema","clm","fieldValidations","nullable","transform","originalValue","matches","excludeEmptyString","getValidationType","generateValidationSchema","handleHeaderClick","formtValues","cells","c","checkRequired","selectedRows","Function","sortingArray","resetRowSelection","getTextWidth","ctx","getContext","measureText","useMaterialReactTable","defaultColumn","minSize","Math","Edit","callback","s","Header","maxSize","common","eyeIcon","alt","muiTableHeadCellProps","muiTableBodyCellProps","Cell","handlePreviewClick","arrowIcon","updatedProps","cloneElement","handleActionsClick","more","muiTableContainerProps","muiTablePaperProps","tableLayout","columnResizeMode","onEditingRowSave","setEditingRow","Error","onCreatingRowSave","setCreatingRow","onCreatingRowCancel","onEditingRowCancel","displayColumnDefOptions","onKeyUp","renderRowActions","enableExpanding","parentId","renderBottomToolbarCustomActions","onRowSelectionChange","enableColumnOrdering","createDisplayMode","enableTopToolbar","enableColumnActions","enableSorting","enableGrouping","enableStickyHeader","enableSortingRemoval","columnPinning","isSaving","showProgressBars","getRowId","muiTableBodyRowProps","editingRowId","getState","editingRow","creatingRow","isErrorRow","has_error","handleRowClick","rowId","cursor","onColumnOrderChange","colOrder","onColumnSizingChange","onColumnSizingInfoChange","renderEmptyRowsFallback","tableNoData","paginationDisplayMode","muiPaginationProps","count","showRowsPerPage","boundaryCount","muiEditTextFieldProps","InputProps","disableUnderline","muiCircularProgressProps","letterSpacing","muiTableBodyProps","muiTableHeadProps","muiSelectCheckboxProps","muiSelectAllCheckboxProps","muiBottomToolbarProps","layoutMode","icons","ArrowDownwardIcon","ArrowUpDown","SortIcon","SyncAltIcon","CancelIcon","SaveIcon","Save","getSelectedRowModel","selectedRowModels","selection","traverseRows","parentKey","rowKey","subRows","getRowModel","MaterialReactTable","Menu","ListItemIcon","ChevronLeftIcon","ListItemText","filteredColumns","updatedColumns","updatedFilteredOptions","handleAddColumn","addIcon","handleVisibleColumn","dotsIcon","ChevronRightIcon","handleAction","ConfirmPopUp","onConfirm","handleRowDelete","description","Loader","LoaderContainer","ModalLoader","defaultLocationState","CustomerVendorModal","handleModalClose","partyCreated","dispatch","useDispatch","locationRef","addressRows","setAddressRows","contactRows","setContactRows","isCreating","setIsCreating","formState","trigger","getValues","handleSubmit","resetField","reset","watch","getFieldState","useForm","defaultValues","status","parties","account_type","mode","resolver","yupResolver","Yup","PARTIES_FIELDS_TYPE","PARTIES_FIELDS_FIRST_NAME","optional","PARTIES_FIELDS_LAST_NAME","PARTIES_FIELDS_COMPANY_NAME","PARTIES_FIELDS_VAT_NUMBER","PARTIES_FIELDS_CRN","PARTIES_FIELDS_COMPANY","mixed","PARTIES_FIELDS_CURRENCY","PARTIES_FIELDS_RESPONSIBLE_PERSON","PARTIES_FIELDS_ADDRESS","notRequired","PARTIES_FIELDS_CONTACTS","PARTIES_FIELDS_RECEIVABLE_ACCOUNT","PARTIES_FIELDS_TAX_TEMPLATE","fieldToUpdate","useAccountingSetting","companyField","formMethods","isUpdateAccount","selectedType","responsiblePerson","mainContactNo","mainEmailIds","tableRows","phoneNumberCache","transformTableColumns","currencySymbol","translationFn","enableFooter","redirectionLink","redirectionLinkState","statusClasses","customizeValue","columnAccessorKey","pointerEvents","phoneKey","has","parsed","parsePhoneNumberFromString","set","nationalNumber","countryCodeKey","countryCallingCode","handleRowOperation","eData","setState","isAddress","editRow","processedValues","dropdowns","addressValues","validateAddressDefaults","state_name","country_data","state_data","country_id","state_id","ar","Promise","reject","u_data","splice","hasDefault","d","deleteRow","rowIndex","resolve","onChangeAddressTableField","r","fieldName","summaryFields","idx","EMAIL_REGEX","onSubmit","formValues","emailArray","email_ids","email_id","match","party","res","createParties","meta","requestStatus","closeModal","errorMessage","getErrorMessage","resetForm","addressData","a","contactData","companyId","entity_priority","company_currencies","currencies","firstContactRow","parsedCountryCode","firstEmail","updatedFirstRow","updatedRows","firstRow","hasAddressDetails","contactChanged","phoneChanged","basicDetailsSection","defaultExpanded","Grid","container","xs","sm","DynamicInput","accountingSection","addressSection","contactSection","overflowY","DialogContent","fDisplayTitle","DynamicSelect","removeUndefine","handleSetOptions","DynamicButton","DynamicCheckBox","titleColor","checkboxProps","stackProps","Stack","DynamicDate","max_date","is_future_dates_allowed","is_past_dates_allowed","views","displayName","DynamicCurrency","multiline","is_multiline","is_required","step","float_step","min_length","max_length","inputMode","pattern","is_negative","startAdornment","borderRight","borderBottomLeftRadius","borderTopLeftRadius","currencyType","numericValue","_formState","DynamicElementHOC","useDrag","drop","useDrop","draggedElement","draggedIndex","dropIndex","swap","elementSwap","activeClassName","activeIndex","defaultClassName","element","duplicate","handleDuplicate","removeElement","setElementHoc","elementPerRow","DynamicInputSelect","defaultOption","setSelectOption","handleOptionChange","boxSizing","IconComponent","KeyboardArrowDownOutlinedIcon","DynamicTagsInput","tags","tag","handleKeyDown","trimmedInputValue","preventDefault","newValueString","Autocomplete","clearIcon","freeSolo","renderTags","renderTagProps","renderInput","params","onKeyDown","InfoCard","info","DynamicInfo","DynamicMedia","field_type","DynamicSectionHOC","handleAccordion","remove_section","removeSection","isFormSwitcher","handleAddButton","$parse","$stringify","Primitive","primitive","ignore","noop","primitives","Primitives","known","reviver","$","lazy","revive","output","ke","y","k","tmp","call","add","replacer","space","firstRun","after","this","DynamicTable","onAddClick","is_button","disableTableAddButton","otherButtons","onTableCellChange","cs","currency_data","symbol","currencyFormat","number_format","symbolPosition","takeCurencyOrPercentage","isCellChangeAFunc","renderedCellValue","toFixedWithNumbers","formatLabel","formatDate","formatAmount","promotion_map_data","rcv","uRows","flexWrap","valueGet","StyledTimePicker","Time","TimePicker","is24hrFormat","DynamicTime","CustomisedSwitch","Switch","focusVisibleClassName","transitionDuration","grey","transition","transitions","create","duration","ToggleSwitch","labelPosition","typographyProps","DynamicToggleButton","toggleSwitchProps","TabBar","tabs","onEditTabTitle","activeValue","setActiveValue","handleTabChange","handleRemoveTab","containerProps","editableTabId","setEditableTabId","TabContext","TabList","_event","scrollButtons","overflowX","tab","tab_order","handleEditTabTitle","tabId","remove_tab","wrapped","onDoubleClick","handleTabDoubleClick","content","TabPanel","toString","StyledAlert","MUIAlert","tertiary6","svg","Alert","ChipContainer","main","disabledBackground","InlineInput","outline","flexGrow","minWidth","fontFamily","typography","InlineChip","ChipGenerator","maxChips","allowDuplicates","endIcon","externalError","onChipAdd","customChipProps","allowMultipleAdd","delimiters","dataType","separator","validationError","setValidationError","focused","setFocused","inputRef","containerRef","validateChip","trimmedValue","isValidEmail","isValidPhone","validator","stringToArray","str","arrayToString","arr","removeChip","chipToRemove","currentChips","newChips","processInput","inputStr","currentValue","valuesToAdd","delimiterPattern","regex","RegExp","parseMultipleValues","addedCount","errorMessages","addChips","handleContainerClick","hasError","FormControl","chip","outputValue","lastIndex","handleKeyPress","onFocus","handleBlur","onPaste","pastedText","clipboardData","getData","handlePaste","FormHelperText","LocationSearchSelect","selectedCompany","propControl","propSetValue","locationFieldName","filterField","dynamicSearchSelectProps","contextControl","contextWatch","contextGetFieldState","controlToUse","setValueToUse","getFieldStateToUse","filterFieldValue","isDirty","prevFilterFieldValue","isValueChanged","isEqual","locationFilter","useLocationFilter","warn","defaultProps","FormSwitcher","formSwitcherName","MemoizedField","sectionLabel","gridSize","is_fullwidth","custom_width","fieldKey","commonProps","iconSrc","sms","url","currency","dollar","geoLocation","relationLabel","renderField","handleSetCountryCodeField","field_properties","onSelectFooterClick","setCurrencyOptions","refreshOptions","title_position","table_columns","table_rows","handleTableAddClick","isButton","currencyOption","MemoizedFormSwitcher","section","switchForms","handleFieldCleanUp","form_switcher_label","forms","FormSection","members","displayAvtar","setDetailsData","visibleMembers","is_hidden","fieldsWithNames","sectionHeader","avatarDisplay","fieldProps","is_accordion","fieldIndex","teamValidationSchema","team","department_id","team_lead_id","member_ids","DEFAULT_VALUES","departmentValidationSchema","department","department_code","parent_department_id","department_head_id","cost_code","boolean","location_data","designationValidationSchema","designation","designation_code","reports_to","level","COSTING_METHODS","DEPRECIATION_METHODS","COMPUTATION_METHODS","inventory_fixed_asset_item","sku","category","base_unit","unit_of_measurement","stock_unit","purchase_unit","sales_unit","costing_method","depreciation_method","computation_method","default_tax_id","income_account_id","asset_account_id","cogs_account_id","fixed_asset_account_id","depreciation_account_id","declining_factor","brandValidationSchema","brand_data","categoryValidationSchema","category_data","category_name","source_type","SourceTypeAddModal","isSubmitting","setIsSubmitting","dividers","journalTypeValidationSchema","journal_type_data","is_payment","JournalTypeAddModal","rowGap","columnSpacing","pt","createApiThunk","getToken","addMapper","postV1WarehouseLocation","toast","setToast","Toast","anchorOrigin","horizontal","vertical","postV1Parties","postV1Departments","rootCompanyId","postV1DepartmentsTeams","selectedDepartmentId","selectedTeamLeadId","leadFilter","membersFilter","postV1Designation","fixedAssetItem","postV1InventoryFixedAssetItems","selectedCategoryData","setSelectedCategoryData","unitFields","methods","watchedName","watchedCategory","watchedUom","watchedDepreciationMethod","generatedSku","skuGenerator","handleCategorySelect","updateUomFields","uomData","FormProvider","brand","postV1Brand","postV1CategoryItems","sku_prefix","unique_items","attribute_data","industry","postV1PartiesIndustry","sourceType","postV1SourceTypes","journalType","postV1JournalTypes","journal_type","handleClear","ls","labelId","customStyle","CustomDropDownIcon","inputStyle","dynamicOptions","initailLoading","prevOptions","setSelectedData","debounceSearch","hasOptions","fValue","hasValue","condition","showGroupLabel","mergedOptions","flatMap","displayEmpty","CustomDropdownIcon","ValueEditor","fieldData","rule","inputType","isDisabled","operator","customFetch","tableName","tokenObj","getV1FilterFilterTable","getFilterTableFields","optionData","mappedValue","OperatorSelect","dValue","RemoveGroupAction","SaveFilterModal","oldName","setName","FolderSave","handleSave","initialQuery","combinator","rules","Filter","savedFilters","fetchSavedFilters","onSaveFilter","onSelectedFilter","applyFilter","fields","isUseFields","useLocation","token","storageTokenKeyName","schemaFields","setActivePage","generateFields","query","setQuery","filteredSavedFilters","setFilteredSavedFilters","selectedFilter","setSelectedFilter","openRenameFilter","setIsOpenRenameFilter","setErrorMessage","resources","routeToResourceMap","handleApplyFilter","clear","q","isDuplicatedFilters","generatedSQLQuery","generateQueryString","filterQueryString","handleFilterSwitch","sf","filteredFilters","isEmpty","uniques","isRuleInvalid","Dialog","savedFilter","filterId","deleteFilterRequest","deleteV1FilterId","catch","handleDeleteFilter","newName","putFilterRequest","module","fieldResource","pageResource","putV1FilterId","handleRenameFilter","handleSubmitRename","severity","px","QueryBuilderMaterial","QueryBuilder","onQueryChange","updatedRules","showCombinatorsBetweenRules","controlClassnames","controlElements","addRuleAction","addGroupAction","combinatorSelector","fieldSelector","operatorSelector","removeRuleAction","valueEditor","removeGroupAction","DropdownButton","isMenuThirdItemDisabled","isOnlyDropDownButton","onlyDropDownButtonProps","buttonGroupProps","dropdownButtonProps","toggleCallback","anchorRef","handleToggle","prevOpen","ButtonGroup","borderRightColor","borderTopRightRadius","borderBottomRightRadius","ArrowDownTwo","Popper","role","disablePortal","TransitionProps","Grow","transformOrigin","Paper","elevation","ClickAwayListener","onClickAway","MenuList","autoFocusItem","disableToggle","TitleDropdownButton","currentTitle","formatBytes","bytes","decimals","dm","floor","parseFloat","pow","toFixed","UploadExcel","importModuleName","handleSuccessImport","setFiles","isCollapsed","setIsCollapsed","isDialogMinimized","setIsDialogMinimized","isDragOver","setIsDragOver","dataResult","setDataResult","setIsLoading","getRootProps","getInputProps","isDragActive","useDropzone","onDropAccepted","newFiles","isPrivate","checkboxDisabled","uploadProgress","fileSize","fileName","fileType","onDragEnter","onDragLeave","noClick","noKeyboard","types","fileInputRef","handleBeforeUnload","returnValue","removeEventListener","renderFileIcon","Avatar","upload","documentPDF","docFile","removeFile","indexToRemove","prevFiles","documentUpload","setAttribute","removeAttribute","click","monitor","successful","failed","in","timeout","FormData","postImportSheet","Upload","RemoveIcon","prevIsCollapsed","KeyboardArrowUp","KeyboardArrowDown","empty","close","tick","folder","ActionBar","button","isDropdownMenuButton","itemListingDropdownOptions","isTitleMenu","titleMenus","isToggleButton","handleToggleButton","showSearch","showFilter","showView","customButtons","pageName","actionBtn","selectedIds","useAppDispatch","isToggledForItem","setIsToggledForItem","openFilterPopup","setOpenFilterPopup","openSaveFilter","setIsOpenSaveFilter","isUploadModalOpen","setIsUploadModalOpen","setSavedFilters","searchedText","setSearchedText","isLgUp","getV1FilterResource","resource","_id","moduleName","templateURL","getExcelExportTemplate","blob","link","URL","createObjectURL","href","download","removeChild","revokeObjectURL","exportExcel","Export","visible_columns","getPdfExportTemplate","exportPdf","getExcelTemplateGenerateTemplate","downloadTemplate","DocumentDownload","Import","getFilterChipLabels","opLabel","getOperatorLabel","rv","getFilterChip","rr","deleteIcon","Cancel","removeSignleFilter","clickable","ruleIndex","uRules","uFilters","searchAnchorEl","setSearchAnchorEl","ele","sort","b","debounceTime","isDrivePage","Search","FilterIcon","activeView","setSelectedSavedFilter","rIndex","rrIndex","FilterRemove","initialFilter","filterQuery","postFilterRequest","is_applied","postV1Filter","showCameraButton","BreadCrumb","Breadcrumbs","slot","Link","to","linkState","Pagination","handlePaginationModel","pageSizeOptions","setIsChanged","borderTop","newModel","parseInt","ChevronRightICon","mx","AddPageModal","pages","setError","pageNames","newPage","SharedPageView","pageValue","viewStyle","renderViewName","sharedPage","kanbanView","calendarView","tableView","ganttView","gridView","centered","other","a11yProps","SharedPageModal","sharedPages","setSharedPages","setSharedPage","PageDescription","viewsMessage","filtersMessage","details","_l","prevPages","isPinToDashboard","handleSharedView","labelPlacement","owner","AddPage","handleAddPage","isAddMenuOpen","setIsAddMenuOpen","isAddPageModalOpen","setIsAddPageModalOpen","isSharedPageModalOpen","setIsSharedPageModalOpen","handleAddMenuClose","AddCircleOutlineRoundedIcon","KeyboardArrowRightIcon","SharePopUp","roles","toggleSwitch","isPeopleAccessVisible","share","useAppSelector","store","isPublic","setIsPublic","selectedUsers","roleValue","setRoleValue","availableRole","setAvailableRole","userDropdownData","setUserDropdownData","isRoleVisible","departments","users","setSelectedUsers","selRole","userRole","role_id","is_role","resetOptions","prevData","getAllUserAndDepartmentDropdown","prevSettings","handleChage","List","ListItem","ListItemAvatar","changeRole","handleRoleChange","uIds","sOptions","u","sharedData","is_private","userRoles","PageAction","setCurrentPage","setPages","handlePageDelete","isEditPageModalOpen","setIsEditPageModalOpen","isShareModalOpen","setIsShareModalOpen","isConfirmOpen","setIsConfirmOpen","deletePageNo","setDeletePageNo","defaultSharedData","setDefaultSharedData","pageSharedData","setPageSharedData","pinToDashboardStore","useSelector","pinToDashboardData","setPinToDashboardData","dashboard","pinToDashboardList","appDispatch","setIsCreatePage","shareUsers","handleDeletePage","actions","isShared","labelExists","uniqueNumberId","generateRandomId","newLabel","counter","updatedPage","defaultData","findIndex","updatedData","updatedArray","elementToShift","moveRight","moveLeft","updatedPages","deletePage","updatedPinToDashboardData","deletePinToDashboardPage","pageData","sharePage","StyledTabs","StyledTab","MUITab","textTransform","PageNavigator","savePages","generatedColumns","isChanged","isCreatePage","addOrDeletePage","isActionsMenuOpen","setIsActionsMenuOpen","setPage","isAllPagesMenuOpen","setIsAllPagesMenuOpen","handleCloseAllPagesMenu","handleAddOrdeletePage","status_code","MenuIcon","pg","handleOpenActionsMenu","clickedPage","Share","nPage","defaultPageState","column_order","uniq","orderKeys","active_view","Footer","currentPage","savePageConfiguration","enablePages","isPaginationDisplayed","isPageSaving","isDrawerOpen","setIsDrawerOpen","handleStorageChange","interval","setInterval","clearInterval","Android12Switch","backgroundImage","encodeURIComponent","getContrastText","debouncedSetColor","ColorLensIcon","heading","subHeading","breadCrumbPath","handleFormSubmit","onTableAddClick","handleFormValues","getFormMethods","setFields","setActiveTabValue","activeTab","recieveTabDataLenght","recieveIsValidForm","activeTabs","containerStyles","convertNestedFieldSchemaObject","nestedFields","hasOwn","unregister","yupSchemaObject","nestedFielvalidations","nestedYupSchemaObj","dotNotationString","existingObject","currentLevel","convertToNestedObject","watchedValues","setSchema","tabsData","setTabsData","errorAlert","setErrorAlert","isTabFormValid","setTabFormValid","validateRequiredFields","setValidRequiredFields","getSectionData","sectionMembers","section_type","SECTION_TYPES","FORM_SWITCH_SECTION","form_switcher_name","switcher_forms","form","formMembers","member","section_form_id","selectedSectionForm","is_form_switcher_section","oldVal","country_code_field_name","newVal","is_country_code_separate","memberName","newData","createNestedObjectFromDot","fieldValue","hours","minutes","seconds","removeMatchingKeyValuePairs","obj1","obj2","forOwn","validateRequiredSwitchFormData","switchData","requiredFields","thenValidation","getMissingFields","watchedFields","validationReqFields","missingFields","handleMessage","origin","formBuilderDeConversion","dVals","wVals","nestedFormValues","is_section_field","finalFormValues","validatedFields","switchFormData","selectValue","isFormTabValid","version","xmlns","x","viewBox","enableBackground","fill","attributeType","attributeName","from","dur","repeatCount","bgClass","bg","CardMedia"],"mappings":"4oGAeMA,GAAYC,EAAAA,KAAMC,IACtB,MAAQC,MAAAA,EAAAA,SAAOC,EAAUC,eAAgBC,GAAmBJ,EAE5D,SACEK,KAACC,GAAA,IAAoBF,EACnBF,SAAA,CAAAK,EAAAA,IAACC,EAAAA,iBAAA,CACCC,iBAAaC,GAAA,IACb,gBAAc,iBACdC,GAAG,gBAEFT,SAAAD,UAEFW,EAAAA,kBAAkBV,kBAMnBI,GAAkBO,EAAAA,OAAOC,YAAPD,CAAqB,EAAGE,OAASC,uBAAiB,MAAA,CACxEC,MAAO,OAAAC,EAAAF,EAAQD,YAAR,EAAAG,EAAeC,UAAU,KAChCC,SAAU,YACVC,UAAW,OACX,4BAA6B,CAC3BC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kD,OAAOxhD,KACpBqxB,IAAK,GAAGr0B,EAAMwkD,OAAOzhD,iBAGzBxC,EAAAA,IAACkE,EAAAA,YAAWC,KAAK,KAAKjB,UAAU,eAC7BvD,SAAAF,EAAMwkD,OAAOzhD","x_google_ignoreList":[38]}
|
|
1
|
+
{"version":3,"file":"android-12-switch-CphTHRb8.js","sources":["../../src/components/accordion/accordion.tsx","../../src/components/view-modal/view-modal.tsx","../../src/components/header-card/header-card.tsx","../../src/components/toggle/toggle.tsx","../../src/components/filter/components/combinator-select.tsx","../../src/components/filter/components/remove-action.tsx","../../src/components/filter/components/field-select.tsx","../../src/components/filter/components/add-filter.tsx","../../src/components/filter/components/add-group.tsx","../../src/components/date-picker/date-picker.tsx","../../src/components/checkbox/checkbox.tsx","../../src/components/form-control/form-builder/form-builder-element/chip-or-placeholder.tsx","../../src/components/radio/radio.tsx","../../src/components/form-control/form-builder/form-builder-element/radio-button.tsx","../../src/components/parties-modal/utils/constant.ts","../../src/components/parties-modal/validator.tsx","../../src/hooks/useSetDefaultConfig.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-select.tsx","../../src/components/phone-input/phone-input.tsx","../../src/components/form-control/form-builder/form-builder-element/phone.tsx","../../src/components/date-time-picker/date-time-picker.tsx","../../src/components/upload-media/upload-media.tsx","../../src/components/material-table/components/inline-edit-fields.tsx","../../src/components/material-table/material-table.tsx","../../src/components/loaders/modal-loader.tsx","../../src/components/parties-modal/parties-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/select.tsx","../../src/components/form-control/form-builder/form-builder-element/button.tsx","../../src/components/form-control/form-builder/form-builder-element/checkbox.tsx","../../src/components/form-control/form-builder/form-builder-element/date.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-currency-input.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-element-hoc.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-input-select.tsx","../../src/components/form-control/form-builder/form-builder-element/dynamic-tags-input.tsx","../../src/components/info-card/info-card.tsx","../../src/components/form-control/form-builder/form-builder-element/info.tsx","../../src/components/form-control/form-builder/form-builder-element/media.tsx","../../src/components/form-control/form-builder/form-builder-element/section.tsx","../../node_modules/flatted/esm/index.js","../../src/components/form-control/form-builder/form-builder-element/table.tsx","../../src/components/time-picker/time-picker.tsx","../../src/components/form-control/form-builder/form-builder-element/time.tsx","../../src/components/toggle-switch/toggle-switch.tsx","../../src/components/form-control/form-builder/form-builder-element/toggle-button.tsx","../../src/components/tabs/tabs.tsx","../../src/components/alert/alert.tsx","../../src/components/chip-generator/chip-generator.tsx","../../src/components/location-select.tsx","../../src/components/form-control/form-parser/form-switcher.tsx","../../src/components/form-control/form-parser/form-section.tsx","../../src/components/form-control/form-parser/form-parser.tsx","../../src/components/team-add-modal.tsx","../../src/components/department-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/location-add-modal/location-add-modal.tsx","../../src/components/designation-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/fixed-asset-item-add-modal/fixed-asset-item-add-modal.tsx","../../src/components/brand-add-modal.tsx","../../src/components/category-add-modal.tsx","../../src/components/source-type-add-modal/source-type-add-modal.tsx","../../src/components/journal-type-add-modal.tsx","../../src/components/form-control/form-builder/form-builder-element/select-configuration.tsx","../../src/components/industry-add-modal.tsx","../../src/components/searchable-select.tsx","../../src/components/filter/components/value-editor.tsx","../../src/components/filter/components/operator-select.tsx","../../src/components/filter/components/delete-group.tsx","../../src/components/save-filter-modal/save-filter-modal.tsx","../../src/components/filter/filter.tsx","../../src/components/dropdown-button/dropdown-button.tsx","../../src/components/title-dropdown-button/title-dropdown-button.tsx","../../src/components/upload-excel/upload-excel.tsx","../../src/components/action-bar/action-bar.tsx","../../src/components/bread-crumb/bread-crumb.tsx","../../src/components/pagination/pagination.tsx","../../src/components/page-navigator/components/add-page-modal.tsx","../../src/components/page-navigator/components/shared-page-view.tsx","../../src/components/page-navigator/components/shared-page-modal.tsx","../../src/components/page-navigator/components/add-page.tsx","../../src/components/share-modal/share-modal.tsx","../../src/views/beforeAuth/components/share-modal-data/share-modal-data.ts","../../src/components/page-navigator/components/page-action.tsx","../../src/components/page-navigator/page-navigator.tsx","../../src/components/footer/footer.tsx","../../src/components/switches/android-12-switch.tsx","../../src/components/color-picker-input/color-picker-input.tsx","../../src/components/fallback/fallback.tsx","../../src/components/form-header/form-header.tsx","../../src/components/loader.tsx","../../src/components/module-button/module-button.tsx"],"sourcesContent":["import {\r\n AccordionDetails,\r\n Accordion as MUIAccordion,\r\n AccordionSummary,\r\n styled,\r\n AccordionProps as MUIAccordionProps,\r\n} from \"@mui/material\";\r\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\r\nimport { memo } from \"react\";\r\n\r\ninterface AccordionProps {\r\n title: string | JSX.Element;\r\n children?: React.ReactNode;\r\n accordionProps?: Partial<MUIAccordionProps>\r\n}\r\nconst Accordion = memo((props: AccordionProps) => {\r\n const { title, children, accordionProps: accordianProps } = props;\r\n\r\n return (\r\n <StyledAccordion {...accordianProps} >\r\n <AccordionSummary\r\n expandIcon={<ExpandMoreIcon />}\r\n aria-controls=\"panel1-content\"\r\n id=\"panel1-header\"\r\n >\r\n {title}\r\n </AccordionSummary>\r\n <AccordionDetails>{children}</AccordionDetails>\r\n </StyledAccordion>\r\n );\r\n});\r\n\r\n\r\nconst StyledAccordion = styled(MUIAccordion)(({ theme: { palette } }) => ({\r\n color: palette.theme?.secondary[1000],\r\n fontSize: \" 0.875rem\",\r\n boxShadow: \"none\",\r\n \".MuiAccordionSummary-root\": {\r\n padding: \"0.625rem 1.5rem\",\r\n minHeight: \"0px !important\",\r\n borderBottomWidth: \"2px\",\r\n borderBottomStyle: \"solid\",\r\n borderBottomColor: palette.theme?.secondary[200],\r\n },\r\n \".MuiAccordionSummary-content\": {\r\n margin: \"0\",\r\n \"&.Mui-expanded\": {\r\n margin: \"0rem\",\r\n },\r\n \"&.MuiButtonBase-root\": {\r\n margin: \"0\",\r\n \"&.MuiAccordionSummary-content.Mui-expanded\": {\r\n margin: \"0\",\r\n },\r\n },\r\n },\r\n \".MuiAccordionDetails-root\": {\r\n padding: \"0\",\r\n },\r\n}));\r\n\r\nexport { Accordion };\r\nexport default Accordion;\r\n","import Button from \"../button/button\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport \"./view-modal.scss\";\nimport { useState } from \"react\";\nimport Modal from \"../modal/modal\";\nimport {\n DialogActions,\n DialogTitle,\n IconButton,\n MenuItem,\n Tab,\n Tabs,\n useMediaQuery,\n useTheme,\n} from \"@mui/material\";\nimport Typography from \"../typography/typography\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport logo from \"../../assets/images\";\nimport Select from \"../select/select\";\nimport viewTypes from \"../../constants/action-bar\";\n\ninterface ActionData {\n label: string;\n position: number;\n}\ninterface ModalPropsType {\n setData: React.Dispatch<React.SetStateAction<ActionData[]>>;\n data: Array<object>;\n setActive: React.Dispatch<React.SetStateAction<string>>;\n disabledViews?: string[]\n}\n\nconst ViewModal = (props: ModalPropsType) => {\n const { data, setData, setActive, disabledViews = [] } = props;\n const [openModal, setOpenModal] = useState(false);\n const [value, setValue] = useState(\"Table\");\n const [disable, setDisable] = useState(false);\n const theme = useTheme();\n const isMdUp = useMediaQuery(theme.breakpoints.up('lg'));\n const handleTabChange = (_: React.SyntheticEvent, newValue: string) => {\n setValue(newValue);\n setDisable(\n Boolean(\n data.find(\n (item: any) => item.label.toLowerCase() === newValue.toLowerCase(),\n ),\n ),\n );\n };\n\n const TabData = [\n {\n label: \"Table\",\n icon: <logo.TableIcon />,\n desc: \"Easily manage, update, and organize your tasks with Table view.\",\n image: <img src={logo.table} />,\n },\n {\n label: \"Grid\",\n icon: <logo.GridIcon />,\n desc: \"Grid of cards, use for mood boards, index cards, and recipes\",\n image: <img src={logo.grid} />,\n },\n // {\n // label: \"Kanban\",\n // icon: <logo.KanbanIcon />,\n // desc: \"Build your perfect Board and easily drag-and-drop tasks between columns.\",\n // image: <img src={logo.kanban} />,\n // },\n // {\n // label: \"Calendar\",\n // icon: <logo.CalenderIcon />,\n // desc: \"Calendar view is your place for planning, scheduling, and resource management.\",\n // image: <img src={logo.calendar} />,\n // },\n // {\n // label: \"Gantt\",\n // icon: <logo.GanttIcon />,\n // desc: \"Plan time, manage resources, visualize dependencies and more with Gantt view.\",\n // image: <img src={logo.gantt} />,\n // },\n ];\n\n const handleSubmit = () => {\n const selectedTabData = TabData.find(\n (data) => data.label.toLowerCase() === value.toLowerCase(),\n );\n if (selectedTabData?.label) {\n if (\n !data.some(\n (item: any) => item.label.toLowerCase() === value.toLowerCase(),\n )\n ) {\n setData([\n ...(data as ActionData[]),\n { label: selectedTabData.label, position: data.length },\n ]);\n\n setActive(selectedTabData?.label);\n setOpenModal(false);\n }\n }\n };\n\n return (\n <div className=\"view-modal\">\n <div className=\"view-modal--Header\">\n |\n <Button\n variant=\"text\"\n startIcon={<AddIcon />}\n sx={isMdUp ? {} : { pr:0 }}\n onClick={() => {\n setOpenModal(true);\n setDisable(\n Boolean(\n data.find(\n (item: any) =>\n item.label.toLowerCase() === value.toLowerCase(),\n ),\n ),\n );\n }}\n >\n {isMdUp ? 'View' : ''}\n </Button>\n </div>\n <Modal\n open={openModal}\n onClose={() => setOpenModal(false)}\n className=\"view-modal\"\n >\n <DialogTitle className=\"view-modal--Head\">\n <Typography type=\"s3\" weight=\"medium\" color=\"#000\">\n Add View\n </Typography>\n <IconButton onClick={() => setOpenModal(false)}>\n <CloseIcon fontSize=\"small\"/>\n </IconButton>\n </DialogTitle>\n\n <div className=\"view-modal--TabsContent\">\n <Tabs\n orientation=\"vertical\"\n value={value}\n onChange={handleTabChange}\n className=\"view-modal--Tab\"\n >\n {TabData &&\n TabData?.map((data) => (\n <Tab\n key={data.label}\n label={`${data?.label} View`}\n iconPosition=\"start\"\n icon={data?.icon}\n value={data.label}\n className=\"view-modal--Tabs\"\n disabled={Boolean(disabledViews?.includes(data.label))}\n />\n ))}\n </Tabs>\n {TabData.map((data) => (\n <div\n key={data.label}\n hidden={value !== data.label}\n className=\"view-modal--TabData\"\n >\n {data.image}\n <div className=\"view-modal--Desc\">\n <Typography type=\"s1\" color={\"theme.secondary.1000\"}>\n {data?.label} Views\n </Typography>\n <Typography type=\"s4\" color={\"theme.secondary.800\"}>\n {data.desc}\n </Typography>\n {(data?.label === viewTypes.KANBAN ||\n data?.label === viewTypes.CALENDAR) && (\n <div className=\"view-modal--BoardContainer\">\n <Typography type=\"s4\" color=\"theme.secondary.900\">\n Group Board by\n </Typography>\n <Select\n placeholder=\"Status\"\n size={\"small\"}\n defaultValue={1}\n className=\"view-modal--Select\"\n variant=\"outlined\"\n >\n <MenuItem value={1}>option 1</MenuItem>\n <MenuItem value={2}>option 2</MenuItem>\n </Select>\n </div>\n )}\n </div>\n </div>\n ))}\n </div>\n <DialogActions\n className=\"view-modal--Actions\"\n sx={{ backgroundColor: \"theme.secondary.200\" }}\n >\n <Button variant=\"text\" onClick={() => setOpenModal(false)}>\n Cancel\n </Button>\n <Button variant=\"contained\" onClick={handleSubmit} disabled={disable}>\n Add {value} View\n </Button>\n </DialogActions>\n </Modal>\n </div>\n );\n};\n\nexport { ViewModal };\nexport default ViewModal;\n","import Typography from \"../typography/typography\";\nimport \"./header-card.scss\";\nimport logo from \"../../assets/images\";\nimport viewTypes from \"../../constants/action-bar\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\ninterface HeaderCard {\n title: string;\n active: string;\n onClick: () => void;\n key: number;\n}\n\nconst HeaderCard = (props: HeaderCard) => {\n const { title, active, onClick, key, ...rest } = props;\n const theme = useTheme();\n const isMdUp = useMediaQuery(theme.breakpoints.up('lg'));\n\n return (\n <div\n key={key}\n className={\n active && title.includes(active)\n ? \"header-card header-card--Active\"\n : \"header-card\"\n }\n onClick={onClick}\n {...rest}\n >\n {title && title === viewTypes.TABLE ? (\n <logo.TableIcon />\n ) : title === viewTypes.GRID ? (\n <logo.GridIcon />\n ) : title === viewTypes.GANTT ? (\n <logo.GanttIcon />\n ) : title === viewTypes.CALENDAR ? (\n <logo.CalenderIcon />\n ) : title === viewTypes.KANBAN ? (\n <logo.KanbanIcon />\n ) : title === viewTypes.CHART ? (\n <logo.ChartIcon />\n ) : (\n \"\"\n )}\n {isMdUp && \n <Typography type=\"s3\" color=\"inherit\">\n {title} View\n </Typography>\n }\n </div>\n );\n};\n\nexport { HeaderCard };\nexport default HeaderCard;\n","import { Box } from \"@mui/material\";\r\nimport \"./toggle.scss\";\r\nimport { styled } from '@mui/material/styles';\r\n\r\nconst ToggleWrapper = styled(Box)(({ theme: { palette } }) => ({\r\n \"& input:checked + .slider\": {\r\n backgroundColor: palette.theme.primary[700],\r\n },\r\n \"& .slider\": {\r\n backgroundColor: palette.theme.secondary[200],\r\n \":hover\": {\r\n backgroundColor: palette.theme.secondary[300],\r\n },\r\n },\r\n \"& input\": {\r\n display: \"none\",\r\n },\r\n}));\r\n\r\ninterface IToggle {\r\n checked: boolean;\r\n onChange: () => void;\r\n}\r\n\r\nconst Toggle = (props: IToggle) => {\r\n return (\r\n <ToggleWrapper>\r\n <label className=\"switch\">\r\n <input type=\"checkbox\" {...props} />\r\n <span className=\"slider round\"></span>\r\n </label>\r\n </ToggleWrapper>\r\n );\r\n};\r\n\r\nexport { Toggle };\r\nexport default Toggle;\r\n","import { MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\n\nconst CombinatorSelect = (props: any) => {\n const { handleOnChange, value, options, ...rest } = props;\n\n const showDropdown = props.path?.[0] === 1 || props.path?.[1] === 1;\n\n return (\n <>\n {!showDropdown ? (\n <Typography\n type=\"s4\"\n color=\"theme.secondary.1000\"\n className=\"combinator-value\"\n >\n {value}\n </Typography>\n ) : (\n <Select\n value={value}\n onChange={(e: any) => handleOnChange(e.target.value)}\n {...rest}\n className=\"combinator-list\"\n >\n {options?.map(({ name, label }: { name: string; label: string }) => (\n <MenuItem key={name} value={name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {label}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n )}\n </>\n );\n};\n\nexport { CombinatorSelect };\nexport default CombinatorSelect;\n","import { Box, IconButton } from \"@mui/material\";\nimport { ActionProps } from \"react-querybuilder\";\nimport { useLanguage } from \"../../../hooks/useLangauge\";\nimport { Trash } from \"../../icons\";\n\nconst RemoveAction = (props: ActionProps) => {\n const { isRtl } = useLanguage();\n const btnStyles = {\n ...(isRtl ? { marginRight:-1.5 } : {}),\n }\n const iconStyles = {\n color: 'theme.grey.600',\n '&:hover': {\n color: 'theme.error.600'\n }\n }\n return (\n <Box>\n <IconButton sx={btnStyles} size={\"small\"} onClick={props.handleOnClick} disableRipple>\n <Trash sx={{ fontSize: '1.35rem', ...iconStyles }} />\n </IconButton>\n </Box>\n );\n};\n\nexport { RemoveAction };\nexport default RemoveAction;\n","import { useEffect, useState } from \"react\";\nimport { Box, MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\nimport { FieldSelectorProps } from \"react-querybuilder\";\nimport SearchBar from \"../../search-bar/search-bar\";\nimport \"../filter.scss\";\nimport formatText from \"../../../utils/format-text\";\nimport { useTranslation } from \"react-i18next\";\n\nconst FieldSelect = (props: FieldSelectorProps) => {\n\n const { t } = useTranslation();\n\n const { handleOnChange, value, options, ...rest } = props;\n\n const [filteredOptions, setFilteredOptions] = useState<any[]>();\n\n const handleSearchEvent = (searchText: string) => {\n const ops = options?.filter(o => Boolean(o.label?.trim())) || []\n const filteredData = ops.filter((option: any) =>\n option.name.toLowerCase().includes(searchText.toLowerCase()),\n );\n setFilteredOptions(filteredData);\n };\n\n useEffect(() => {\n setFilteredOptions(options?.filter(o => Boolean(o.label?.trim())) || [])\n // eslint-disable-next-line react-hooks/exhaustive-deps\n },[options?.length])\n\n\n return (\n <Box width=\"100%\">\n <Select\n fullWidth\n value={value}\n onChange={(e: any) => handleOnChange(e.target.value)}\n {...rest}\n className=\"select-drps\"\n variant=\"outlined\"\n renderValue={(value: any) => formatText(t(filteredOptions?.find((opttion: any)=>opttion.name === value)?.label)?.replace(\"_id\", '')?.replaceAll(\"_\", \" \") || \"Select Default\")}\n onClose={() => setFilteredOptions(options?.filter(o => Boolean(o.label?.trim())) || [])}\n >\n <div className=\"searchbar-box-list new-searchbar\">\n <SearchBar\n placeholder={\"Search Attributes\"}\n handleSearch={(e) => handleSearchEvent(e)}\n />\n </div>\n {filteredOptions?.map((op: any) => (\n <MenuItem key={op.name} value={op.name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {formatText(t(op.label)?.replace(\"_id\", '')?.replaceAll(\"_\", \" \"))}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n </Box>\n );\n};\n\nexport { FieldSelect };\nexport default FieldSelect;\n","import { ActionProps } from \"react-querybuilder\";\r\nimport Button from \"../../button/button\";\r\nimport { styled } from '@mui/material/styles';\r\nimport { Add } from \"@mui/icons-material\";\r\n\r\nconst StyledAddButton = styled(Button)(({ theme: { palette } }) => ({\r\n \":hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n \"&.MuiButton-text\": {\r\n \":hover\": {\r\n color: palette.theme?.secondary[1000],\r\n },\r\n },\r\n}));\r\n\r\nconst AddFilterButton = (props: ActionProps) => {\r\n const { handleOnClick, ...rest } = props;\r\n return (\r\n <StyledAddButton\r\n onClick={handleOnClick}\r\n {...rest}\r\n className=\"add-filter\"\r\n variant=\"text\"\r\n startIcon={<Add/>}\r\n >\r\n Add Filter\r\n </StyledAddButton>\r\n );\r\n};\r\n\r\nexport { AddFilterButton };\r\nexport default AddFilterButton;\r\n","import { styled } from '@mui/material/styles';\r\nimport Button from \"../../button/button\";\r\nimport { ActionProps } from \"react-querybuilder\";\r\nimport { Add } from \"@mui/icons-material\";\r\n\r\nconst StyledAddButton = styled(Button)(({ theme: { palette } }) => ({\r\n \":hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n \"&.MuiButton-text\": {\r\n \":hover\": {\r\n color: palette.theme?.secondary[1000],\r\n },\r\n },\r\n}));\r\n\r\nconst AddGroupButton = (props: ActionProps) => {\r\n const { handleOnClick, ...rest } = props;\r\n return (\r\n <StyledAddButton\r\n onClick={handleOnClick}\r\n {...rest}\r\n className=\"add-group\"\r\n variant=\"text\"\r\n startIcon={<Add/>}\r\n >\r\n Add Group\r\n </StyledAddButton>\r\n );\r\n};\r\n\r\nexport { AddGroupButton };\r\nexport default AddGroupButton;\r\n","import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\r\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\r\nimport { DatePicker as Date } from '@mui/x-date-pickers/DatePicker';\r\nimport Typography from '../typography/typography';\r\nimport { styled } from '@mui/material/styles';\r\nimport logo from '../../assets/images';\r\nimport './date-picker.scss';\r\nimport dayjs from 'dayjs';\r\nimport { memo } from 'react';\r\n\r\nexport interface DatePickerProps {\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\terror?: boolean;\r\n\tname?: string;\r\n\tvalue?: string | number | Date;\r\n\thelperText?: string;\r\n\tdataPosition?: number;\r\n\tdataName?: string;\r\n\tdisableFutureDates?: boolean;\r\n\tplaceholder?: string;\r\n\trequired?: boolean;\r\n\tdisablePastDates?: boolean;\r\n\tdefaultValue?: string | number | Date | undefined;\r\n\ttextFieldProps?: any;\r\n\tformat?: string;\r\n\r\n}\r\n\r\nconst StyledDatePicker = styled(Date)(({ theme: { palette } }) => ({\r\n\t'& .MuiOutlinedInput-root': {\r\n\t\tpadding: '0',\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'& fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[400]\r\n\t\t},\r\n\t\t'&:hover fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[500]\r\n\t\t},\r\n\t\t'&.Mui-focused fieldset': {\r\n\t\t\tborderWidth: '0.0625rem',\r\n\t\t\tborderStyle: 'solid',\r\n\t\t\tborderColor: palette.theme?.primary[700]\r\n\t\t},\r\n\t\t'&.Mui-error fieldset': {\r\n\t\t\tborderColor: palette.theme?.error[600]\r\n\t\t},\r\n\t\t'&.Mui-disabled': {\r\n\t\t\tbackground: palette.theme?.secondary[200],\r\n\t\t\tcolor: palette.theme?.secondary[800]\r\n\t\t},\r\n\t\t'& .MuiInputBase-input::placeholder': {\r\n\t\t\tcolor: palette.theme?.secondary[800],\r\n\t\t\topacity: 1\r\n\t\t}\r\n\t},\r\n\t'& .MuiFormHelperText-root': {\r\n\t\tmarginLeft: 0,\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'&.Mui-error': {\r\n\t\t\tcolor: palette.theme?.error[600]\r\n\t\t}\r\n\t},\r\n\t'& .MuiIconButton-root': {\r\n\t\tmarginRight: 0\r\n\t},\r\n\t'& .MuiPickersCalendarHeader-labelContainer': {\r\n\t\tfontWeight: 600\r\n\t}\r\n}));\r\n\r\nconst DatePicker = memo((props: DatePickerProps) => {\r\n\tconst {\r\n\t\tlabel,\r\n\t\tdisabled,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tdataName,\r\n\t\tdataPosition,\r\n\t\tdisableFutureDates = false,\r\n\t\tplaceholder,\r\n\t\trequired = false,\r\n\t\tdisablePastDates = false,\r\n\t\tdefaultValue,\r\n\t\ttextFieldProps,\r\n\t\tformat,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<LocalizationProvider dateAdapter={AdapterDayjs}>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}>\r\n\t\t\t\t\t{label} {required && <span className='requiredStar'>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n\t\t\t<StyledDatePicker\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tdisableFuture={disableFutureDates}\r\n\t\t\t\tdisablePast={disablePastDates}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\thelperText: helperText,\r\n\t\t\t\t\t\terror: error,\r\n\t\t\t\t\t\tplaceholder: placeholder || 'MM/DD/YYYY',\r\n\t\t\t\t\t\t...textFieldProps\r\n\t\t\t\t\t\t// required: required,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tdesktopPaper: {\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\t'& .MuiButtonBase-root.Mui-selected': {\r\n\t\t\t\t\t\t\t\tcolor: 'theme.primary.900',\r\n\t\t\t\t\t\t\t\tbgcolor: '#B6E9D6 !important'\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t'& .MuiButtonBase-root:hover': {\r\n\t\t\t\t\t\t\t\tcolor: 'theme.primary.900',\r\n\t\t\t\t\t\t\t\tbgcolor: '#B6E9D6 !important'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tformat={format || 'DD-MM-YYYY'}\r\n\t\t\t\tslots={{ openPickerIcon: logo.CalenderIcon }}\r\n\t\t\t\t{...rest}\r\n\t\t\t\t\r\n\t\t\t\tdefaultValue={defaultValue ? dayjs(defaultValue) : undefined}\r\n\t\t\t\tclassName='datePicker'\r\n\t\t\t/>\r\n\t\t</LocalizationProvider>\r\n\t);\r\n});\r\n\r\nexport { DatePicker };\r\nexport default DatePicker;\r\n","import { CheckboxProps, Checkbox as MUICheckbox, styled } from '@mui/material';\r\nimport { CheckBoxIcon, RecgtangleIcon } from '../icons';\r\nimport { memo } from 'react';\r\n\r\nconst StyledCheckbox = styled(MUICheckbox)(({ theme: { palette } }) => ({\r\n\tpadding: '0rem',\r\n\tcolor: palette.theme?.secondary[300],\r\n\tborderRadius: '.625rem',\r\n\t'&.Mui-checked': {\r\n\t\tcolor: palette.theme?.primary[600],\r\n\t\t'&:hover': {\r\n\t\t\tcolor: palette.theme?.primary[500]\r\n\t\t}\r\n\t},\r\n\t'&.Mui-disabled': {\r\n\t\tcolor: palette.theme?.secondary[400]\r\n\t}\r\n}));\r\n\r\nconst Checkbox = memo((props: CheckboxProps) => {\r\n\treturn (\r\n\t\t<StyledCheckbox\r\n\t\t\ticon={<RecgtangleIcon fontSize={props?.size || 'small'} />}\r\n\t\t\tcheckedIcon={<CheckBoxIcon fontSize={props?.size || 'small'} />}\r\n\t\t\tdisableRipple\r\n\t\t\t{...props}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\nexport { Checkbox };\r\nexport default Checkbox;\r\n","import React from 'react';\n// import { Close } from '@mui/icons-material';\nimport { ChipProps } from '@mui/material';\nimport Chip from '../../../chip/chip';\nimport Typography from '../../../typography/typography';\n\ninterface ChipOrPlaceholderProps {\n\tdata: string[];\n\tplaceholder: string;\n\tonDelete?: () => void;\n\tchipProps?: Omit<ChipProps, 'label'>;\n\tdisabled?: boolean;\n\tselectedLabel?: string;\n}\n\nconst ChipOrPlaceholder: React.FC<ChipOrPlaceholderProps> = ({\n\tdata,\n\tplaceholder,\n\tonDelete,\n\tchipProps,\n\tdisabled,\n\tselectedLabel = 'Item'\n}) => (\n\t<>\n\t\t{data.length ? (\n\t\t\t<Chip\n\t\t\t\t// variant='outlined'\n\t\t\t\ttype='normal'\n\t\t\t\tlabel={\n\t\t\t\t\t<Typography color='theme.secondary.1000' type='s5'>\n\t\t\t\t\t\t{data.length} {selectedLabel} Selected\n\t\t\t\t\t</Typography>\n\t\t\t\t}\n\t\t\t\t// deleteIcon={<Close fontSize='large' />}\n\t\t\t\tonDelete={onDelete}\n\t\t\t\tonMouseDown={(event) => event.stopPropagation()}\n\t\t\t\tdisabled={Boolean(disabled)}\n\t\t\t\t{...chipProps}\n\t\t\t\tsx={{\n\t\t\t\t\t...chipProps?.sx,\n\t\t\t\t\t'& .MuiChip-deleteIcon': {\n\t\t\t\t\t\tcolor: 'theme.primary.800',\n\t\t\t\t\t\tfontSize: '1rem',\n\t\t\t\t\t\t'&:hover': {\n\t\t\t\t\t\t\tcolor: 'theme.primary.900'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : (\n\t\t\t<Typography color='inherit' type='s3'>\n\t\t\t\t{placeholder}\n\t\t\t</Typography>\n\t\t)}\n\t</>\n);\n\nexport default ChipOrPlaceholder;\n","import { Radio as MUIRadio, RadioProps } from '@mui/material';\nimport { BlankCircle, FilledCircle } from '../icons';\nimport { memo } from 'react';\n\nconst Radio = memo((props: RadioProps) => {\n\tconst { color, ...rest } = props;\n\n\treturn (\n\t\t<>\n\t\t\t<MUIRadio\n\t\t\t\tdisableRipple\n\t\t\t\tsx={{\n\t\t\t\t\t'&, &.Mui-checked': {\n\t\t\t\t\t\tcolor: color || 'theme.primary.700'\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ticon={<BlankCircle color='theme.secondary.300' fontSize='large'/>}\n\t\t\t\tcheckedIcon={<FilledCircle fontSize='large'/>}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</>\n\t);\n});\n\nexport { Radio };\nexport default Radio;\n","import React, { memo } from 'react';\r\nimport { Control, Controller } from 'react-hook-form';\r\nimport Typography from '../../../typography/typography';\r\nimport Radio from '../../../radio/radio';\r\nimport { FormControlLabel, RadioGroup, Box } from '@mui/material';\r\nimport { styled } from '@mui/material/styles';\r\n\r\ninterface IDynamicRadioButton {\r\n\tformControl: Control<any>;\r\n\tfieldArrayName: string;\r\n\tname: string;\r\n\tlabel: string;\r\n\ttitlePosition?: string;\r\n\tposition: number;\r\n\toptions: {\r\n\t\tlabel: string;\r\n\t\tvalue: string;\r\n\t}[];\r\n\tdisabled?: boolean;\r\n\ttypeOfField?: string;\r\n\tdisplay?: 'row' | 'column';\r\n\ttitle?: string;\r\n\tbordered?: boolean;\r\n\tdefaultValue?: string; // Optional defaultValue prop\r\n}\r\n\r\nconst BorderedOption = styled(Box, {\r\n\tshouldForwardProp: (prop) => prop !== 'bordered' && prop !== 'isSelected'\r\n})<{ bordered?: boolean; isSelected: boolean }>(({ theme, bordered }) => ({\r\n\tdisplay: 'flex',\r\n\talignItems: 'center',\r\n\tpadding: 0,\r\n\tmargin: 0,\r\n\t...(bordered && {\r\n\t\tborder: `1px solid ${theme.palette.divider}`,\r\n\t\tborderRadius: theme.shape.borderRadius,\r\n\t\tmargin: theme.spacing(0, 3, 0, 0),\r\n\t\tpadding: theme.spacing(0, 5, 0, 1),\r\n\t\theight: '36px',\r\n\t\talignContent: 'left',\r\n\t\t'&:hover': {\r\n\t\t\tbackgroundColor: theme.palette.action.hover\r\n\t\t}\r\n\t})\r\n}));\r\n\r\nexport const DynamicRadioButton: React.FC<IDynamicRadioButton> = memo(\r\n\t({\r\n\t\tformControl,\r\n\t\tfieldArrayName,\r\n\t\tname,\r\n\t\toptions,\r\n\t\tdisplay,\r\n\t\tlabel,\r\n\t\tposition,\r\n\t\tdisabled,\r\n\t\ttitle,\r\n\t\ttitlePosition,\r\n\t\tbordered = false,\r\n\t\tdefaultValue = ''\r\n\t}) => {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\tdata-position={position}\r\n\t\t\t\t\tsx={{ mb: 0.5 }}>\r\n\t\t\t\t\t{label}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<Controller\r\n\t\t\t\t\tcontrol={formControl}\r\n\t\t\t\t\tname={`${fieldArrayName}.${name}`}\r\n\t\t\t\t\t// disabled={disabled}\r\n\t\t\t\t\tdefaultValue={defaultValue} // Set defaultValue to 'item' if none provided\r\n\t\t\t\t\trender={({ field, fieldState: { error } }) => (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t<RadioGroup\r\n\t\t\t\t\t\t\t\tvalue={field.value ?? defaultValue} // Ensure 'item' if value is undefined\r\n\t\t\t\t\t\t\t\tonChange={(e) => field.onChange(e.target.value)}\r\n\t\t\t\t\t\t\t\trow={display === 'row'}\r\n\t\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 1 }}>\r\n\t\t\t\t\t\t\t\t{title && titlePosition === 'start' && (\r\n\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\ttype='s4'\r\n\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\t\t\t\t\t\tweight='medium'>\r\n\t\t\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t{options.map((option) => (\r\n\t\t\t\t\t\t\t\t\t<BorderedOption\r\n\t\t\t\t\t\t\t\t\t\tkey={option.value}\r\n\t\t\t\t\t\t\t\t\t\tbordered={bordered}\r\n\t\t\t\t\t\t\t\t\t\tisSelected={field.value == option.value}>\r\n\t\t\t\t\t\t\t\t\t\t<FormControlLabel\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ margin: 0, opacity: disabled ? 0.5 : 1 }}\r\n\t\t\t\t\t\t\t\t\t\t\tvalue={option.value}\r\n\t\t\t\t\t\t\t\t\t\t\tcontrol={<Radio checked={field.value == option.value} />}\r\n\t\t\t\t\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype='s5'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tweight='medium'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</BorderedOption>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t{title && titlePosition === 'end' && (\r\n\t\t\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\t\t\ttype='s4'\r\n\t\t\t\t\t\t\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\t\t\t\t\t\t\tweight='medium'>\r\n\t\t\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</RadioGroup>\r\n\t\t\t\t\t\t\t{error && (\r\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\r\n\t\t\t\t\t\t\t\t\t{error.message}\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nexport default DynamicRadioButton;\r\n","import _ from \"lodash\";\r\nimport { MaterialTableColumnProps } from \"../../material-table/material-table\";\r\n\r\nexport const PARTIES_FORM_ARRAY_NAME = 'parties';\r\n\r\nexport const PARTIES_FIELDS = {\r\n TYPE: 'account_type',\r\n\r\n FIRST_NAME: 'first_name',\r\n LAST_NAME: 'last_name',\r\n\r\n COMPANY_NAME: 'company_name',\r\n VAT_NUMBER: 'vat_number',\r\n CRN: 'crn',\r\n\r\n // COMPANY: 'company_id',\r\n COMPANY: 'companies',\r\n CURRENCY: 'currencies',\r\n CONTACT_NO: 'contact_no',\r\n EMAIL_IDS: 'email_ids',\r\n RESPONSIBLE_PERSON : 'responsible_person',\r\n\r\n ADDRESS: 'addresses',\r\n CONTACTS: 'contacts',\r\n\r\n RECEIVABLE_ACCOUNT: 'account_id',\r\n TAX_TEMPLATE: 'default_tax_template'\r\n}\r\n\r\nexport const partyType = [\r\n { label: 'Individual', value: 'Individual' },\r\n { label: 'Company', value: 'Company' }\r\n];\r\n\r\nexport const addressPayload = {\r\n parties_id: null,\r\n address_type: null,\r\n contact_name: null,\r\n street_1: null,\r\n street_2: null,\r\n city: null,\r\n zip_code: null,\r\n state: null,\r\n country: null,\r\n email: null,\r\n mobile: null,\r\n phone: null,\r\n street_3: null,\r\n summary: null,\r\n default_shipping_address: 0,\r\n default_billing_address: 0,\r\n country_code: null\r\n};\r\nexport const contactPayload = {\r\n parties_id: null,\r\n name: null,\r\n country_code: null,\r\n contact_no: null,\r\n email: null\r\n};\r\n\r\n/* Address columns & rows */\r\nexport const addressColumns: MaterialTableColumnProps[] = [\r\n {\r\n header: 'common.party.table.addressType_header',\r\n accessorKey: 'address_type',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n placeholder: 'Select Address Type',\r\n field_name: 'address_type',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Address Type is required',\r\n msg_ar: 'Address Type is required'\r\n }\r\n ]\r\n },\r\n editSelectOptions: [\r\n { label: 'Delivery', value: 'Delivery' },\r\n { label: 'Shipping', value: 'Shipping' },\r\n { label: 'Office', value: 'Office' }\r\n ]\r\n },\r\n {\r\n header: 'common.party.table.addressee_header',\r\n accessorKey: 'contact_name',\r\n visible: true,\r\n type: 'custom_link',\r\n editProperties: {\r\n placeholder: 'Enter Addressee',\r\n field_name: 'contact_name',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: false,\r\n msg_en: 'Contact name is required',\r\n msg_ar: 'Contact name is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.defaultShippingAddress_header',\r\n accessorKey: 'default_shipping_address',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'checkbox',\r\n editProperties: {\r\n field_name: 'default_shipping_address'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.defaultBillingAddress_header',\r\n accessorKey: 'default_billing_address',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'checkbox',\r\n editProperties: {\r\n field_name: 'default_billing_address'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.countryCode_header',\r\n accessorKey: 'country_code',\r\n visible: true,\r\n type: 'custom_link',\r\n enableEditing: false\r\n },\r\n {\r\n header: 'common.party.table.contactNumber_header',\r\n accessorKey: 'phone',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'phone',\r\n editProperties: {\r\n field_name: 'phone'\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addrressOne_header',\r\n accessorKey: 'street_1',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_1',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: false,\r\n msg_en: 'Address is required',\r\n msg_ar: 'Address is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addressTwo_header',\r\n accessorKey: 'street_2',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_2',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.addressThree_header',\r\n accessorKey: 'street_3',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Address',\r\n field_name: 'street_3',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.zipCode_header',\r\n accessorKey: 'zip_code',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n field_name: 'zip_code',\r\n placeholder: 'Enter Zip Code',\r\n }\r\n },\r\n {\r\n header: 'common.party.table.country_header',\r\n accessorKey: 'country_name',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n field_name: 'country',\r\n placeholder: 'Select country',\r\n valueKey: 'country_id',\r\n apiType: 'countries',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Country is required',\r\n msg_ar: 'Country is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.state_header',\r\n accessorKey: 'state_name',\r\n visible: true,\r\n type: 'string',\r\n editVariant: 'select',\r\n editProperties: {\r\n field_name: 'state',\r\n placeholder: 'Select state',\r\n valueKey: 'state_id',\r\n apiType: 'states',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'State is required',\r\n msg_ar: 'State is required'\r\n }\r\n ],\r\n customeFilter: (row: any, values) => {\r\n const filter = values?.country_name ? { '&country_id.eq': values?.country_name } : null\r\n return filter\r\n }\r\n }\r\n },\r\n {\r\n header: 'common.party.table.city_header',\r\n accessorKey: 'city',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter City',\r\n field_name: 'city',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'City is required',\r\n msg_ar: 'City is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.summary_header',\r\n accessorKey: 'summary',\r\n visible: true,\r\n type: 'string',\r\n enableEditing: false\r\n // editProperties: {\r\n // \tplaceholder: 'Populated after filling address',\r\n // \tfield_name: 'summary'\r\n // \tdisabled\r\n // }\r\n }\r\n];\r\n\r\n/* contact columns & rows */\r\nexport const contactColumns: MaterialTableColumnProps[] = [\r\n {\r\n header: 'common.party.table.name_header',\r\n accessorKey: 'name',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Name',\r\n field_name: 'name',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Name is required',\r\n msg_ar: 'Name is required'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.email_header',\r\n accessorKey: 'email',\r\n visible: true,\r\n type: 'string',\r\n editProperties: {\r\n placeholder: 'Enter Email',\r\n field_name: 'email',\r\n validations: [\r\n {\r\n type: 'required',\r\n value: true,\r\n msg_en: 'Email is required',\r\n msg_ar: 'Email is required'\r\n },\r\n {\r\n type: 'email',\r\n value: true,\r\n msg_en: 'Invalid Email',\r\n msg_ar: 'Invalid Email'\r\n }\r\n ]\r\n }\r\n },\r\n {\r\n header: 'common.party.table.countryCode_header',\r\n accessorKey: 'country_code',\r\n visible: true,\r\n type: 'custom_link',\r\n enableEditing: false\r\n },\r\n {\r\n header: 'common.party.table.contactNumber_header',\r\n accessorKey: 'contact_no',\r\n visible: true,\r\n type: 'custom_link',\r\n editVariant: 'phone',\r\n editProperties: {\r\n field_name: 'contact_no'\r\n }\r\n }\r\n];\r\n\r\nexport const addressOmitKeys = [\r\n 'id',\r\n 'state_id',\r\n 'country_id',\r\n 'country_name',\r\n 'state_name',\r\n 'parties_id',\r\n 'state_data',\r\n 'country_data',\r\n 'summary'\r\n];\r\nexport const contactOmitKeys = ['id', 'summary'];\r\n\r\n\r\nexport const processPartiesPayload = (payload: any) => {\r\n const { addresses = [], contacts = [], ...rest } = payload || {}\r\n const addressPayload = addresses.map(address => (_.omit(address, ...addressOmitKeys)))\r\n const contactPayload = contacts.map(contact => (_.omit(contact, ...contactOmitKeys)))\r\n return {\r\n ...rest,\r\n addresses: addressPayload,\r\n contacts: contactPayload\r\n }\r\n}\r\n","import * as Yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport { PARTIES_FIELDS, PARTIES_FORM_ARRAY_NAME } from './utils/constant';\r\n\r\nexport const generateValidationSchema = () => {\r\n\treturn yupResolver(\r\n\t\tYup.object().shape({\r\n\t\t\t[PARTIES_FORM_ARRAY_NAME]: Yup.object().shape({\r\n\t\t\t\t[PARTIES_FIELDS.FIRST_NAME]: Yup.string().required('First name is required'),\r\n\t\t\t\t[PARTIES_FIELDS.LAST_NAME]: Yup.string().required('Last name is required'),\r\n\t\t\t\t[PARTIES_FIELDS.COMPANY]: Yup.mixed().required('Company is required'),\r\n\t\t\t\t[PARTIES_FIELDS.CURRENCY]: Yup.array().required('Currency is required'),\r\n\t\t\t\t[PARTIES_FIELDS.ADDRESS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one address')\r\n\t\t\t\t\t.min(1, 'Please add atleast one address'),\r\n\t\t\t\t[PARTIES_FIELDS.CONTACTS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one Contact')\r\n\t\t\t\t\t.min(1, 'Please add atleast one Contact')\r\n\t\t\t})\r\n\t\t})\r\n\t);\r\n};\r\n\r\nexport const generateValidationSchema1 = () => {\r\n\treturn yupResolver(\r\n\t\tYup.object().shape({\r\n\t\t\t[PARTIES_FORM_ARRAY_NAME]: Yup.object().shape({\r\n\t\t\t\t[PARTIES_FIELDS.TYPE]: Yup.string().required('Customer type is required'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.FIRST_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Individual',\r\n\t\t\t\t\tthen: () => Yup.string().required('First name is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.LAST_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Individual',\r\n\t\t\t\t\tthen: () => Yup.string().required('Last name is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.COMPANY_NAME]: Yup.string().when('account_type', {\r\n\t\t\t\t\tis: (val: any) => val === 'Company',\r\n\t\t\t\t\tthen: () => Yup.string().required('Company is required'),\r\n\t\t\t\t\totherwise: () => Yup.string().optional().nullable()\r\n\t\t\t\t}),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.VAT_NUMBER]: Yup.string().optional().nullable(),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.CRN]: Yup.string().optional().nullable() ,\r\n\r\n\t\t\t[PARTIES_FIELDS.COMPANY]: Yup.mixed().required('Company is required'),\r\n\r\n\t\t\t[PARTIES_FIELDS.CURRENCY]: Yup.array().required('Currency is required'),\r\n\t\t\t\t[PARTIES_FIELDS.RESPONSIBLE_PERSON]: Yup.string().required('Responsible Person is required'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.ADDRESS]: Yup.array().nullable().notRequired(),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.CONTACTS]: Yup.array()\r\n\t\t\t\t\t.required('Please add atleast one Contact')\r\n\t\t\t\t\t.min(1, 'Please add atleast one Contact'),\r\n\r\n\t\t\t\t[PARTIES_FIELDS.RECEIVABLE_ACCOUNT]: Yup.number().required('Receivable account is required'),\r\n\t\t\t\t[PARTIES_FIELDS.TAX_TEMPLATE]: Yup.number().required('Tax template is required')\r\n\t\t\t})\r\n\r\n\t\t})\r\n\t);\r\n}\r\n","import { useEffect, useState } from 'react';\r\nimport { useAuth } from './useAuth';\r\nimport { auth } from '../constants/auth';\r\n\r\n/**\r\n * In MFE mode the AuthContext of the common-hub is not bridged from the\r\n * host app, so `useAuth()` returns `user: null`. As a fallback we read\r\n * the persisted user object directly from localStorage so that default\r\n * values (e.g. company_id) are always available.\r\n */\r\nconst getEffectiveUser = (contextUser: any): any => {\r\n if (contextUser) return contextUser;\r\n try {\r\n const stored = window.localStorage.getItem(auth.storageUserKeyName);\r\n return stored ? JSON.parse(stored) : null;\r\n } catch {\r\n return null;\r\n }\r\n};\r\n\r\nconst setCompany = (user: any) => {\r\n return {\r\n value: user?.company_id,\r\n options: [{\r\n // Fallback to company_id when company_data is not present in the\r\n // user object (common in MFE where the stored payload is leaner).\r\n label: user?.company_data?.name ?? user?.company_id,\r\n value: user?.company_id\r\n }]\r\n }\r\n}\r\n\r\nexport const configMapper: Record<string, any> = {\r\n 'company': {\r\n callBack: setCompany,\r\n },\r\n 'company_id': {\r\n callBack: setCompany,\r\n },\r\n}\r\n\r\nexport const getDefaultConfig = (props: any, user: any) => {\r\n const { apiType, name } = props;\r\n const config = configMapper[apiType || name];\r\n if (config) {\r\n return config.callBack(user)\r\n }\r\n return {\r\n value: null,\r\n options: []\r\n }\r\n}\r\n\r\nexport const useDefaultConfig = ({\r\n props,\r\n setValue,\r\n isInternalOptions\r\n}: {\r\n props: any;\r\n setValue?: any;\r\n isInternalOptions: boolean;\r\n}) => {\r\n const { user: authUser } = useAuth();\r\n const contextUser = getEffectiveUser(authUser);\r\n const [defaultOptions, setDefaultOptions] = useState<any>([]);\r\n\r\n useEffect(() => {\r\n const user = getEffectiveUser(contextUser);\r\n const { value, options } = getDefaultConfig(props, user);\r\n\r\n if (value === null || value === undefined) {\r\n return;\r\n }\r\n\r\n if (typeof setValue === 'function') {\r\n setValue(`${props.fieldArrayName}.${props.name}`, props?.is_multiselect ? [value] : value);\r\n }\r\n\r\n if (!isInternalOptions) {\r\n setDefaultOptions(options);\r\n }\r\n\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props?.name, props?.apiType, contextUser, setValue, isInternalOptions]);\r\n\r\n return {\r\n defaultOptions\r\n }\r\n}","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { Controller, useFormContext, useWatch, Control } from 'react-hook-form';\r\nimport { dynamicSelectAdd } from './select-configuration';\r\nimport {\r\n Box,\r\n CircularProgress,\r\n Divider,\r\n IconButton,\r\n InputAdornment,\r\n MenuItem,\r\n MenuItemProps,\r\n OutlinedInput,\r\n Tooltip\r\n} from '@mui/material';\r\nimport PropTypes from 'prop-types';\r\nimport { debounce } from 'lodash';\r\nimport { sortBy } from \"lodash\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Add, Close } from '@mui/icons-material';\r\n\r\nimport Select from '../../../select/select';\r\nimport ChipOrPlaceholder from './chip-or-placeholder';\r\nimport Checkbox from '../../../checkbox/checkbox';\r\nimport Typography from '../../../typography/typography';\r\nimport Chip from '../../../chip/chip';\r\nimport { MoreIcon } from '../../../icons';\r\nimport { fetchApi } from '../../../../utils/api';\r\nimport './element.scss';\r\nimport { useAuth, useLanguage } from '@/hooks';\r\nimport { useDefaultConfig } from '@/hooks/useSetDefaultConfig';\r\nimport { auth } from '../../../../constants/auth';\r\n\r\n// Types\r\ninterface IOption {\r\n id: string | number;\r\n value: string | number;\r\n label: string | React.ReactNode;\r\n disabled?: boolean;\r\n isGroup?: boolean;\r\n options?: IOption[];\r\n searchLabel?: string;\r\n}\r\n\r\n// Custom API fetch function type for parent components\r\ninterface CustomFetchApiParams {\r\n search?: string;\r\n filters?: any;\r\n limit: number;\r\n skip: number;\r\n select?: string;\r\n order?: string;\r\n}\r\n\r\ninterface CustomFetchApiResponse {\r\n data: IOption[];\r\n pagination?: {\r\n totalCount: number;\r\n };\r\n}\r\n\r\ninterface IMenuItemsProps extends MenuItemProps {\r\n options: IOption[];\r\n multiple: boolean;\r\n placeholder: string;\r\n with_checkboxes: boolean;\r\n values: string | string[];\r\n field: IDynamicSearchSelectProps;\r\n disabledIds: (string | number)[];\r\n onChange: (value: string | string[]) => void;\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent: boolean;\r\n t: (key: string) => string;\r\n // onFooterClick?: () => void;\r\n}\r\n\r\ninterface IDynamicSearchSelectProps {\r\n name: string;\r\n placeholder: string;\r\n label: string;\r\n size?: 'small' | 'medium';\r\n options: IOption[];\r\n formControl: Control<any>;\r\n defaultValue?: string | string[];\r\n fieldArrayName: string;\r\n id?: string;\r\n required?: boolean;\r\n is_multiselect?: boolean;\r\n position?: number;\r\n formType?: string;\r\n typeOfField?: string;\r\n disabled?: boolean;\r\n onChipRemove?: (value: string) => void;\r\n enable_footer?: boolean;\r\n footer_action?: string;\r\n onFooterClick?: () => void;\r\n is_loading?: boolean;\r\n selectedLabel?: string;\r\n isInternal?: boolean;\r\n disabledIds?: (string | number)[];\r\n getSelectedData?: (data: IOption | IOption[] | null, name: string) => void;\r\n attributes?: string[];\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent?: boolean;\r\n sortOrder?: string;\r\n apiType?: string;\r\n handleOptions?: (value: any) => void;\r\n filterKey?: string;\r\n customeFilter?: Record<string, any>;\r\n refresh?: boolean;\r\n addType?: string;\r\n showCancelButton?: boolean;\r\n /** Custom API function to fetch options from parent component */\r\n customFetchApi?: (params: CustomFetchApiParams) => Promise<CustomFetchApiResponse>;\r\n isMergeOptions?: boolean;\r\n showItemTooltip?: boolean;\r\n}\r\n\r\ninterface IPaginationState {\r\n page: number;\r\n hasMore: boolean;\r\n isLoadingMore: boolean;\r\n total: number;\r\n}\r\n\r\n// Helper function to generate menu items\r\nconst generateMenuItems = ({\r\n options,\r\n multiple,\r\n placeholder,\r\n with_checkboxes,\r\n values,\r\n // field,\r\n disabledIds,\r\n onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick\r\n}: IMenuItemsProps): React.ReactElement[] => {\r\n const itemDisabled = (id: string | number) => disabledIds?.includes(id);\r\n const items: React.ReactElement[] = [];\r\n\r\n if (!multiple) {\r\n items.push(\r\n <MenuItem disabled value='' key=\"placeholder\" sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\r\n <Typography type='s3' color='theme.secondary.1000'>\r\n <em>{t(placeholder)}</em>\r\n </Typography>\r\n </MenuItem>\r\n );\r\n }\r\n const selectedValues = (Array.isArray(values) && values?.length > 0) ? values?.filter((value) => value) : values;\r\n\r\n const handleParentChange = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n\r\n const isParentSelected = valueArray.includes(parentValue);\r\n const updatedValues = isParentSelected\r\n ? valueArray.filter((value) => value !== parentValue && !childValues.includes(value))\r\n : [...new Set([...valueArray, parentValue, ...childValues])];\r\n\r\n onChange(updatedValues);\r\n handleChange?.(updatedValues);\r\n };\r\n\r\n const isAllOptionsSelected = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.every((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n const isSomeOptionsSelected = (childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.some((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n if (Array.isArray(options) && options.length > 0) {\r\n options.forEach((option) => {\r\n items.push(\r\n <MenuItem\r\n value={option.value}\r\n key={option.value}\r\n disabled={Boolean(option.disabled) || itemDisabled(option.id || option.value)}\r\n className={option.isGroup ? 'select--MenuItemHeader' : ''}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={\r\n hasParent\r\n ? isAllOptionsSelected(option.value, option.options || [])\r\n : Boolean(Array.isArray(selectedValues) ? selectedValues.includes(option.value) : selectedValues == option.value)\r\n }\r\n indeterminate={\r\n hasParent && isSomeOptionsSelected(option.options || [])\r\n }\r\n onChange={() => hasParent ? handleParentChange(option.value, option.options || []) : handleChange?.(option.value)}\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(option.value)}\r\n >\r\n {option.label}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n\r\n if (option.isGroup && Array.isArray(option.options)) {\r\n option.options.forEach((opt) => {\r\n items.push(\r\n <MenuItem\r\n value={opt.value}\r\n disabled={Boolean(opt.disabled) || itemDisabled(opt.id || opt.value)}\r\n sx={{ pl: 5 }}\r\n key={`${option.value}-${opt.value}`}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={Boolean(Array.isArray(values) && values.includes(opt.value))}\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(String(opt.value))}\r\n >\r\n {opt.label == \"Payment Entries\" ? \"Payment and Collection Entries\" : opt.label || opt.value}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n });\r\n }\r\n });\r\n }\r\n\r\n // if (field.enable_footer) {\r\n\r\n // }\r\n\r\n if (!items.length || (items.length == 1 && !multiple)) {\r\n items.push(\r\n <MenuItem disabled key=\"no-data\">\r\n No data available\r\n </MenuItem>\r\n );\r\n }\r\n\r\n return items;\r\n};\r\n\r\n// Selected items component\r\nconst SelectedItems: React.FC<{\r\n data: (string | number)[];\r\n options: IOption[];\r\n}> = ({ data, options }) => {\r\n const displayTitle = data.map(\r\n (selectedItem) =>\r\n options?.find((option) => option.value == selectedItem)?.label || ''\r\n );\r\n const filteredDisplayTitle = displayTitle.filter(Boolean);\r\n\r\n return (\r\n <Typography\r\n type='s4'\r\n color='inherit'\r\n sx={{ display: 'flex', gap: 1, alignItems: 'center', mt: 0.5 }}\r\n >\r\n {filteredDisplayTitle.slice(0, 4).join(', ')}\r\n {data.length > 4 && (\r\n <Chip variant='outlined' type='normal' label={<MoreIcon />} />\r\n )}\r\n </Typography>\r\n );\r\n};\r\n\r\nconst Loading = () => (\r\n <Typography fontStyle='italic' color='inherit' type='s3'>Loading...</Typography>\r\n)\r\n\r\nconst DynamicSearchSelect: React.FC<IDynamicSearchSelectProps> = React.memo((props) => {\r\n const watchedValue = useWatch({\r\n control: props.formControl,\r\n name: `${props.fieldArrayName}.${props.name}`\r\n });\r\n\r\n // In MFE mode each federated module ships its own copy of react-hook-form,\r\n // so the FormContext created by the host's FormProvider is invisible here\r\n // and useFormContext() returns null.\r\n // The internal `control` object (passed as formControl prop) does NOT expose\r\n // setValue — that lives only on the useForm() return value. We build a\r\n // stable fallback using useCallback so that useDefaultConfig's useEffect\r\n // (which has setValue as a dependency) does NOT re-fire on every render.\r\n const formContext = useFormContext();\r\n const { setValue: contextSetValue } = formContext || {};\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mfeFallbackSetValue = useCallback((fieldPath: string, value: any) => {\r\n const ctrl = props.formControl as any;\r\n if (!ctrl) return;\r\n // Write into internal form values\r\n const parts = fieldPath.split('.');\r\n let obj = ctrl._formValues;\r\n for (let i = 0; i < parts.length - 1; i++) {\r\n if (!obj[parts[i]]) obj[parts[i]] = {};\r\n obj = obj[parts[i]];\r\n }\r\n obj[parts[parts.length - 1]] = value;\r\n // Notify RHF subscribers so React re-renders\r\n ctrl._subjects?.state?.next({ name: fieldPath, values: { ...ctrl._formValues } });\r\n // props.formControl is stable for the lifetime of the form\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [props.formControl]);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const setValue: any = contextSetValue ?? mfeFallbackSetValue;\r\n const { t } = useTranslation();\r\n const { isRtl } = useLanguage();\r\n const { user: authUser } = useAuth();\r\n const contextUser = useMemo(() => {\r\n if (authUser) return authUser;\r\n try {\r\n const stored = window.localStorage.getItem(auth.storageUserKeyName);\r\n return stored ? JSON.parse(stored) : null;\r\n } catch {\r\n return null;\r\n }\r\n }, [authUser]);\r\n const selectRef = useRef<HTMLDivElement>(null);\r\n\r\n // State management\r\n const [options, setOptions] = useState<IOption[]>([]);\r\n const [selectedValue, setSelectedValue] = useState<any>(null);\r\n const [selectedOptions, setSelectedOptions] = useState<IOption[]>([]);\r\n const [loading, setLoading] = useState<boolean>(false);\r\n const [open, setOpen] = useState<boolean>(false);\r\n const [isAlreadyLoaded, setIsAlreadyLoaded] = useState<boolean>(false);\r\n const [prevFilter, setPrevFilter] = useState<any>(null);\r\n const [initialLoading, setInitialLoading] = useState<boolean>(false);\r\n const [searchQuery, setSearchQuery] = useState<string>(\"\");\r\n const [searchInitiate, setSearchInitiate] = useState<boolean>(false);\r\n const [addConfig, setAddConfig] = useState<any>(null);\r\n\r\n // Modal states\r\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\r\n const [isAddLoading, setIsAddLoading] = useState<boolean>(false);\r\n\r\n\r\n // Pagination state\r\n const [pagination, setPagination] = useState<IPaginationState>({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n\r\n // Props destructuring with defaults\r\n const {\r\n handleOptions,\r\n isInternal = false,\r\n disabledIds = [],\r\n getSelectedData,\r\n attributes = [],\r\n filterKey = 'id',\r\n customeFilter = {},\r\n refresh,\r\n handleChange,\r\n hasParent = false,\r\n sortOrder = 'id:-1',\r\n apiType,\r\n addType,\r\n showCancelButton = true,\r\n customFetchApi,\r\n isMergeOptions = false,\r\n } = props;\r\n\r\n const showItemTooltip = props.showItemTooltip ?? (apiType === 'salesItems');\r\n\r\n const limit = 25;\r\n\r\n // Memoized values\r\n // Memoized values\r\n const isInternalOptions = useMemo(() => {\r\n if (isMergeOptions && (apiType || customFetchApi)) return false;\r\n return (!apiType && !customFetchApi) || (isInternal ? (apiType || customFetchApi) && props.options?.length == 0 ? false : true : false);\r\n }, [isInternal, apiType, customFetchApi, props.options?.length, isMergeOptions]);\r\n\r\n\r\n //eslint-disable-next-line\r\n const cf = useMemo(() => customeFilter, [JSON.stringify(customeFilter)]);\r\n\r\n\r\n\r\n\r\n const { defaultOptions = [] } = useDefaultConfig({\r\n props,\r\n setValue,\r\n isInternalOptions\r\n });\r\n\r\n\r\n // Local search function\r\n const searchOptionsLocally = useCallback((searchTerm: string, value: any): IOption[] => {\r\n const currentOptions: IOption[] = (props.options && props.options.length > 0) ? props.options : (defaultOptions || []);\r\n if (!searchTerm) return currentOptions;\r\n\r\n const lowercasedSearchTerm = searchTerm.toLowerCase();\r\n\r\n const filteredOptions = hasParent\r\n ? currentOptions?.reduce((acc: IOption[], opt: IOption) => {\r\n const searchedOptions = opt.options?.filter((item: IOption) => {\r\n const label = React.isValidElement(item.label) ? item.searchLabel : String(item.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n });\r\n\r\n if (searchedOptions?.length) {\r\n acc.push({ ...opt, options: searchedOptions });\r\n }\r\n\r\n return acc;\r\n }, []) || []\r\n : currentOptions?.filter((opt: IOption) => {\r\n const label = React.isValidElement(opt.label) ? opt.searchLabel : String(opt.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n }) || [];\r\n\r\n //eslint-disable-next-line\r\n return sortBySelectedValues(filteredOptions, value);\r\n //eslint-disable-next-line\r\n }, [props.options, hasParent, defaultOptions]);\r\n\r\n // Get unique options\r\n const getUniqueOptions = useCallback((data: IOption[]): IOption[] => {\r\n const uniqueOptions = [\r\n ...new Map(data?.map(item => [item.value, item])).values()\r\n ];\r\n return uniqueOptions;\r\n }, []);\r\n\r\n // Sort by selected values\r\n const sortBySelectedValues = useCallback((arrayToSort: IOption[], value: any): IOption[] => {\r\n let selectedValues = Array.isArray(value) ? value : [value];\r\n selectedValues = selectedValues.map((item) => Number(item));\r\n const sortedValue = sortBy(arrayToSort, (item) => {\r\n const index = selectedValues.indexOf(item.id || item.value);\r\n return index == -1 ? Infinity : index;\r\n });\r\n return sortedValue;\r\n }, []);\r\n\r\n // Filtered options with pagination support\r\n const filteredOptions = useMemo(() => {\r\n if (isInternalOptions) {\r\n return searchOptionsLocally(searchQuery, watchedValue);\r\n }\r\n const apiOptions = sortBySelectedValues(getUniqueOptions([...options, ...selectedOptions]), watchedValue);\r\n if (isMergeOptions) {\r\n const localOptions = searchOptionsLocally(searchQuery, watchedValue);\r\n return getUniqueOptions([...localOptions, ...apiOptions]);\r\n }\r\n return apiOptions;\r\n //eslint-disable-next-line\r\n }, [options, selectedOptions, isInternalOptions, props.options, watchedValue, searchQuery, searchOptionsLocally, sortBySelectedValues, getUniqueOptions, isMergeOptions]);\r\n\r\n // Helper to get selected item data for tooltip\r\n const getSelectedDataOptions = useMemo(() => {\r\n if (!watchedValue || !filteredOptions.length) return null;\r\n const selected = filteredOptions.find(opt =>\r\n opt.id === watchedValue || opt.value === watchedValue\r\n );\r\n return selected || null;\r\n }, [watchedValue, filteredOptions]);\r\n\r\n // API Functions\r\n const fetchOptions = useCallback(async (searchTerm = '', flt = cf, page = 1, append = false) => {\r\n // Skip if neither apiType nor customFetchApi is provided\r\n if (!apiType && !customFetchApi) return [];\r\n\r\n setLoading(true);\r\n if (page > 1) {\r\n setPagination(prev => ({ ...prev, isLoadingMore: true }));\r\n }\r\n\r\n try {\r\n let data: IOption[] = [];\r\n let paginationResult: { totalCount?: number } = {};\r\n\r\n // Use custom API if provided, otherwise use default fetchApi\r\n if (customFetchApi) {\r\n const response = await customFetchApi({\r\n search: searchTerm,\r\n filters: flt,\r\n limit,\r\n skip: (page - 1) * limit,\r\n select: attributes?.join(','),\r\n order: sortOrder\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n } else {\r\n const response = await fetchApi({\r\n apiKey: apiType!,\r\n filters: {\r\n limit,\r\n skip: (page - 1) * limit,\r\n search: searchTerm,\r\n filters: flt,\r\n select: attributes,\r\n order: sortOrder\r\n }\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n }\r\n\r\n if (data && Array.isArray(data)) {\r\n const newOptions = append ? [...options, ...data] : data;\r\n\r\n updateOptions(newOptions, append);\r\n handleSelectedValue(data);\r\n // Update pagination\r\n setPagination(prev => ({\r\n ...prev,\r\n page,\r\n hasMore: (paginationResult?.totalCount || 0) > (page * limit),\r\n total: paginationResult?.totalCount || 0,\r\n isLoadingMore: false\r\n }));\r\n }\r\n\r\n return data || [];\r\n } catch (error) {\r\n console.error('Error fetching options:', error);\r\n setPagination(prev => ({ ...prev, isLoadingMore: false }));\r\n return [];\r\n } finally {\r\n setLoading(false);\r\n }\r\n //eslint-disable-next-line\r\n }, [apiType, customFetchApi, options, attributes, sortOrder, limit, cf]);\r\n\r\n // Handle scroll pagination\r\n const handleScroll = useCallback((event: React.UIEvent<HTMLDivElement>) => {\r\n const { scrollTop, scrollHeight, clientHeight } = event.currentTarget;\r\n const isBottom = scrollHeight - scrollTop <= clientHeight + 10;\r\n\r\n if (isBottom && pagination.hasMore && !pagination.isLoadingMore && !isInternalOptions) {\r\n const nextPage = pagination.page + 1;\r\n fetchOptions(searchQuery, cf, nextPage, true);\r\n }\r\n }, [pagination.hasMore, pagination.isLoadingMore, pagination.page, isInternalOptions, searchQuery, cf, fetchOptions]);\r\n\r\n // Update options\r\n const updateOptions = useCallback((newOptions: IOption[], append = false) => {\r\n const oldOptions = append ? options : selectedOptions;\r\n const uniqueOptions = getUniqueOptions([...oldOptions, ...newOptions]);\r\n setOptions(uniqueOptions);\r\n }, [options, selectedOptions, getUniqueOptions]);\r\n\r\n // Handle selected value\r\n const handleSelectedValue = useCallback(async (updateOptions: IOption[]) => {\r\n if (!watchedValue) return;\r\n let filterValue = props.is_multiselect ? watchedValue : [watchedValue];\r\n filterValue = Array.isArray(filterValue) ? filterValue?.filter(i => i) : [];\r\n filterValue = Array.isArray(filterValue) ? filterValue?.map((item) => Number(item)) : [];\r\n const isInOptions = updateOptions?.filter((item) =>\r\n Array.isArray(filterValue) ? filterValue.includes(item.id || item.value) : (item[filterKey] || item.value || item.id) == filterValue\r\n );\r\n\r\n if (Array.isArray(isInOptions) && isInOptions.length > 0) {\r\n getSelectedData?.(props.is_multiselect ? isInOptions : isInOptions[0], props.name);\r\n return true;\r\n }\r\n return false;\r\n //eslint-disable-next-line\r\n }, [props.is_multiselect, props.name, watchedValue, filterKey, getSelectedData, filteredOptions]);\r\n\r\n // Fetch options by ID\r\n const fetchIdOptions = useCallback(async () => {\r\n if (open) return;\r\n if (await handleSelectedValue(filteredOptions)) return;\r\n\r\n const condition = props.is_multiselect ?\r\n Array.isArray(watchedValue) && watchedValue.length > 0 :\r\n Boolean(watchedValue);\r\n\r\n if (condition) {\r\n setInitialLoading(true);\r\n const response = await fetchOptions('', { ...cf, '&id.in': watchedValue }, 1, false);\r\n setInitialLoading(false);\r\n\r\n if (response.length == 0 && setValue && !isInternalOptions) {\r\n // setValue(`${props.fieldArrayName}.${props.name}`, props.is_multiselect ? [] : null);\r\n }\r\n }\r\n //eslint-disable-next-line\r\n }, [open, watchedValue, JSON.stringify(cf)]);\r\n\r\n // Initial fetch\r\n const initialFetch = useCallback(async () => {\r\n const condition = JSON.stringify(cf) !== JSON.stringify(prevFilter);\r\n\r\n if (condition) {\r\n setPrevFilter(cf);\r\n setOptions([]);\r\n setIsAlreadyLoaded(false);\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n }\r\n\r\n if (!isInternalOptions && !isAlreadyLoaded) {\r\n await fetchOptions(searchQuery, cf, 1, false);\r\n setIsAlreadyLoaded(true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [cf, isInternalOptions, isAlreadyLoaded]);\r\n\r\n // Debounced search\r\n const debouncedSearch = useMemo(\r\n () => debounce(async (searchTerm: string) => {\r\n if (loading) return;\r\n\r\n if (!searchTerm && !isInternalOptions && searchInitiate) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions('', cf, 1, false);\r\n }\r\n if (searchTerm.length > 1 && !isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions(searchTerm, cf, 1, false);\r\n }\r\n }, 700),\r\n //eslint-disable-next-line\r\n [isInternalOptions, searchInitiate, cf]\r\n );\r\n\r\n // Reset value function\r\n const resetValue = useCallback((field: any) => {\r\n field.onChange(props.is_multiselect ? [] : null);\r\n if (getSelectedData) {\r\n getSelectedData(null, props.name);\r\n }\r\n }, [props.is_multiselect, props.name, getSelectedData]);\r\n\r\n // Handle close\r\n const handleClose = useCallback(() => {\r\n setOpen(false);\r\n if (searchQuery.length > 0) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n setSearchInitiate(false);\r\n setSearchQuery('');\r\n }, [searchQuery]);\r\n\r\n const handleModalOpen = useCallback(() => {\r\n setIsModalOpen(true);\r\n }, []);\r\n\r\n\r\n\r\n // Handle modal save\r\n const handleModalSave = useCallback(async (payload: any) => {\r\n if (!addConfig || !addConfig.api) {\r\n console.error('Add configuration is not properly set');\r\n return;\r\n }\r\n\r\n setIsAddLoading(true);\r\n try {\r\n const result = await addConfig.api(payload);\r\n setIsAddLoading(false);\r\n setIsModalOpen(false);\r\n if (!isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n setIsAlreadyLoaded(false);\r\n await fetchOptions('', cf, 1, false);\r\n }\r\n if (result && result.data) {\r\n const newValue = props.is_multiselect\r\n ? [...(watchedValue || []), result.data.id]\r\n : result.data.id;\r\n\r\n if (setValue) {\r\n setValue(`${props.fieldArrayName}.${props.name}`, newValue);\r\n }\r\n }\r\n } catch (error) {\r\n console.log(\"error\", error);\r\n setIsAddLoading(false);\r\n }\r\n\r\n\r\n }, [addConfig, isInternalOptions, fetchOptions, cf, props.is_multiselect, props.fieldArrayName, props.name, watchedValue, setValue]);\r\n\r\n // Effects\r\n useEffect(() => {\r\n if (handleOptions) {\r\n handleOptions(selectedValue);\r\n }\r\n }, [handleOptions, selectedValue]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n initialFetch();\r\n }\r\n }, [open, initialFetch]);\r\n\r\n useEffect(() => {\r\n fetchIdOptions();\r\n }, [fetchIdOptions]);\r\n\r\n useEffect(() => {\r\n if (refresh) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n fetchOptions('', cf, 1, false);\r\n }\r\n }, [refresh, fetchOptions, cf]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n debouncedSearch(searchQuery);\r\n }\r\n return () => debouncedSearch.cancel();\r\n }, [searchQuery, open, debouncedSearch]);\r\n\r\n useEffect(() => {\r\n if (watchedValue && !open) {\r\n const selectedData = options?.filter((item) =>\r\n props.is_multiselect ?\r\n Array.isArray(watchedValue) && watchedValue.includes(item.id || item.value) :\r\n (item.id || item.value) == watchedValue\r\n );\r\n setSelectedOptions(selectedData || []);\r\n }\r\n }, [watchedValue, options, props.is_multiselect]);\r\n\r\n const removeUndefined = useCallback((selectOptions: any[]) => {\r\n return Array.isArray(selectOptions) ? selectOptions.filter(Boolean) : [];\r\n }, []);\r\n\r\n useEffect(() => {\r\n const config = dynamicSelectAdd(addType);\r\n setAddConfig(config);\r\n }, [addType])\r\n\r\n\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={`${props.fieldArrayName}.${props.name}`}\r\n render={({ field, fieldState }) => (\r\n <>\r\n {props.placeholder == 'Select Currency' && setSelectedValue(field.value)}\r\n {showItemTooltip ? (\r\n <Tooltip\r\n title={getSelectedDataOptions?.label ? String(getSelectedDataOptions.label) : ''}\r\n placement='top'\r\n arrow\r\n slotProps={{\r\n popper: {\r\n modifiers: [{ name: 'offset', options: { offset: [0, -25] } }],\r\n },\r\n tooltip: {\r\n sx: { maxWidth: 500 },\r\n },\r\n }}\r\n >\r\n <span>\r\n <Select\r\n {...field}\r\n ref={selectRef}\r\n open={open}\r\n onOpen={() => {\r\n setOpen(true);\r\n setTimeout(() => {\r\n const searchInput = document.querySelector(\r\n `input[placeholder=\"Search ${props.label}\"]`\r\n ) as HTMLInputElement;\r\n console.log('Active Search input:', searchInput);\r\n searchInput?.focus();\r\n }, 150);\r\n }}\r\n onClose={handleClose}\r\n fullWidth\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n placeholder={props.placeholder}\r\n label={props.label}\r\n defaultValue={props.defaultValue || (props.is_multiselect ? [] : '')}\r\n searchValue={searchQuery}\r\n required={props.formType == 'builder' ? false : props.required}\r\n size={props.size || 'small'}\r\n multiple={props.is_multiselect || false}\r\n disabled={props.disabled}\r\n sx={(props.is_multiselect && field?.value?.length) ? { \"& .MuiSelect-select\": { padding: '5.5px !important' } } : {}}\r\n variant='outlined'\r\n value={\r\n initialLoading\r\n ? (props.is_multiselect ? [] : '')\r\n : (field.value?.id || field.value || (props.is_multiselect ? [] : ''))\r\n }\r\n className={\r\n props.is_multiselect && removeUndefined(field.value)?.length\r\n ? 'MultiSelect filter-select'\r\n : ''\r\n }\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 300 }\r\n }\r\n }}\r\n\r\n renderValue={(selected: any) => {\r\n if (Array.isArray(selected)) {\r\n return (\r\n <ChipOrPlaceholder\r\n selectedLabel={props.selectedLabel}\r\n data={removeUndefined(selected)}\r\n placeholder={(loading || props.is_loading) ? <Loading /> : `${t('common.search')} ${props.label}`}\r\n onDelete={props.onChipRemove}\r\n disabled={props.disabled}\r\n chipProps={{\r\n sx: {\r\n background: '#ebf9f2',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: '#289b64',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n );\r\n } else {\r\n const selectedOption = filteredOptions.find(\r\n (option) => (option.value?.id || option.value) == selected\r\n );\r\n return (loading || props.is_loading) ? <Loading /> : selectedOption?.label ||\r\n (typeof props.label == 'string' ?\r\n `${t('common.search')} ${props.label}` :\r\n props.placeholder);\r\n }\r\n }}\r\n searchPlaceholder={`${t('common.search')} ${props.label}`}\r\n handleSearch={(text: string) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || ''}\r\n onBlur={field.onBlur}\r\n input={\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n {(loading || props.is_loading) ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n !props.disabled &&\r\n (props.is_multiselect ?\r\n (Array.isArray(field.value) && field.value.length > 0) :\r\n Boolean(field.value)) && showCancelButton && (\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => resetValue(field)}\r\n edge='end'\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size='small'\r\n >\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n }\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(props.is_multiselect),\r\n placeholder: props.placeholder,\r\n values: field.value,\r\n with_checkboxes: true,\r\n field: props,\r\n disabledIds,\r\n onChange: field.onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick: () => {\r\n // if (props?.onFooterClick) {\r\n // props?.onFooterClick();\r\n // } else {\r\n // handleModalOpen();\r\n // }\r\n // }\r\n })}\r\n {props?.enable_footer &&\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={\r\n () => {\r\n if (props?.onFooterClick) {\r\n props?.onFooterClick();\r\n } else {\r\n handleModalOpen();\r\n }\r\n }\r\n\r\n }>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {props.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n </span>\r\n </Tooltip>\r\n ) : (\r\n <Select\r\n {...field}\r\n ref={selectRef}\r\n open={open}\r\n onOpen={() => {\r\n setOpen(true);\r\n setTimeout(() => {\r\n const searchInput = document.querySelector(\r\n `input[placeholder=\"Search ${props.label}\"]`\r\n ) as HTMLInputElement;\r\n console.log('Active Search input:', searchInput);\r\n searchInput?.focus();\r\n }, 150);\r\n }}\r\n onClose={handleClose}\r\n fullWidth\r\n dataPosition={props.position}\r\n dataName={`${props.fieldArrayName}.${props.name}`}\r\n placeholder={props.placeholder}\r\n label={props.label}\r\n defaultValue={props.defaultValue || (props.is_multiselect ? [] : '')}\r\n searchValue={searchQuery}\r\n required={props.formType == 'builder' ? false : props.required}\r\n size={props.size || 'small'}\r\n multiple={props.is_multiselect || false}\r\n disabled={props.disabled}\r\n sx={(props.is_multiselect && field?.value?.length) ? { \"& .MuiSelect-select\": { padding: '5.5px !important' } } : {}}\r\n variant='outlined'\r\n value={\r\n initialLoading\r\n ? (props.is_multiselect ? [] : '')\r\n : (field.value?.id || field.value || (props.is_multiselect ? [] : ''))\r\n }\r\n className={\r\n props.is_multiselect && removeUndefined(field.value)?.length\r\n ? 'MultiSelect filter-select'\r\n : ''\r\n }\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 300 }\r\n }\r\n }}\r\n\r\n renderValue={(selected: any) => {\r\n if (Array.isArray(selected)) {\r\n return (\r\n <ChipOrPlaceholder\r\n selectedLabel={props.selectedLabel}\r\n data={removeUndefined(selected)}\r\n placeholder={(loading || props.is_loading) ? <Loading /> : `${t('common.search')} ${props.label}`}\r\n onDelete={props.onChipRemove}\r\n disabled={props.disabled}\r\n chipProps={{\r\n sx: {\r\n background: '#ebf9f2',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: '#289b64',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n );\r\n } else {\r\n const selectedOption = filteredOptions.find(\r\n (option) => (option.value?.id || option.value) == selected\r\n );\r\n return (loading || props.is_loading) ? <Loading /> : selectedOption?.label ||\r\n (typeof props.label == 'string' ?\r\n `${t('common.search')} ${props.label}` :\r\n props.placeholder);\r\n }\r\n }}\r\n searchPlaceholder={`${t('common.search')} ${props.label}`}\r\n handleSearch={(text: string) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n error={Boolean(fieldState.error?.message)}\r\n helperText={fieldState.error?.message || ''}\r\n onBlur={field.onBlur}\r\n input={\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n {(loading || props.is_loading) ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n !props.disabled &&\r\n (props.is_multiselect ?\r\n (Array.isArray(field.value) && field.value.length > 0) :\r\n Boolean(field.value)) && showCancelButton && (\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => resetValue(field)}\r\n edge='end'\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size='small'\r\n >\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n }\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(props.is_multiselect),\r\n placeholder: props.placeholder,\r\n values: field.value,\r\n with_checkboxes: true,\r\n field: props,\r\n disabledIds,\r\n onChange: field.onChange,\r\n handleChange,\r\n hasParent,\r\n t,\r\n // onFooterClick: () => {\r\n // if (props?.onFooterClick) {\r\n // props?.onFooterClick();\r\n // } else {\r\n // handleModalOpen();\r\n // }\r\n // }\r\n })}\r\n {props?.enable_footer &&\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={\r\n () => {\r\n if (props?.onFooterClick) {\r\n props?.onFooterClick();\r\n } else {\r\n handleModalOpen();\r\n }\r\n }\r\n\r\n }>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {props.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n </Select>\r\n )}\r\n\r\n {/* Modal for adding new items */}\r\n {addConfig && addConfig.component && (\r\n <>\r\n {React.createElement(addConfig.component, {\r\n isOpen: isModalOpen,\r\n setIsOpen: setIsModalOpen,\r\n isLoading: isAddLoading,\r\n onSave: handleModalSave,\r\n modalProps: {\r\n maxWidth: 'md',\r\n fullWidth: true\r\n },\r\n ...props?.modalComponentProps\r\n })}\r\n </>\r\n )}\r\n\r\n {props.is_multiselect && Array.isArray(field.value) && (\r\n <SelectedItems\r\n data={field.value}\r\n options={filteredOptions}\r\n />\r\n )}\r\n </>\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicSearchSelect.propTypes = {\r\n name: PropTypes.string.isRequired,\r\n placeholder: PropTypes.string.isRequired,\r\n label: PropTypes.string.isRequired,\r\n size: PropTypes.string,\r\n options: PropTypes.arrayOf(\r\n PropTypes.shape({\r\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\r\n value: PropTypes.any\r\n })\r\n ).isRequired,\r\n formControl: PropTypes.object.isRequired,\r\n defaultValue: PropTypes.any,\r\n fieldArrayName: PropTypes.string.isRequired,\r\n id: PropTypes.string,\r\n required: PropTypes.bool,\r\n is_multiselect: PropTypes.bool,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n typeOfField: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n onChipRemove: PropTypes.func,\r\n enable_footer: PropTypes.bool,\r\n footer_action: PropTypes.string,\r\n onFooterClick: PropTypes.func,\r\n is_loading: PropTypes.bool,\r\n selectedLabel: PropTypes.string,\r\n isInternal: PropTypes.bool,\r\n disabledIds: PropTypes.array,\r\n getSelectedData: PropTypes.func,\r\n attributes: PropTypes.array,\r\n handleChange: PropTypes.func,\r\n hasParent: PropTypes.bool,\r\n sortOrder: PropTypes.string,\r\n apiType: PropTypes.string,\r\n handleOptions: PropTypes.func,\r\n filterKey: PropTypes.string,\r\n customeFilter: PropTypes.object,\r\n refresh: PropTypes.bool,\r\n addType: PropTypes.string,\r\n modalComponentProps: PropTypes.object,\r\n showCancelButton: PropTypes.bool,\r\n customFetchApi: PropTypes.func\r\n};\r\n\r\nexport default DynamicSearchSelect;","/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable unused-imports/no-unused-vars */\r\nimport { styled } from '@mui/material/styles';\r\nimport Typography from \"../typography/typography\";\r\nimport ReactPhoneInput, { CountryData } from \"react-phone-input-2\";\r\nimport \"react-phone-input-2/lib/material.css\";\r\nimport { images } from \"../../assets/images\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { memo, useEffect } from \"react\";\r\n\r\nconst StyledInput = styled(ReactPhoneInput)<{ isRtl: boolean }>(({ theme: { palette }, isRtl }) => ({\r\n \"&:hover\": {\r\n border: \"none\",\r\n },\r\n \"&.react-tel-input\": {\r\n \".form-control\": {\r\n borderRadius: \"0.25rem\",\r\n padding: \"8px 8px 8px 55px\", // Ensure space for flag on the left\r\n border: `1px solid ${palette.theme?.secondary[300]}`,\r\n fontSize: \"0.875rem\",\r\n width: \"100%\",\r\n maxHeight: \"36.13px\",\r\n direction: \"ltr\", // Force LTR direction for input to start from left\r\n textAlign: \"left\", // Force left alignment for input value\r\n\r\n \":hover\": {\r\n border: `1px solid ${palette.theme?.secondary[400]}`,\r\n },\r\n\r\n \":focus\": {\r\n border: `1px solid ${palette.theme?.primary[600]}`,\r\n boxShadow: \"none\",\r\n },\r\n \":disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n\r\n \"&.invalid-number\": {\r\n border: `1px solid ${palette.theme?.error[600]}`,\r\n \":focus\": {\r\n boxShadow: \"none\",\r\n },\r\n },\r\n },\r\n\r\n \".flag-dropdown\": {\r\n left: \"0\",\r\n right: \"auto\",\r\n borderRadius: \"0.25rem 0 0 0.25rem\",\r\n\r\n \".selected-flag\": {\r\n borderRadius: \"0.25rem 0 0 0.25rem\",\r\n\r\n \"&:hover\": {\r\n backgroundColor: palette.theme?.secondary[100],\r\n },\r\n },\r\n },\r\n\r\n \".country-list\": {\r\n left: isRtl ? \"auto\" : \"0\",\r\n right: isRtl ? \"0\" : \"auto\",\r\n\r\n \".search\": {\r\n padding: \"0.5rem 0.5rem 0.5rem 0.75rem\",\r\n borderBottom: \"1px solid #F3F2F2\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n\r\n \".search-emoji\": {\r\n position: \"absolute\",\r\n left: isRtl ? \"auto\" : \"1.25rem\",\r\n right: isRtl ? \"1.25rem\" : \"auto\",\r\n\r\n \":first-child\": {\r\n display: \"block\",\r\n color: \"transparent\",\r\n background: `url(${images.search})`,\r\n backgroundRepeat: \"no-repeat\",\r\n backgroundPosition: \"center\",\r\n },\r\n },\r\n\r\n \".search-box\": {\r\n width: \"100%\",\r\n marginLeft: \"0rem\",\r\n border: `1px solid ${palette.theme?.secondary[200]}`,\r\n backgroundColor: palette.theme?.secondary[100],\r\n borderRadius: \"0.5rem\",\r\n padding: \"0.4rem\",\r\n paddingLeft: isRtl ? \"0.4rem\" : \"2rem\",\r\n paddingRight: isRtl ? \"2rem\" : \"0.4rem\",\r\n fontSize: \"0.8125rem\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n textAlign: isRtl ? \"right\" : \"left\",\r\n\r\n \":hover\": {\r\n border: `1px solid ${palette.theme?.secondary[300]}`,\r\n },\r\n\r\n \":focus\": {\r\n border: `1px solid ${palette.theme?.primary[600]}`,\r\n },\r\n },\r\n },\r\n\r\n \".country\": {\r\n fontSize: \"0.8125rem\",\r\n direction: isRtl ? \"rtl\" : \"ltr\",\r\n textAlign: isRtl ? \"right\" : \"left\",\r\n\r\n \".dial-code\": {\r\n fontSize: \"0.75rem\",\r\n position: \"absolute\",\r\n right: isRtl ? \"auto\" : \"0.5rem\",\r\n left: isRtl ? \"0.5rem\" : \"auto\",\r\n },\r\n },\r\n },\r\n },\r\n}));\r\n\r\ninterface IPhoneInput {\r\n error?: boolean;\r\n name?: string;\r\n dataPosition?: number;\r\n dataName?: string;\r\n label: string;\r\n required?: boolean;\r\n placeholder?: string;\r\n default_value?: string;\r\n onChange?: (e: any) => void;\r\n disabled?: boolean;\r\n setCountryCodeField?: (country: CountryData) => void;\r\n helperText?: string;\r\n isInlineEditing?: boolean\r\n}\r\n\r\nfunction fixPhoneDropdown() {\r\n let dropdown, input;\r\n\r\n const positionDropdown = () => {\r\n if (!dropdown || !input) return;\r\n const rect = input.getBoundingClientRect();\r\n\r\n dropdown.style.position = \"fixed\";\r\n dropdown.style.top = rect.bottom + \"px\";\r\n dropdown.style.left = rect.left + \"px\";\r\n dropdown.style.zIndex = \"2000\";\r\n };\r\n\r\n document.addEventListener(\"click\", () => {\r\n dropdown = document.querySelector(\".react-tel-input .country-list\");\r\n input = document.querySelector(\".react-tel-input input\");\r\n\r\n if (dropdown && input && !document.body.contains(dropdown)) {\r\n document.body.appendChild(dropdown);\r\n }\r\n\r\n positionDropdown();\r\n });\r\n\r\n // reposition on scroll (any container) and resize\r\n window.addEventListener(\"scroll\", positionDropdown, true); // true = capture all scrolls\r\n window.addEventListener(\"resize\", positionDropdown);\r\n}\r\n\r\n\r\nconst HelperTextWrapper = styled('div')(() => ({\r\n marginTop: '0.4rem',\r\n}));\r\n\r\nconst PhoneInput = memo(({\r\n name,\r\n error = false,\r\n dataName,\r\n dataPosition,\r\n label,\r\n required = false,\r\n placeholder,\r\n default_value,\r\n onChange,\r\n disabled,\r\n setCountryCodeField,\r\n helperText,\r\n isInlineEditing = false,\r\n ...rest\r\n}: IPhoneInput) => {\r\n const { isRtl } = useLanguage();\r\n\r\n useEffect(() => {\r\n if (isInlineEditing) {\r\n fixPhoneDropdown(isInlineEditing)\r\n }\r\n }, [isInlineEditing])\r\n\r\n useEffect(() => {\r\n if (typeof setCountryCodeField === \"function\") {\r\n setCountryCodeField?.({ dialCode: \"971\" } as CountryData);\r\n }\r\n }, [])\r\n\r\n return (\r\n <>\r\n <Typography\r\n type=\"s5\"\r\n weight=\"medium\"\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n <StyledInput\r\n dropdownContainer={document.body}\r\n isRtl={isRtl}\r\n specialLabel={\"\"}\r\n enableSearch\r\n searchPlaceholder=\"Search Country\"\r\n isValid={!error}\r\n country={\"ae\"}\r\n searchNotFound=\"Not Found!\"\r\n inputProps={{\r\n name: name,\r\n required: required,\r\n }}\r\n placeholder={placeholder}\r\n value={default_value || rest?.value}\r\n onChange={(value, country) => {\r\n setCountryCodeField?.(country as CountryData);\r\n onChange?.(value);\r\n }}\r\n disabled={disabled}\r\n />\r\n {helperText && (\r\n <HelperTextWrapper>\r\n <Typography\r\n type=\"s5\"\r\n color={error ? \"theme.error.600\" : \"theme.secondary.600\"}\r\n >\r\n {helperText}\r\n </Typography>\r\n </HelperTextWrapper>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nexport { PhoneInput };\r\nexport default PhoneInput;","import { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport PhoneInput from \"../../../phone-input/phone-input\";\nimport { memo } from \"react\";\n\nconst DynamicPhone = memo((props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field,fieldState }) => (\n <PhoneInput\n {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n required={props.formType === \"builder\" ? false : props.required}\n placeholder={props.placeholder}\n default_value={props.default_value}\n onChange={(val) => field.onChange(val)}\n error={Boolean(fieldState.error?.message)}\n disabled={props.disabled}\n helperText={fieldState.error?.message || \"\"}\n setCountryCodeField={props.setCountryCodeField}\n />\n )}\n />\n );\n});\n\nDynamicPhone.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n position: PropTypes.number,\n formType: PropTypes.string,\n placeholder: PropTypes.string,\n default_value: PropTypes.string,\n type: PropTypes.string,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n setCountryCodeField: PropTypes.func,\n};\n\nexport { DynamicPhone };\nexport default DynamicPhone;\n","import React from 'react';\r\n\r\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';\r\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';\r\nimport { DateTimePicker as Date } from '@mui/x-date-pickers/DateTimePicker';\r\nimport Typography from '../typography/typography';\r\nimport { styled } from '@mui/material/styles';\r\nimport logo from '../../assets/images';\r\nimport dayjs from 'dayjs';\r\nimport './date-time-picker.scss'\r\n\r\nexport interface DatePickerProps {\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\terror?: boolean;\r\n\tname?: string;\r\n\tvalue?: string | number | Date;\r\n\thelperText?: string;\r\n\tdataPosition?: number;\r\n\tdataName?: string;\r\n\tdisableFutureDates?: boolean;\r\n\tplaceholder?: string;\r\n\trequired?: boolean;\r\n\tdisablePastDates?: boolean;\r\n\tdefaultValue?: string | number | Date | undefined;\r\n\ttextFieldProps?: any;\r\n\tformat?: string;\r\n}\r\n\r\nconst StyledDatePicker = styled(Date)(({ theme: { palette } }) => ({\r\n\t'& .MuiOutlinedInput-root': {\r\n\t\tpadding: '0',\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'& fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[400]\r\n\t\t},\r\n\t\t'&:hover fieldset': {\r\n\t\t\tborderColor: palette.theme?.secondary[500]\r\n\t\t},\r\n\t\t'&.Mui-focused fieldset': {\r\n\t\t\tborderWidth: '0.0625rem',\r\n\t\t\tborderStyle: 'solid',\r\n\t\t\tborderColor: palette.theme?.primary[700]\r\n\t\t},\r\n\t\t'&.Mui-error fieldset': {\r\n\t\t\tborderColor: palette.theme?.error[600]\r\n\t\t},\r\n\t\t'&.Mui-disabled': {\r\n\t\t\tbackground: palette.theme?.secondary[200],\r\n\t\t\tcolor: palette.theme?.secondary[800]\r\n\t\t},\r\n\t\t'& .MuiInputBase-input::placeholder': {\r\n\t\t\tcolor: palette.theme?.secondary[800],\r\n\t\t\topacity: 1\r\n\t\t}\r\n\t},\r\n\t'& .MuiFormHelperText-root': {\r\n\t\tmarginLeft: 0,\r\n\t\tcolor: palette.theme?.secondary[800],\r\n\t\t'&.Mui-error': {\r\n\t\t\tcolor: palette.theme?.error[600]\r\n\t\t}\r\n\t},\r\n\t'& .MuiIconButton-root': {\r\n\t\tmarginRight: 0\r\n\t},\r\n\t'& .MuiPickersCalendarHeader-labelContainer': {\r\n\t\tfontWeight: 600\r\n\t}\r\n}));\r\n\r\nconst DateTimePicker = (props: DatePickerProps) => {\r\n\tconst {\r\n\t\tlabel,\r\n\t\tdisabled,\r\n\t\terror,\r\n\t\thelperText,\r\n\t\tdataName,\r\n\t\tdataPosition,\r\n\t\tdisableFutureDates = false,\r\n\t\tplaceholder,\r\n\t\trequired = false,\r\n\t\tdisablePastDates = false,\r\n\t\tdefaultValue,\r\n\t\ttextFieldProps,\r\n\t\tformat,\r\n\t\t...rest\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<LocalizationProvider dateAdapter={AdapterDayjs}>\r\n\t\t\t{label && (\r\n\t\t\t\t<Typography\r\n\t\t\t\t\ttype='s5'\r\n\t\t\t\t\tweight='medium'\r\n\t\t\t\t\tmb={0.5}\r\n\t\t\t\t\tcolor={error ? 'theme.error.600' : 'theme.secondary.800'}\r\n\t\t\t\t\tdata-position={dataPosition}\r\n\t\t\t\t\tdata-name={dataName}>\r\n\t\t\t\t\t{label} {required && <span className='requiredStar'>*</span>}\r\n\t\t\t\t</Typography>\r\n\t\t\t)}\r\n\t\t\t<StyledDatePicker\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tdisableFuture={disableFutureDates}\r\n\t\t\t\tdisablePast={disablePastDates}\r\n\t\t\t\tslotProps={{\r\n\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\thelperText: helperText,\r\n\t\t\t\t\t\terror: error,\r\n\t\t\t\t\t\tplaceholder: placeholder || 'MM/DD/YYYY HH:mm:ss',\r\n\t\t\t\t\t\t...textFieldProps\r\n\t\t\t\t\t\t// required: required,\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tformat={format || 'MM/DD/YYYY HH:mm:ss'}\r\n\t\t\t\tslots={{ openPickerIcon: logo.CalenderIcon }}\r\n\t\t\t\t{...rest}\r\n\t\t\t\tdefaultValue={defaultValue ? dayjs(defaultValue) : undefined}\r\n\t\t\t\tclassName='datePicker'\r\n\t\t\t/>\r\n\t\t</LocalizationProvider>\r\n\t);\r\n};\r\n\r\nexport { DateTimePicker };\r\nexport default DateTimePicker;\r\n","import { Box, styled } from \"@mui/material\";\nimport logo from \"../../assets/images\";\nimport Button from \"../button/button\";\nimport Typography from \"../typography/typography\";\n// import { useEffect, useState } from \"react\";\nimport { Document } from \"../icons\";\nimport { enqueueSnackbar } from \"notistack\";\nimport { memo } from \"react\";\n// import Avatar from \"../avatar/avatar\";\n\nexport interface UploadImageProps {\n type?: string;\n label: string;\n disabled?: boolean;\n error?: boolean;\n dataPosition?: number;\n dataName?: string;\n required?: boolean;\n max_size?: number;\n name: string;\n value: string;\n onChange: (e: any) => any;\n multiple: boolean\n}\nconst UploadMedia = memo((props: UploadImageProps) => {\n const {\n type,\n label,\n disabled,\n error,\n dataName,\n dataPosition,\n required,\n max_size = 20,\n onChange,\n name,\n value,\n multiple,\n ...rest\n } = props;\n\n const VisuallyHiddenInput = styled(\"input\")({\n clip: \"rect(0 0 0 0)\",\n clipPath: \"inset(50%)\",\n height: 1,\n overflow: \"hidden\",\n position: \"absolute\",\n bottom: 0,\n left: 0,\n whiteSpace: \"nowrap\",\n width: 1,\n });\n\n // const [selectedFile, setSelectedFile] = useState<string | null>(null);\n const StyledButton = styled(Button)(({ theme: { palette } }) => ({\n marginBottom: 8,\n \"&.MuiButton-outlined\": {\n color: palette.theme?.primary[1000],\n },\n \"&.Mui-disabled\": {\n background: palette.theme?.secondary[200],\n color: palette.theme?.secondary[800],\n borderWidth: \"0.0625rem\",\n borderStyle: \"solid\",\n borderColor: palette.theme?.secondary[400],\n },\n }));\n\n const allowedImageTypes = [\n \"image/jpeg\", // JPG, JPEG\n \"image/png\", // PNG\n \"image/gif\", // GIF\n \"image/bmp\", // BMP\n \"image/webp\", // WebP\n \"image/svg+xml\", // SVG\n \"image/tiff\", // TIFF\n \"image/x-icon\", // ICO (icon files)\n \"image/heic\", // HEIC (High Efficiency Image Format)\n \"image/heif\"\n ]\n const allowedFileTypes = [\n \"application/pdf\",\n \"application/msword\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n 'application/vnd.ms-powerpoint',\n 'application/vnd.oasis.opendocument.text',\n 'text/csv',\n 'text/plain',\n 'application/rtf',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'application/vnd.oasis.opendocument.spreadsheet',\n 'application/vnd.oasis.opendocument.presentation',\n \"image/jpeg\", // JPG, JPEG\n \"image/png\", // PNG\n \"image/gif\", // GIF\n \"image/bmp\", // BMP\n \"image/webp\", // WebP\n \"image/svg+xml\", // SVG\n \"image/tiff\", // TIFF\n \"image/x-icon\", // ICO (icon files)\n \"image/heic\", // HEIC (High Efficiency Image Format)\n \"image/heif\"\n ];\n\n const isValidFileType = (file: any) => {\n if (type === \"image\") {\n return allowedImageTypes.includes(file.type);\n } else if (type === 'file') {\n return allowedFileTypes.includes(file.type);\n }\n };\n\n\n const handleUpload = (e: any) => {\n const files = [...e.target.files];\n const filterredFiles = files.map(file => {\n if (file && file.size <= max_size * 1024 * 1024) {\n if (isValidFileType(file)) {\n return file\n } else {\n enqueueSnackbar(`Invalid file type for ${file.name}. Please upload a valid document.`, { variant: 'error' })\n return null\n }\n }\n })?.filter(Boolean)\n onChange(multiple ? (value?.length ? [...value, ...filterredFiles] : filterredFiles) : filterredFiles[0]);\n };\n\n const getFileName = (file) => {\n if (!file) return \"\"\n if (file instanceof File) {\n return file.name\n } else if(typeof file === 'string') { \n const parts = file?.split('/');\n return parts?.[parts?.length - 1];\n } else if(Array.isArray(file) && file?.length > 0) {\n return file.map(f => {\n const parts = f?.split('/');\n return parts?.[parts?.length - 1];\n }).join(', ')\n }\n }\n // const getImagePreview = (file) => {\n // if (!file) return \"\"\n // if (file instanceof File) {\n // let previewUrl:any = ''\n // const reader = new FileReader();\n // reader.onload = () => {\n // previewUrl = reader.result;\n // };\n // reader.readAsDataURL(file);\n\n // return previewUrl\n // } else {\n // return file.includes(S3_BUCKET_URL) ? file : S3_BUCKET_URL + file\n // }\n // }\n\n const getSelectedFiles = (files: any) => {\n\n if (files) {\n if (Array.isArray(files)) {\n return files.map(file => (\n <Box display=\"flex\" gap={1} mb={1} alignItems='center'>\n {type === 'file' && <Document fontSize=\"small\" />}\n {/* {type === 'image' && <Avatar src={getImagePreview(file)} />} */}\n <Typography\n type=\"s5\"\n weight=\"medium\"\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n noWrap\n >\n {getFileName(file)}\n </Typography>\n </Box>\n ))\n } else {\n return (\n <Box display=\"flex\" gap={1} alignItems='center'>\n {type === 'file' && <Document fontSize=\"small\" />}\n {/* {type === 'image' && <Avatar src={getImagePreview(files)} />} */}\n <Typography\n type=\"s5\"\n weight={\"medium\"}\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n noWrap\n >\n {getFileName(files)}\n </Typography>\n </Box>\n )\n }\n }\n }\n\n // useEffect(() => {\n // if(!multiple) {\n // const parts = value?.split('/');\n // // const documentPath = parts?.slice(3, parts.length - 1).join('/');\n // const filename = parts?.[parts?.length - 1];\n\n \n // if (value) setSelectedFile(filename)\n // }\n // }, [multiple, value])\n\n return (\n <>\n <Typography\n type=\"s5\"\n weight={\"medium\"}\n mb={0.5}\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n >\n {label} {required && \" *\"}\n </Typography>\n <div style={{ display: \"flex\" }}>\n <StyledButton\n component=\"label\"\n startIcon={\n <img\n src={type === \"image\" ? logo.uploadImage : logo.uploadDocument}\n />\n }\n variant=\"outlined\"\n disabled={disabled}\n >\n <Typography type='s5' weight=\"medium\" color=\"theme.secondary.1000\">Upload</Typography>\n <VisuallyHiddenInput\n type=\"file\"\n accept={type === \"file\" ? allowedFileTypes.join(\",\") : (type === 'image' ? allowedImageTypes.join(\",\") : undefined)}\n // required={required}\n onChange={handleUpload}\n name={name}\n multiple={multiple}\n {...rest}\n />\n </StyledButton>\n </div >\n {getSelectedFiles(value)}\n\n </>\n );\n})\n\nexport { UploadMedia };\nexport default UploadMedia;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\r\n\r\nimport { Box } from '@mui/material';\r\n\r\nimport Typography from '../../typography/typography';\r\nimport DatePicker from '../../date-picker/date-picker';\r\nimport DateTimePicker from '../../date-time-picker/date-time-picker';\r\nimport TextField from '../../text-field/text-field';\r\nimport UploadMedia from '../../upload-media/upload-media';\r\n\r\nimport * as yup from 'yup';\r\nimport _ from 'lodash';\r\nimport dayjs from 'dayjs';\r\nimport PhoneInput from '../../phone-input/phone-input';\r\nimport Checkbox from '../../checkbox/checkbox';\r\nimport SearchableSelect from '../../searchable-select';\r\n\r\ninterface IInlineEditFields {\r\n\tcell: any;\r\n\tcolumn: any;\r\n\trow: any;\r\n\ttable: any;\r\n\tcol: any;\r\n\tcallback: (value: any, column: any, rowId: any) => any;\r\n\terrors: any;\r\n\tvalidationSchema: any;\r\n\tsetValidationErrors: any;\r\n\tonChangeRowField?: (e: any, type: string, row: any) => any;\r\n\tgetSelectedData: any\r\n}\r\nconst InlineEditFields: React.FC<IInlineEditFields> = ({\r\n\t// cell,\r\n\tcolumn,\r\n\trow,\r\n\t// table,\r\n\tcol,\r\n\t// callback,\r\n\terrors,\r\n\tvalidationSchema,\r\n\tsetValidationErrors,\r\n\tonChangeRowField,\r\n\tgetSelectedData\r\n}) => {\r\n\r\n\tconst [inputValue, setInputValue] = useState<any>();\r\n\tconst [isInitialSet, setIsInitialSet] = useState<any>(false);\r\n\tconst customFilter = useRef(null)\r\n\t// ** Getting only editing enabled fields.\r\n\tconst editCols = row\r\n\t\t.getAllCells()\r\n\t\t.map((col: any) => col.column.columnDef)\r\n\t\t.filter(\r\n\t\t\t(col: any) =>\r\n\t\t\t\tcol?.enableEditing === undefined || col?.enableEditing === true\r\n\t\t);\r\n\r\n\tconst editVariant = col.editVariant;\r\n\tconst fieldProperties = column.columnDef?.editProperties || {};\r\n\r\n\t// ** Default and Dynamic disbaling a field with row data\r\n\tlet fieldDisbled = false;\r\n\tif (fieldProperties?.disable) {\r\n\t\tif (typeof fieldProperties.disable === 'function') {\r\n\t\t\tfieldDisbled = Boolean(fieldProperties?.disable(row, row._valuesCache));\r\n\t\t} else {\r\n\t\t\tfieldDisbled = Boolean(fieldProperties.disable);\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleCustomFilter = useCallback(async (row, values) => {\r\n\r\n\t\ttry {\r\n\t\t\tif (typeof fieldProperties.customeFilter === 'function') {\r\n\t\t\t\tconst filter = await fieldProperties.customeFilter(row, values);\r\n\t\t\t\tcustomFilter.current = filter;\r\n\t\t\t\treturn filter;\r\n\t\t\t} else {\r\n\t\t\t\tcustomFilter.current = fieldProperties?.customeFilter;\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [fieldProperties, row, row._valuesCache]);\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\thandleCustomFilter(row, row._valuesCache)\r\n\t}, [handleCustomFilter, row, row._valuesCache]);\r\n\t// ** Setting a default value for edit mode.\r\n\tconst valueKey = fieldProperties?.valueKey;\r\n\tlet defaultValue: any = '';\r\n\r\n\tif (editVariant === 'select' && fieldProperties?.is_multiple) {\r\n\t\tdefaultValue = valueKey ? _.get(row.original, valueKey, []) : [];\r\n\t} else {\r\n\t\tdefaultValue = valueKey\r\n\t\t\t? _.get(row.original, valueKey, row.original[column.id])\r\n\t\t\t: row.original[column.id];\r\n\t}\r\n\r\n\t// ** Validate a field with Material Table Validation Schema.\r\n\tconst validate = async (value: any) => {\r\n\t\ttry {\r\n\t\t\t// const v = await validationSchema.validateAt( // * * This line has commented for rerendering purpose\r\n\t\t\tawait validationSchema.validateAt(\r\n\t\t\t\tcolumn.id,\r\n\t\t\t\t{\r\n\t\t\t\t\t[column.id]: value\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t\t// if (v) { // * * The if condition has commented for rerendering purpose\r\n\t\t\tconst fe: any = {}; // field error\r\n\t\t\tfor (const e in errors) {\r\n\t\t\t\tif (e != column.id) {\r\n\t\t\t\t\tfe[e] = errors[e];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetValidationErrors(fe);\r\n\t\t\t// }\r\n\t\t} catch (err) {\r\n\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\tconst e: Record<string, string> = {};\r\n\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\te[error.path] = error.message;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tconst em = { ...errors, ...e };\r\n\t\t\t\tsetValidationErrors(em);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\t// ** Detect onChnage to perform the action on an input change.\r\n\tconst onChange = async (e: any, type: string, selectedData: any) => {\r\n\t\tconst data = selectedData\r\n\t\tlet value;\r\n\t\tswitch (type) {\r\n\t\t\tcase 'date':\r\n\t\t\tcase 'file':\r\n\t\t\tcase 'image':\r\n\t\t\tcase 'phone':\r\n\t\t\t\tvalue = e;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: e });\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'text':\r\n\t\t\tcase 'number':\r\n\t\t\t\tvalue = e.target.value;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: value });\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'checkbox':\r\n\t\t\t\tvalue = e.target.checked;\r\n\t\t\t\t// setInputValue({ ...inputValue, [column.id]: value });\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tvalue = e.target.value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tsetInputValue({ ...inputValue, [column.id]: value });\r\n\r\n\t\tif (onChangeRowField) {\r\n\t\t\tconst v = await onChangeRowField(e, type, row, col, data);\r\n\t\t\tif (v) {\r\n\t\t\t\trow._valuesCache = { ...row._valuesCache, ...v };\r\n\t\t\t\tsetInputValue({ ...inputValue, ...v });\r\n\t\t\t}\r\n\t\t}\r\n\t\tsetInputValue({ ...inputValue, [column.id]: value });\r\n\t\trow._valuesCache = { ...row._valuesCache, [column.id]: value };\r\n\r\n\t\tawait validate(value);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetInputValue({ ...inputValue, ...row._valuesCache });\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [row._valuesCache]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isInitialSet) {\r\n\t\t\tconst editFields = Object.keys(row._valuesCache || {});\r\n\t\t\tconst dValues: any = {};\r\n\r\n\t\t\trow.getAllCells().forEach((cell) => {\r\n\t\t\t\tif (\r\n\t\t\t\t\tcell.column.columnDef?.enableEditing === undefined ||\r\n\t\t\t\t\tcell.column.columnDef?.enableEditing === true\r\n\t\t\t\t) {\r\n\t\t\t\t\tconst { is_multiple, valueKey } =\r\n\t\t\t\t\t\tcell.column.columnDef?.editProperties || {};\r\n\t\t\t\t\tif (editFields.includes(cell.column.id)) {\r\n\t\t\t\t\t\tconst vl = _.get(row.original, valueKey);\r\n\t\t\t\t\t\tif (editVariant === 'select' && is_multiple) {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = vl\r\n\t\t\t\t\t\t\t\t? Array.isArray(vl)\r\n\t\t\t\t\t\t\t\t\t? vl\r\n\t\t\t\t\t\t\t\t\t: [vl]\r\n\t\t\t\t\t\t\t\t: [];\r\n\t\t\t\t\t\t} else if (editVariant === 'date' || editVariant === 'date_time') {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = vl\r\n\t\t\t\t\t\t\t\t? dayjs(vl).isValid()\r\n\t\t\t\t\t\t\t\t\t? dayjs(vl)\r\n\t\t\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t\t\t\t: dayjs(row.original[cell.column.id]).isValid()\r\n\t\t\t\t\t\t\t\t\t? dayjs(row.original[cell.column.id])\r\n\t\t\t\t\t\t\t\t\t: undefined;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdValues[cell.column.id] = _.get(\r\n\t\t\t\t\t\t\t\trow.original,\r\n\t\t\t\t\t\t\t\tvalueKey,\r\n\t\t\t\t\t\t\t\trow.original[cell.column.id]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t// setFieldsValues(dValues);\r\n\t\t\trow._valuesCache = dValues;\r\n\t\t\tsetInputValue(dValues);\r\n\t\t\tsetIsInitialSet(true);\r\n\t\t}\r\n\t}, [row, editVariant, isInitialSet]);\r\n\r\n\tconst handleMinDate = (state) => typeof state == 'function' ? state(row) : state\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{(!editVariant || editVariant === 'number') && (\r\n\t\t\t\t<TextField\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\t// onBlur={(e) => onBlur(e)}\r\n\t\t\t\t\t// onKeyDown={onKeyDown}\r\n\t\t\t\t\tonChange={(e) => onChange(e, editVariant)}\r\n\t\t\t\t\tvalue={inputValue?.[column.id]}\r\n\t\t\t\t\tautoFocus={editCols?.[0]?.accessorKey === column.id}\r\n\t\t\t\t\ttype={editVariant || 'text'}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tplaceholder={fieldProperties?.placeholder || ''}\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'select' && (\r\n\t\t\t\t<Box display='flex' flexDirection='column' width='100%'>\r\n\t\t\t\t\t<SearchableSelect\r\n\t\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\t\tplaceholder={fieldProperties?.placeholder || ''}\r\n\t\t\t\t\t\tsearchPlaceholder={`Search ${col.header}`}\r\n\t\t\t\t\t\tonChange={(e, row) => onChange(e, 'select', row)}\r\n\t\t\t\t\t\tapiType={fieldProperties?.apiType}\r\n\t\t\t\t\t\tautoFocus={editCols?.[0]?.accessorKey === column.id}\r\n\t\t\t\t\t\toptions={col?.editSelectOptions}\r\n\t\t\t\t\t\tcustomeFilter={customFilter.current}\r\n\t\t\t\t\t\tfilterKey={fieldProperties?.filterKey}\r\n\t\t\t\t\t\tlabelKey={fieldProperties?.labelKey}\r\n\t\t\t\t\t\tvalueKey={fieldProperties?.bindingKey}\r\n\t\t\t\t\t\tattributes={fieldProperties.attributes}\r\n\t\t\t\t\t\tisInternal={fieldProperties?.isInternal || !fieldProperties?.apiType}\r\n\t\t\t\t\t\tmultiple={fieldProperties?.is_multiple}\r\n\t\t\t\t\t\tvalue={\r\n\t\t\t\t\t\t\tfieldProperties?.is_multiple\r\n\t\t\t\t\t\t\t\t? Array.isArray(inputValue?.[column.id])\r\n\t\t\t\t\t\t\t\t\t? inputValue?.[column.id]\r\n\t\t\t\t\t\t\t\t\t: []\r\n\t\t\t\t\t\t\t\t: inputValue?.[column.id]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tgetSelectedData={(row) => getSelectedData(fieldProperties?.field_name, row)}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t{errors?.[column.id] && (\r\n\t\t\t\t\t\t<Typography color='theme.error.600' type='s5'>\r\n\t\t\t\t\t\t\t{errors?.[column.id]}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'date' && (\r\n\t\t\t\t<DatePicker\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'date')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={\r\n\t\t\t\t\t\tdayjs(row._valuesCache[column.id]).isValid()\r\n\t\t\t\t\t\t\t? dayjs(row._valuesCache[column.id])\r\n\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t\tminDate={() => handleMinDate(fieldProperties?.min_date)}\r\n\t\t\t\t\tmaxDate={() => handleMinDate(fieldProperties?.min_date)}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'date_time' && (\r\n\t\t\t\t<DateTimePicker\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultValue={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'date')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={\r\n\t\t\t\t\t\tdayjs(row._valuesCache[column.id]).isValid()\r\n\t\t\t\t\t\t\t? dayjs(row._valuesCache[column.id])\r\n\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{(editVariant === 'file' || editVariant === 'image') && (\r\n\t\t\t\t<Box display='flex' flexDirection='column'>\r\n\t\t\t\t\t<UploadMedia\r\n\t\t\t\t\t\tname={fieldProperties?.field_name || 'table_file'}\r\n\t\t\t\t\t\tdataPosition={0}\r\n\t\t\t\t\t\tdataName='table_file'\r\n\t\t\t\t\t\tlabel=''\r\n\t\t\t\t\t\ttype={editVariant}\r\n\t\t\t\t\t\tmax_size={10}\r\n\t\t\t\t\t\tonChange={(v) => onChange(v, 'file')}\r\n\t\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\t\tmultiple={Boolean(column?.is_multiple)}\r\n\t\t\t\t\t\tvalue={row._valuesCache[column.id]}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{errors?.[column.id] && (\r\n\t\t\t\t\t\t<Typography color='theme.error.600' type='s5'>\r\n\t\t\t\t\t\t\t{errors?.[column.id]}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'phone' && (\r\n\t\t\t\t<PhoneInput\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefault_value={defaultValue}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'phone')}\r\n\t\t\t\t\ttextFieldProps={{\r\n\t\t\t\t\t\tautoFocus: editCols?.[0]?.accessorKey === column.id\r\n\t\t\t\t\t}}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={row._valuesCache?.[column.id]}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t\tisInlineEditing={true}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{editVariant === 'checkbox' && (\r\n\t\t\t\t<Checkbox\r\n\t\t\t\t\tname={fieldProperties?.field_name || ''}\r\n\t\t\t\t\tdefaultChecked={Boolean(defaultValue)}\r\n\t\t\t\t\t// checked={Boolean(defaultValue)}\r\n\t\t\t\t\tonChange={(v) => onChange(v, 'checkbox')}\r\n\t\t\t\t\terror={errors?.[column.id] ? true : false}\r\n\t\t\t\t\thelperText={errors?.[column.id]}\r\n\t\t\t\t\tformat={fieldProperties?.dateFormat}\r\n\t\t\t\t\tplaceholder={\r\n\t\t\t\t\t\tfieldProperties?.placeholder || fieldProperties?.dateFormat\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalue={row._valuesCache?.[column.id]}\r\n\t\t\t\t\tdisabled={fieldDisbled}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nexport default InlineEditFields;\r\n","/* eslint-disable unused-imports/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport React, { cloneElement, useCallback, useEffect, useState } from 'react';\r\nimport {\r\n\tMRT_ColumnDef,\r\n\tMRT_ColumnSizingInfoState,\r\n\tMRT_ColumnSizingState,\r\n\tMRT_Header,\r\n\tMRT_Row,\r\n\tMRT_RowData,\r\n\tMRT_RowSelectionState,\r\n\tMRT_SortingState,\r\n\tMRT_TableInstance,\r\n\tMRT_TableState,\r\n\tMaterialReactTable,\r\n\tMaterialReactTableProps,\r\n\tuseMaterialReactTable,\r\n\t// Cell\r\n} from 'material-react-table';\r\nimport { IPaginationModel } from '../../@types/pagination-model';\r\nimport {\r\n\tBox,\r\n\tstyled,\r\n\tMenuItem,\r\n\tIconButton,\r\n\tListItemIcon,\r\n\tListItemText,\r\n\tSvgIconProps,\r\n\tDivider\r\n} from '@mui/material';\r\nimport ChevronRightIcon from '@mui/icons-material/ChevronRight';\r\nimport ChevronLeftIcon from '@mui/icons-material/ChevronLeft';\r\nimport Menu from '../menu/menu';\r\nimport Typography from '../typography/typography';\r\nimport SearchBar from '../search-bar/search-bar';\r\nimport images from '../../assets/images';\r\n// import DeleteIcon from \"@mui/icons-material/Delete\";\r\n// import UpdateIcon from \"@mui/icons-material/Update\";\r\n// import PlayIcon from \"@mui/icons-material/PlayArrow\";\r\n\r\nimport './material-table.scss';\r\nimport {\r\n\tArrowUpDown,\r\n\tCheckBoxIcon,\r\n\tClose,\r\n\tEdit,\r\n\tRecgtangleIcon,\r\n\tSave,\r\n\tTrash\r\n} from '../icons';\r\n// import {\r\n// \tArrowDropDown /* , SaveOutlined */,\r\n// \tArrowDropUp\r\n// } from '@mui/icons-material';\r\nimport InlineEditFields from './components/inline-edit-fields';\r\nimport Tooltip from '../tooltip/Tooltip';\r\nimport Button from '../button/button';\r\nimport Add from '@mui/icons-material/Add';\r\nimport dayjs from 'dayjs';\r\nimport * as yup from 'yup';\r\nimport ConfirmPopUp from '../confirm-modal/confirm-modal';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport { useNavigate } from 'react-router-dom';\r\n// Module-specific pathname imports removed - should be passed as props or configured by consuming app\r\n// import { PathnameAccounting } from 'accounting/src/pathname.accounting';\r\n// import { PathnameInventory } from 'inventory/src/pathname.inventory';\r\n// import { PathnameManufacturing } from 'manufacturing/src/pathname.manufacturing';\r\n// import { PathnamePurchase } from 'procurement/src/pathname.procurement';\r\n// import { PathnameCrm } from 'crm/src/pathname.crm';\r\n// import { PathnameUsers } from 'user/src/pathname.user';\r\n// import { PathnameRental } from '../../../../rental/src/pathname.rental';\r\nimport { PathnameDocument } from '../../constants/pathnames/pathname.document';\r\nimport { PathnameAccounting } from '../../constants/pathnames/pathname.accounting';\r\nimport { PathnameInventory } from '../../constants/pathnames/pathname.inventory';\r\nimport { PathnameManufacturing } from '../../constants/pathnames/pathname.manufacturing';\r\nimport { PathnamePurchase } from '../../constants/pathnames/pathname.procurement';\r\nimport { PathnameCrm } from '../../constants/pathnames/pathname.crm';\r\nimport { PathnameUsers } from '../../constants/pathnames/pathname.user';\r\nimport { PathnameRental } from '../../constants/pathnames/pathname.rental';\r\nimport useDeepMemo from '../../hooks/use-deep-memo';\r\nimport { PageState } from '../../contexts/page-context';\r\n\r\ntype ExtraEditVariants =\r\n\t| 'file'\r\n\t| 'image'\r\n\t| 'date'\r\n\t| 'number'\r\n\t| 'time'\r\n\t| 'date_time'\r\n\t| 'phone'\r\n\t| 'checkbox';\r\n\r\ntype DisableFunction = (row: any, virtualRow?: any) => boolean;\r\n\r\nexport type TypeBooleanLabels = { 1: string; 0: string; true: string; false: string }\r\n\r\nexport interface MaterialTableColumnProps\r\n\textends Omit<MRT_ColumnDef<MRT_RowData>, 'editVariant'> {\r\n\tvisible?: boolean;\r\n\ttype?: string;\r\n\tshowDefaultCurrency?: boolean,\r\n\tvalueGet?: string;\r\n\tcustom_class?: string;\r\n\ttypeArrayAccessorKey?: string; //when type is an array of object\r\n\ttypeBooleanLabels?: TypeBooleanLabels; //when type is an boolean\r\n\teditVariant?: MRT_ColumnDef<MRT_RowData>['editVariant'] | ExtraEditVariants;\r\n\teditProperties?: {\r\n\t\tfield_name?: string;\r\n\t\tvalueKey?: string;\r\n\t\tplaceholder?: string;\r\n\t\tdateFormat?: string;\r\n\t\tvalidations?: any[];\r\n\t\tis_multiple?: boolean;\r\n\t\tis_multiline?: boolean;\r\n\t\tdisable?: boolean | DisableFunction;\r\n\t};\r\n\tredirectionPathWithId?: string;\r\n\thandleRowClick?: (row: any) => void;\r\n\tidField?: string;\r\n}\r\n\r\n\r\n\r\nexport interface MaterialTableColumnHeaderProps {\r\n\tcolumn: MRT_ColumnDef<any, any>;\r\n\theader: MRT_Header<any>;\r\n\ttable: MRT_TableInstance<any>;\r\n}\r\n\r\ntype rowSelectionCallback = (row: MRT_Row<any>) => boolean\r\n\r\ninterface MaterialTablePropsType {\r\n\tenablePagination?: boolean;\r\n\tdisableMaxHeight?: boolean;\r\n\trows: any;\r\n\ttotalPages: number;\r\n\tcolumns: any;\r\n\tpaginationModel: IPaginationModel;\r\n\tcolumnOrder?: string[];\r\n\tupdateData?: any;\r\n\thandleColumnOrdering?: (colOrder: any) => void;\r\n\tenableEditing?: boolean;\r\n\tenableColumnDragging?: boolean;\r\n\trowActionMenu?: any;\r\n\tdestructiveActionMenu?: any;\r\n\tgetRowId?: any;\r\n\tstates?: Partial<MRT_TableState<any>>;\r\n\tonSortingChange?: any;\r\n\tdisableDefaultActionColumn?: boolean;\r\n\tenableRowSelection?: boolean | rowSelectionCallback;\r\n\tdefaultActionColumnItems?: React.ReactElement[];\r\n\tenableBottomToolbar?: boolean;\r\n\tSetSelectedRowId?: any;\r\n\tisResetRow?: boolean;\r\n\tonCreateRow?: (data: any) => Promise<unknown>;\r\n\tonEditRow?: (data: any) => Promise<unknown>;\r\n\tonDeleteRow?: (data: any) => Promise<unknown>;\r\n\teditDisplayMode?: MaterialReactTableProps<any>['editDisplayMode'];\r\n\tenableRowCreate?: boolean;\r\n\tonChangeRowField?: (e: any, type: string, row: any) => void;\r\n\tonSelectRow?: (rows: any, prevSelected?: any) => any;\r\n\tenableColumnResizing?: boolean;\r\n\tselectedRowIds?: any[];\r\n\tonColumnVisibility?: (columns: MaterialTableColumnProps[]) => void\r\n\tgetSelectedData: any;\r\n\tenableAddCustomField?: boolean;\r\n\tdisabledDefaultActionColumnIcon?: boolean\r\n\tenableRowDragging?: boolean\r\n\thandleColumnResizing?: (sizes: MRT_ColumnSizingState) => void,\r\n\tcolumnSizes?: MRT_ColumnSizingState,\r\n\tshowPreview?: boolean;\r\n\thandlePreview?: (row: MRT_RowData) => void;\r\n}\r\n\r\nconst TableWrapper = styled(Box, {\r\n\tshouldForwardProp: (prop) => prop !== 'disableMaxHeight',\r\n})<{ disableMaxHeight?: boolean }>(({ theme: { palette }, disableMaxHeight }) => ({\r\n\t'.MuiTableCell-root': {\r\n\t\tborder: '1px solid #efefef',\r\n\t\tborderBottom: 0,\r\n\t\tborderLeft: 0,\r\n\t\tpadding: '0 0.5rem',\r\n\t\tlineHeight: '19px',\r\n\t\tfontSize: '14px',\r\n\t\tminHeight: 32,\r\n\t\t// '&:first-child': {\r\n\t\t// \tborderLeft: '1px solid #efefef'\r\n\t\t// },\r\n\t\t// '&:last-child': {\r\n\t\t// \tborderBottom: '1px solid #efefef'\r\n\t\t// }\r\n\r\n\t},\r\n\t'.MuiTableCell-head': {\r\n\t\tbackgroundColor: palette.theme?.secondary[100]\r\n\t},\r\n\t'.MuiTableContainer-root': {\r\n\t\t...(!disableMaxHeight && { maxHeight: 'clamp(350px, 100vh - 200px, 9999px) !important' }),\r\n\t},\r\n\r\n\t'.MuiPaper-root': {\r\n\t\tboxShadow: 'none',\r\n\r\n\t},\r\n\t'.MuiPaginationItem-root': {\r\n\t\t'&.Mui-selected': {\r\n\t\t\tbackgroundColor: palette?.theme?.primary[700],\r\n\t\t\tcolor: 'white'\r\n\t\t}\r\n\t},\r\n\t'.MuiTableRow-root': {\r\n\t\t'&.Mui-selected': {\r\n\t\t\tbackgroundColor: `${palette?.theme?.primary[100]} !important`,\r\n\t\t\tcolor: 'white'\r\n\t\t}\r\n\t},\r\n\t'.MuiCheckbox-indeterminate': {\r\n\t\tcolor: `${palette?.theme?.primary[700]} !important`,\r\n\t\t\"& svg\": {\r\n\t\t\theight: `20px !important`,\r\n\t\t\twidth: `20px !important`,\r\n\t\t}\r\n\t}\r\n}));\r\n\r\nexport const MaterialTable = React.memo(({\r\n\tenablePagination = false,\r\n\trows,\r\n\tcolumns,\r\n\ttotalPages,\r\n\tpaginationModel,\r\n\tcolumnOrder = ['mrt-row-select'],\r\n\tupdateData,\r\n\thandleColumnOrdering,\r\n\tenableEditing,\r\n\tenableColumnDragging,\r\n\tstates,\r\n\trowActionMenu,\r\n\tdestructiveActionMenu,\r\n\tdisableDefaultActionColumn,\r\n\tenableRowSelection,\r\n\tdefaultActionColumnItems = [],\r\n\tenableBottomToolbar,\r\n\tSetSelectedRowId,\r\n\tisResetRow,\r\n\tonCreateRow,\r\n\tonEditRow,\r\n\tonDeleteRow,\r\n\teditDisplayMode,\r\n\tenableRowCreate,\r\n\tonChangeRowField,\r\n\tonSelectRow,\r\n\tenableColumnResizing = true,\r\n\tselectedRowIds = [],\r\n\tonColumnVisibility,\r\n\tonSortingChange,\r\n\tgetSelectedData,\r\n\tdisabledDefaultActionColumnIcon = false,\r\n\tenableAddCustomField = true,\r\n\tenableRowDragging = false,\r\n\thandleColumnResizing = () => { },\r\n\tcolumnSizes = {},\r\n\tdisableMaxHeight = false,\r\n\tshowPreview = false,\r\n\thandlePreview = () => { },\r\n\t// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\r\n\t// getRowId,\r\n\t// onDelete,\r\n\t// onUpdate,\r\n\t...rest\r\n}: MaterialTablePropsType) => {\r\n\tconst { t } = useTranslation();\r\n\tconst { formData = null, updatePageInfo, activePage: aPage } = usePages()\r\n\tconst activePage = useDeepMemo<PageState>(aPage);\r\n\tconst { pageNo } = paginationModel;\r\n\tconst [row, setRow] = useState({});\r\n\tconst [tableColumns, setTableColumns] = useState(columns);\r\n\tconst [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst [popUpShow, setPopupShow] = useState<boolean>(false);\r\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst visibleColumns = tableColumns.filter((column: any) => column.visible);\r\n\tconst hiddenColumns = tableColumns.filter((column: any) => !column.visible);\r\n\tconst [filteredOptions, setFilteredOptions] = useState(hiddenColumns);\r\n\tconst [selectedRow, setSelectedRow] = useState<number | null>(null);\r\n\tconst [validationErrors, setValidationErrors] = useState<any>({});\r\n\tconst [validationSchema, setValidationSchema] = useState<any>([]);\r\n\tconst [isCreatingRow, setIsCreatingRow] = useState<boolean>(false);\r\n\tconst [isEditingRow, setIsEditingRow] = useState<boolean>(false);\r\n\tconst [isDeletingRow, setIsDeletingRow] = useState<boolean>(false);\r\n\tconst [rowToDelete, setRowToDelete] = useState<any>(null);\r\n\tconst [rowSelection, setRowSelection] = useState<MRT_RowSelectionState>({});\r\n\tconst [isChecked, setIsChecked] = useState(false)\r\n\tconst [sorting, setSorting] = useState<MRT_SortingState>([]);\r\n\tconst [disableNextEdit, setDisableNextEdit] = useState(false);\r\n\tconst [columnSizing, setColumnSizing] = useState<MRT_ColumnSizingState>(activePage.column_sizes);\r\n\tconst [columnSizingInfo, setColumnSizingInfo] = useState<MRT_ColumnSizingInfoState>({\r\n\t\tcolumnSizingStart: [],\r\n\t\tdeltaOffset: null,\r\n\t\tdeltaPercentage: null,\r\n\t\tisResizingColumn: false,\r\n\t\tstartOffset: null,\r\n\t\tstartSize: null\r\n\t});\r\n\r\n\tconst navigate = useNavigate();\r\n\tconst currentModule = location.pathname.split('/')[2]\r\n\r\n\tlet redirectionPath = ''\r\n\tswitch (currentModule) {\r\n\t\tcase 'accounting':\r\n\t\t\tredirectionPath = PathnameAccounting.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'inventory':\r\n\t\t\tredirectionPath = PathnameInventory.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'manufacturing':\r\n\r\n\t\t\tredirectionPath = PathnameManufacturing.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'procurement':\r\n\t\t\tredirectionPath = PathnamePurchase.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'crm':\r\n\t\t\tredirectionPath = PathnameCrm.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'user':\r\n\t\t\tredirectionPath = PathnameUsers.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'rental':\r\n\t\t\tredirectionPath = PathnameRental.CUSTOM_FORM\r\n\t\t\tbreak;\r\n\t\tcase 'drive':\r\n\t\t\tredirectionPath = PathnameDocument.ADD_CUSTOM_FIELDS\r\n\t\t\tbreak;\r\n\t}\r\n\tconst path = `/dashboard/${currentModule}${redirectionPath}`\r\n\tconst getValidationType = (column: any) => {\r\n\t\tswitch (column.editVariant) {\r\n\t\t\tcase 'select':\r\n\t\t\t\treturn column?.editProperties?.is_multiple ? yup.array() : yup.string();\r\n\r\n\t\t\tcase 'number':\r\n\t\t\t\treturn yup.number().nullable().transform((value, originalValue) => (originalValue === \"\" ? null : value));\r\n\r\n\t\t\tcase 'url':\r\n\t\t\t\treturn yup\r\n\t\t\t\t\t.string()\r\n\t\t\t\t\t.matches(\r\n\t\t\t\t\t\t/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/,\r\n\t\t\t\t\t\t{ excludeEmptyString: true, message: 'Please enter valid URL.' }\r\n\t\t\t\t\t);\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn yup.string()\r\n\t\t}\r\n\t};\r\n\r\n\tconst validationReducer = (\r\n\t\tvalidations: any,\r\n\t\tvalidation: any,\r\n\t\tcolumn: any\r\n\t) => {\r\n\t\tlet vld = validations\r\n\t\tswitch (validation.type) {\r\n\t\t\tcase 'required':\r\n\t\t\t\tvld = validation.value\r\n\t\t\t\t\t? validations.required(validation.msg_en).typeError(validation.msg_en)\r\n\t\t\t\t\t: column?.editProperties?.is_multiple\r\n\t\t\t\t\t\t? validations.min(1, validation.msg_en)\r\n\t\t\t\t\t\t: validations;\r\n\t\t\t\tbreak\r\n\t\t\tcase 'min':\r\n\t\t\t\tvld = validations.min(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'email':\r\n\t\t\t\tvld = validations.email(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'max':\r\n\t\t\t\tvld = validations.max(validation.value, validation.msg_en);\r\n\t\t\t\tbreak\r\n\t\t\tcase 'positive':\r\n\t\t\t\tvld = validation.value === true ? validations.test('is-positive-number', 'Value must be a positive number', (value) => !value || value >= 0) : validations;\r\n\t\t\t\tbreak\r\n\t\t\tcase 'when':\r\n\t\t\t\treturn validations.when(validation.relation, {\r\n\t\t\t\t\tis: (val: any) => val === validation.values,\r\n\t\t\t\t\tthen: () =>\r\n\t\t\t\t\t\tvalidation?.thenValidations?.reduce(\r\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\r\n\t\t\t\t\t\t\tvalidations\r\n\t\t\t\t\t\t) || validations,\r\n\t\t\t\t\totherwise: () =>\r\n\t\t\t\t\t\tvalidation?.otherWiseValidations?.reduce(\r\n\t\t\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\t\t\tvalidationReducer(validations, validation, column),\r\n\t\t\t\t\t\t\tvalidations\r\n\t\t\t\t\t\t) || validations\r\n\t\t\t\t});\r\n\t\t\t// Add more cases for other validation types as needed\r\n\t\t\tdefault:\r\n\t\t\t\tvld = validations;\r\n\t\t\t\tbreak\r\n\t\t}\r\n\r\n\t\tif (validation.type == 'required' && validation.value && (!column?.editVariant || column?.editVariant == 'text')) {\r\n\t\t\tvld = validations.test('no-blank-spaces', 'Blank space is not allowed', (value) => {\r\n\t\t\t\treturn value && value.trim()?.length > 0;\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn vld\r\n\r\n\t};\r\n\r\n\r\n\tconst generateValidationSchema = (columns: any[]) => {\r\n\t\tconst schema: any = {};\r\n\t\tcolumns.forEach((clm) => {\r\n\t\t\tif (clm?.editProperties?.validations?.length) {\r\n\t\t\t\tconst fieldValidations = clm?.editProperties?.validations.reduce(\r\n\t\t\t\t\t(validations: any, validation: any) =>\r\n\t\t\t\t\t\tvalidationReducer(validations, validation, clm),\r\n\t\t\t\t\tgetValidationType(clm)\r\n\t\t\t\t);\r\n\t\t\t\tschema[clm.accessorKey] = fieldValidations;\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn schema;\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tsetTableColumns(columns);\r\n\r\n\t\tconst schema: any = generateValidationSchema(columns);\r\n\t\tsetValidationSchema(yup.object().shape(schema));\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [columns]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!columnSizingInfo?.isResizingColumn) {\r\n\t\t\tupdatePageInfo({ column_sizes: { ...activePage.column_sizes, ...columnSizing } })\r\n\t\t\thandleColumnResizing?.(columnSizing)\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [columnSizingInfo?.isResizingColumn, columnSizing])\r\n\r\n\tconst handleHeaderClick = (event: any) => {\r\n\t\tsetAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleHeaderClose = () => {\r\n\t\tsetAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleVisibleColumn = (column: any) => {\r\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\tvisible: col.accessorKey === column.accessorKey ? false : col.visible\r\n\t\t}));\r\n\t\tsetTableColumns(updatedColumns);\r\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\r\n\t\tsetFilteredOptions([...filteredOptions, column]);\r\n\t\tsetAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleAddButtonClick = () => {\r\n\t\tsetPopupShow(true);\r\n\t};\r\n\r\n\tconst handleBackButtonClick = () => {\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleAddColumn = (column: any) => {\r\n\t\tconst updatedColumns = tableColumns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\tvisible: col.accessorKey === column.accessorKey ? true : col.visible\r\n\t\t}));\r\n\t\tonColumnVisibility?.(JSON.parse(JSON.stringify(updatedColumns)))\r\n\t\tsetTableColumns(updatedColumns);\r\n\r\n\t\tconst updatedFilteredOptions = filteredOptions.filter(\r\n\t\t\t(option: any) => option.accessorKey !== column.accessorKey\r\n\t\t);\r\n\t\tsetFilteredOptions(updatedFilteredOptions);\r\n\t\tsetAnchorEl(null);\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleSearchEvent = (searchQuery: string) => {\r\n\t\tconst filteredColumns = hiddenColumns.filter((option: any) =>\r\n\t\t\toption.header.toLowerCase().includes(searchQuery.toLowerCase())\r\n\t\t);\r\n\t\tsetFilteredOptions(filteredColumns);\r\n\t};\r\n\r\n\tconst handleCustomAddColumn = () => {\r\n\t\tnavigate(path, { state: formData })\r\n\t\tsetAnchorEl(null);\r\n\t\tsetPopupShow(false);\r\n\t};\r\n\r\n\tconst handleRowClick = (rowId: number) => {\r\n\t\tsetSelectedRow(rowId); // Update selected row ID when a row is clicked\r\n\t};\r\n\r\n\tconst handlePreviewClick = (row: MRT_RowData) => {\r\n\t\thandlePreview?.(row);\r\n\t};\r\n\r\n\t// const handleDeleteClick = (event: any, data: any) => {\r\n\t// onDelete?.(data.id);\r\n\t// };\r\n\t// const handleUpdateClick = (event: any, data: any) => {\r\n\t// onUpdate?.(data.id);\r\n\t// };\r\n\r\n\tconst handleActionsClick = (event: any, data: any) => {\r\n\t\tsetRow(data);\r\n\t\tsetRowAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleActionsClose = () => {\r\n\t\tsetRowAnchorEl(null);\r\n\t};\r\n\r\n\tconst formtValues = (values: any, cells: any[]) => {\r\n\t\tconst v: any = {};\r\n\t\tObject.keys(values).forEach((vl) => {\r\n\t\t\tconst val = values[vl];\r\n\t\t\tv[vl] = val;\r\n\t\t\tconst cell = cells.find((c) => c.accessorKey == vl);\r\n\t\t\tif (val) {\r\n\t\t\t\tif (val instanceof File) {\r\n\t\t\t\t\tv[vl] = val.name;\r\n\t\t\t\t}\r\n\t\t\t\tif (cell && cell?.editVariant == 'date') {\r\n\t\t\t\t\tv[vl] = dayjs(val).format(cell?.dateFormat || 'DD-MM-YYYY');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn v;\r\n\t};\r\n\r\n\tconst handleRowDelete = async () => {\r\n\t\tsetIsDeletingRow(true);\r\n\t\tif (rowToDelete) {\r\n\t\t\tawait onDeleteRow?.(rowToDelete);\r\n\t\t\tsetRowToDelete(null);\r\n\t\t}\r\n\t\tsetIsDeletingRow(false);\r\n\t};\r\n\r\n\tconst checkRequired = useCallback((editProperties: any) => {\r\n\t\treturn editProperties?.validations?.some((validation: any) => validation.type === 'required')\r\n\t}, [])\r\n\tuseEffect(() => {\r\n\t\tconst selectedRows = {};\r\n\t\t// Build the selectedRows object\r\n\t\tif (!isChecked && selectedRowIds.length) {\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tif (selectedRowIds.includes(row.id)) {\r\n\t\t\t\t\tselectedRows[row.id] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tsetRowSelection(selectedRows);\r\n\t\t\tsetIsChecked(true)\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [rows, selectedRowIds]); // Dependency only on rows and selectedRowIds\r\n\r\n\tuseEffect(() => {\r\n\t\tif (onSortingChange instanceof Function) {\r\n\t\t\tconst sortingArray = Array.isArray(sorting) ? sorting : [];\r\n\t\t\tonSortingChange(sortingArray[0] || null)\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [sorting])\r\n\r\n\r\n\tconst resetRowSelection = () => {\r\n\t\tsetRowSelection({});\r\n\t\tsetDisableNextEdit(false)\r\n\t}\r\n\tconst getTextWidth = (text: string) => {\r\n\t\tconst canvas = document.createElement(\"canvas\");\r\n\t\tconst ctx = canvas.getContext(\"2d\");\r\n\t\tif (!ctx) return 50;\r\n\t\treturn ctx.measureText(text).width + 5; // padding\r\n\t}\r\n\tconst table = useMaterialReactTable({\r\n\t\t// options:{\r\n\t\t// \ttableLayout: \"auto\", // 👈 important\r\n\t\t// \tpadding: \"dense\",\r\n\t\t// },\r\n\t\t// columns: visibleColumns,\r\n\t\tdefaultColumn: {\r\n\t\t\tminSize: 0, // 👈 remove default min width\r\n\t\t\tsize: undefined, // 👈 optional, default size\r\n\t\t},\r\n\t\tcolumns: [\r\n\t\t\t...visibleColumns.map((c: any) => {\r\n\t\t\t\tconst headerWidth = getTextWidth(c.header || '');\r\n\t\t\t\tconst maxCellWidth = Math.max(\r\n\t\t\t\t\t...rows.map(row => getTextWidth(String(row[c.accessorKey] ?? '')))\r\n\t\t\t\t);\r\n\t\t\t\tconst finalWidth = Math.max(headerWidth, maxCellWidth);\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...c,\r\n\t\t\t\t\t...(editDisplayMode === 'row'\r\n\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\tEdit: ({ cell, row, table, column }) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<InlineEditFields\r\n\t\t\t\t\t\t\t\t\t\tcell={cell}\r\n\t\t\t\t\t\t\t\t\t\tcolumn={column}\r\n\t\t\t\t\t\t\t\t\t\tcol={c}\r\n\t\t\t\t\t\t\t\t\t\trow={row}\r\n\t\t\t\t\t\t\t\t\t\ttable={table}\r\n\t\t\t\t\t\t\t\t\t\tcallback={(s) => console.log('Save', s)}\r\n\t\t\t\t\t\t\t\t\t\terrors={validationErrors}\r\n\t\t\t\t\t\t\t\t\t\tvalidationSchema={validationSchema}\r\n\t\t\t\t\t\t\t\t\t\tsetValidationErrors={setValidationErrors}\r\n\t\t\t\t\t\t\t\t\t\tonChangeRowField={onChangeRowField}\r\n\t\t\t\t\t\t\t\t\t\tgetSelectedData={(name, row) => getSelectedData?.(name, row)}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t: {}),\r\n\t\t\t\t\tHeader: (\r\n\t\t\t\t\t\t<Box display='flex' alignItems='center'>\r\n\t\t\t\t\t\t\t{c.header}\r\n\t\t\t\t\t\t\t{c?.required || checkRequired(c?.editProperties) && (\r\n\t\t\t\t\t\t\t\t<Typography type='s5' color='theme.error.600'>\r\n\t\t\t\t\t\t\t\t\t*\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t),\r\n\t\t\t\t\tenableColumnDragging: c.id !== 'actions',\r\n\t\t\t\t\t// cellStyle: { ...c.cellStyle, width: finalWidth },\r\n\t\t\t\t\t// headerStyle: { ...c.headerStyle, width: finalWidth },\r\n\t\t\t\t\t// size: finalWidth\r\n\t\t\t\t\tsize: undefined,\r\n\t\t\t\t\t// minSize: 40,\r\n\t\t\t\t\tmaxSize: 800,\r\n\t\t\t\t};\r\n\t\t\t}),\r\n\t\t\t...(showPreview ? [\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 'preview',\r\n\t\t\t\t\tenableEditing: false,\r\n\t\t\t\t\tsize: 70,\r\n\t\t\t\t\theader: (\r\n\t\t\t\t\t\t<IconButton size=\"small\" sx={{ ml: '20px', '&:hover': { backgroundColor: 'transparent' } }}>\r\n\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\r\n\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t),\r\n\t\t\t\t\tenableColumnDragging: false,\r\n\t\t\t\t\tvisible: true,\r\n\t\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\t\tclassName: 'pinned-column',\r\n\t\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t\twhiteSpace: 'pre-wrap'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tCell: (props) =>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tsize=\"small\"\r\n\t\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\t\tonClick={() => handlePreviewClick(props.row.original)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tPreview\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t}\r\n\t\t\t] : []),\r\n\t\t\t...(!disableDefaultActionColumn\r\n\t\t\t\t? [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 'actions',\r\n\t\t\t\t\t\tenableEditing: false,\r\n\t\t\t\t\t\tsize: defaultActionColumnItems?.length > 1 ? 80 : 50,\r\n\t\t\t\t\t\theader: (\r\n\t\t\t\t\t\t\t<IconButton size=\"small\" sx={{ p: 0.5, '&:hover': { backgroundColor: 'transparent' } }} onClick={handleHeaderClick}>\r\n\t\t\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\tenableColumnDragging: false,\r\n\t\t\t\t\t\tvisible: true,\r\n\t\t\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\t\t\tclassName: 'pinned-column'\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tCell: (props) =>\r\n\t\t\t\t\t\t\tdefaultActionColumnItems?.length ? (\r\n\t\t\t\t\t\t\t\tdefaultActionColumnItems.map((item) => {\r\n\t\t\t\t\t\t\t\t\tconst updatedProps = {\r\n\t\t\t\t\t\t\t\t\t\t...item.props,\r\n\t\t\t\t\t\t\t\t\t\tonClick: () => item.props.onClick(props)\r\n\t\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\t\treturn cloneElement(item, updatedProps);\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t) : !disabledDefaultActionColumnIcon && (\r\n\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleActionsClick(e, props.row.original)} disabled={!rowActionMenu?.length && !destructiveActionMenu?.length}>\r\n\t\t\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t\t: [])\r\n\t\t],\r\n\t\tdata: rows,\r\n\t\tmuiTableContainerProps: {\r\n\t\t\tsx: {\r\n\t\t\t\t...(disableMaxHeight && { maxHeight: 'none !important' }),\r\n\t\t\t},\r\n\t\t},\r\n\t\tmuiTablePaperProps: {\r\n\t\t\tsx: {\r\n\t\t\t\ttableLayout: 'auto', // lets columns shrink to fit content\r\n\t\t\t},\r\n\t\t},\r\n\t\tcolumnResizeMode: 'onChange',\r\n\t\tonEditingRowSave: async (data) => {\r\n\t\t\ttry {\r\n\t\t\t\tawait validationSchema.validate(data.values, {\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t});\r\n\t\t\t\tsetValidationErrors({});\r\n\t\t\t\tsetIsEditingRow(true);\r\n\t\t\t\tsetDisableNextEdit(false)\r\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\r\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\r\n\r\n\t\t\t\tif (onEditRow) {\r\n\t\t\t\t\tawait onEditRow(data, 'edit');\r\n\t\t\t\t}\r\n\t\t\t\tsetIsEditingRow(false);\r\n\t\t\t\tdata.table.setEditingRow(null);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tsetIsEditingRow(false);\r\n\t\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\t\tconst errors: Record<string, string> = {};\r\n\r\n\t\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\t\terrors[error.path] = error.message;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetValidationErrors(errors);\r\n\t\t\t\t} else if (err instanceof Error) {\r\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonCreatingRowSave: async (data) => {\r\n\t\t\ttry {\r\n\t\t\t\tawait validationSchema.validate(data.values, {\r\n\t\t\t\t\tabortEarly: false\r\n\t\t\t\t});\r\n\t\t\t\tsetValidationErrors({});\r\n\t\t\t\tsetIsCreatingRow(true);\r\n\t\t\t\tsetDisableNextEdit(false)\r\n\t\t\t\tconst cells = data.row.getAllCells().map((c) => c.column.columnDef);\r\n\r\n\t\t\t\tdata.row._valuesCache = formtValues(data.values, cells);\r\n\r\n\t\t\t\tif (onCreateRow) {\r\n\t\t\t\t\tawait onCreateRow(data);\r\n\t\t\t\t}\r\n\t\t\t\tsetIsCreatingRow(false);\r\n\t\t\t\tdata.table.setCreatingRow(null);\r\n\t\t\t} catch (err) {\r\n\t\t\t\tsetIsCreatingRow(false);\r\n\t\t\t\tif (err instanceof yup.ValidationError) {\r\n\t\t\t\t\tconst errors: Record<string, string> = {};\r\n\r\n\t\t\t\t\terr.inner.forEach((error) => {\r\n\t\t\t\t\t\tif (error.path) {\r\n\t\t\t\t\t\t\terrors[error.path] = error.message;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tsetValidationErrors(errors);\r\n\t\t\t\t} else if (err instanceof Error) {\r\n\t\t\t\t\tenqueueSnackbar(err.message, { variant: 'error' })\r\n\t\t\t\t} else {\r\n\t\t\t\t\tenqueueSnackbar('Something went wrong', { variant: 'error' })\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonCreatingRowCancel: () => resetRowSelection(),\r\n\t\tonEditingRowCancel: () => resetRowSelection(),\r\n\t\tonSortingChange: states?.sorting ? onSortingChange : setSorting,\r\n\r\n\t\tdisplayColumnDefOptions: {\r\n\t\t\t'mrt-row-actions': {\r\n\t\t\t\t// size: onDeleteRow ? 80 : 50,\r\n\r\n\t\t\t\tHeader: (\r\n\t\t\t\t\t<IconButton onClick={handleHeaderClick} size='small'>\r\n\t\t\t\t\t\t<img src={images.common.arrowIcon} alt='Arrow Icon' />\r\n\t\t\t\t\t</IconButton>\r\n\t\t\t\t),\r\n\t\t\t\tmuiTableBodyCellProps: {\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t'& .MuiBox-root': {\r\n\t\t\t\t\t\t\tgap: 0\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tonKeyUp: (e) => console.log(e)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t'mrt-row-expand': {\r\n\t\t\t\tsize: 70, // Set the size of the expand-collapse arrow column here\r\n\t\t\t},\r\n\t\t\t'mrt-row-select': {\r\n\t\t\t\tsize: 50, // Set the width of the checkbox column here\r\n\t\t\t},\r\n\t\t},\r\n\t\trenderRowActions: ({ row, table }) => (\r\n\t\t\t<>\r\n\t\t\t\t{rest?.enableExpanding ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{row?.parentId && (\r\n\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\r\n\t\t\t\t\t\t\t\t<Tooltip title='Edit'>\r\n\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => {\r\n\t\t\t\t\t\t\t\t\t\ttable.setEditingRow(row)\r\n\t\t\t\t\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t} size='small'>\r\n\t\t\t\t\t\t\t\t\t\t<Edit fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t\t{onDeleteRow && (\r\n\t\t\t\t\t\t\t\t\t<Tooltip title='Delete'>\r\n\t\t\t\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => setRowToDelete(row)} size='small'>\r\n\t\t\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0 }}>\r\n\t\t\t\t\t\t<Tooltip title='Edit'>\r\n\t\t\t\t\t\t\t<IconButton disabled={disableNextEdit} onClick={() => {\r\n\t\t\t\t\t\t\t\ttable.setEditingRow(row)\r\n\t\t\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t<Edit fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t{onDeleteRow && (\r\n\t\t\t\t\t\t\t<Tooltip title='Delete'>\r\n\t\t\t\t\t\t\t\t<IconButton onClick={() => setRowToDelete(row)}>\r\n\t\t\t\t\t\t\t\t\t<Trash fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</>\r\n\t\t),\r\n\r\n\t\t...(Boolean(enableRowCreate) && {\r\n\t\t\trenderBottomToolbarCustomActions: ({ table }) => (\r\n\t\t\t\t<Button\r\n\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\tstartIcon={<Add />}\r\n\t\t\t\t\tclassName='add-row-btn'\r\n\t\t\t\t\tdisabled={disableNextEdit}\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\ttable.setCreatingRow(true); //simplest way to open the create row modal with no default values\r\n\t\t\t\t\t\tsetDisableNextEdit(true)\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t</Button>\r\n\t\t\t)\r\n\t\t}),\r\n\t\tonRowSelectionChange: setRowSelection,\r\n\t\tenableColumnOrdering: true,\r\n\t\tenableRowSelection: enableRowSelection ?? true,\r\n\t\tenableEditing: enableEditing instanceof Function ? enableEditing() : enableEditing ?? true,\r\n\t\teditDisplayMode: editDisplayMode ?? 'cell',\r\n\t\tcreateDisplayMode: 'row',\r\n\t\tenableColumnResizing: enableColumnResizing,\r\n\t\tenableRowDragging: enableRowDragging,\r\n\t\tenableTopToolbar: false,\r\n\t\tenableColumnActions: false,\r\n\t\tenableSorting: true,\r\n\t\tenableGrouping: true,\r\n\t\tenableBottomToolbar: enableBottomToolbar ?? false,\r\n\t\tenableColumnDragging: enableColumnDragging ?? true,\r\n\t\tenableStickyHeader: true,\r\n\t\tenableSortingRemoval: false,\r\n\t\t// column ordering\r\n\t\tstate: {\r\n\t\t\t// columnOrder: (!columnOrder || columnOrder.length <= 1) \r\n\t\t\t// ? [...internalColumnOrder] \r\n\t\t\t// : [...columnOrder],\r\n\t\t\tcolumnOrder: columnOrder,\r\n\t\t\tcolumnPinning: { left: ['actions', 'mrt-row-actions'] },\r\n\t\t\tisSaving: isCreatingRow || isEditingRow,\r\n\t\t\tshowProgressBars: false,\r\n\t\t\trowSelection,\r\n\t\t\t...states,\r\n\t\t\tsorting: Array.isArray(states?.sorting) ? states?.sorting :\r\n\t\t\t\tArray.isArray(sorting) ? sorting : [],\r\n\t\t\tcolumnSizing\r\n\r\n\t\t},\r\n\t\tgetRowId: (row) => row?.id,\r\n\t\t// table.getState().editingRow\r\n\t\tmuiTableBodyRowProps: ({ row }) => {\r\n\t\t\tconst editingRowId =\r\n\t\t\t\ttable.getState()?.editingRow?.id ||\r\n\t\t\t\ttable.getState()?.creatingRow?.id ||\r\n\t\t\t\tnull;\r\n\t\t\tconst isErrorRow = Boolean(row?.original?.has_error)\r\n\t\t\treturn {\r\n\t\t\t\tonClick: () => handleRowClick(row.id),\r\n\t\t\t\tsx: {\r\n\t\t\t\t\tcursor: 'pointer',\r\n\t\t\t\t\t// backgroundColor: !editingRowId\r\n\t\t\t\t\t// \t? (selectedRow === row.id\r\n\t\t\t\t\t// \t\t? '#e8e8e8'\r\n\t\t\t\t\t// \t\t: (isErrorRow ? 'theme.error.100' : 'inherit'))\r\n\t\t\t\t\t// \t: 'inherit',\r\n\t\t\t\t\tbackgroundColor: !editingRowId\r\n\t\t\t\t\t\t? (isErrorRow ? 'theme.error.100' : 'inherit')\r\n\t\t\t\t\t\t: 'inherit',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tbackgroundColor: editingRowId ? 'transparent' : (isErrorRow ? 'theme.error.200' : '#e8e8e8') // Removes hover effect globally\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'&:hover td:after': {\r\n\t\t\t\t\t\tbackgroundColor: 'transparent' // Removes the grey background applied via :after\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\t\tonColumnOrderChange: (colOrder: any) => {\r\n\t\t\tif (handleColumnOrdering) handleColumnOrdering(colOrder);\r\n\t\t},\r\n\t\tonColumnSizingChange: setColumnSizing,\r\n\t\tonColumnSizingInfoChange: setColumnSizingInfo,\r\n\r\n\t\trenderEmptyRowsFallback: () => (\r\n\t\t\t<Box className='no-data'>\r\n\t\t\t\t<img src={images.common.tableNoData} />\r\n\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t{/* sx={{ textAlign: 'center', pb: 4.75, pt: 4.75 }}> */}\r\n\t\t\t\t\t{t('common.noData')}\r\n\t\t\t\t</Typography>\r\n\t\t\t</Box>\r\n\t\t),\r\n\r\n\t\t// pagination\r\n\t\tenablePagination: enablePagination,\r\n\t\tpaginationDisplayMode: 'pages',\r\n\t\tmuiPaginationProps: {\r\n\t\t\tshape: 'rounded',\r\n\t\t\tpage: pageNo, // current page number\r\n\t\t\tcount: totalPages, // total pages\r\n\t\t\tshowRowsPerPage: false, // Hide rows per page options\r\n\t\t\tboundaryCount: 3\r\n\t\t},\r\n\r\n\t\tmuiEditTextFieldProps: ({ row, column }) => ({\r\n\t\t\tInputProps: {\r\n\t\t\t\tdisableUnderline: true\r\n\t\t\t},\r\n\t\t\tonBlur: (e) => {\r\n\t\t\t\tupdateData(e.target.value, column, row.id);\r\n\t\t\t},\r\n\t\t\t// onChange: (e) => {\r\n\t\t\t// \tupdateData(e.target.value, column, row.id);\r\n\t\t\t// },\r\n\t\t\tvariant: 'outlined',\r\n\t\t\tsx: ({ palette }) => ({\r\n\t\t\t\t'& .MuiOutlinedInput-root': {\r\n\t\t\t\t\t'& fieldset': {\r\n\t\t\t\t\t\tborderColor: `${palette.theme?.primary[700]} !important`\r\n\t\t\t\t\t\t// backgroundColor: palette.theme?.primary[700]\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}),\r\n\r\n\t\t/* Table loader style */\r\n\t\tmuiCircularProgressProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: '#289B64'\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Table header cell default styles\r\n\t\tmuiTableHeadCellProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tlineHeight: '140%',\r\n\t\t\t\tletterSpacing: '-0.28px',\r\n\t\t\t\tfontWeight: '500',\r\n\t\t\t\tfontSize: '0.875rem',\r\n\t\t\t\t'& .Mui-TableHeadCell-Content': {\r\n\t\t\t\t\theight: '100%'\r\n\t\t\t\t},\r\n\t\t\t\t'& .Mui-TableHeadCell-Content-Labels': {\r\n\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\tjustifyContent: 'space-between'\r\n\t\t\t\t},\r\n\t\t\t\t'&.pinned-column': {\r\n\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t},\r\n\t\t\t\t'& .Mui-TableHeadCell-ResizeHandle-Wrapper': {\r\n\t\t\t\t\tpadding: 0,\r\n\t\t\t\t\tmargin: 0,\r\n\t\t\t\t\tright: '-5px',\r\n\t\t\t\t\topacity: 0\r\n\t\t\t\t},\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t// Table body cell default styles\r\n\t\tmuiTableBodyProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tzIndex: 500\r\n\t\t\t}\r\n\t\t},\r\n\t\tmuiTableHeadProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tzIndex: 600\r\n\t\t\t}\r\n\t\t},\r\n\t\tmuiTableBodyCellProps: (/* { cell, column, table , row } */) => ({\r\n\t\t\tsx: {\r\n\t\t\t\tlineHeight: '140%',\r\n\t\t\t\tletterSpacing: '-0.26px',\r\n\t\t\t\tfontWeight: '400',\r\n\t\t\t\tfontSize: '0.8125rem',\r\n\t\t\t\t'&.pinned-column': {\r\n\t\t\t\t\tbackgroundColor: '#fff'\r\n\t\t\t\t},\r\n\t\t\t\t'&:hover': {\r\n\t\t\t\t\tbackgroundColor: 'transparent' // Removes hover effect globally\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// onClick: () => {\r\n\t\t\t// \ttable.setEditingCell(cell); //set editing cell\r\n\t\t\t// \tqueueMicrotask(() => {\r\n\t\t\t// \t\tconst textField = table.refs.editInputRefs.current[column.id];\r\n\t\t\t// \t\tif (textField) {\r\n\t\t\t// \t\t\ttextField.focus();\r\n\t\t\t// \t\t\ttextField.select?.();\r\n\t\t\t// \t\t}\r\n\t\t\t// \t});\r\n\t\t\t// }\r\n\t\t\t// onKeyDown: (event) => {\r\n\t\t\t// \tif (event.key === 'Tab') {\r\n\t\t\t// \t\ttry {\r\n\t\t\t// \t\t\t\t// if (column.columnDef.editVariant === 'select') {\r\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id]?.node?.blur();\r\n\t\t\t// \t\t\t\t// } else {\r\n\t\t\t// \t\t\t\t// \ttable.refs.editInputRefs.current[column.id].blur();\r\n\t\t\t// \t\t\t\t// }\r\n\r\n\t\t\t// \t\t\tconst rowIdx = row.index;\r\n\t\t\t// \t\t\tconst colIdx = columns.findIndex(\r\n\t\t\t// \t\t\t\t(col) => col.accessorKey === column.id\r\n\t\t\t// \t\t\t);\r\n\t\t\t// \t\t\tconst newColIdx = colIdx + 1;\r\n\t\t\t// \t\t\tconst clm = columns[newColIdx];\r\n\t\t\t// \t\t\tconst nextCell = row\r\n\t\t\t// \t\t\t\t.getAllCells()\r\n\t\t\t// \t\t\t\t.find((cl) => (cl.id = `${rowIdx}_${clm.accessorKey}`));\r\n\r\n\t\t\t// \t\t\tif (nextCell) {\r\n\t\t\t// \t\t\t\t// updateData(event.target.value, column, row.id);\r\n\t\t\t// \t\t\t\ttable.setEditingCell(nextCell);\r\n\t\t\t// \t\t\t\tqueueMicrotask(() => {\r\n\t\t\t// \t\t\t\t\tconst textField = table.refs.editInputRefs.current[column.id];\r\n\t\t\t// \t\t\t\t\tif (textField) {\r\n\t\t\t// \t\t\t\t\t\ttextField.focus();\r\n\t\t\t// \t\t\t\t\t\ttextField.select?.();\r\n\t\t\t// \t\t\t\t\t}\r\n\t\t\t// \t\t\t\t});\r\n\t\t\t// \t\t\t}\r\n\t\t\t// \t\t} catch (error) {\r\n\t\t\t// \t\t}\r\n\t\t\t// \t}\r\n\t\t\t// },\r\n\t\t\t// onBlur: () => {\r\n\t\t\t// \ttable.setEditingCell(null);\r\n\t\t\t// }\r\n\t\t}),\r\n\r\n\t\t// Checkbox styling\r\n\t\tmuiSelectCheckboxProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: 'theme.secondary.300',\r\n\t\t\t\t'&.Mui-checked': {\r\n\t\t\t\t\tcolor: 'theme.primary.600',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tcolor: 'theme.primary.500'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t'&.Mui-disabled': {\r\n\t\t\t\t\tcolor: 'theme.secondary.200'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\r\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\r\n\t\t},\r\n\t\tmuiSelectAllCheckboxProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tcolor: 'theme.secondary.300',\r\n\t\t\t\t'&.Mui-checked': {\r\n\t\t\t\t\tcolor: 'theme.primary.600',\r\n\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\tcolor: 'theme.primary.500'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t'&.Mui-disabled': {\r\n\t\t\t\t\tcolor: 'theme.secondary.600'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\ticon: <RecgtangleIcon sx={{ width: 20, height: 20 }} />,\r\n\t\t\tcheckedIcon: <CheckBoxIcon sx={{ width: 20, height: 20 }} />\r\n\t\t},\r\n\t\tmuiBottomToolbarProps: {\r\n\t\t\tsx: {\r\n\t\t\t\tboxShadow: 'none',\r\n\t\t\t\t'& .MuiBox-root': {\r\n\t\t\t\t\tpaddingLeft: 0\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tlayoutMode: 'grid',\r\n\t\ticons: {\r\n\t\t\tArrowDownwardIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<ArrowUpDown fontSize='medium' {...props} />\r\n\t\t\t),\r\n\t\t\tSortIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<ArrowUpDown fontSize='medium' {...props} />\r\n\t\t\t),\r\n\t\t\tSyncAltIcon: () => <ArrowUpDown fontSize='medium' />,\r\n\t\t\tCancelIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<Close fontSize='small' {...props} sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t),\r\n\t\t\tSaveIcon: (props: SvgIconProps) => (\r\n\t\t\t\t<Save {...props} fontSize='small' sx={{ color: 'theme.secondary.1000' }} />\r\n\t\t\t)\r\n\t\t},\r\n\r\n\t\t...rest\r\n\t});\r\n\r\n\tuseEffect(() => {\r\n\t\tif (enableRowSelection) {\r\n\t\t\tif (table?.getSelectedRowModel()?.rows) {\r\n\t\t\t\tSetSelectedRowId?.(table?.getSelectedRowModel()?.rows);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [enableRowSelection]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (onSelectRow) {\r\n\t\t\tif (rest?.enableExpanding) {\r\n\t\t\t\tconst selectedRowModels: any[] = [];\r\n\t\t\t\tconst selection = table.getState().rowSelection; // e.g., { 0.0: true }\r\n\t\t\t\tconst traverseRows = (rows, parentKey = '') => {\r\n\t\t\t\t\trows.forEach((row, index) => {\r\n\t\t\t\t\t\tconst rowKey = parentKey ? `${parentKey}.${index}` : `${row.id}`;\r\n\t\t\t\t\t\tif (selection[rowKey]) {\r\n\t\t\t\t\t\t\tselectedRowModels.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Check for sub-rows and traverse further\r\n\t\t\t\t\t\tif (row.subRows?.length) {\r\n\t\t\t\t\t\t\ttraverseRows(row.subRows, rowKey);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t};\r\n\r\n\t\t\t\ttraverseRows(table.getRowModel().rows);\r\n\t\t\t\tonSelectRow(selectedRowModels, rowSelection);\r\n\t\t\t} else {\r\n\t\t\t\tonSelectRow(table.getSelectedRowModel().rows, rowSelection);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [rowSelection, table]);\r\n\r\n\t// useEffect(() => {\r\n\t// \tconst relativeContainer = document.getElementsByClassName(\r\n\t// \t\t'MuiTableContainer-root'\r\n\t// \t)[0];\r\n\t// \tconst fixedElement = document.getElementsByClassName('no-data')[0];\r\n\t// \trelativeContainer.addEventListener('scroll', () => {\r\n\t// \t\tconst scrollLeft = relativeContainer.scrollLeft;\r\n\t// \t\tfixedElement.style.left = `${scrollLeft + 100}px`;\r\n\t// \t});\r\n\t// }, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isResetRow) {\r\n\t\t\ttable?.resetRowSelection();\r\n\t\t}\r\n\t}, [isResetRow, table]);\r\n\treturn (\r\n\t\t<TableWrapper className='MRT-TableWrapper custom-table' disableMaxHeight={disableMaxHeight}>\r\n\t\t\t<MaterialReactTable table={table} />\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tanchorEl={anchorEl}\r\n\t\t\t\topen={Boolean(anchorEl)}\r\n\t\t\t\tonClose={handleHeaderClose}\r\n\t\t\t\tclassName='add-role-drp'>\r\n\t\t\t\t{popUpShow ? (\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tonClick={handleBackButtonClick}\r\n\t\t\t\t\t\t\tclassName='role-drp-list add-column-title'>\r\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t<ChevronLeftIcon />\r\n\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\r\n\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<div className='searchbar-box-list'>\r\n\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\tplaceholder={'Search User'}\r\n\t\t\t\t\t\t\t\thandleSearch={(e) => handleSearchEvent(e)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className='all-attribute-title'>\r\n\t\t\t\t\t\t\t<Typography variant='body2' color='text.secondary'>\r\n\t\t\t\t\t\t\t\t{t('common.allAttributes_label')}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t{filteredOptions.map((column: any) => (\r\n\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\r\n\t\t\t\t\t\t\t\tonClick={() => handleAddColumn(column)}>\r\n\t\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s3'>\r\n\t\t\t\t\t\t\t\t\t{column.header}\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tenableAddCustomField && <MenuItem onClick={handleCustomAddColumn} className='role-drp-list'>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t\t{t('common.addCustomField_label')}\r\n\t\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{visibleColumns.map((column: any) => (\r\n\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\tkey={column.accessorKey}\r\n\t\t\t\t\t\t\t\tonClick={() => handleVisibleColumn(column)}\r\n\t\t\t\t\t\t\t\tclassName='role-drp-list'>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.dotsIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t\t<ListItemText className='title'>{column.header}</ListItemText>\r\n\t\t\t\t\t\t\t\t<ListItemIcon className='eye-icon'>\r\n\t\t\t\t\t\t\t\t\t<img src={images.common.eyeIcon} alt='Eye Icon' />\r\n\t\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<MenuItem onClick={handleAddButtonClick} className='role-drp-list'>\r\n\t\t\t\t\t\t\t<ListItemIcon className='add-icon'>\r\n\t\t\t\t\t\t\t\t<img src={images.common.addIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t</ListItemIcon>\r\n\t\t\t\t\t\t\t<ListItemText className='title'>\r\n\t\t\t\t\t\t\t\t{t('common.addColumn_label')}\r\n\t\t\t\t\t\t\t</ListItemText>\r\n\t\t\t\t\t\t\t<Typography\r\n\t\t\t\t\t\t\t\tvariant='body2'\r\n\t\t\t\t\t\t\t\tcolor='text.secondary'\r\n\t\t\t\t\t\t\t\tclassName='eye-icon'>\r\n\t\t\t\t\t\t\t\t<ChevronRightIcon sx={{ fontSize: '1.25rem !important' }} />\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t</Menu>\r\n\r\n\t\t\t<Menu\r\n\t\t\t\tanchorEl={rowAnchorEl}\r\n\t\t\t\topen={Boolean(rowAnchorEl)}\r\n\t\t\t\tonClose={handleActionsClose}>\r\n\t\t\t\t{rowActionMenu?.map((option: any) => {\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(option.label === 'Move' &&\r\n\t\t\t\t\t\t\t(row?.is_directory === true || row?.is_directory === 1)) ||\r\n\t\t\t\t\t\t(option.label === 'Download' &&\r\n\t\t\t\t\t\t\t(row?.is_directory === true ||\r\n\t\t\t\t\t\t\t\trow?.is_directory === 1 ||\r\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === true ||\r\n\t\t\t\t\t\t\t\trow?.drive?.is_directory === 1))\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\t// return null;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tonClick={async () => {\r\n\t\t\t\t\t\t\t\tawait option.handleAction(row);\r\n\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t? option.disabled(row)\r\n\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{option?.icon}\r\n\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t\t{destructiveActionMenu?.length > 0 &&\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n\t\t\t\t\t\t<div className='dropdown-inner--DestructiveHeader'>\r\n\t\t\t\t\t\t\t{destructiveActionMenu?.map((option: any) => (\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\toption.handleAction(row);\r\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tclassName='dropdown-inner--DestructiveActions'\r\n\t\t\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled(row)\r\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t\t\t{typeof option.label === 'function' ? option.label(row) : option.label}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</>\r\n\t\t\t\t}\r\n\t\t\t</Menu>\r\n\t\t\t<ConfirmPopUp\r\n\t\t\t\topen={Boolean(rowToDelete)}\r\n\t\t\t\tonClose={() => setRowToDelete(null)}\r\n\t\t\t\tonConfirm={() => handleRowDelete()}\r\n\t\t\t\ttitle='Delete Item'\r\n\t\t\t\tdescription={`Are you sure you want to delete entry ?`}\r\n\t\t\t\tloading={isDeletingRow}\r\n\t\t\t/>\r\n\t\t</TableWrapper>\r\n\t);\r\n});\r\n\r\nexport default MaterialTable;","import React from 'react';\r\nimport { Box, CircularProgress, CircularProgressProps } from '@mui/material';\r\nimport { styled } from '@mui/material/styles';\r\n\r\nconst Loader = styled(CircularProgress)(({ theme }) => ({\r\n\tcolor: theme.palette?.theme.primary[500]\r\n}));\r\n\r\nconst LoaderContainer = styled(Box)(() => ({\r\n\tposition: 'absolute',\r\n\tdisplay: 'flex',\r\n\twidth: '100%',\r\n\theight: '100%',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tbackgroundColor: '#ffffff96',\r\n\tzIndex: 3,\r\n\tleft: 0,\r\n\ttop: 0\r\n}));\r\n\r\nconst ModalLoader = (props: CircularProgressProps) => {\r\n\treturn (\r\n\t\t<LoaderContainer>\r\n\t\t\t<Loader size={50} {...props} />\r\n\t\t</LoaderContainer>\r\n\t);\r\n};\r\n\r\nexport { ModalLoader };\r\nexport default ModalLoader;\r\n","import { Box, DialogActions, DialogContent, DialogTitle, Divider, Grid, IconButton } from \"@mui/material\";\r\nimport Modal from '../modal/modal';\r\nimport Typography from \"../typography/typography\";\r\nimport DynamicInput from '../form-control/form-builder/form-builder-element/text';\r\nimport DynamicRadioButton from '../form-control/form-builder/form-builder-element/radio-button';\r\nimport { useForm, useWatch } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { generateValidationSchema, generateValidationSchema1 } from \"./validator\";\r\nimport DynamicSearchSelect from \"../form-control/form-builder/form-builder-element/dynamic-select\";\r\nimport DynamicPhone from '@/components/form-control/form-builder/form-builder-element/phone';\r\nimport Accordion from \"../accordion/accordion\";\r\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\r\nimport _ from \"lodash\";\r\nimport './parties-modal.scss';\r\nimport { useAccountingSetting } from \"../../hooks/useAccountSetting\";\r\nimport { useAuth } from '../../hooks/useAuth';\r\nimport {\r\n addressColumns,\r\n addressOmitKeys,\r\n addressPayload,\r\n contactColumns,\r\n contactOmitKeys,\r\n contactPayload,\r\n PARTIES_FIELDS,\r\n PARTIES_FORM_ARRAY_NAME,\r\n partyType,\r\n processPartiesPayload\r\n} from \"./utils/constant\";\r\nimport MaterialTable from \"../material-table/material-table\";\r\nimport parsePhoneNumberFromString from \"libphonenumber-js\";\r\nimport Checkbox from \"../checkbox/checkbox\";\r\nimport { transformTableColumns } from \"../../utils/common-utility\";\r\nimport { createParties } from \"../../redux/actionCreator\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { getErrorMessage } from \"../../utils/common\";\r\nimport ModalLoader from \"../loaders/modal-loader\";\r\nimport Button from \"../button/button\";\r\nimport { Close } from \"@mui/icons-material\";\r\n\r\ninterface CustomerVendorModalProps {\r\n isOpen: boolean;\r\n handleModalClose?: () => void;\r\n modalProps?: any;\r\n type?: string;\r\n partyCreated?: () => void;\r\n isLoading?: boolean;\r\n onSave?: (payload: any) => Promise<void>;\r\n setIsOpen?: (value: boolean) => void;\r\n}\r\n\r\ninterface LocationState {\r\n state: any;\r\n country: any;\r\n}\r\n\r\nconst defaultLocationState: LocationState = { state: '', country: '' };\r\n\r\nexport default function CustomerVendorModal({\r\n isOpen,\r\n handleModalClose,\r\n modalProps,\r\n type,\r\n partyCreated,\r\n isLoading,\r\n onSave,\r\n setIsOpen\r\n}: CustomerVendorModalProps) {\r\n\r\n //Hooks\r\n const { t } = useTranslation();\r\n const dispatch = useDispatch();\r\n const { user } = useAuth();\r\n\r\n //Refs\r\n const locationRef = useRef<LocationState>(defaultLocationState);\r\n\r\n //Local states\r\n const [addressRows, setAddressRows] = useState<any[]>([]);\r\n const [contactRows, setContactRows] = useState<any[]>([]);\r\n const [isCreating, setIsCreating] = useState(false);\r\n const [selectedCompanyData, setSelectedCompanyData] = useState<any[]>([]);\r\n\r\n //Form\r\n const {\r\n control,\r\n formState: { errors },\r\n trigger,\r\n getValues,\r\n handleSubmit,\r\n setValue,\r\n resetField,\r\n reset,\r\n watch,\r\n getFieldState\r\n\r\n } = useForm({\r\n defaultValues: {\r\n status: true,\r\n parties: {\r\n account_type: 'Company',\r\n },\r\n },\r\n mode: 'all',\r\n resolver: generateValidationSchema1()\r\n });\r\n\r\n const fieldToUpdate = {\r\n [PARTIES_FIELDS.RECEIVABLE_ACCOUNT]: 'receivable_account',\r\n [PARTIES_FIELDS.TAX_TEMPLATE]: 'default_tax',\r\n };\r\n\r\n useAccountingSetting({\r\n fieldToUpdate,\r\n companyField: PARTIES_FIELDS.COMPANY,\r\n fieldArrayName: PARTIES_FORM_ARRAY_NAME,\r\n formMethods: { control, setValue, watch, getFieldState },\r\n ...({ isUpdateAccount: true } as any),\r\n });\r\n\r\n\r\n const selectedType = useWatch({\r\n control,\r\n name: 'parties.account_type',\r\n });\r\n\r\n const responsiblePerson = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.RESPONSIBLE_PERSON}`,\r\n });\r\n\r\n const mainContactNo = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACT_NO}`,\r\n });\r\n\r\n const mainEmailIds = useWatch({\r\n control,\r\n name: `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.EMAIL_IDS}`,\r\n });\r\n\r\n //Call Back functions\r\n const tableColumns = useCallback(\r\n (columns: any, tableRows: any) => {\r\n const phoneNumberCache = new Map();\r\n\r\n return transformTableColumns({\r\n columns,\r\n currencySymbol: undefined,\r\n translationFn: t,\r\n enableFooter: false,\r\n redirectionLink: undefined,\r\n redirectionLinkState: undefined,\r\n rows: tableRows,\r\n statusClasses: undefined,\r\n customizeValue: (row, columnAccessorKey, value) => {\r\n switch (columnAccessorKey) {\r\n case 'default_shipping_address':\r\n case 'default_billing_address': {\r\n return (\r\n <Box sx={{ display: \"flex\", gap: 1 }}>\r\n <Checkbox\r\n checked={Boolean(value)}\r\n sx={{ pointerEvents: 'none' }}\r\n />\r\n </Box>\r\n );\r\n }\r\n\r\n case 'phone':\r\n case 'contact_no': {\r\n if (!value) return '';\r\n const phoneKey = `phone-${value}`;\r\n if (!phoneNumberCache.has(phoneKey)) {\r\n const parsed = parsePhoneNumberFromString(`+${value}`);\r\n phoneNumberCache.set(phoneKey, parsed?.nationalNumber || '');\r\n }\r\n return phoneNumberCache.get(phoneKey);\r\n }\r\n\r\n case 'country_code': {\r\n const phone = row?.original?.phone || row?.original?.contact_no;\r\n if (!phone) return '';\r\n const countryCodeKey = `country-${phone}`;\r\n if (!phoneNumberCache.has(countryCodeKey)) {\r\n const parsed = parsePhoneNumberFromString(`+${phone}`);\r\n phoneNumberCache.set(countryCodeKey,\r\n parsed?.countryCallingCode ? `+${parsed.countryCallingCode}` : ''\r\n );\r\n }\r\n return phoneNumberCache.get(countryCodeKey);\r\n }\r\n\r\n default:\r\n return value;\r\n }\r\n }\r\n });\r\n },\r\n [t]\r\n );\r\n\r\n //Methods\r\n\r\n const handleRowOperation = async (\r\n eData: any,\r\n state: any[],\r\n setState: React.Dispatch<React.SetStateAction<any[]>>,\r\n isAddress: boolean\r\n ) => {\r\n try {\r\n const { values, row } = eData;\r\n const editRow = row.index >= 0;\r\n const payload = isAddress ? addressPayload : contactPayload;\r\n\r\n const processedValues: any = {};\r\n for (const key in payload) {\r\n if (_.has(values, key)) {\r\n processedValues[key] = values?.[key] ? values[key] : null;\r\n }\r\n }\r\n\r\n if (isAddress) {\r\n const dropdowns = {\r\n c: locationRef.current?.country,\r\n s: locationRef.current?.state,\r\n };\r\n\r\n const validatedValues = await validateAddressDefaults(processedValues, state, row.index);\r\n const addressValues = {\r\n ...validatedValues,\r\n country_name: dropdowns.c?.name,\r\n country: dropdowns.c?.id,\r\n state_name: dropdowns.s?.name,\r\n state: dropdowns.s?.id,\r\n country_data: dropdowns.c,\r\n state_data: dropdowns.s,\r\n country_id: dropdowns.c?.id,\r\n state_id: dropdowns.s?.id,\r\n };\r\n\r\n if (editRow) {\r\n return setState(state.map((ar, i) => i === row.index ? { ...ar, ...addressValues } : ar));\r\n }\r\n return setState([...state, addressValues]);\r\n }\r\n\r\n if (editRow) {\r\n return setState(state.map((ar, i) => i === row.index ? { ...ar, ...processedValues } : ar));\r\n }\r\n return setState([...state, processedValues]);\r\n } catch (error) {\r\n return Promise.reject(error);\r\n }\r\n };\r\n\r\n const validateAddressDefaults = async (values: any, state: any[], index: number) => {\r\n let updatedValues = { ...values };\r\n const validate = (type: \"shipping\" | \"billing\") => {\r\n const u_data = [...state];\r\n const field = type === 'shipping' ? 'default_shipping_address' : 'default_billing_address';\r\n if (index >= 0) {\r\n u_data.splice(index, 1);\r\n }\r\n const hasDefault = u_data.some((d: any) => d?.[field]);\r\n\r\n if (hasDefault && values?.[field]) {\r\n throw new Error(\r\n `Another address is already marked as the default ${type} address. Please uncheck that before selecting this one`\r\n );\r\n }\r\n else if (!hasDefault) {\r\n updatedValues = {\r\n ...updatedValues,\r\n [field]: values?.[field] || state?.length == 0 ? 1 : 0,\r\n };\r\n }\r\n\r\n };\r\n\r\n await validate(\"shipping\");\r\n await validate(\"billing\");\r\n\r\n return updatedValues;\r\n };\r\n\r\n const deleteRow = async (\r\n state: any[],\r\n setState: React.Dispatch<React.SetStateAction<any[]>>,\r\n row: any\r\n ) => {\r\n const rowIndex = row.index;\r\n const updatedData = state.filter((_, i) => i !== rowIndex);\r\n setState(updatedData);\r\n return Promise.resolve();\r\n };\r\n\r\n const onChangeAddressTableField = async (e: any, t: any, r: any, col: any, selectedData: any) => {\r\n const fieldName = e?.target?.name;\r\n let updatedValues: any = null;\r\n\r\n if (col?.editProperties?.field_name) {\r\n locationRef.current = {\r\n ...locationRef.current,\r\n [col.editProperties.field_name]: selectedData,\r\n };\r\n }\r\n\r\n if (fieldName === 'country') {\r\n updatedValues = {\r\n ...r._valuesCache,\r\n country: selectedData.id,\r\n country_id: selectedData.id,\r\n state: null,\r\n state_id: null,\r\n state_name: null,\r\n };\r\n } else if (fieldName === 'state') {\r\n updatedValues = {\r\n ...r._valuesCache,\r\n state: selectedData.id,\r\n state_id: selectedData.id\r\n };\r\n } else if (fieldName === 'phone') {\r\n const p = parsePhoneNumberFromString(`+${e}`);\r\n updatedValues = {\r\n ...r._valuesCache,\r\n country_code: p?.countryCallingCode ? `+${p.countryCallingCode}` : '',\r\n };\r\n }\r\n\r\n const summaryFields = [\r\n 'contact_name',\r\n 'street_1',\r\n 'street_2',\r\n 'street_3',\r\n 'zip_code',\r\n 'city',\r\n 'state',\r\n 'country'\r\n ];\r\n\r\n if (r._valuesCache) {\r\n const fieldValues = summaryFields.map(field => {\r\n if (field === 'country') {\r\n return locationRef.current?.country?.name || '';\r\n } else if (field === 'state') {\r\n return locationRef.current?.state?.name || '';\r\n } else if (field === fieldName) {\r\n return e.target?.value || '';\r\n }\r\n return r._valuesCache?.[field] || '';\r\n });\r\n\r\n const summary = fieldValues.reduce((acc, val, idx) => {\r\n if (!val) return acc;\r\n if (!acc) return val;\r\n\r\n val = val?.name || val;\r\n acc = acc?.name || acc;\r\n\r\n return [2, 3].includes(idx) ? `${acc} ${val}` : `${acc}, \\n${val}`;\r\n }, '');\r\n\r\n r._valuesCache.summary = summary;\r\n }\r\n\r\n if (updatedValues) {\r\n r.getAllCells().forEach((c: any) => {\r\n if (_.has(updatedValues, c.column.id)) {\r\n r._valuesCache[c.column.id] = updatedValues[c.column.id];\r\n }\r\n });\r\n }\r\n\r\n return r._valuesCache;\r\n };\r\n\r\n\r\n\r\n const EMAIL_REGEX =\r\n /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\r\nconst onSubmit = async () => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n\r\n const values = getValues();\r\n const formValues = values?.[PARTIES_FORM_ARRAY_NAME];\r\n let emailArray: string[] = [];\r\n\r\n if (formValues?.email_ids) {\r\n emailArray = formValues?.email_ids\r\n ?.split(/\\s*,\\s*/)\r\n .map((email_id: any) => email_id?.replaceAll(',', '')?.trim())\r\n .filter((email_id: any) => email_id.match(EMAIL_REGEX));\r\n }\r\n\r\n const payload = {\r\n party: {\r\n ...processPartiesPayload(formValues),\r\n email_ids: emailArray,\r\n account_type: selectedType,\r\n status: 1,\r\n type,\r\n company_id: formValues?.[PARTIES_FIELDS.COMPANY] || null\r\n }\r\n };\r\n if (typeof onSave == 'function') {\r\n onSave?.(payload);\r\n return;\r\n }\r\n setIsCreating(true);\r\n try {\r\n\r\n const res = await dispatch(createParties(payload));\r\n\r\n if (res?.meta?.requestStatus === 'fulfilled') {\r\n enqueueSnackbar(`${type} ${t('common.party.msg.success')}`);\r\n closeModal();\r\n partyCreated();\r\n } else if (res?.meta?.requestStatus === 'rejected') {\r\n const errorMessage = getErrorMessage(res?.error?.message);\r\n enqueueSnackbar(errorMessage, { variant: 'error' });\r\n }\r\n } finally {\r\n setIsCreating(false);\r\n }\r\n };\r\n\r\n const closeModal = () => {\r\n resetForm()\r\n setAddressRows([]);\r\n setContactRows([]);\r\n handleModalClose?.();\r\n setIsOpen?.(false);\r\n }\r\n const resetForm = () => {\r\n reset();\r\n }\r\n\r\n //Use Effect\r\n useEffect(() => {\r\n const addressData = addressRows.map(a => _.omit(a, addressOmitKeys));\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.ADDRESS}`, addressData);\r\n }, [addressRows, setValue]);\r\n\r\n useEffect(() => {\r\n const contactData = contactRows.map(c => _.omit(c, contactOmitKeys));\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACTS}`, contactData);\r\n }, [contactRows, setValue]);\r\n\r\n useEffect(() => {\r\n setIsCreating(isLoading)\r\n }, [isLoading]);\r\n\r\n\r\n useEffect(() => {\r\n if (selectedType === 'Individual') {\r\n // Clear Company fields\r\n resetField('parties.company_name');\r\n resetField('parties.vat_number');\r\n resetField('parties.crn');\r\n }\r\n\r\n if (selectedType === 'Company') {\r\n // Clear Individual fields\r\n resetField('parties.first_name');\r\n resetField('parties.last_name');\r\n }\r\n }, [selectedType, resetField]);\r\n\r\n// Pre-fill company and currency from user data when modal opens\r\nuseEffect(() => {\r\n\t\tif (isOpen && user?.company_data) {\r\n\t\t\tconst companyId =\r\n\t\t\t\tuser?.entity_priority ||\r\n\t\t\t\tuser?.company_data?.id ||\r\n\t\t\t\t(Array.isArray(user?.company_data) && user?.company_data[0]?.id) ||\r\n\t\t\t\tnull;\r\n\r\n\r\n\t\t\tif (companyId) {\r\n\t\t\t\tsetValue('quotation.company_id', companyId);\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.COMPANY}`, companyId);\r\n\t\t\t}\r\n\t\t}\r\n }, [isOpen, user?.company_data, setValue]);\r\n\r\n useEffect(() => {\r\n if (isOpen && user?.company_currencies) {\r\n const currencies = Object.values(user.company_currencies);\r\n if (currencies.length > 0) {\r\n setValue(`${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CURRENCY}`, [currencies[0].id]);\r\n }\r\n }\r\n }, [isOpen, user?.company_currencies , setValue]);\r\n\r\n // Auto fill first contact row\r\n useEffect(() => {\r\n const firstContactRow = contactRows[0];\r\n const parsedCountryCode = mainContactNo\r\n ? `+${parsePhoneNumberFromString(`+${mainContactNo}`)?.countryCallingCode || ''}`\r\n : '';\r\n\r\n const firstEmail = mainEmailIds\r\n ? mainEmailIds.split(/\\s*,\\s*/).map((e: string) => e.trim()).filter((e: string) => EMAIL_REGEX.test(e))[0] || ''\r\n : '';\r\n\r\n const updatedFirstRow = {\r\n name: responsiblePerson || '',\r\n contact_no: mainContactNo || '',\r\n email: firstEmail,\r\n country_code: parsedCountryCode,\r\n };\r\n\r\n if (firstContactRow) {\r\n const hasChanged = Object.keys(updatedFirstRow).some(\r\n (key) => firstContactRow[key] !== updatedFirstRow[key]\r\n );\r\n if (hasChanged) {\r\n const updatedRows = [...contactRows];\r\n updatedRows[0] = { ...updatedRows[0], ...updatedFirstRow };\r\n setContactRows(updatedRows);\r\n }\r\n } else {\r\n setContactRows([updatedFirstRow, ...contactRows]);\r\n }\r\n }, [responsiblePerson, mainContactNo, mainEmailIds]);\r\n\r\n // Auto fill first Address Row\r\n useEffect(() => {\r\n const firstRow = addressRows[0];\r\n const hasAddressDetails = firstRow?.address_type || firstRow?.street_1 || firstRow?.city;\r\n\r\n if (responsiblePerson && mainContactNo) {\r\n const parsedCountryCode = mainContactNo\r\n ? `+${parsePhoneNumberFromString(`+${mainContactNo}`)?.countryCallingCode || ''}`\r\n : '';\r\n\r\n // Create first row if doesn't exist yet\r\n if (!firstRow) {\r\n setAddressRows([{\r\n ...addressPayload,\r\n contact_name: responsiblePerson,\r\n phone: mainContactNo,\r\n country_code: parsedCountryCode,\r\n }]);\r\n return;\r\n }\r\n\r\n // Update first row ONLY if address details are not yet filled\r\n if (!hasAddressDetails) {\r\n const contactChanged = firstRow?.contact_name !== responsiblePerson;\r\n const phoneChanged = firstRow?.phone !== mainContactNo;\r\n\r\n if (contactChanged || phoneChanged) {\r\n setAddressRows(prev => prev.map((row, idx) =>\r\n idx === 0\r\n ? { ...row, contact_name: responsiblePerson, phone: mainContactNo, country_code: parsedCountryCode }\r\n : row\r\n ));\r\n }\r\n }\r\n }\r\n }, [responsiblePerson, mainContactNo]);\r\n\r\n const basicDetailsSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.basic_details\")}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid container spacing={2}>\r\n\r\n <Grid item xs={12} sm={12}>\r\n <DynamicRadioButton\r\n label=''\r\n name={PARTIES_FIELDS.TYPE}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n options={partyType}\r\n display='row'\r\n title={t(t('common.party.fields.type'))}\r\n titlePosition='start'\r\n position={2} />\r\n </Grid>\r\n\r\n {selectedType === \"Individual\" && (\r\n <>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.firstName_label')}\r\n name={PARTIES_FIELDS.FIRST_NAME}\r\n placeholder={t('common.party.fields.firstName_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.lastName_label')}\r\n name={PARTIES_FIELDS.LAST_NAME}\r\n placeholder={t('common.party.fields.lastName_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n </>\r\n )}\r\n\r\n\r\n {selectedType === \"Company\" && (\r\n <>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.company_name_label')}\r\n name={PARTIES_FIELDS.COMPANY_NAME}\r\n placeholder={t('common.party.fields.company_name_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.vat_number_label')}\r\n name={PARTIES_FIELDS.VAT_NUMBER}\r\n placeholder={t('common.party.fields.vat_number_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.crn_label')}\r\n name={PARTIES_FIELDS.CRN}\r\n placeholder={t('common.party.fields.crn_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n />\r\n </Grid>\r\n </>\r\n )}\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicPhone\r\n type=\"text\"\r\n label={t('common.party.fields.contact_label')}\r\n name={PARTIES_FIELDS.CONTACT_NO}\r\n placeholder={t('common.party.fields.contact_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.email_label')}\r\n name={PARTIES_FIELDS.EMAIL_IDS}\r\n placeholder={t('common.party.fields.email_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/*Entity Name */}\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.company_label')}\r\n apiType=\"company\"\r\n selectedLabel='Companies'\r\n name={PARTIES_FIELDS.COMPANY}\r\n placeholder={t('common.party.fields.company_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.currency_label')}\r\n apiType='currency'\r\n selectedLabel='Currency'\r\n name={PARTIES_FIELDS.CURRENCY}\r\n placeholder={t('common.party.fields.currency_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n is_multiselect\r\n />\r\n </Grid>\r\n\r\n <Grid item xs={12} sm={6}>\r\n <DynamicInput\r\n label={t('common.party.fields.responsible_person_label')}\r\n name={PARTIES_FIELDS.RESPONSIBLE_PERSON}\r\n placeholder={t('common.party.fields.responsible_person_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n />\r\n </Grid>\r\n\r\n\r\n </Grid>\r\n </Accordion>\r\n ), [t, control, selectedType]);\r\n\r\n const accountingSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.accounting\")}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid container spacing={2}>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.receivable_account_label')}\r\n apiType=\"accounts\"\r\n selectedLabel='Account'\r\n name={PARTIES_FIELDS.RECEIVABLE_ACCOUNT}\r\n placeholder={t('common.party.fields.receivable_account_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n customeFilter={{ '&account_type.eq': 'Receivable' }}\r\n options={[]}\r\n />\r\n </Grid>\r\n <Grid item xs={12} sm={6}>\r\n <DynamicSearchSelect\r\n label={t('common.party.fields.tax_template_label')}\r\n apiType=\"taxTemplate\"\r\n selectedLabel='Tax Template'\r\n name={PARTIES_FIELDS.TAX_TEMPLATE}\r\n placeholder={t('common.party.fields.tax_template_placeholder')}\r\n fieldArrayName={PARTIES_FORM_ARRAY_NAME}\r\n formControl={control}\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n ), [t, control]);\r\n\r\n const addressSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.address\")}\r\n <span className='errorIndicator'>*</span>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.ADDRESS] && (\r\n <span className='error'>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.ADDRESS]?.message}\r\n </span>\r\n )}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid spacing={4}>\r\n <Grid item xs={12}>\r\n <MaterialTable\r\n rows={[...addressRows]}\r\n columns={tableColumns(addressColumns)}\r\n paginationModel={{ pageNo: 1, limit: 10 }}\r\n totalPages={20}\r\n enableColumnDragging={false}\r\n isResetRow={false}\r\n columnOrder={['mrt-row-select']}\r\n enableRowSelection={false}\r\n enableBottomToolbar\r\n disableDefaultActionColumn\r\n editDisplayMode='row'\r\n enableRowCreate\r\n onCreateRow={(data) => handleRowOperation(data, addressRows, setAddressRows, true)}\r\n onEditRow={(data) => handleRowOperation(data, addressRows, setAddressRows, true)}\r\n onDeleteRow={(row) => deleteRow(addressRows, setAddressRows, row)}\r\n onChangeRowField={onChangeAddressTableField}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n // eslint-disable-next-line\r\n ), [t, addressRows, tableColumns, errors]);\r\n\r\n const contactSection = useMemo(() => (\r\n <Accordion\r\n title={\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {t(\"common.party.sections.contact\")}\r\n <span className='errorIndicator'>*</span>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.CONTACTS] && (\r\n <span className='error'>\r\n {errors?.[PARTIES_FORM_ARRAY_NAME]?.[PARTIES_FIELDS.CONTACTS]?.message}\r\n </span>\r\n )}\r\n </Typography>\r\n }\r\n accordionProps={{\r\n defaultExpanded: true,\r\n className: \"form--Accordion\",\r\n }}\r\n >\r\n <Grid spacing={4}>\r\n <Grid item xs={12}>\r\n\r\n <MaterialTable\r\n rows={[...contactRows]}\r\n columns={tableColumns(contactColumns)}\r\n paginationModel={{ pageNo: 1, limit: 10 }}\r\n totalPages={20}\r\n enableColumnDragging={false}\r\n isResetRow={false}\r\n columnOrder={['mrt-row-select']}\r\n enableRowSelection={false}\r\n enableBottomToolbar\r\n disableDefaultActionColumn\r\n editDisplayMode='row'\r\n enableRowCreate\r\n onCreateRow={(data) => handleRowOperation(data, contactRows, setContactRows, false)}\r\n onEditRow={(data) => {\r\n handleRowOperation(data, contactRows, setContactRows, false);\r\n\r\n if (data.row.index === 0) {\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.RESPONSIBLE_PERSON}`,\r\n data.values.name || ''\r\n );\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.CONTACT_NO}`,\r\n data.values.contact_no || ''\r\n );\r\n setValue(\r\n `${PARTIES_FORM_ARRAY_NAME}.${PARTIES_FIELDS.EMAIL_IDS}`,\r\n data.values.email || ''\r\n );\r\n }\r\n }}\r\n onDeleteRow={(row) => {\r\n if (row.index === 0) {\r\n enqueueSnackbar(t('common.party.errors.cannotDeleteResponsiblePerson'), { variant: 'error' });\r\n return Promise.resolve();\r\n }\r\n return deleteRow(contactRows, setContactRows, row);\r\n }}\r\n onChangeRowField={onChangeAddressTableField}\r\n />\r\n </Grid>\r\n </Grid>\r\n </Accordion>\r\n // eslint-disable-next-line\r\n ), [t, contactRows, tableColumns, errors]);\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={closeModal}\r\n maxWidth='lg'\r\n fullWidth\r\n sx={{ overflowY: 'hidden' }}\r\n {...modalProps}\r\n >\r\n {isCreating && <ModalLoader />}\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"scroll-container\" style={{ position: 'relative', overflow: 'auto' }}>\r\n <DialogTitle className='itemEntryModal--DialogTitle'\r\n >\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {`Add ${type}`}\r\n </Typography>\r\n <IconButton onClick={closeModal}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n\r\n <DialogContent>\r\n {basicDetailsSection}\r\n <Divider className='form--SectionDivider' />\r\n {addressSection}\r\n <Divider className='form--SectionDivider' />\r\n {contactSection}\r\n <Divider className='form--SectionDivider' />\r\n {accountingSection}\r\n </DialogContent>\r\n\r\n <DialogActions className='itemEntryModal--DialogAction' sx={{\r\n position: 'sticky',\r\n bottom: 0,\r\n backgroundColor: 'white',\r\n zIndex: 1,\r\n padding: '8px 24px',\r\n justifyContent: 'end'\r\n }}>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='itemEntryModal--DialogAction--WhiteBtn'\r\n onClick={closeModal}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button\r\n variant=\"contained\"\r\n onClick={handleSubmit(onSubmit)}\r\n >\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </Modal>\r\n );\r\n};\r\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { Controller } from 'react-hook-form';\nimport {\n\tBox,\n\tDivider,\n\tIconButton,\n\tInputAdornment,\n\tMenuItem,\n\tMenuItemProps,\n\tOutlinedInput\n} from '@mui/material';\nimport PropTypes from 'prop-types';\n\nimport Select from '../../../select/select';\nimport ChipOrPlaceholder from './chip-or-placeholder';\nimport Checkbox from '../../../checkbox/checkbox';\nimport Typography from '../../../typography/typography';\nimport Chip from '../../../chip/chip';\nimport { MoreIcon } from '../../../icons';\nimport './element.scss';\nimport { Add, Close } from '@mui/icons-material';\nimport { useTranslation } from \"react-i18next\";\n\ninterface IMenuItems extends MenuItemProps {\n\toptions: any[];\n\tmultiple: boolean;\n\tplaceholder: string;\n\twith_checkboxes: boolean;\n\tvalues: string | string[];\n\tfield: any;\n}\n\nconst generateMenuItems = ({\n\toptions,\n\tmultiple,\n\tplaceholder,\n\twith_checkboxes,\n\tvalues,\n\tfield\n}: IMenuItems) => {\n\tconst items: React.ReactElement[] = [];\n\tif (!multiple) {\n\t\titems.push(\n\t\t\t<MenuItem disabled value='' sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\n\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t<em>{placeholder}</em>\n\t\t\t\t</Typography>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n\toptions?.forEach((option, index) => {\n\t\titems.push(\n\t\t\t<MenuItem\n\t\t\t\tvalue={option.value}\n\t\t\t\tkey={index}\n\t\t\t\tdisabled={Boolean(option.disabled)}\n\t\t\t\tclassName={option?.isGroup ? 'select--MenuItemHeader' : ''}>\n\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\n\t\t\t\t\t{multiple && with_checkboxes && (\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tchecked={Boolean(values && values?.indexOf(option.value) > -1)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t{option.label}\n\t\t\t\t\t</Typography>\n\t\t\t\t</Box>\n\t\t\t</MenuItem>\n\t\t);\n\t\tif (option?.isGroup && Array.isArray(option?.options)) {\n\t\t\toption.options.forEach((opt) => {\n\t\t\t\titems.push(\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tvalue={opt.value}\n\t\t\t\t\t\tdisabled={Boolean(opt.disabled)}\n\t\t\t\t\t\tsx={{ pl: 5 }}\n\t\t\t\t\t\tkey={`${option.value}-${opt.value}`}>\n\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 1 }}>\n\t\t\t\t\t\t\t{multiple && with_checkboxes && (\n\t\t\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\t\t\tchecked={Boolean(values && values?.indexOf(opt.value) > -1)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Typography type='s3' color='theme.secondary.1000'>\n\t\t\t\t\t\t\t\t{opt.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</MenuItem>\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t});\n\tif (field.enable_footer) {\n\t\titems.push(\n\t\t\t<Box>\n\t\t\t\t<Divider flexItem />\n\t\t\t\t<MenuItem sx={{ gap: 1 }} onClick={field.onFooterClick}>\n\t\t\t\t\t<Add fontSize='small' />\n\t\t\t\t\t<Typography type='s4' color='theme.secondary.1000'>\n\t\t\t\t\t\tCreate New {field.label}\n\t\t\t\t\t</Typography>\n\t\t\t\t</MenuItem>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn items;\n};\nconst SelectedItems = ({\n\tdata,\n\toptions\n}: {\n\tdata: string[];\n\toptions: any[];\n}) => {\n\tconst displayTitle = data.map(\n\t\t(selectedItem) =>\n\t\t\toptions?.find((option: any) => option.value === selectedItem)?.label ||\n\t\t\tselectedItem\n\t);\n\tconst fDisplayTitle = displayTitle.filter(Boolean)\n\treturn (\n\t\t<Typography\n\t\t\ttype='s4'\n\t\t\tcolor='inherit'\n\t\t\tsx={{ display: 'flex', gap: 1, alignItems: 'center', mt: 0.5 }}>\n\t\t\t{fDisplayTitle.slice(0.4).join(', ')}\n\t\t\t{data.length > 4 && (\n\t\t\t\t<Chip variant='outlined' type='normal' label={<MoreIcon />} />\n\t\t\t)}\n\t\t</Typography>\n\t);\n};\n\nconst DynamicSelect = React.memo((props: any) => {\n\tconst [options, setOptions] = useState([]);\n\tconst [selectedValue, setSelectedValue] = useState(null);\n\tconst { handleOptions } = props;\n\tuseEffect(() => {\n\t\tif (handleOptions) {\n\t\t\thandleOptions(selectedValue);\n\t\t}\n\t}, [handleOptions, selectedValue]);\n\tconst handleSearch = (search: string) => {\n\t\tif (props.options?.length && search) {\n\t\t\tconst searchedOptions = props.options.filter((opt) =>\n\t\t\t\tReact.isValidElement(opt.label)\n\t\t\t\t\t? opt?.searchLabel?.toLowerCase()?.includes(search.toLowerCase())\n\t\t\t\t\t: opt.label.toLowerCase().includes(search.toLowerCase())\n\t\t\t);\n\t\t\tsetOptions(searchedOptions);\n\t\t} else {\n\t\t\tsetOptions(props.options);\n\t\t}\n\t};\n\n\tconst removeUndefine = (selectOptions: any[]) => {\n\t\treturn selectOptions?.filter((option) => option);\n\t};\n\tconst handleSetOptions = useCallback(() => {\n\t\tsetOptions(props.options);\n\t}, [props.options]);\n\n\tuseEffect(() => {\n\t\thandleSetOptions();\n\t}, [handleSetOptions]);\n\t\tconst { t } = useTranslation();\n\t\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={props.formControl}\n\t\t\tname={`${props.fieldArrayName}.${props.name}`}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<>\n\t\t\t\t\t{props.placeholder === 'Select Currency'\n\t\t\t\t\t\t? setSelectedValue(field.value)\n\t\t\t\t\t\t: setSelectedValue(null)}\n\t\t\t\t\t<Select\n\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t// onFocus={() => {\n\t\t\t\t\t\t// \tsetOptions(props.options);\n\t\t\t\t\t\t// }}\n\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\tdataPosition={props.position}\n\t\t\t\t\t\tdataName={`${props.fieldArrayName}.${props.name}`}\n\t\t\t\t\t\tplaceholder={props.placeholder}\n\t\t\t\t\t\tlabel={props.label}\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tfield.value?.id || field.value?.label || field.value || (props.is_multiselect ? [] : '')\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefaultValue={\n\t\t\t\t\t\t\tprops.defaultValue || (props.is_multiselect ? [] : '')\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequired={props.formType === 'builder' ? false : props.required}\n\t\t\t\t\t\tsize={props.size || 'small'}\n\t\t\t\t\t\tmultiple={props.is_multiselect || false}\n\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\tvariant='outlined'\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tprops.is_multiselect && removeUndefine(field.value)?.length\n\t\t\t\t\t\t\t\t? 'MultiSelect'\n\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t}\n\t\t\t\t\t\trenderValue={(selected: string | string[]) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{Array.isArray(selected) ? (\n\t\t\t\t\t\t\t\t\t<ChipOrPlaceholder\n\t\t\t\t\t\t\t\t\t\tselectedLabel={props.selectedLabel}\n\t\t\t\t\t\t\t\t\t\tdata={removeUndefine(selected)}\n\t\t\t\t\t\t\t\t\t\tplaceholder={props.placeholder}\n\t\t\t\t\t\t\t\t\t\tonDelete={props?.onChipRemove}\n\t\t\t\t\t\t\t\t\t\tdisabled={props.disabled}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\toptions?.find(\n\t\t\t\t\t\t\t\t\t\t(option: any) =>\n\t\t\t\t\t\t\t\t\t\t\t(option.value?.id || option.value) === selected\n\t\t\t\t\t\t\t\t\t)?.label ||\n\t\t\t\t\t\t\t\t\tselected ||\n\t\t\t\t\t\t\t\t\tprops.placeholder\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tsearchPlaceholder={`${t('common.search')} ${props.label}`}\n\t\t\t\t\t\thandleSearch={handleSearch}\n\t\t\t\t\t\terror={Boolean(fieldState.error?.message)}\n\t\t\t\t\t\thelperText={fieldState.error?.message || ''}\n\t\t\t\t\t\tonBlur={field.onBlur}\n\t\t\t\t\t\tinput={\n\t\t\t\t\t\t\t!props?.is_multiselect && !props.disabled && field?.value ? (\n\t\t\t\t\t\t\t\t<OutlinedInput\n\t\t\t\t\t\t\t\t\tlabel=''\n\t\t\t\t\t\t\t\t\tendAdornment={\n\t\t\t\t\t\t\t\t\t\t<InputAdornment position='end'>\n\t\t\t\t\t\t\t\t\t\t\t{field.value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-label='clear selection'\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => field.onChange(null)}\n\t\t\t\t\t\t\t\t\t\t\t\t\tedge='end'\n\t\t\t\t\t\t\t\t\t\t\t\t\tsx={{ mr: 1.5 }}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize='small'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Close sx={{ fontSize: '1rem' }} />\n\t\t\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tloading={props?.is_loading}>\n\t\t\t\t\t\t{generateMenuItems({\n\t\t\t\t\t\t\toptions,\n\t\t\t\t\t\t\tmultiple: Boolean(props.is_multiselect),\n\t\t\t\t\t\t\tplaceholder: props.placeholder,\n\t\t\t\t\t\t\tvalues: field.value,\n\t\t\t\t\t\t\twith_checkboxes: true,\n\t\t\t\t\t\t\tfield: props\n\t\t\t\t\t\t})}\n\t\t\t\t\t</Select>\n\t\t\t\t\t{props.is_multiselect && Array.isArray(field?.value) && (\n\t\t\t\t\t\t<SelectedItems data={field.value} options={options} />\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nDynamicSelect.propTypes = {\n\tname: PropTypes.string.isRequired,\n\tplaceholder: PropTypes.string.isRequired,\n\tlabel: PropTypes.string.isRequired,\n\tsize: PropTypes.string,\n\toptions: PropTypes.arrayOf(\n\t\tPropTypes.shape({\n\t\t\tlabel: PropTypes.string,\n\t\t\tvalue: PropTypes.string\n\t\t})\n\t).isRequired,\n\tformControl: PropTypes.shape({\n\t\tregister: PropTypes.func.isRequired,\n\t\tsetValue: PropTypes.func\n\t}).isRequired,\n\tdefaultValue: PropTypes.string,\n\tfieldArrayName: PropTypes.string,\n\tid: PropTypes.string,\n\trequired: PropTypes.bool,\n\tis_multiselect: PropTypes.bool,\n\tposition: PropTypes.number,\n\tformType: PropTypes.string,\n\ttypeOfField: PropTypes.string,\n\tdisabled: PropTypes.bool,\n\tonChipRemove: PropTypes.func,\n\tenable_footer: PropTypes.bool,\n\tfooter_action: PropTypes.string,\n\tonFooterClick: PropTypes.any,\n\tis_loading: PropTypes.bool,\n\tselectedLabel: PropTypes.string\n};\n\nexport { DynamicSelect };\nexport default DynamicSelect;\n","// import { Controller } from 'react-hook-form';\nimport PropTypes from \"prop-types\";\nimport Button from \"../../../button/button\";\n\n// { control, index }\n\nconst DynamicButton = (props: any) => {\n const { type, onClick, className, disable, ...rest } = props;\n\n return (\n <Button\n type={type}\n onClick={onClick}\n className={className}\n {...rest}\n disabled={disable}\n >\n {props.text}\n </Button>\n );\n};\n\nDynamicButton.propTypes = {\n text: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n type: PropTypes.string,\n style: PropTypes.object,\n variant: PropTypes.string,\n className: PropTypes.string,\n disable: PropTypes.bool,\n startIcon: PropTypes.node,\n};\n\nexport { DynamicButton };\nexport default DynamicButton;\n","import React from 'react';\nimport { Control, Controller } from 'react-hook-form';\nimport Checkbox from '../../../checkbox/checkbox';\nimport Typography from '../../../typography/typography';\nimport { CheckboxProps, Stack, StackProps } from '@mui/material';\nimport { useLanguage } from '../../../../hooks/useLangauge';\n\ninterface IDynamicCheckbox {\n\tformControl: Control<any>;\n\tfieldArrayName: string;\n\tname: string;\n\tlabel?: string;\n\tposition?: number;\n\tdisabled?: boolean;\n\ttitlePosition?: 'start' | 'end';\n\ttypeOfField?: string;\n\ttitle: string;\n\ttitleColor?: string; // New prop for title color\n\tcheckboxProps?: CheckboxProps;\n\tstackProps?: StackProps;\n}\n\nconst DynamicCheckBox: React.FC<IDynamicCheckbox> = ({\n\tformControl,\n\tfieldArrayName,\n\tname,\n\tlabel,\n\tposition,\n\tdisabled,\n\ttitlePosition = 'end',\n\ttitle,\n\ttitleColor = 'theme.secondary.800', // Default color\n\tcheckboxProps,\n\tstackProps,\n}) => {\n\tconst {isRtl}=useLanguage();\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={formControl}\n\t\t\tname={`${fieldArrayName}.${name}`}\n\t\t\trender={({ field }) => (\n\t\t\t\t<>\n\t\t\t\t\t{label && (\n\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\t\tdata-position={position}\n\t\t\t\t\t\t\tsx={{ mb: 0.5 }}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</Typography>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<Stack direction='row' spacing={isRtl?'':0.25} alignItems='center' {...stackProps}>\n\t\t\t\t\t\t{titlePosition === 'start' && (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor={titleColor}> {/* Use titleColor prop here */}\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<Checkbox\n\t\t\t\t\t\t\tchecked={Boolean(field.value)}\n\t\t\t\t\t\t\tonChange={field.onChange}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\tsx={{ m: 1 }}\n\t\t\t\t\t\t\t{...checkboxProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{titlePosition === 'end' && (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor={titleColor}> {/* Use titleColor prop here */}\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n};\n\nexport default DynamicCheckBox;","/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport { Controller/* , useFormContext */ } from 'react-hook-form';\r\nimport PropTypes from 'prop-types';\r\nimport React, { useMemo } from 'react';\r\nimport dayjs from 'dayjs';\r\n\r\nimport './element.scss';\r\nimport DatePicker from '../../../date-picker/date-picker';\r\n\r\ninterface DynamicDateProps {\r\n formControl: any;\r\n name: string;\r\n label: string;\r\n fieldArrayName?: string;\r\n required?: boolean;\r\n position?: number;\r\n formType?: string;\r\n placeholder?: string;\r\n defaultValue?: any;\r\n is_future_dates_allowed?: boolean;\r\n is_past_dates_allowed?: boolean;\r\n typeOfField?: string;\r\n disabled?: boolean;\r\n min_date?: any;\r\n max_date?: any;\r\n}\r\n\r\nconst DynamicDate = React.memo<DynamicDateProps>((props) => {\r\n // const formContext = useFormContext();\r\n\r\n // Memoize field name to prevent unnecessary recalculations\r\n const fieldName = useMemo(() =>\r\n `${props.fieldArrayName}.${props.name}`,\r\n [props.fieldArrayName, props.name]\r\n );\r\n\r\n // Memoize date calculations to prevent recalculation on every render\r\n const { minDate, maxDate } = useMemo(() => {\r\n const min = dayjs(props.min_date || null).isValid()\r\n ? dayjs(props.min_date)\r\n : null;\r\n\r\n const max = dayjs(props.max_date || null).isValid()\r\n ? dayjs(props.max_date)\r\n : null;\r\n\r\n return { minDate: min, maxDate: max };\r\n }, [props.min_date, props.max_date]);\r\n\r\n // Memoize required prop calculation\r\n const isRequired = useMemo(() =>\r\n props.formType === 'builder' ? false : props.required,\r\n [props.formType, props.required]\r\n );\r\n\r\n return (\r\n <Controller\r\n control={props.formControl}\r\n name={fieldName}\r\n render={({ field, fieldState }) => (\r\n <DatePicker\r\n {...field}\r\n // {...props}\r\n dataPosition={props.position}\r\n dataName={fieldName}\r\n label={props.label}\r\n placeholder={props.placeholder}\r\n required={isRequired}\r\n defaultValue={props.defaultValue}\r\n disableFutureDates={props.is_future_dates_allowed}\r\n disablePastDates={props.is_past_dates_allowed}\r\n helperText={fieldState.error?.message}\r\n error={Boolean(fieldState.error)}\r\n disabled={props.disabled}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n {...(props?.views && { views: props?.views })}\r\n />\r\n )}\r\n />\r\n );\r\n});\r\n\r\nDynamicDate.displayName = 'DynamicDate';\r\n\r\nDynamicDate.propTypes = {\r\n formControl: PropTypes.shape({\r\n register: PropTypes.func.isRequired,\r\n setValue: PropTypes.func\r\n }).isRequired,\r\n name: PropTypes.string.isRequired,\r\n label: PropTypes.string.isRequired,\r\n fieldArrayName: PropTypes.string,\r\n required: PropTypes.bool,\r\n position: PropTypes.number,\r\n formType: PropTypes.string,\r\n placeholder: PropTypes.string,\r\n defaultValue: PropTypes.any,\r\n is_future_dates_allowed: PropTypes.bool,\r\n is_past_dates_allowed: PropTypes.bool,\r\n typeOfField: PropTypes.string,\r\n disabled: PropTypes.bool,\r\n min_date: PropTypes.any,\r\n max_date: PropTypes.any\r\n};\r\n\r\nexport { DynamicDate };\r\nexport default DynamicDate;","import { Controller } from \"react-hook-form\";\nimport TextField from \"../../../text-field/text-field\";\nimport PropTypes from \"prop-types\"\nimport { InputAdornment } from \"@mui/material\";\nconst DynamicCurrency = (props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n name={`${props.fieldArrayName}.${props.name}`}\n fullWidth\n label={props.label}\n defaultValue={props.default_value.replace(/[^0-9]/g, \"\")}\n placeholder={props.placeholder}\n multiline={props.is_multiline || false}\n disabled={props.disabled}\n required={props.is_required}\n inputProps={{\n step: props?.float_step || \"0\" , \n min : props.min_length || 0 , \n max : props.max_length || 1000 ,\n inputMode: 'numeric',\n pattern : `${props.is_negative}` ? '-?[0-9]*' : '[0-9]*' , \n \n }}\n InputProps={{\n startAdornment: (\n <InputAdornment\n position=\"start\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderRight: '1px solid rgba(0, 0, 0, 0.23)',\n width: 50,\n height: '100%',\n borderBottomLeftRadius: 4, \n borderTopLeftRadius: 4,\n }}\n >\n {(props.currencyType !== null ? props.currencyType : \"-\")}\n </InputAdornment>\n )\n\n }}\n\n error={Boolean(fieldState.error?.message)}\n helperText={fieldState.error?.message || \"\"}\n onBlur = {field.onBlur}\n onChange ={(e : any) => {\n const numericValue = e.target.value.replace(/[^0-9]/g , \"\");\n field.onChange(numericValue)\n }}\n />\n )}\n />\n )\n}\nDynamicCurrency.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired\n }).isRequired,\n defaultValue: PropTypes.string,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiline: PropTypes.bool,\n min: PropTypes.number,\n max: PropTypes.number,\n min_length: PropTypes.number,\n max_length: PropTypes.number,\n float_step: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n disabled: PropTypes.bool,\n InputProps: PropTypes.object,\n placeholder : PropTypes.string , \n currencyType :PropTypes.string ,\n \n}\nexport { DynamicCurrency };\nexport default DynamicCurrency;\n\n\n\n","import PropTypes from \"prop-types\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Grid, Box } from \"@mui/material\";\nimport { useDrag, useDrop } from \"react-dnd\";\n\nimport \"./element.scss\";\nimport images from \"../../../../assets/images\";\n\nconst DynamicElementHOC = (props: any) => {\n const [, ref] = useDrag({\n type: \"element\",\n item: { index: props.index },\n });\n const [, drop] = useDrop({\n accept: \"element\",\n hover: (draggedElement: any) => {\n const draggedIndex = draggedElement.index;\n const dropIndex = props.index;\n if (dropIndex === draggedIndex) {\n return;\n }\n\n props.swap(draggedIndex, dropIndex);\n },\n drop: () => {\n props.elementSwap();\n },\n });\n\n \n const activeClassName = `${\n props.activeIndex\n ? \"form-element-wrapper--Active\"\n : \"form-element-wrapper--Element\"\n }`;\n const defaultClassName = `${\n props?.children?.props?.typeOfField === \"custom\"\n ? \"\"\n : \"form-element-wrapper--Default\"\n }`;\n\n return (\n <Grid\n item\n xs={props?.element === \"table\" ? 12 : 12}\n className={`${activeClassName} ${defaultClassName}`}\n ref={(node) => drop(ref(node))}\n >\n <Box sx={{ width: \"100%\" }} onClick={props.onClick}>\n {props.children}\n </Box>\n <div className=\"form-element-wrapper--Actions\">\n <img\n src={images.duplicate}\n onClick={() => props.handleDuplicate(props.index)}\n />\n {props?.children?.props?.typeOfField === \"custom\" && (\n <CloseIcon\n style={{ fontSize: \"1rem\", color: \"#656669\" }}\n onClick={() => {\n props.removeElement(props.index);\n props.setElementHoc();\n }}\n />\n )}\n </div>\n </Grid>\n );\n};\n\nDynamicElementHOC.propTypes = {\n removeElement: PropTypes.func.isRequired,\n index: PropTypes.number.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n swap: PropTypes.func,\n elementSwap: PropTypes.func,\n activeIndex: PropTypes.bool,\n handleDuplicate: PropTypes.func,\n setElementHoc: PropTypes.func,\n element: PropTypes.string,\n elementPerRow : PropTypes.number \n};\n\nexport { DynamicElementHOC };\nexport default DynamicElementHOC;\n","import { Controller } from \"react-hook-form\";\nimport TextField from \"../../../text-field/text-field\";\nimport PropTypes from \"prop-types\"\nimport { InputAdornment, Select, MenuItem } from \"@mui/material\";\nimport { useState } from \"react\";\nimport KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';\nconst DynamicInputSelect = (props: any) => {\n const [defaultOption, setSelectOption] = useState(props.options[0].value); //need to be update \n const handleOptionChange = (event: any) => {\n setSelectOption(event.target.value);\n };\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n name={`${props.fieldArrayName}.${props.name}`}\n fullWidth\n label={props.label}\n placeholder={props.placeholder}\n multiline={props.is_multiline || false}\n disabled={props.disabled}\n required={props.is_required}\n inputProps={{\n step: props?.float_step || \"0\",\n min: props.min_length || 0,\n max: props.max_length || 1000,\n inputMode: 'string',\n\n\n }}\n InputProps={{\n endAdornment: (\n <InputAdornment\n position=\"start\"\n sx={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n borderLeft: '1px solid rgba(0, 0, 0, 0.23)',\n padding: 1,\n height: '100%',\n borderBottomLeftRadius: 4,\n borderTopLeftRadius: 4,\n backgroundColor: 'rgba(245 , 245 , 245 )',\n margin: 0,\n boxSizing: 'border-box',\n borderRadius: 0,\n\n }}\n\n >\n <Select\n value={defaultOption}\n onChange={handleOptionChange}\n sx={{\n height: '100%',\n '&:focus': {\n backgroundColor: 'rgba(245 , 245 , 245 )' , // Prevent background color change on focus\n },\n '&:hover': {\n backgroundColor: 'rgba(245 , 245 , 245 )', // Prevent background color change on hover\n },\n '&:active': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on active\n },\n '&.Mui-focused': {\n backgroundColor: '#fff', // Override the focus background color\n },\n '&.Mui-focused .MuiOutlinedInput-notchedOutline': {\n borderColor: '#fff', // Prevent border color change on focus\n },\n }}\n variant=\"standard\"\n disableUnderline\n\n IconComponent={KeyboardArrowDownOutlinedIcon}\n\n >\n {props.options?.map((item: any, index: any) => (\n <MenuItem\n key={index}\n value={item.value}\n sx={{\n '&:hover': {\n backgroundColor: 'rgba(245 , 245 , 245 )', // Prevent background color change on hover\n },\n '&.Mui-selected': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on selection\n },\n '&.Mui-selected:hover': {\n backgroundColor: 'rgba(245 , 245 , 245)', // Prevent background color change on selection hover\n },\n }}\n >\n {item.label}\n </MenuItem>\n ))}\n </Select>\n\n </InputAdornment>\n )\n\n }}\n\n error={Boolean(fieldState.error?.message)}\n helperText={fieldState.error?.message || \"\"}\n onBlur={field.onBlur}\n onChange={(e: any) => {\n field.onChange(e.target.value)\n }}\n />\n )}\n />\n )\n}\nDynamicInputSelect.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired\n }).isRequired,\n defaultValue: PropTypes.string,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiline: PropTypes.bool,\n min: PropTypes.number,\n max: PropTypes.number,\n min_length: PropTypes.number,\n max_length: PropTypes.number,\n float_step: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n disabled: PropTypes.bool,\n InputProps: PropTypes.object,\n placeholder: PropTypes.string,\n\n\n}\nexport { DynamicInputSelect };\nexport default DynamicInputSelect;\n","import React, { useState } from 'react';\nimport { Controller, Control, FieldValues } from 'react-hook-form';\nimport PropTypes from 'prop-types';\nimport { Autocomplete } from '@mui/material';\nimport TextField from '../../../text-field/text-field';\nimport Chip from '../../../chip/chip';\n// import { Close } from '@mui/icons-material';\nimport Typography from '../../../typography/typography';\nimport './element.scss';\n\n// Define the type for props\ninterface DynamicTagsInputProps<TFieldValues extends FieldValues> {\n formControl: Control<TFieldValues>;\n name: string;\n fieldArrayName?: string;\n label: React.ReactNode;\n}\n\n// Define the component using generic type TFieldValues\nconst DynamicTagsInput = <TFieldValues extends FieldValues>({\n formControl,\n name,\n fieldArrayName = '',\n label,\n}: DynamicTagsInputProps<TFieldValues>) => {\n // Local state for managing the input value\n const [inputValue, setInputValue] = useState<string>('');\n\n return (\n <Controller\n control={formControl}\n name={`${fieldArrayName}.${name}`}\n render={({ field: { value = '', onChange } }) => {\n const tags = value ? value.split(',').map((tag: string) => tag.trim()) : [];\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Tab') {\n // Get the trimmed input value\n const trimmedInputValue = inputValue.trim();\n \n // Check if input is not empty and not already a tag\n if (trimmedInputValue && !tags.includes(trimmedInputValue)) {\n event.preventDefault(); // Prevent default tab action\n\n // Add new tag\n const newTags = [...tags, trimmedInputValue];\n const newValueString = newTags.join(', ');\n onChange(newValueString);\n setInputValue(''); // Clear the input field\n }\n }\n };\n\n return (\n <Autocomplete\n clearIcon={false}\n options={[]}\n freeSolo\n multiple\n fullWidth\n value={tags}\n onChange={(event: React.ChangeEvent<unknown>, newValue: string[] | null) => {\n const newValueString = newValue?.join(', ') || '';\n onChange(newValueString);\n }}\n renderTags={(value: string[], renderTagProps) =>\n value.map((option, index) => (\n <Chip\n key={index}\n // deleteIcon={<Close fontSize='large' />}\n // variant='outlined'\n type='normal'\n label={\n <Typography color='theme.secondary.1000' type='s4'>\n {option}\n </Typography>\n }\n {...renderTagProps({ index })}\n />\n ))\n }\n renderInput={(params) => (\n <TextField\n label={label}\n type=\"text\"\n {...params}\n value={inputValue}\n onChange={(event:any) => setInputValue(event.target.value)}\n onKeyDown={handleKeyDown}\n />\n )}\n />\n );\n }}\n />\n );\n};\n\n// Define PropTypes for runtime validation (optional)\nDynamicTagsInput.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n _formState: PropTypes.object.isRequired,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.node.isRequired,\n fieldArrayName: PropTypes.string,\n};\n\nexport { DynamicTagsInput };\nexport default DynamicTagsInput;\n\n","import Typography from \"../typography/typography\";\nimport logo from \"../../assets/images\";\nimport \"./info-card.scss\";\n\nexport interface InfoCardProps {\n label: string;\n dataPosition?: number;\n dataName?: string;\n value?: string;\n}\n\nconst InfoCard = (props: InfoCardProps) => {\n const { label, dataPosition, dataName, value } = props;\n return (\n <>\n <Typography\n type=\"s5\"\n weight=\"medium\"\n mb={0.5}\n color={\"theme.secondary.800\"}\n data-position={dataPosition}\n data-name={dataName}\n className=\"infoCard\"\n >\n {label}\n <img src={logo.info} />\n </Typography>\n <Typography color={\"theme.secondary.1000\"}>{value ?? \"Info\"}</Typography>\n </>\n );\n};\n\nexport { InfoCard };\nexport default InfoCard;\n","import { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport InfoCard from \"../../../info-card/info-card\";\n\nconst DynamicInfo = (props: any) => {\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field }) => (\n <InfoCard\n {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n value={props.defaultValue || \"Info\"}\n />\n )}\n />\n );\n};\n\nDynamicInfo.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n position: PropTypes.number,\n formType: PropTypes.string,\n defaultValue: PropTypes.string,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nexport { DynamicInfo };\nexport default DynamicInfo;\n","import React from \"react\";\nimport { Controller } from \"react-hook-form\";\nimport PropTypes from \"prop-types\";\n\nimport \"./element.scss\";\nimport UploadMedia from \"../../../upload-media/upload-media\";\nimport Typography from \"../../../typography/typography\";\n\nconst DynamicMedia = React.memo((props: any) => {\n\n return (\n <Controller\n control={props.formControl}\n name={`${props.fieldArrayName}.${props.name}`}\n render={({ field, fieldState: { error } }) => (\n <>\n <UploadMedia\n // {...field}\n dataPosition={props.position}\n dataName={`${props.fieldArrayName}.${props.name}`}\n label={props.label}\n required={props.formType === \"builder\" ? false : props.required}\n type={props.field_type}\n max_size={props?.max_size}\n disabled={props?.disabled}\n onChange={field?.onChange}\n name={props.name}\n value={field?.value || props?.value}\n multiple={Boolean(props?.is_multiple)}\n />\n {error &&\n <Typography color=\"theme.error.600\" type=\"s5\">{error.message}</Typography>\n }\n </>\n )}\n />\n );\n});\n\nDynamicMedia.propTypes = {\n formControl: PropTypes.shape({\n register: PropTypes.func.isRequired,\n setValue: PropTypes.func,\n }).isRequired,\n name: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n fieldArrayName: PropTypes.string,\n required: PropTypes.bool,\n is_multiple: PropTypes.bool,\n position: PropTypes.number,\n formType: PropTypes.string,\n placeholder: PropTypes.string,\n default_value: PropTypes.string,\n type: PropTypes.string,\n field_type: PropTypes.string,\n max_size: PropTypes.number,\n typeOfField: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nexport { DynamicMedia };\nexport default DynamicMedia;\n","import PropTypes from \"prop-types\";\nimport { Grid, /* Box, */ IconButton, Menu, MenuItem } from \"@mui/material\";\n\nimport \"./element.scss\";\nimport Typography from \"../../../typography/typography\";\nimport images from \"../../../../assets/images\";\nimport React from \"react\";\nimport Button from \"../../../button/button\";\nimport AddIcon from \"@mui/icons-material/Add\";\n\nconst DynamicSectionHOC = (props: any) => {\n const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);\n\n const handleActionClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n return (\n <Grid\n className={\n props.className ? `formBuilder ${props.className}` : \"formBuilder\"\n }\n >\n <div className=\"formBuilder--Header\">\n <Typography\n type=\"s4\"\n fontWeight={\"medium\"}\n mb={0.5}\n color={\"theme.secondary.800\"}\n sx={{ cursor: \"pointer\", ...(!props.label?.trim() ? { fontStyle: 'italic' } : {}) }}\n onClick={props.onClick}\n data-position={props.position}\n data-name={`${props.fieldArrayName}.${props.name}`}\n >\n {props.label || \"(Unnamed Section)\"}\n </Typography>\n <div>\n <IconButton color=\"inherit\" size=\"small\" onClick={handleActionClick}>\n <img src={images.more} alt=\"more icon\" />\n </IconButton>\n <Menu\n open={Boolean(anchorEl)}\n anchorEl={anchorEl}\n onClose={() => setAnchorEl(null)}\n >\n <MenuItem\n onClick={() => {\n props.handleAccordion();\n setAnchorEl(null);\n }}\n >\n Make this section accordion\n </MenuItem>\n {!props.remove_section && (\n <MenuItem\n sx={{ color: \"#F86060\" }}\n onClick={() => {\n props.removeSection();\n setAnchorEl(null);\n }}\n >\n Remove Section\n </MenuItem>\n )}\n </Menu>\n </div>\n </div>\n <div\n className={`${\n props.activeIndex ? \"formBuilder--Active\" : \"formBuilder--Section\"\n }`}\n >\n {/* <Box sx={{ width: \"100%\" }} className=\"formBuilder--GridLayout\">\n {props.children}\n </Box> */}\n <Grid container sx={{ mb: 2 }}>\n {props.children}\n </Grid>\n {!props.isFormSwitcher ? (\n <Button\n variant=\"outlined\"\n style={{ color: \"#292D32\", marginBottom: \"0.375rem\" }}\n startIcon={<AddIcon />}\n data-position={props.position}\n data-name={`${props.fieldArrayName}.${props.name}`}\n onClick={props.handleAddButton}\n >\n Add\n </Button>\n ) : null}\n </div>\n </Grid>\n );\n};\n\nDynamicSectionHOC.propTypes = {\n index: PropTypes.number.isRequired,\n onClick: PropTypes.func,\n children: PropTypes.node.isRequired,\n label: PropTypes.string,\n position: PropTypes.number,\n fieldArrayName: PropTypes.string,\n className: PropTypes.string,\n removeSection: PropTypes.func.isRequired,\n handleAccordion: PropTypes.func,\n activeIndex: PropTypes.bool,\n handleAddButton: PropTypes.func,\n remove_section: PropTypes.bool,\n isFormSwitcher: PropTypes.bool,\n};\n\nexport { DynamicSectionHOC };\nexport default DynamicSectionHOC;\n","/// <reference types=\"../types/index.d.ts\" />\n\n// (c) 2020-present Andrea Giammarchi\n\nconst {parse: $parse, stringify: $stringify} = JSON;\nconst {keys} = Object;\n\nconst Primitive = String; // it could be Number\nconst primitive = 'string'; // it could be 'number'\n\nconst ignore = {};\nconst object = 'object';\n\nconst noop = (_, value) => value;\n\nconst primitives = value => (\n value instanceof Primitive ? Primitive(value) : value\n);\n\nconst Primitives = (_, value) => (\n typeof value === primitive ? new Primitive(value) : value\n);\n\nconst resolver = (input, lazy, parsed, $) => output => {\n for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {\n const k = ke[y];\n const value = output[k];\n if (value instanceof Primitive) {\n const tmp = input[+value];\n if (typeof tmp === object && !parsed.has(tmp)) {\n parsed.add(tmp);\n output[k] = ignore;\n lazy.push({ o: output, k, r: tmp });\n }\n else\n output[k] = $.call(output, k, tmp);\n }\n else if (output[k] !== ignore)\n output[k] = $.call(output, k, value);\n }\n return output;\n};\n\nconst set = (known, input, value) => {\n const index = Primitive(input.push(value) - 1);\n known.set(value, index);\n return index;\n};\n\n/**\n * Converts a specialized flatted string into a JS value.\n * @param {string} text\n * @param {(this: any, key: string, value: any) => any} [reviver]\n * @returns {any}\n */\nexport const parse = (text, reviver) => {\n const input = $parse(text, Primitives).map(primitives);\n const $ = reviver || noop;\n\n let value = input[0];\n\n if (typeof value === object && value) {\n const lazy = [];\n const revive = resolver(input, lazy, new Set, $);\n value = revive(value);\n\n let i = 0;\n while (i < lazy.length) {\n // it could be a lazy.shift() but that's costly\n const {o, k, r} = lazy[i++];\n o[k] = $.call(o, k, revive(r));\n }\n }\n\n return $.call({'': value}, '', value);\n};\n\n/**\n * Converts a JS value into a specialized flatted string.\n * @param {any} value\n * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]\n * @param {string | number | undefined} [space]\n * @returns {string}\n */\nexport const stringify = (value, replacer, space) => {\n const $ = replacer && typeof replacer === object ?\n (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :\n (replacer || noop);\n const known = new Map;\n const input = [];\n const output = [];\n let i = +set(known, input, $.call({'': value}, '', value));\n let firstRun = !i;\n while (i < input.length) {\n firstRun = true;\n output[i] = $stringify(input[i++], replace, space);\n }\n return '[' + output.join(',') + ']';\n function replace(key, value) {\n if (firstRun) {\n firstRun = !firstRun;\n return value;\n }\n const after = $.call(this, key, value);\n switch (typeof after) {\n case object:\n if (after === null) return after;\n case primitive:\n return known.get(after) || set(known, input, after);\n }\n return after;\n }\n};\n\n/**\n * Converts a generic value into a JSON serializable object without losing recursion.\n * @param {any} value\n * @returns {any}\n */\nexport const toJSON = value => $parse(stringify(value));\n\n/**\n * Converts a previously serialized object with recursion into a recursive one.\n * @param {any} value\n * @returns {any}\n */\nexport const fromJSON = value => parse($stringify(value));\n","// import { MRT_ColumnDef, MRT_RowData } from 'material-react-table';\r\nimport { Add } from '@mui/icons-material';\r\nimport Button from '../../../button/button';\r\nimport MaterialTable, { MaterialTableColumnProps } from '../../../material-table/material-table';\r\nimport Typography from '../../../typography/typography';\r\nimport { Box } from '@mui/material';\r\nimport './element.scss';\r\nimport { parse, stringify } from 'flatted';\r\nimport React, { useCallback } from 'react';\r\nimport { useAuth } from '../../../../hooks/useAuth';\r\nimport { formatDate } from '../../../../utils/dateFormat';\r\nimport Chip from '../../../chip/chip';\r\nimport Checkbox from '../../../checkbox/checkbox';\r\nimport { MRT_Row } from 'material-react-table';\r\nimport _ from 'lodash';\r\nimport { formatAmount, getFileName, toFixedWithNumbers } from \"../../../../utils/common\";\r\nimport { useTranslation } from 'react-i18next';\r\nimport { formatLabel } from '../../../../utils/format-text';\r\nexport interface ICellChangeParam {\r\n\tvalue: any,\r\n\tdata: any,\r\n\tcol: MaterialTableColumnProps,\r\n\trow: MRT_Row<any>,\r\n\tname: string,\r\n\tuRows: any[]\r\n}\r\n\r\ninterface IDynamicTable {\r\n\tcolumns: any[];\r\n\trows?: any[];\r\n\tposition: number;\r\n\tlabel: string;\r\n\tdisabled?: boolean;\r\n\ttypeOfField?: string;\r\n\tonAddClick?: (name?: string) => void;\r\n\tname?: string;\r\n\tis_button?: boolean;\r\n\tdisableTableAddButton?: boolean;\r\n\totherButtons?: React.ReactNode[];\r\n\tdefaultActionColumnItems?: React.ReactElement[];\r\n\tonTableCellChange: ({ value, data, col, row }: ICellChangeParam) => void;\r\n\tcurrencySymbol?: string;\r\n}\r\n\r\nconst DynamicTable: React.FC<IDynamicTable> = React.memo(({\r\n\tcolumns,\r\n\tposition,\r\n\tlabel,\r\n\trows = [],\r\n\tonAddClick,\r\n\tname,\r\n\tis_button = true,\r\n\tdisableTableAddButton,\r\n\totherButtons,\r\n\tdefaultActionColumnItems,\r\n\tonTableCellChange,\r\n\tcurrencySymbol = '',\r\n\t...rest\r\n\t// disabled\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\tconst { user } = useAuth();\r\n\tconst cs = currencySymbol || user?.currency_data?.symbol || '';\r\n\tconst currencyFormat = user?.currency_data?.number_format || '';\r\n\tconst symbolPosition = user?.currency_data?.position || 'before';\r\n\tconst takeCurencyOrPercentage = useCallback((type: string, value: any) => {\r\n\t\tswitch (type) {\r\n\t\t\tcase 'Percentage':\r\n\t\t\t\treturn `${value}%`;\r\n\t\t\tcase 'Fixed Amount':\r\n\t\t\t\treturn `${cs}${value}`;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn value;\r\n\t\t}\r\n\t}, [cs]);\r\n\r\n\tconst isCellChangeAFunc = onTableCellChange instanceof Function\r\n\r\n\tconst tableColumns = useCallback(\r\n\t\t(columns: MaterialTableColumnProps[]) => {\r\n\t\t\treturn columns.map((column) => ({\r\n\t\t\t\t...column,\r\n\t\t\t\theader: t(column.header),\r\n\t\t\t\tCell: ({ renderedCellValue, row }: any) => {\r\n\t\t\t\t\tlet v = renderedCellValue;\r\n\t\t\t\t\tif (typeof v === 'number' && v && String(v)?.includes('.')) {\r\n\t\t\t\t\t\treturn v = toFixedWithNumbers(v)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tswitch (column.type) {\r\n\t\t\t\t\t\tcase 'formattedString':\r\n\t\t\t\t\t\t\tv = formatLabel(renderedCellValue) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'date':\r\n\t\t\t\t\t\t\tv = formatDate(\r\n\t\t\t\t\t\t\t\trenderedCellValue,\r\n\t\t\t\t\t\t\t\tcolumn.editProperties?.dateFormat || 'DD-MM-YYYY'\r\n\t\t\t\t\t\t\t) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t\tv = renderedCellValue ? `${formatAmount(renderedCellValue, currencyFormat, symbolPosition, cs)}` : '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'stringOrArray': {\r\n\t\t\t\t\t\t\tconst type = row.original?.promotion_map_data?.type;\r\n\t\t\t\t\t\t\tv = Array.isArray(renderedCellValue)\r\n\t\t\t\t\t\t\t\t? renderedCellValue.map((rcv) => (\r\n\t\t\t\t\t\t\t\t\trcv ? <Chip label={takeCurencyOrPercentage(type, rcv)} /> : null\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t\t: takeCurencyOrPercentage(type, renderedCellValue);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"checkbox\": {\r\n\t\t\t\t\t\t\tv = <Checkbox\r\n\t\t\t\t\t\t\t\tchecked={Boolean(renderedCellValue)}\r\n\t\t\t\t\t\t\t\tonClick={isCellChangeAFunc\r\n\t\t\t\t\t\t\t\t\t? (e) => onTableCellChange({\r\n\t\t\t\t\t\t\t\t\t\tvalue: e.target.checked,\r\n\t\t\t\t\t\t\t\t\t\tdata: row.original,\r\n\t\t\t\t\t\t\t\t\t\tcol: column,\r\n\t\t\t\t\t\t\t\t\t\trow: row,\r\n\t\t\t\t\t\t\t\t\t\tname: name,\r\n\t\t\t\t\t\t\t\t\t\tuRows: rows\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t/>;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"array\": {\r\n\t\t\t\t\t\t\tv = Array.isArray(renderedCellValue) && renderedCellValue.length ?\r\n\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', gap: 0.5, alignItems: 'center', flexWrap: 'wrap' }}>\r\n\t\t\t\t\t\t\t\t\t{renderedCellValue.map(r => (<Chip type='normal' label={_.get(r, column?.valueGet, '')} active />))}\r\n\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t: '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase \"file\": {\r\n\t\t\t\t\t\t\tv = getFileName(renderedCellValue) || '-';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn v;\r\n\t\t\t\t}\r\n\t\t\t}));\r\n\t\t},\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t\t[cs, takeCurencyOrPercentage, currencySymbol, rows]\r\n\t);\r\n\treturn (\r\n\t\t<Box data-position={position}>\r\n\t\t\t<Typography\r\n\t\t\t\ttype='s5'\r\n\t\t\t\tweight='medium'\r\n\t\t\t\tcolor='theme.secondary.800'\r\n\t\t\t\tdata-position={position}\r\n\t\t\t\tsx={{ mb: 0.5 }}>\r\n\t\t\t\t{t(label)}\r\n\t\t\t</Typography>\r\n\t\t\t<Box /* sx={disabled ? { pointerEvents: 'none' } : {}} */>\r\n\t\t\t\t<MaterialTable\r\n\t\t\t\t\tcolumnOrder={['mrt-row-select']}\r\n\t\t\t\t\t// rows={parse(stringify(rows))}\r\n\t\t\t\t\trows={rows}\r\n\t\t\t\t\tcolumns={tableColumns(parse(stringify(columns)))}\r\n\t\t\t\t\ttotalPages={20}\r\n\t\t\t\t\tpaginationModel={{ pageNo: 1, limit: 10 }}\r\n\t\t\t\t\tenableEditing={false}\r\n\t\t\t\t\tenableColumnDragging={false}\r\n\t\t\t\t\tenableBottomToolbar={false}\r\n\t\t\t\t\tdefaultActionColumnItems={defaultActionColumnItems}\r\n\t\t\t\t\t{...rest}\r\n\t\t\t\t/>\r\n\t\t\t\t{is_button && !disableTableAddButton && (\r\n\t\t\t\t\t<Box\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\t\t\tjustifyContent: 'space-between',\r\n\t\t\t\t\t\t\tmt: 1\r\n\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\tonClick={() => onAddClick?.(name)}\r\n\t\t\t\t\t\t\tstartIcon={<Add />}\r\n\t\t\t\t\t\t\tclassName='table--AddButton'>\r\n\t\t\t\t\t\t\tAdd\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t{Boolean(otherButtons?.length) && otherButtons}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t)}\r\n\t\t\t</Box>\r\n\t\t</Box>\r\n\t);\r\n});\r\n\r\nexport default DynamicTable;\r\n","import { styled } from '@mui/material/styles';\r\nimport { AdapterDayjs } from \"@mui/x-date-pickers/AdapterDayjs\";\r\nimport { LocalizationProvider } from \"@mui/x-date-pickers/LocalizationProvider\";\r\nimport { TimePicker as Time } from \"@mui/x-date-pickers/TimePicker\";\r\nimport Typography from \"../typography/typography\";\r\nimport \"./time-picker.scss\";\r\nimport { memo } from \"react\";\r\n\r\nexport interface TimePickerProps {\r\n label: string;\r\n disabled?: boolean;\r\n error?: boolean;\r\n name?: string;\r\n value?: string | number | Date;\r\n helperText?: string;\r\n dataPosition?: number;\r\n dataName?: string;\r\n is24hrFormat?: boolean;\r\n placeholder?: string;\r\n required?: boolean;\r\n}\r\n\r\nconst StyledTimePicker = styled(Time)(({ theme: { palette } }) => ({\r\n \"& .MuiOutlinedInput-root\": {\r\n padding: \"0\",\r\n color: palette.theme?.secondary[800],\r\n \"& fieldset\": {\r\n borderColor: palette.theme?.secondary[400],\r\n },\r\n \"&:hover fieldset\": {\r\n borderColor: palette.theme?.secondary[500],\r\n },\r\n \"&.Mui-focused fieldset\": {\r\n borderWidth: \"0.0625rem\",\r\n borderStyle: \"solid\",\r\n borderColor: palette.theme?.primary[700],\r\n },\r\n \"&.Mui-error fieldset\": {\r\n borderColor: palette.theme?.error[600],\r\n },\r\n \"&.Mui-disabled\": {\r\n background: palette.theme?.secondary[200],\r\n color: palette.theme?.secondary[800],\r\n },\r\n \"& .MuiInputBase-input::placeholder\": {\r\n color: palette.theme?.secondary[800],\r\n opacity: 1,\r\n },\r\n },\r\n \"& .MuiFormHelperText-root\": {\r\n marginLeft: 0,\r\n color: palette.theme?.secondary[800],\r\n \"&.Mui-error\": {\r\n color: palette.theme?.error[600],\r\n },\r\n },\r\n \"& .MuiIconButton-root\": {\r\n marginRight: 0,\r\n },\r\n \"& .MuiPickersCalendarHeader-labelContainer\": {\r\n fontWeight: 600,\r\n },\r\n}));\r\n\r\nconst TimePicker = memo((props: TimePickerProps) => {\r\n const {\r\n label,\r\n disabled,\r\n error,\r\n helperText,\r\n dataName,\r\n dataPosition,\r\n is24hrFormat = false,\r\n placeholder,\r\n required = false,\r\n ...rest\r\n } = props;\r\n return (\r\n <div>\r\n <LocalizationProvider dateAdapter={AdapterDayjs}>\r\n {label && (\r\n <Typography\r\n type=\"s4\"\r\n fontWeight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n data-position={dataPosition}\r\n data-name={dataName}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n <StyledTimePicker\r\n {...rest}\r\n disabled={disabled}\r\n slotProps={{\r\n textField: {\r\n helperText: helperText,\r\n error: error,\r\n placeholder: placeholder || \"HH:mm A\",\r\n // required: required,\r\n },\r\n }}\r\n format={is24hrFormat ? \"HH:MM\" : \"hh:mm a\"}\r\n className=\"timePicker\"\r\n />\r\n </LocalizationProvider>\r\n </div>\r\n );\r\n});\r\n\r\nexport { TimePicker };\r\nexport default TimePicker;\r\n","import { Controller } from 'react-hook-form';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport './element.scss';\r\nimport TimePicker from '../../../time-picker/time-picker';\r\nimport React from 'react';\r\n\r\nconst DynamicTime = React.memo((props: any) => {\r\n\r\n\treturn (\r\n\t\t<Controller\r\n\t\t\tcontrol={props.formControl}\r\n\t\t\tname={`${props.fieldArrayName}.${props.name}`}\r\n\t\t\trender={({ field, fieldState }) => (\r\n\t\t\t\t<TimePicker\r\n\t\t\t\t\t{...field}\r\n\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\tfield.onChange(e);\r\n\t\t\t\t\t\tprops?.onChange(e);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tdataPosition={props.position}\r\n\t\t\t\t\tdataName={`${props.fieldArrayName}.${props.name}`}\r\n\t\t\t\t\tlabel={props.label}\r\n\t\t\t\t\tplaceholder={props.placeholder}\r\n\t\t\t\t\trequired={props.formType === 'builder' ? false : props.required}\r\n\t\t\t\t\tis24hrFormat={props.options === '24hr'}\r\n\t\t\t\t\tdisabled={props.disabled}\r\n\t\t\t\t\thelperText={fieldState.error?.message}\r\n\t\t\t\t\terror={Boolean(fieldState.error)}\r\n\t\t\t\t\t{...(props?.rest || {})}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t);\r\n});\r\n\r\n\r\nDynamicTime.propTypes = {\r\n\tformControl: PropTypes.shape({\r\n\t\tregister: PropTypes.func.isRequired,\r\n\t\tsetValue: PropTypes.func\r\n\t}).isRequired,\r\n\tname: PropTypes.string.isRequired,\r\n\tlabel: PropTypes.string.isRequired,\r\n\tfieldArrayName: PropTypes.string,\r\n\trequired: PropTypes.bool,\r\n\tposition: PropTypes.number,\r\n\tformType: PropTypes.string,\r\n\toption: PropTypes.string,\r\n\tplaceholder: PropTypes.string,\r\n\ttypeOfField: PropTypes.string,\r\n\tdisabled: PropTypes.bool,\r\n\tonChange: PropTypes.func,\r\n\trest: PropTypes.object,\r\n};\r\n\r\nexport { DynamicTime };\r\nexport default DynamicTime;\r\n","import { styled } from \"@mui/material/styles\";\nimport Switch, { SwitchProps } from \"@mui/material/Switch\";\nimport Stack from \"@mui/material/Stack\";\nimport Typography, { ITypography } from \"../typography/typography\";\nimport { useLanguage } from \"../../hooks/useLangauge\";\nimport { memo } from \"react\";\n\nexport interface ISwitchProps extends SwitchProps {\n label?: string;\n labelPosition?: \"start\" | \"end\";\n typographyProps?: ITypography;\n}\n\nconst CustomisedSwitch = styled((props: ISwitchProps) => (\n <Switch focusVisibleClassName=\".Mui-focusVisible\" disableRipple {...props} />\n))(({ theme, size, checked }) => ({\n width: 24,\n height: 16,\n padding: 0,\n \"& .MuiSwitch-switchBase\": {\n padding: 0,\n margin: size === \"medium\" ? 2 : 1,\n transitionDuration: \"300ms\",\n \"&.Mui-checked\": {\n transform: size === \"medium\" ? \"translateX(16px)\" : \"translateX(8px)\",\n color: \"#fff\",\n \"& + .MuiSwitch-track\": {\n backgroundColor: theme.palette.mode === \"dark\" ? \"#2ECA45\" : \"#65C466\",\n opacity: 1,\n border: 0,\n },\n \"&.Mui-disabled + .MuiSwitch-track\": {\n opacity: 0.5,\n },\n },\n \"&.Mui-focusVisible .MuiSwitch-thumb\": {\n color: \"#33cf4d\",\n border: \"6px solid #fff\",\n },\n \"&.Mui-disabled .MuiSwitch-thumb\": {\n color:\n theme.palette.mode === \"light\"\n ? theme.palette.grey[100]\n : theme.palette.grey[600],\n },\n \"&.Mui-disabled + .MuiSwitch-track\": {\n opacity: theme.palette.mode === \"light\" ? 0.7 : 0.3,\n },\n },\n \"& .MuiSwitch-thumb\": {\n boxSizing: \"border-box\",\n width: 14,\n height: 14,\n border: checked ? 0 : `1px solid ${theme.palette.theme?.secondary[300]}`,\n },\n \"& .MuiSwitch-track\": {\n borderRadius: 26 / 2,\n backgroundColor: theme.palette.theme?.secondary[200],\n opacity: 1,\n transition: theme.transitions.create([\"background-color\"], {\n duration: 500,\n }),\n },\n ...(size === \"medium\" && {\n width: 42,\n height: 26,\n \"& .MuiSwitch-thumb\": {\n boxSizing: \"border-box\",\n width: 22,\n height: 22,\n border: checked ? 0 : `1px solid ${theme.palette.theme?.secondary[300]}`,\n },\n }),\n}));\n\nconst ToggleSwitch: React.FC<ISwitchProps> = memo(({\n label,\n labelPosition = \"end\",\n typographyProps,\n ...rest\n}) => {\n const {isRtl}=useLanguage();\n return (\n <Stack direction=\"row\" spacing={isRtl ? '' : 0.5} alignItems=\"center\">\n {labelPosition === \"start\" && (\n <Typography type=\"s3\" color=\"theme.secondary.1000\" {...typographyProps}>\n {label}\n </Typography>\n )}\n <CustomisedSwitch sx={{ m: 1 }} {...rest} />\n {labelPosition === \"end\" && (\n <Typography type=\"s3\" color=\"theme.secondary.1000\" {...typographyProps}>\n {label}\n </Typography>\n )}\n </Stack>\n );\n});\n\nexport default ToggleSwitch;\n","import { Control, Controller } from \"react-hook-form\";\nimport Typography from \"../../../typography/typography\";\nimport ToggleSwitch, {\n ISwitchProps,\n} from \"../../../toggle-switch/toggle-switch\";\nimport { memo } from \"react\";\n\ninterface IDynamicToggleButton {\n formControl: Control<any>;\n fieldArrayName: string;\n name: string;\n label: string;\n position: number;\n disabled?: boolean;\n titlePosition?: \"start\" | \"end\";\n typeOfField?: string;\n title: string;\n toggleSwitchProps?: ISwitchProps;\n}\n\nconst DynamicToggleButton: React.FC<IDynamicToggleButton> = memo(({\n formControl,\n fieldArrayName,\n name,\n label,\n position,\n disabled,\n titlePosition,\n title,\n toggleSwitchProps,\n}) => {\n\treturn (\n\t\t<Controller\n\t\t\tcontrol={formControl}\n\t\t\tname={`${fieldArrayName}.${name}`}\n\t\t\trender={({ field }) => (\n\t\t\t\t<>\n\t\t\t\t\t<Typography\n\t\t\t\t\t\ttype='s5'\n\t\t\t\t\t\tcolor='theme.secondary.800'\n\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\tdata-position={position}\n\t\t\t\t\t\tsx={{ mb: 0.5 }}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Typography>\n\t\t\t\t\t<ToggleSwitch\n\t\t\t\t\t\t{...toggleSwitchProps}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\tonChange={field.onChange}\n\t\t\t\t\t\tlabel={title}\n\t\t\t\t\t\tdisabled={Boolean(disabled)}\n\t\t\t\t\t\tlabelPosition={titlePosition}\t\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nexport default DynamicToggleButton;\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport React, { ReactNode, useEffect, useState } from \"react\";\nimport { Box, IconButton } from \"@mui/material\";\nimport Tab from \"@mui/material/Tab\";\nimport TabContext from \"@mui/lab/TabContext\";\nimport TabList from \"@mui/lab/TabList\";\nimport TabPanel from \"@mui/lab/TabPanel\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\nimport \"./tabs.scss\";\nimport TextField from \"../text-field/text-field\";\nimport { useTranslation } from \"react-i18next\";\nimport Typography from \"../typography/typography\";\n\ninterface TabItem {\n tab_order: number;\n title: string;\n content?: string | ReactNode;\n data?: any;\n remove_tab?: boolean;\n}\nexport interface TabProps {\n tabs: TabItem[];\n activeValue?: number;\n setActiveValue?: React.Dispatch<React.SetStateAction<number | undefined>>;\n onEditTabTitle?: (tabId: number, newTitle: string) => void;\n handleTabChange?: () => void;\n handleRemoveTab?: (tabId: number) => void;\n isFormTabValid?: boolean ;\n isTabViewOnly?: boolean;\n activeTabs?: any[] ;\n setActiveTabs?: React.Dispatch<React.SetStateAction<number | undefined>>;\n containerProps?: any;\n}\n\nexport const TabBar = (props: TabProps) => {\n const { t } = useTranslation();\n const {\n tabs,\n onEditTabTitle,\n activeValue,\n setActiveValue,\n handleTabChange,\n handleRemoveTab,\n // isFormTabValid , \n isTabViewOnly,\n activeTabs, \n containerProps\n } = props; \n \n const [value, setValue] = useState<number>(activeValue || 0);\n const [editableTabId, setEditableTabId] = useState<number | null>(null);\n useEffect(()=>{\n activeValue && setValue(activeValue);\n\t} , [activeValue])\n\n const handleChange = (_event: React.SyntheticEvent, newValue: number) => {\n setValue(newValue);\n setActiveValue && setActiveValue(newValue);\n handleTabChange && handleTabChange();\n };\n\n const handleTabDoubleClick = (tabId: number) => {\n setEditableTabId(tabId);\n };\n\n const handleEditTabTitle = (\n event: React.ChangeEvent<HTMLInputElement>,\n tabId: number,\n ) => {\n onEditTabTitle && onEditTabTitle(tabId, event.target.value);\n };\n\n // useEffect(() => {\n // if (setActiveValue && Boolean(tabs?.length)) setActiveValue(value);\n // // eslint-disable-next-line\n // }, [tabs]);\n\n return (\n <Box mb={2} {...containerProps}>\n <TabContext value={activeValue ?? value }>\n <Box>\n <TabList className=\"account-payble-tabs-wrap\" onChange={handleChange} variant=\"scrollable\" scrollButtons=\"auto\" aria-label=\"scrollable tabs\" sx={{ overflowX: 'auto', maxWidth: '100%' }}>\n {tabs.map((tab: TabItem, index: any) => (\n <Tab\n className=\"account-payble-tab-items\"\n key={tab.tab_order}\n \n label={\n <Box display='flex' alignItems='center'>\n {\n onEditTabTitle && editableTabId === tab.tab_order ? (\n <TextField\n value={tab.title}\n autoFocus\n onBlur={() => setEditableTabId(null)}\n onChange={(e: any) =>\n handleEditTabTitle(e, tab.tab_order)\n }\n />\n ) : handleRemoveTab ? (\n <div className=\"Tabs--Title\">\n <Typography color='theme.secondary.1000' type='s3'>{t(tab.title)}</Typography>\n {!tab.remove_tab && (\n <IconButton size=\"small\" onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n handleRemoveTab(tab.tab_order);\n }}>\n <CloseIcon style={{ fontSize: \"15px\", cursor: \"pointer\" }}/>\n </IconButton>\n )}\n </div>\n ) : (\n <Typography color='theme.secondary.1000' type='s3'>{t(tab.title)}</Typography>\n )\n }\n </Box>\n }\n wrapped\n onDoubleClick={() => handleTabDoubleClick(tab.tab_order)}\n />\n ))}\n </TabList>\n </Box>\n {tabs.map(\n (tab: TabItem, index: number) =>\n tab.content && (\n <TabPanel value={index.toString()} key={tab.tab_order}>\n {value === index && tab.content}\n </TabPanel>\n ),\n )}\n </TabContext>\n </Box>\n );\n}\n\nexport default TabBar;","import { AlertProps, Alert as MUIAlert, styled } from \"@mui/material\";\r\n\r\nconst StyledAlert = styled(MUIAlert)(({ theme: { palette } }) => ({\r\n \"&.MuiAlert-root\": {\r\n fontSize: \"0.75rem\",\r\n fontWeight: \"500\",\r\n letterSpacing: \"-0.24px\",\r\n padding: \"0rem 0.75rem\",\r\n },\r\n \"&.MuiAlert-standardInfo\": {\r\n color: palette.theme?.secondary[900],\r\n backgroundColor: palette.theme?.secondary[200],\r\n },\r\n \"&.MuiAlert-standardSuccess\": {\r\n color: palette.theme?.primary[900],\r\n backgroundColor: palette.theme?.primary[100],\r\n },\r\n \"&.MuiAlert-standardError\": {\r\n color: palette.theme?.tertiary6[900],\r\n backgroundColor: palette.theme?.tertiary6[100],\r\n \"& .MuiAlert-icon\" : {\r\n color: palette.theme?.tertiary6[900],\r\n }\r\n },\r\n\r\n \".MuiAlert-action\": {\r\n svg: {\r\n fontSize: \"1rem\",\r\n },\r\n },\r\n}));\r\n\r\nconst Alert = (props: AlertProps) => {\r\n const { children, icon = false, ...rest } = props;\r\n\r\n return (\r\n <StyledAlert icon={icon} {...rest}>\r\n {children}\r\n </StyledAlert>\r\n );\r\n};\r\n\r\nexport { Alert };\r\nexport default Alert;\r\n","//eslint-disable @typescript-eslint/no-explicit-any\r\nimport React, { useState, useRef, KeyboardEvent, memo } from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport { \r\n Chip, \r\n Box, \r\n FormControl, \r\n FormHelperText,\r\n InputAdornment,\r\n styled\r\n} from '@mui/material';\r\nimport Typography from '../typography/typography';\r\n\r\n// interface ValidationRule {\r\n// type: 'email' | 'url' | 'phone' | 'custom';\r\n// pattern?: RegExp;\r\n// message: string;\r\n// validator?: (value: string) => boolean;\r\n// }\r\n\r\ninterface ChipGeneratorProps {\r\n name: string;\r\n control: any;\r\n label?: string;\r\n placeholder?: string;\r\n required?: boolean;\r\n disabled?: boolean;\r\n validation?: any[];\r\n maxChips?: number;\r\n allowDuplicates?: boolean;\r\n fieldArrayName?: string;\r\n endIcon?: React.ReactNode;\r\n helperText?: string;\r\n error?: boolean;\r\n onChipAdd?: (chip: string) => void;\r\n onChipRemove?: (chip: string, index: number) => void;\r\n customChipProps?: any;\r\n textFieldProps?: any;\r\n allowMultipleAdd?: boolean;\r\n delimiters?: string[];\r\n // New props for data type handling\r\n dataType?: 'array' | 'string';\r\n separator?: string;\r\n}\r\n\r\n// Styled components for inline chips\r\nconst ChipContainer = styled(Box)(({ theme }) => ({\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n alignItems: 'center',\r\n gap: theme.spacing(0.5),\r\n minHeight: '1.4375em',\r\n border: `1px solid #D3D3D4`,\r\n borderRadius: '0.25rem',\r\n cursor: 'text',\r\n fontSize: '0.875rem',\r\n// '&:hover': {\r\n// borderColor: theme.palette.text.primary,\r\n// },\r\n '&.focused': {\r\n borderColor:'#54CC96',\r\n borderWidth: '1px',\r\n },\r\n '&.error': {\r\n borderColor: theme.palette.error.main,\r\n },\r\n '&.disabled': {\r\n backgroundColor: theme.palette.action.disabledBackground,\r\n cursor: 'default',\r\n },\r\n paddingLeft: 3 \r\n}));\r\n\r\nconst InlineInput = styled('input')(({ theme }) => ({\r\n border: 'none',\r\n outline: 'none',\r\n backgroundColor: 'transparent',\r\n flexGrow: 1,\r\n minWidth: '120px',\r\n padding: '0.5rem',\r\n fontSize: '0.875rem',\r\n fontFamily: theme.typography.fontFamily,\r\n '&::placeholder': {\r\n color: theme.palette.text.secondary,\r\n opacity: 1,\r\n },\r\n '&:disabled': {\r\n cursor: 'default',\r\n }\r\n}));\r\n\r\nconst InlineChip = styled(Chip)(({theme: { palette }}) => ({\r\n height: '24px',\r\n fontSize: '0.875rem',\r\n borderColor:' #54CC96',\r\n backgroundColor: palette.theme.primary[50],\r\n color:'#2EB273',\r\n margin: '1px',\r\n '& .MuiChip-deleteIcon': {\r\n fontSize: '16px',\r\n color:'#2EB273',\r\n '&:hover': {\r\n color: '#2EB273',\r\n },\r\n },\r\n}));\r\n\r\nconst ChipGenerator: React.FC<ChipGeneratorProps> = memo(({\r\n name,\r\n control,\r\n label,\r\n placeholder = \"Type and press space to add\",\r\n required = false,\r\n disabled = false,\r\n validation,\r\n maxChips,\r\n allowDuplicates = false,\r\n fieldArrayName,\r\n endIcon,\r\n helperText,\r\n error: externalError,\r\n onChipAdd,\r\n onChipRemove,\r\n customChipProps = {},\r\n allowMultipleAdd = true,\r\n delimiters = [',', ';', '\\n', '\\t'],\r\n dataType = 'string',\r\n separator = ',',\r\n}) => {\r\n const [inputValue, setInputValue] = useState('');\r\n const [validationError, setValidationError] = useState('');\r\n const [focused, setFocused] = useState(false);\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n\r\n const validateChip = (value: string,validation: any): { isValid: boolean; error: string } => {\r\n if (!validation) return { isValid: true, error: '' };\r\n\r\n const trimmedValue = value.trim();\r\n if (!trimmedValue) return { isValid: false, error: 'Empty values are not allowed' };\r\n\r\n switch (validation.type) {\r\n case 'email': {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n const isValidEmail = emailRegex.test(trimmedValue);\r\n return {\r\n isValid: isValidEmail,\r\n error: isValidEmail ? '' : validation.message || 'Please enter a valid email address'\r\n };\r\n }\r\n\r\n // case 'url': {\r\n // const urlRegex = /^(https?:\\/\\/)?([\\da-z.-]+)\\.([a-z.]{2,6})([\\/\\w .-]*)*\\/?$/;\r\n // const isValidUrl = urlRegex.test(trimmedValue);\r\n // return {\r\n // isValid: isValidUrl,\r\n // error: isValidUrl ? '' : validation.message || 'Please enter a valid URL'\r\n // };\r\n // }\r\n\r\n case 'phone': {\r\n const phoneRegex = /^[+]?[1-9][\\d]{0,15}$/;\r\n const isValidPhone = phoneRegex.test(trimmedValue.replace(/[\\s()-]/g, ''));\r\n return {\r\n isValid: isValidPhone,\r\n error: isValidPhone ? '' : validation.message || 'Please enter a valid phone number'\r\n };\r\n }\r\n\r\n case 'custom': {\r\n if (validation.pattern) {\r\n const isValid = validation.pattern.test(trimmedValue);\r\n return {\r\n isValid,\r\n error: isValid ? '' : validation.message\r\n };\r\n }\r\n if (validation.validator) {\r\n const isValid = validation.validator(trimmedValue);\r\n return {\r\n isValid,\r\n error: isValid ? '' : validation.message\r\n };\r\n }\r\n return { isValid: true, error: '' };\r\n }\r\n\r\n default:\r\n return { isValid: true, error: '' };\r\n }\r\n };\r\n\r\n // Convert between string and array formats\r\n const stringToArray = (str: string): string[] => {\r\n if (!str || typeof str !== 'string') return [];\r\n return str.split(separator).map(item => item.trim()).filter(Boolean);\r\n };\r\n\r\n const arrayToString = (arr: string[]): string => {\r\n return arr.join(separator + ' ');\r\n };\r\n\r\n // Parse input value by delimiters\r\n const parseMultipleValues = (inputStr: string): string[] => {\r\n if (!allowMultipleAdd) {\r\n return [inputStr.trim()].filter(Boolean);\r\n }\r\n\r\n const delimiterPattern = delimiters.map(d => \r\n d.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\r\n ).join('|');\r\n \r\n const regex = new RegExp(`[${delimiterPattern}]`);\r\n \r\n return inputStr\r\n .split(regex)\r\n .map(val => val.trim())\r\n .filter(Boolean);\r\n };\r\n\r\n const addChips = (inputStr: string, currentChips: string[]): { \r\n newChips: string[]; \r\n errors: string[]; \r\n addedCount: number;\r\n } => {\r\n const valuesToAdd = parseMultipleValues(inputStr);\r\n if (valuesToAdd.length === 0) {\r\n return { newChips: currentChips, errors: [], addedCount: 0 };\r\n }\r\n\r\n const newChips = [...currentChips];\r\n const errors: string[] = [];\r\n let addedCount = 0;\r\n\r\n for (const value of valuesToAdd) {\r\n if (maxChips && newChips.length >= maxChips) {\r\n errors.push(`Maximum ${maxChips} items allowed`);\r\n break;\r\n }\r\n \r\n if (validation?.length > 0) {\r\n const errorMessages = validation\r\n .map(val => validateChip(value, val))\r\n .filter(result => !result.isValid)\r\n .map(result => result.error);\r\n\r\n if (errorMessages.length > 0) {\r\n errors.push(`\"${value}\": ${errorMessages.join(', ')}`);\r\n continue;\r\n }\r\n }\r\n \r\n\r\n if (!allowDuplicates && newChips.includes(value)) {\r\n errors.push(`\"${value}\": Duplicate values are not allowed`);\r\n continue;\r\n }\r\n\r\n newChips.push(value);\r\n addedCount++;\r\n onChipAdd?.(value);\r\n }\r\n\r\n return { newChips, errors, addedCount };\r\n };\r\n\r\n const removeChip = (chipToRemove: string, index: number, currentChips: string[]) => {\r\n const newChips = currentChips.filter((_, i) => i !== index);\r\n onChipRemove?.(chipToRemove, index);\r\n setValidationError('');\r\n return newChips;\r\n };\r\n\r\n const processInput = (\r\n inputStr: string,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n const currentChips = Array.isArray(currentValue) ? currentValue : stringToArray(currentValue);\r\n const { newChips, errors } = addChips(inputStr, currentChips);\r\n \r\n if (errors.length > 0) {\r\n setValidationError(errors.join('; '));\r\n } else {\r\n setValidationError('');\r\n }\r\n \r\n if (newChips.length !== currentChips.length) {\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n setInputValue('');\r\n }\r\n };\r\n\r\n const handleKeyPress = (\r\n event: KeyboardEvent<HTMLInputElement>,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n if (event.key === ' ' || event.key === 'Enter') {\r\n event.preventDefault();\r\n if (inputValue.trim()) {\r\n processInput(inputValue, onChange, currentValue);\r\n }\r\n } else if (event.key === 'Backspace' && !inputValue) {\r\n const currentChips = Array.isArray(currentValue) ? currentValue : stringToArray(currentValue);\r\n if (currentChips.length > 0) {\r\n const lastIndex = currentChips.length - 1;\r\n const newChips = removeChip(currentChips[lastIndex], lastIndex, currentChips);\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n }\r\n }\r\n };\r\n\r\n const handleBlur = (\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n setFocused(false);\r\n if (inputValue.trim()) {\r\n processInput(inputValue, onChange, currentValue);\r\n }\r\n };\r\n\r\n const handlePaste = (\r\n event: React.ClipboardEvent<HTMLInputElement>,\r\n onChange: (value: string[] | string) => void,\r\n currentValue: string[] | string\r\n ) => {\r\n if (allowMultipleAdd) {\r\n event.preventDefault();\r\n const pastedText = event.clipboardData.getData('text');\r\n const combinedInput = inputValue + pastedText;\r\n processInput(combinedInput, onChange, currentValue);\r\n }\r\n };\r\n\r\n const handleContainerClick = () => {\r\n if (!disabled && inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const fieldName = fieldArrayName ? `${fieldArrayName}.${name}` : name;\r\n\r\n return (\r\n <Controller\r\n name={fieldName}\r\n control={control}\r\n defaultValue={dataType === 'string' ? '' : []}\r\n render={({ field: { onChange, value, ...field }, fieldState: { error } }) => {\r\n const currentChips = Array.isArray(value) ? value : stringToArray(value || '');\r\n const hasError = !!error || !!validationError || externalError;\r\n\r\n return (\r\n <FormControl fullWidth error={hasError}>\r\n {label && (\r\n <Typography\r\n type=\"s5\"\r\n weight={\"medium\"}\r\n mb={0.5}\r\n color={error ? \"theme.error.600\" : \"theme.secondary.800\"}\r\n >\r\n {label} {required && <span className=\"requiredStar\">*</span>}\r\n </Typography>\r\n )}\r\n\r\n <ChipContainer\r\n ref={containerRef}\r\n className={`${focused ? 'focused' : ''} ${hasError ? 'error' : ''} ${disabled ? 'disabled' : ''}`}\r\n onClick={handleContainerClick}\r\n >\r\n {currentChips.map((chip: string, index: number) => (\r\n <InlineChip\r\n key={`${chip}-${index}`}\r\n label={chip}\r\n onDelete={\r\n disabled\r\n ? undefined\r\n : (event) => {\r\n event.stopPropagation();\r\n const newChips = removeChip(chip, index, currentChips);\r\n const outputValue = dataType === 'string' ? arrayToString(newChips) : newChips;\r\n onChange(outputValue);\r\n }\r\n }\r\n size=\"small\"\r\n // color=\"primary\"\r\n // variant=\"outlined\"\r\n {...customChipProps}\r\n />\r\n ))}\r\n \r\n <InlineInput\r\n {...field}\r\n ref={inputRef}\r\n value={inputValue}\r\n onChange={(e) => setInputValue(e.target.value)}\r\n onKeyDown={(e) => handleKeyPress(e, onChange, value)}\r\n onFocus={() => setFocused(true)}\r\n onBlur={() => handleBlur(onChange, value)}\r\n onPaste={(e) => handlePaste(e, onChange, value)}\r\n placeholder={currentChips.length === 0 ? placeholder : ''}\r\n disabled={disabled}\r\n style={{ \r\n width: inputValue ? `${Math.max(inputValue.length * 8, 120)}px` : '120px',\r\n }}\r\n />\r\n \r\n {endIcon && (\r\n <InputAdornment position=\"end\" sx={{ ml: 1 }}>\r\n {endIcon}\r\n </InputAdornment>\r\n )}\r\n </ChipContainer>\r\n\r\n {(helperText || error?.message || validationError) && (\r\n <FormHelperText>\r\n {error?.message || validationError || helperText}\r\n </FormHelperText>\r\n )}\r\n\r\n {maxChips && (\r\n <FormHelperText>\r\n {currentChips.length} / {maxChips} items\r\n </FormHelperText>\r\n )}\r\n\r\n \r\n </FormControl>\r\n );\r\n }}\r\n />\r\n );\r\n});\r\n\r\nexport default ChipGenerator;","import {\r\n\tUseFormSetValue,\r\n\tFieldValues,\r\n\tuseFormContext,\r\n\tUseFormWatch,\r\n\tUseFormGetFieldState,\r\n\tControl\r\n} from 'react-hook-form';\r\nimport { useLocationFilter } from '../hooks/useLocationFilter';\r\nimport DynamicSearchSelect from './form-control/form-builder/form-builder-element/dynamic-select';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { memo, useEffect, useMemo, useRef } from 'react';\r\nimport _ from 'lodash';\r\n\r\n\r\nexport interface LocationSearchSelectProps<\r\n\tT extends FieldValues = FieldValues\r\n> {\r\n\tselectedCompany?: string[] | string | number | null | undefined;\r\n\tcontrol?: Control<T>;\r\n\tsetValue?: UseFormSetValue<T>;\r\n\tfieldArrayName: string;\r\n\tlocationFieldName?: string;\r\n\tlabel?: string;\r\n\tplaceholder?: string;\r\n\tresetValue?: any;\r\n\tfilterKey?: string;\r\n\t[key: string]: any;\r\n}\r\n\r\nexport interface LocationFilterType {\r\n\t[key: string]: string[] | string | number;\r\n}\r\n\r\nexport const LocationSearchSelect = memo(\r\n\t<T extends FieldValues = FieldValues>({\r\n\t\tselectedCompany,\r\n\t\tcontrol: propControl,\r\n\t\tsetValue: propSetValue,\r\n\t\tfieldArrayName,\r\n\t\tlocationFieldName = 'location_id',\r\n\t\tlabel,\r\n\t\tplaceholder,\r\n\t\tresetValue = undefined,\r\n\t\tfilterKey = '&company_id.in',\r\n\t\tfilterField = 'company_id',\r\n\t\t...dynamicSearchSelectProps\r\n\t}: LocationSearchSelectProps<T>): JSX.Element => {\r\n\t\tconst formContext = useFormContext();\r\n\t\tconst {\r\n\t\t\tcontrol: contextControl,\r\n\t\t\twatch: contextWatch,\r\n\t\t\tsetValue: contextSetValue,\r\n\t\t\tgetFieldState: contextGetFieldState\r\n\t\t} = formContext || {};\r\n\r\n\t\tconst controlToUse = propControl || contextControl;\r\n\t\tconst setValueToUse = propSetValue || contextSetValue;\r\n\t\tconst watchToUse: UseFormWatch<T> = contextWatch || (() => undefined);\r\n\t\tconst getFieldStateToUse: UseFormGetFieldState<T> =\r\n\t\t\tcontextGetFieldState || (() => ({}));\r\n\r\n\t\tconst filterFieldValue = watchToUse(`${fieldArrayName}.${filterField}`);\r\n\t\tconst isDirty = getFieldStateToUse(\r\n\t\t\t`${fieldArrayName}.${filterField}`\r\n\t\t)?.isDirty;\r\n\r\n\t\tconst prevFilterFieldValue = useRef<any>();\r\n\r\n\t\tconst { t } = useTranslation();\r\n\r\n\t\tconst isValueChanged = useMemo(() => {\r\n\t\t\treturn filterFieldValue && prevFilterFieldValue.current\r\n\t\t\t\t? !_.isEqual(prevFilterFieldValue.current, filterFieldValue)\r\n\t\t\t\t: false;\r\n\t\t}, [filterFieldValue]);\r\n\r\n\r\n\t\tuseEffect(() => {\r\n\t\t\tif (filterFieldValue) {\r\n\t\t\t\tprevFilterFieldValue.current = filterFieldValue;\r\n\t\t\t}\r\n\t\t}, [filterFieldValue]);\r\n\r\n\t\tconst locationFilter: LocationFilterType = useLocationFilter({\r\n\t\t\tselectedCompany: filterFieldValue || selectedCompany,\r\n\t\t\tsetValue: setValueToUse,\r\n\t\t\tfieldArrayName,\r\n\t\t\tlocationFieldName,\r\n\t\t\tresetValue,\r\n\t\t\tfilterKey,\r\n\t\t\tisDirty: isValueChanged || isDirty\r\n\t\t});\r\n\r\n\t\t// Now safely do the conditional render\r\n\t\tif (!controlToUse) {\r\n\t\t\tconsole.warn('LocationSearchSelect: No form control available.');\r\n\t\t\treturn <div>Location Search Select</div>;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<DynamicSearchSelect\r\n\t\t\t\tlabel={t(label) || t('crm.salesOrder.fields.location_label')}\r\n\t\t\t\tapiType='location'\r\n\t\t\t\taddType='location'\r\n\t\t\t\tenable_footer={true}\r\n\t\t\t\tname={locationFieldName}\r\n\t\t\t\tplaceholder={\r\n\t\t\t\t\tt(placeholder) || t('crm.salesOrder.fields.location_placeholder')\r\n\t\t\t\t}\r\n\t\t\t\tfieldArrayName={fieldArrayName}\r\n\t\t\t\tformControl={controlToUse}\r\n\t\t\t\tcustomeFilter={locationFilter}\r\n\t\t\t\t{...dynamicSearchSelectProps}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nLocationSearchSelect.defaultProps = {\r\n\tlocationFieldName: 'location_id',\r\n\tresetValue: undefined,\r\n\tfilterKey: '&company_id.in'\r\n};\r\n\r\nexport default LocationSearchSelect","// import React from \"react\";\nimport { Controller } from \"react-hook-form\";\nimport { RadioGroup } from \"@mui/material\";\nimport Typography from \"../../typography/typography\";\nimport { memo } from \"react\";\n\nconst FormSwitcher = memo(({\n children,\n isFormSwitcher,\n control,\n fieldArrayName,\n formSwitcherName,\n label,\n resetForm,\n}: any) => {\n if (isFormSwitcher) {\n return (\n <Controller\n control={control}\n name={`${fieldArrayName}.${formSwitcherName}`}\n render={({ field }) => (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"24px\",\n }}\n >\n {label ? (\n <Typography\n type=\"s5\"\n style={{ fontWeight: 500 }}\n color={\"theme.secondary.900\"}\n >\n {label}\n </Typography>\n ) : null}\n <RadioGroup\n value={field.value}\n onChange={(e) => {\n resetForm(e.target.value)\n field.onChange(e.target.value)\n }}\n row={true}\n >\n {children}\n </RadioGroup>\n </div>\n )}\n />\n );\n }\n return null;\n});\n\nexport { FormSwitcher };\nexport default FormSwitcher;\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { memo, useMemo, useCallback } from 'react';\r\nimport { Grid, Divider, FormControlLabel, Radio } from '@mui/material';\r\nimport DynamicInput from '../form-builder/form-builder-element/text';\r\nimport DynamicDate from '../form-builder/form-builder-element/date';\r\nimport DynamicTime from '../form-builder/form-builder-element/time';\r\nimport DynamicPhone from '../form-builder/form-builder-element/phone';\r\nimport DynamicSearchSelect from '../form-builder/form-builder-element/dynamic-select';\r\nimport DynamicMedia from '../form-builder/form-builder-element/media';\r\nimport DynamicInfo from '../form-builder/form-builder-element/info';\r\nimport DynamicToggleButton from '../form-builder/form-builder-element/toggle-button';\r\nimport DynamicCheckBox from '../form-builder/form-builder-element/checkbox';\r\nimport DynamicTable from '../form-builder/form-builder-element/table';\r\nimport DynamicRadioButton from '../form-builder/form-builder-element/radio-button';\r\nimport DynamicTagsInput from '../form-builder/form-builder-element/dynamic-tags-input';\r\nimport DynamicCurrency from '../form-builder/form-builder-element/dynamic-currency-input';\r\nimport DynamicInputSelect from '../form-builder/form-builder-element/dynamic-input-select';\r\nimport ChipGenerator from '../../chip-generator/chip-generator';\r\nimport { LocationSearchSelect } from '../../location-select';\r\nimport FormSwitcher from './form-switcher';\r\nimport Typography from '../../typography/typography';\r\nimport Accordion from '../../accordion/accordion';\r\n\r\n// Types for better type safety\r\ninterface Field {\r\n name?: string;\r\n label: string;\r\n field_type: string;\r\n is_fullwidth?: boolean;\r\n custom_width?: number;\r\n is_hidden?: boolean;\r\n is_required?: boolean;\r\n disabled?: boolean;\r\n placeholder?: string;\r\n value?: any;\r\n default_value?: any;\r\n title?: string;\r\n title_position?: string;\r\n table_columns?: any[];\r\n table_rows?: any[];\r\n component?: React.ReactNode;\r\n field_properties?: {\r\n apiType?: string;\r\n customeFilter?: any;\r\n attributes?: any;\r\n disabledIds?: any[];\r\n sortOrder?: string;\r\n maxChips?: number;\r\n allowDuplicates?: boolean;\r\n };\r\n validation?: any;\r\n filterField?: string;\r\n}\r\n\r\ninterface Section {\r\n label?: string;\r\n is_accordion?: boolean;\r\n disabled?: boolean;\r\n form_switcher_label?: string;\r\n}\r\n\r\ninterface FormSectionProps {\r\n section: Section;\r\n index: number;\r\n members?: Field[];\r\n switchForms?: any[];\r\n isFormSwitcher: boolean;\r\n control: any;\r\n fieldArrayName: string;\r\n formSwitcherName: string;\r\n displayAvtar?: boolean;\r\n isButton?: boolean;\r\n currencyOption?: any;\r\n values: any;\r\n onBlur?: (e: any, fieldName?: string) => void;\r\n setValue: (name: string, value: any) => void;\r\n onSelectFooterClick?: (field: Field) => void;\r\n getSelectedData?: (row: any, key: any) => void;\r\n setCurrencyOptions: (options: any) => void;\r\n refreshOptions: any;\r\n handleFieldCleanUp: (forms: any[]) => void;\r\n handleSetCountryCodeField: (country: any, field: Field, fieldArrayName: string, values: any) => void;\r\n handleTableAddClick: (field: Field) => void;\r\n onTableCellChange?: (data: any) => void;\r\n // setDetailsData: (data: any) => void;\r\n t: (key: string) => string;\r\n images: any;\r\n}\r\n\r\n// Memoized field component to prevent unnecessary re-renders\r\nconst MemoizedField = memo(({\r\n field,\r\n fieldName,\r\n sectionLabel,\r\n index,\r\n ...props\r\n}: {\r\n field: Field;\r\n fieldName: string;\r\n sectionLabel?: string;\r\n index: number;\r\n [key: string]: any;\r\n}) => {\r\n const gridSize = useMemo(() =>\r\n field.is_fullwidth ? 12 : (field.custom_width ?? 6),\r\n [field.is_fullwidth, field.custom_width]\r\n );\r\n\r\n const fieldKey = useMemo(() =>\r\n `${sectionLabel}-${fieldName}-${index}`,\r\n [sectionLabel, fieldName, index]\r\n );\r\n\r\n const commonProps = useMemo(() => ({\r\n ...field,\r\n key: fieldKey,\r\n name: fieldName,\r\n position: index,\r\n formControl: props.control,\r\n fieldArrayName: props.fieldArrayName,\r\n required: field.is_required,\r\n label: props.t(field.label),\r\n placeholder: props.t(field.placeholder),\r\n defaultValue: field.value || field.default_value,\r\n disabled: field.disabled\r\n }), [field, fieldName, index, fieldKey, props.control, props.fieldArrayName, props.t]);\r\n\r\n const handleBlur = useCallback((e: any) => {\r\n if (props.onBlur && typeof props.onBlur === 'function') {\r\n props.onBlur(e, fieldName);\r\n }\r\n }, [props.onBlur, fieldName]);\r\n\r\n const endIcon = useMemo(() => {\r\n const iconMap: Record<string, string> = {\r\n email: props.images.sms,\r\n url: props.images.url,\r\n currency: props.images.dollar,\r\n geoLocation: props.images.location\r\n };\r\n\r\n const iconSrc = iconMap[field.field_type];\r\n return iconSrc ? <img src={iconSrc} alt={field.field_type} /> : null;\r\n }, [field.field_type, props.images]);\r\n\r\n const relationLabel = useMemo(() => (\r\n field.field_type === \"relation\" ? (\r\n <span className=\"formSection--Relation\">\r\n {props.t(field.label)}\r\n <img src={props.images.relation} alt=\"relation\" />\r\n </span>\r\n ) : props.t(field.label)\r\n ), [field.field_type, field.label, props.t, props.images.relation]);\r\n\r\n // Render field based on type\r\n const renderField = () => {\r\n switch (field.field_type) {\r\n case \"text\":\r\n case \"email\":\r\n case \"url\":\r\n case \"currency\":\r\n case \"number\":\r\n case \"geoLocation\":\r\n case \"relation\":\r\n return (\r\n <DynamicInput\r\n {...commonProps}\r\n key={commonProps.key}\r\n label={relationLabel}\r\n onBlur={handleBlur}\r\n type={field.field_type}\r\n endIcon={endIcon}\r\n disabled={field.disabled || field.field_type === \"relation\"}\r\n />\r\n );\r\n\r\n case \"date\":\r\n return <DynamicDate {...commonProps} key={commonProps.key} />;\r\n\r\n case \"time\":\r\n return <DynamicTime {...commonProps} key={commonProps.key} />;\r\n\r\n case \"phone\":\r\n return (\r\n <DynamicPhone\r\n {...commonProps}\r\n key={commonProps.key}\r\n setCountryCodeField={(country: any) =>\r\n props.handleSetCountryCodeField(country, field, props.fieldArrayName, props.values)\r\n }\r\n />\r\n );\r\n\r\n case \"select\":\r\n return (\r\n <DynamicSearchSelect\r\n {...commonProps}\r\n key={commonProps.key}\r\n apiType={field.field_properties?.apiType}\r\n customeFilter={field.field_properties?.customeFilter}\r\n attributes={field.field_properties?.attributes}\r\n disabledIds={field.field_properties?.disabledIds}\r\n onChipRemove={() => props.setValue(`${props.fieldArrayName}.${fieldName}`, [])}\r\n {\r\n ...(!field?.addType || !field?.field_properties?.addType\r\n ? { onFooterClick: () => props.onSelectFooterClick?.(field) }\r\n : {})\r\n }\r\n handleOptions={props.setCurrencyOptions}\r\n getSelectedData={props.getSelectedData}\r\n refresh={props.refreshOptions}\r\n sortOrder={field.field_properties?.sortOrder}\r\n showCancelButton={field.field_properties?.showCancelButton}\r\n addType={field?.addType || field?.field_properties?.addType}\r\n modalComponentProps={field?.field_properties?.modalComponentProps}\r\n />\r\n );\r\n\r\n case \"file\":\r\n case \"image\":\r\n return <DynamicMedia {...commonProps} key={commonProps.key} />;\r\n\r\n case \"info\":\r\n return <DynamicInfo {...commonProps} key={commonProps.key} />;\r\n\r\n case \"toggleButton\":\r\n return (\r\n <DynamicToggleButton\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"checkbox\":\r\n return (\r\n <DynamicCheckBox\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"table\":\r\n return (\r\n <DynamicTable\r\n {...commonProps}\r\n key={commonProps.key}\r\n columns={field.table_columns}\r\n rows={field.table_rows}\r\n onAddClick={() => props.handleTableAddClick(field)}\r\n disableTableAddButton={Boolean(field.disableTableAddButton)}\r\n is_button={props.isButton}\r\n onTableCellChange={props.onTableCellChange}\r\n />\r\n );\r\n\r\n case \"radioButton\":\r\n return (\r\n <DynamicRadioButton\r\n {...commonProps}\r\n key={commonProps.key}\r\n titlePosition={field.title_position}\r\n title={props.t(field.title)}\r\n />\r\n );\r\n\r\n case \"customComponent\":\r\n return field.component;\r\n\r\n case \"tagsInput\":\r\n return (\r\n <DynamicTagsInput\r\n {...commonProps}\r\n key={commonProps.key}\r\n label={relationLabel}\r\n type={field.field_type}\r\n endIcon={endIcon}\r\n />\r\n );\r\n\r\n case \"currency_with_amount\":\r\n return (\r\n <DynamicCurrency\r\n {...commonProps}\r\n key={commonProps.key}\r\n currencyType={props.currencyOption}\r\n />\r\n );\r\n\r\n case \"select_with_input\":\r\n return (\r\n <DynamicInputSelect\r\n {...commonProps}\r\n currencyType={props.currencyOption}\r\n />\r\n );\r\n\r\n case \"chipInput\":\r\n return (\r\n <ChipGenerator\r\n {...commonProps}\r\n key={commonProps.key}\r\n maxChips={field.field_properties?.maxChips}\r\n allowDuplicates={field.field_properties?.allowDuplicates}\r\n validation={field.validation}\r\n endIcon={endIcon}\r\n onChipAdd={(chip: any) => console.log('Chip added:', chip)}\r\n onChipRemove={(chip: any, index: number) => console.log('Chip removed:', chip, 'at index:', index)}\r\n />\r\n );\r\n\r\n case \"location_select\":\r\n return (\r\n <LocationSearchSelect\r\n fieldArrayName={props.fieldArrayName}\r\n filterField={field.filterField}\r\n getSelectedData={(row: any[]) => props.getSelectedData(row)}\r\n locationFieldName={field.name}\r\n addType=\"location\"\r\n enable_footer={true}\r\n />\r\n );\r\n\r\n default:\r\n return null;\r\n }\r\n };\r\n\r\n // For table fields, use full width\r\n if (field.field_type === \"table\" || field.field_type === \"customComponent\") {\r\n return (\r\n <Grid item xs={12}>\r\n {renderField()}\r\n </Grid>\r\n );\r\n }\r\n\r\n return (\r\n <Grid item xs={gridSize}>\r\n {renderField()}\r\n </Grid>\r\n );\r\n});\r\n\r\nMemoizedField.displayName = 'MemoizedField';\r\n\r\n// Memoized FormSwitcher component\r\nconst MemoizedFormSwitcher = memo(({\r\n section,\r\n switchForms,\r\n isFormSwitcher,\r\n control,\r\n fieldArrayName,\r\n formSwitcherName,\r\n handleFieldCleanUp,\r\n t\r\n}: {\r\n section: Section;\r\n switchForms?: any[];\r\n isFormSwitcher: boolean;\r\n control: any;\r\n fieldArrayName: string;\r\n formSwitcherName: string;\r\n handleFieldCleanUp: (forms: any[]) => void;\r\n t: (key: string) => string;\r\n}) => {\r\n const resetForm = useCallback(() => {\r\n handleFieldCleanUp(switchForms || []);\r\n }, [handleFieldCleanUp, switchForms]);\r\n\r\n if (!isFormSwitcher || !switchForms?.length) return null;\r\n\r\n return (\r\n <FormSwitcher\r\n {...section}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n label={t(section.form_switcher_label || '')}\r\n resetForm={resetForm}\r\n >\r\n {switchForms.map((forms: any) => (\r\n <FormControlLabel\r\n key={forms.id}\r\n value={forms.value || forms.name}\r\n control={<Radio />}\r\n slotProps={{ typography: { variant: \"body2\" } }}\r\n label={t(forms.name)}\r\n disabled={Boolean(section.disabled)}\r\n />\r\n ))}\r\n </FormSwitcher>\r\n );\r\n});\r\n\r\nMemoizedFormSwitcher.displayName = 'MemoizedFormSwitcher';\r\n\r\n// Main component\r\nconst FormSection = memo<FormSectionProps>(({\r\n section,\r\n index,\r\n members,\r\n switchForms,\r\n isFormSwitcher,\r\n control,\r\n fieldArrayName,\r\n formSwitcherName,\r\n displayAvtar,\r\n isButton,\r\n currencyOption,\r\n values,\r\n onBlur,\r\n setValue,\r\n onSelectFooterClick,\r\n getSelectedData,\r\n setCurrencyOptions,\r\n refreshOptions,\r\n handleFieldCleanUp,\r\n handleSetCountryCodeField,\r\n handleTableAddClick,\r\n onTableCellChange,\r\n setDetailsData,\r\n t,\r\n images\r\n}) => {\r\n // Memoize visible members to prevent recalculation\r\n const visibleMembers = useMemo(() =>\r\n members?.filter(f => !f.is_hidden) || [],\r\n [members]\r\n );\r\n\r\n // Memoize field names to prevent recalculation\r\n const fieldsWithNames = useMemo(() =>\r\n visibleMembers.map(field => ({\r\n ...field,\r\n fieldName: field.name || field.label.toLowerCase().split(\" \").join(\"_\")\r\n })),\r\n [visibleMembers]\r\n );\r\n\r\n // Memoize section header\r\n const sectionHeader = useMemo(() => {\r\n if (!section.label) return null;\r\n\r\n return (\r\n <div style={{ minHeight: \"16px\" }}>\r\n {index !== 0 && <Divider className='formParser--Section--SectionDivider' />}\r\n <Typography\r\n type=\"s3\"\r\n weight=\"medium\"\r\n mb={2}\r\n mt={4}\r\n color=\"theme.secondary.1000\"\r\n className='formParser--Section--SectionTitle'\r\n >\r\n {t(section.label)}\r\n </Typography>\r\n </div>\r\n );\r\n }, [section.label, index, t]);\r\n\r\n // Avatar component\r\n const avatarDisplay = useMemo(() =>\r\n displayAvtar ? <div className='avtarDisplay'>ERP</div> : null,\r\n [displayAvtar]\r\n );\r\n\r\n // Common props for field rendering\r\n const fieldProps = useMemo(() => ({\r\n control,\r\n fieldArrayName,\r\n isButton,\r\n currencyOption,\r\n values,\r\n onBlur,\r\n setValue,\r\n onSelectFooterClick,\r\n getSelectedData,\r\n setCurrencyOptions,\r\n refreshOptions,\r\n handleSetCountryCodeField,\r\n handleTableAddClick,\r\n onTableCellChange,\r\n setDetailsData,\r\n t,\r\n images\r\n }), [\r\n control, fieldArrayName, isButton, currencyOption, values,\r\n onBlur, setValue, onSelectFooterClick, getSelectedData,\r\n setCurrencyOptions, refreshOptions, handleSetCountryCodeField,\r\n handleTableAddClick, onTableCellChange, setDetailsData, t, images\r\n ]);\r\n\r\n if (section.is_accordion) {\r\n return (\r\n <section key={index} className='formParser--Section'>\r\n <div style={{ marginTop: '20px' }}>\r\n <Accordion title={t(section.label || '')}>\r\n <div className=\"formParser--Grid formParser--Accordion\">\r\n <MemoizedFormSwitcher\r\n section={section}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n t={t}\r\n />\r\n {fieldsWithNames.map((field, fieldIndex) => (\r\n <MemoizedField\r\n key={`${section.label}-${field.fieldName}-${fieldIndex}`}\r\n field={field}\r\n fieldName={field.fieldName}\r\n sectionLabel={section.label}\r\n index={fieldIndex}\r\n {...fieldProps}\r\n />\r\n ))}\r\n </div>\r\n </Accordion>\r\n </div>\r\n </section>\r\n );\r\n }\r\n\r\n return (\r\n <section key={index} className='formParser--Section'>\r\n {sectionHeader}\r\n\r\n <MemoizedFormSwitcher\r\n section={section}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n t={t}\r\n />\r\n\r\n <Grid container spacing={2}>\r\n {avatarDisplay}\r\n {fieldsWithNames.map((field, fieldIndex) => (\r\n <MemoizedField\r\n key={`${section.label}-${field.fieldName}-${fieldIndex}`}\r\n field={field}\r\n fieldName={field.fieldName}\r\n sectionLabel={section.label}\r\n index={fieldIndex}\r\n {...fieldProps}\r\n />\r\n ))}\r\n </Grid>\r\n </section>\r\n );\r\n});\r\n\r\nFormSection.displayName = 'FormSection';\r\n\r\nexport { FormSection };\r\nexport default FormSection;","import { FormProvider, useForm, useWatch } from \"react-hook-form\";\r\n// import { useLocation } from \"react-router-dom\";\r\nimport { Box } from \"@mui/material\";\r\n\r\n// import FullScreenLayout from \"../../../layout/fullScreen/fullScreen\";\r\n\r\nimport { useState, useEffect, useCallback } from \"react\";\r\nimport images from \"../../../assets/images\";\r\nimport \"./form-parser.scss\";\r\nimport TabBar from \"../../tabs/tabs\";\r\nimport formBuilderDeConversion from \"../../../utils/form-builder-deconversion\";\r\nimport { yupResolver } from \"@hookform/resolvers/yup\";\r\nimport * as yup from \"yup\";\r\nimport dayjs from \"dayjs\";\r\nimport { SECTION_TYPES } from '../../../utils/constant';\r\nimport { CountryData } from 'react-phone-input-2';\r\nimport Alert from '../../alert/alert';\r\nimport _ from \"lodash\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport FormSection from \"./form-section\";\r\nconst validationReducer = (validations: any, validation: any, field: any, translationFn: any) => {\r\n switch (validation.type) {\r\n case \"required\":\r\n return (field.field_properties?.is_multiselect ? validations.required(translationFn(validation.msg_en)).min(1, translationFn(validation.msg_en)) : validation.value\r\n ? validations.required(translationFn(validation.msg_en)).test('not-empty', translationFn(validation.msg_en), value => typeof value === 'string' ? value && value?.trim()?.length > 0 : true) : validations.nullable());\r\n case \"min_length\":\r\n return validations.min(validation.value, translationFn(validation.msg_en));\r\n case \"max_length\":\r\n return validations.max(validation.value, translationFn(validation.msg_en));\r\n case \"min_val\":\r\n return validations.min(validation.value, translationFn(validation.msg_en));\r\n case \"max_val\":\r\n return validations.max(validation.value, translationFn(validation.msg_en));\r\n case \"postive_number\":\r\n return validations.test('is-positive-number', translationFn(validation.msg_en), (value) => value >= 0)\r\n case 'email':\r\n return validations.email(validation.msg_en);\r\n case \"no_special_char\":\r\n return validations.test(\r\n \"no-special-char\",\r\n translationFn(validation.msg_en),\r\n value =>\r\n typeof value === \"string\"\r\n ? /^[^.\\-\\W_]+$/u.test(value) // allow letters/digits only\r\n : true\r\n );\r\n case \"when\":\r\n return validations.when(validation.relation, {\r\n is: (val: any) => val === validation.values,\r\n then: () => validation?.thenValidations?.reduce(\r\n (validations: any, validation: any) => validationReducer(validations, validation, field, translationFn),\r\n validations\r\n ) || validations,\r\n otherwise: () => validation?.otherWiseValidations?.reduce(\r\n (validations: any, validation: any) => validationReducer(validations, validation, field, translationFn),\r\n validations\r\n ) || validations,\r\n });\r\n // Add more cases for other validation types as needed\r\n default:\r\n return validations;\r\n }\r\n}\r\n\r\nconst FormParser = ({\r\n data,\r\n defaultValues,\r\n handleFormSubmit,\r\n fieldArrayName,\r\n mode,\r\n displayAvtar = false,\r\n onTableAddClick,\r\n handleFormValues,\r\n getFormMethods,\r\n setFields,\r\n onSelectFooterClick,\r\n setActiveTabValue,\r\n activeTab = 0,\r\n recieveTabDataLenght,\r\n recieveIsValidForm,\r\n activeTabs,\r\n onTableCellChange,\r\n containerStyles = undefined,\r\n isButton = true,\r\n getSelectedData,\r\n refreshOptions = false,\r\n onBlur,\r\n}: any) => {\r\n\r\n const { t } = useTranslation();\r\n\r\n function convertToNestedObject(dotNotationString: string, field: any, existingObject: any = {}) {\r\n const keys = dotNotationString.split('.');\r\n let currentLevel = existingObject;\r\n\r\n keys.forEach((key, index) => {\r\n if (index === keys.length - 1) {\r\n if (!currentLevel[key]) {\r\n const fieldValidations = field.validation.reduce(\r\n (validations: any, validation: any) => {\r\n switch (validation.type) {\r\n case \"required\":\r\n return validation.value\r\n ? validations.required(t(validation.msg_en)).test('not-empty', t(validation.msg_en), value => typeof value === 'string' ? value && value?.trim()?.length > 0 : true)\r\n : (field.field_properties?.is_multiselect ? validations.min(1, t(validation.msg_en)) : validations.nullable());\r\n case \"min_length\":\r\n return validations.min(validation.value, t(validation.msg_en));\r\n case \"max_length\":\r\n return validations.max(validation.value, t(validation.msg_en));\r\n case \"min_val\":\r\n return validations.min(validation.value, t(validation.msg_en));\r\n case \"max_val\":\r\n return validations.max(validation.value, t(validation.msg_en));\r\n // Add more cases for other validation types as needed\r\n default:\r\n return validations;\r\n }\r\n },\r\n getValidationType(field)\r\n );\r\n currentLevel[key] = fieldValidations;\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n } else {\r\n if (!currentLevel[key]) {\r\n currentLevel[key] = {};\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n currentLevel = currentLevel[key];\r\n\r\n }\r\n });\r\n\r\n return existingObject;\r\n }\r\n\r\n const getValidationType = (field: any) => {\r\n switch (field.field_type) {\r\n case 'select':\r\n return field.field_properties?.is_multiselect\r\n ? yup.array()\r\n : yup.string()\r\n\r\n case 'number':\r\n case 'currency':\r\n return yup.number().transform((value, originalValue) => (originalValue === '' ? undefined : value)).typeError('Please enter valid number').nullable()\r\n case 'currency_with_amount':\r\n return yup.number()\r\n case 'url':\r\n return yup.string().matches(/^(https?:\\/\\/)?((([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,})|localhost)(:\\d{2,5})?(\\/[a-zA-Z0-9#_-]+\\/?)*(\\?[a-zA-Z0-9&=_-]+)?(#\\S+)?$/, { excludeEmptyString: true, message: \"Please enter valid URL.\" })\r\n\r\n default:\r\n return yup.string()\r\n }\r\n }\r\n\r\n const convertNestedFieldSchemaObject = (nestedFields: any) => {\r\n const schema: any = {};\r\n\r\n for (const key in nestedFields) {\r\n if (typeof nestedFields[key] === 'object' && !Object.hasOwn(nestedFields[key], 'tests')) {\r\n schema[key] = yup.object().shape(convertNestedFieldSchemaObject(nestedFields[key]));\r\n } else {\r\n schema[key] = nestedFields[key]\r\n }\r\n }\r\n return schema;\r\n }\r\n\r\n\r\n const generateValidationSchema = (data: any[]) => {\r\n const yupSchemaObject: any = {};\r\n let nestedFielvalidations: any = {},\r\n nestedYupSchemaObj: any = {};\r\n\r\n data &&\r\n data?.forEach((field: any) => {\r\n let fieldValidations: any;\r\n if (field.validation && field.validation.length > 0) {\r\n if (field.name?.includes(\".\")) {\r\n nestedFielvalidations = convertToNestedObject(field.name, field, nestedFielvalidations);\r\n } else {\r\n fieldValidations = field.validation.reduce((validations: any, validation: any) => validationReducer(validations, validation, field, t),\r\n getValidationType(field)\r\n );\r\n yupSchemaObject[field.name] = fieldValidations;\r\n }\r\n\r\n nestedYupSchemaObj = convertNestedFieldSchemaObject(nestedFielvalidations)\r\n }\r\n\r\n });\r\n\r\n return yup.object().shape({\r\n [fieldArrayName]: yup.object().shape({ ...yupSchemaObject, ...nestedYupSchemaObj }),\r\n });\r\n };\r\n\r\n const {\r\n control,\r\n handleSubmit,\r\n formState: { errors },\r\n setValue,\r\n reset,\r\n getValues,\r\n watch,\r\n resetField,\r\n unregister,\r\n trigger,\r\n getFieldState,\r\n ...rest\r\n } = useForm({\r\n ...(defaultValues && typeof defaultValues === 'object' ? { defaultValues } : {}),\r\n resolver: yupResolver(generateValidationSchema(data)),\r\n mode: \"all\",\r\n });\r\n\r\n const watchedValues = useWatch({\r\n control,\r\n name: fieldArrayName,\r\n });\r\n\r\n // Local States\r\n const [schema, setSchema] = useState<[]>([]);\r\n const [tabsData, setTabsData] = useState<any[]>([]);\r\n const [errorAlert, setErrorAlert] = useState<boolean>(false);\r\n const [currencyOption, setCurrencyOptions] = useState<string>('');\r\n const [isTabFormValid, setTabFormValid] = useState<boolean>(false);\r\n const [validateRequiredFields, setValidRequiredFields] = useState<any[]>([]);\r\n\r\n // Local Functions\r\n const handleTableAddClick = (tableName?: string) => {\r\n onTableAddClick?.(tableName)\r\n }\r\n\r\n const getSectionData = useCallback((section: any) => {\r\n const sectionMembers = section?.members?.map((ele: any) => ele) || []\r\n const values = getValues(fieldArrayName)\r\n const isFormSwitcher = section.section_type === SECTION_TYPES.FORM_SWITCH_SECTION\r\n const formSwitcherName =\r\n section?.form_switcher_name ||\r\n section?.form_switcher_label?.toLowerCase().split(\" \").join(\"_\");\r\n const switchForms = section?.switcher_forms?.map((form: any) => ({\r\n ...form,\r\n formMembers: sectionMembers.filter(\r\n (member: any) => member.section_form_id === form.id,\r\n )\r\n }));\r\n const selectedSectionForm =\r\n values?.[formSwitcherName] ?\r\n switchForms.find((ele: any) =>\r\n ele.name === values?.[formSwitcherName]\r\n ) : {};\r\n\r\n // When form switcher is active, include:\r\n // 1. Common fields (fields without section_form_id or is_form_switcher_section)\r\n // 2. Form-specific fields (fields with section_form_id matching the selected form)\r\n let members;\r\n if (isFormSwitcher) {\r\n const commonFields = sectionMembers.filter(\r\n (member: any) => !member.section_form_id && !member.is_form_switcher_section\r\n );\r\n const formSpecificFields = selectedSectionForm?.formMembers || [];\r\n members = [...commonFields, ...formSpecificFields];\r\n } else {\r\n members = section?.members;\r\n }\r\n\r\n return {\r\n isFormSwitcher,\r\n formSwitcherName,\r\n switchForms,\r\n selectedSectionForm,\r\n members,\r\n values\r\n }\r\n }, [fieldArrayName, getValues])\r\n\r\n const handleSetCountryCodeField = useCallback((country: CountryData, field: any, fieldArrayName: any, values: any) => {\r\n const oldVal = values?.[fieldArrayName]?.[field?.country_code_field_name]\r\n const newVal = `+${country.dialCode}`\r\n if (\r\n field?.is_country_code_separate &&\r\n field?.country_code_field_name &&\r\n oldVal !== newVal\r\n ) {\r\n setValue(\r\n `${fieldArrayName}.${field?.country_code_field_name}` as never,\r\n newVal as never\r\n )\r\n }\r\n }, [setValue])\r\n\r\n const handleFieldCleanUp = useCallback((switchForms: any) => {\r\n switchForms.forEach((form: any) => {\r\n form?.formMembers.forEach((member: any) => {\r\n const memberName = member?.name || member.label.toLowerCase().split(\" \").join(\"_\")\r\n const v = _.get(defaultValues, `${fieldArrayName}.${memberName}`, null)\r\n const newData = data.map((ele: any) => {\r\n if (member?.section_form_id === ele?.section_form_id) {\r\n delete ele.value\r\n }\r\n return ({\r\n ...ele,\r\n ...(v ? { value: v } : {}),\r\n })\r\n })\r\n if (!v) {\r\n resetField(`${fieldArrayName}.${memberName}` as never)\r\n unregister(`${fieldArrayName}.${memberName}` as never)\r\n }\r\n setFields?.(newData)\r\n })\r\n\r\n })\r\n }, [data, defaultValues, fieldArrayName, resetField, setFields, unregister])\r\n\r\n const createNestedObjectFromDot = useCallback((dotNotationString: string, field: any, existingObject: any = {}) => {\r\n const keys = dotNotationString.split('.');\r\n let currentLevel = existingObject;\r\n\r\n keys.forEach((key, index) => {\r\n if (index === keys.length - 1) {\r\n if (!currentLevel[key]) {\r\n let fieldValue = field.value\r\n if (fieldValue && (field.field_type !== 'image' || field.field_type !== 'file')) {\r\n if (field.field_type === 'date') {\r\n fieldValue = dayjs(fieldValue)\r\n } else if (field.field_type === 'time') {\r\n const [hours, minutes, seconds] = fieldValue.split(\":\").map(Number);\r\n fieldValue = dayjs().set('hour', hours).set('minute', minutes).set('second', seconds).set('millisecond', 0)\r\n } else if (field.name.includes('_id') && !Array.isArray(field?.value)) {\r\n fieldValue = Number(fieldValue)\r\n }\r\n }\r\n currentLevel[key] = fieldValue;\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n } else {\r\n if (!currentLevel[key]) {\r\n currentLevel[key] = {};\r\n } else if (typeof currentLevel[key] !== 'object' || Array.isArray(currentLevel[key])) {\r\n throw new Error(`Conflict: The key \"${key}\" already exists and is not an object.`);\r\n }\r\n currentLevel = currentLevel[key];\r\n\r\n }\r\n });\r\n\r\n return existingObject;\r\n }, [])\r\n\r\n const removeMatchingKeyValuePairs = useCallback((obj1, obj2) => {\r\n _.forOwn(obj1, (value, key) => {\r\n if (_.has(obj2, key) && _.isEqual(value, obj2[key])) {\r\n delete obj1[key];\r\n }\r\n });\r\n return obj1;\r\n }, [])\r\n\r\n const validateRequiredSwitchFormData = useCallback((switchData: any) => {\r\n const requiredFields: string[] = [];\r\n if (switchData) {\r\n switchData && switchData[0]?.formMembers.forEach((member: any) => {\r\n if (member?.validation && Array.isArray(member?.validation)) {\r\n member?.validation.forEach((validation: any) => {\r\n if (validation?.thenValidations && Array.isArray(validation?.thenValidations)) {\r\n validation?.thenValidations.forEach((thenValidation: any) => {\r\n if (thenValidation?.type === \"required\" && thenValidation?.value === true) {\r\n if (member?.name) {\r\n requiredFields.push(member.name);\r\n }\r\n }\r\n });\r\n } else {\r\n const hasRequiredValidation = member.validation.some(\r\n (validation: any) => validation.type === 'required' && validation.value === true\r\n )\r\n if (hasRequiredValidation) {\r\n requiredFields.push(member.name);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n }\r\n if (requiredFields) {\r\n setValidRequiredFields(_.uniq(requiredFields))\r\n }\r\n\r\n }, [])\r\n\r\n const isEmpty = useCallback((value: any): boolean => {\r\n return (\r\n value === null ||\r\n value === undefined ||\r\n (Array.isArray(value) && value.length === 0) ||\r\n (typeof value === 'object' && Object.keys(value).length === 0)\r\n );\r\n }, [])\r\n\r\n const getMissingFields = useCallback((watchedFields: any, validationReqFields: string[]): string[] => {\r\n const missingFields: string[] = [];\r\n\r\n validationReqFields.forEach((fieldPath) => {\r\n const keys = fieldPath.split(\".\");\r\n let currentLevel = watchedFields;\r\n\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n\r\n if (!currentLevel?.[key] && currentLevel?.[key] !== 0) {\r\n // If any key in the path is missing, mark the field as missing\r\n missingFields.push(fieldPath);\r\n return;\r\n }\r\n\r\n // Move deeper into the object\r\n currentLevel = currentLevel[key];\r\n }\r\n\r\n // After navigating the full path, check if the final value is empty\r\n if (isEmpty(currentLevel)) {\r\n missingFields.push(fieldPath);\r\n }\r\n });\r\n\r\n\r\n return missingFields;\r\n }, [isEmpty])\r\n\r\n // Use Effects\r\n useEffect(() => {\r\n if (recieveTabDataLenght) {\r\n recieveTabDataLenght(tabsData.length)\r\n }\r\n }, [recieveTabDataLenght, tabsData])\r\n\r\n useEffect(() => {\r\n const handleMessage = (event: MessageEvent) => {\r\n if (event.origin !== window.origin) {\r\n return;\r\n }\r\n const { state } = event.data;\r\n\r\n if (state?.length) {\r\n const data: any = formBuilderDeConversion(state);\r\n\r\n if (data.tab) {\r\n setTabsData(data.tab);\r\n } else if (data.section) {\r\n setSchema(data.section);\r\n }\r\n }\r\n };\r\n\r\n window.addEventListener(\"message\", handleMessage);\r\n\r\n return () => {\r\n window.removeEventListener(\"message\", handleMessage);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (data) {\r\n const formData = formBuilderDeConversion(data)\r\n if (formData?.tab) {\r\n // setSchema([])\r\n setTabsData(formData.tab);\r\n if (activeTab !== undefined) {\r\n setSchema(formData.tab[activeTab]?.data || []);\r\n }\r\n } else {\r\n setSchema(formData.section);\r\n // setTabsData([])\r\n }\r\n const dVals = _.get(defaultValues, fieldArrayName, {})\r\n const wVals = removeMatchingKeyValuePairs((watchedValues || {}), (dVals || {}))\r\n if (mode === 'edit' && !Object.keys(wVals)?.length) {\r\n let formValues: any = {};\r\n let nestedFormValues: any = {};\r\n data.forEach((field: any) => {\r\n const fieldValue = field.value\r\n if (field.name?.includes(\".\")) {\r\n nestedFormValues = createNestedObjectFromDot(field.name, field, nestedFormValues)\r\n } else {\r\n if (fieldValue && (field.field_type !== 'image' || field.field_type !== 'file')) {\r\n if (field?.is_section_field) {\r\n const fieldName = field?.form_switcher_name || field?.form_switcher_label;\r\n formValues = { ...formValues, [fieldName]: fieldValue }\r\n } else if (\r\n field?.name &&\r\n ['company_id', 'email_ids'].includes(field?.name) &&\r\n ['edit_customer', 'add_customer', 'edit_vendor', 'add_vendor'].includes(fieldArrayName)\r\n ) {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n } else if (field.field_type === 'date') {\r\n formValues = { ...formValues, [field.name]: dayjs(fieldValue) }\r\n } else if (field.field_type === 'time') {\r\n const [hours, minutes, seconds] = fieldValue.split(\":\").map(Number);\r\n formValues = { ...formValues, [field.name]: dayjs().set('hour', hours).set('minute', minutes).set('second', seconds).set('millisecond', 0) }\r\n } else if (field.name.includes('_id') && !Array.isArray(field?.value)) {\r\n if (fieldArrayName === \"edit_user\" && field.name === \"role_id\") {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n } else {\r\n formValues = { ...formValues, [field.name]: Number(fieldValue) }\r\n }\r\n } else {\r\n formValues = { ...formValues, [field.name]: fieldValue }\r\n }\r\n }\r\n }\r\n })\r\n const finalFormValues = { ...formValues, ...nestedFormValues }\r\n reset({ [fieldArrayName]: { ...finalFormValues } })\r\n }\r\n getFormMethods?.({ control, handleSubmit, setValue, reset, resetField, getValues, unregister, trigger, watch, getFieldState, errors, ...rest })\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [data])\r\n\r\n useEffect(() => {\r\n if (activeTab?.toString()) {\r\n if (tabsData && tabsData[activeTab]) {\r\n setSchema(tabsData[activeTab].data);\r\n }\r\n }\r\n }, [activeTab, tabsData]);\r\n\r\n useEffect(() => {\r\n if (watchedValues && handleFormValues) {\r\n handleFormValues?.(watchedValues);\r\n }\r\n }, [handleFormValues, watchedValues])\r\n\r\n useEffect(() => {\r\n if (errors?.[fieldArrayName]) {\r\n setErrorAlert(true)\r\n } else {\r\n setErrorAlert(false)\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [fieldArrayName, JSON.stringify(errors)])\r\n\r\n useEffect(() => {\r\n const validatedFields: string[] = [];\r\n if (activeTab != undefined) {\r\n tabsData[activeTab]?.data.forEach((section: any) => {\r\n\r\n if (section.members && Array.isArray(section.members)) {\r\n\r\n section.members.forEach((member: any) => {\r\n if (member.validation && Array.isArray(member.validation)) {\r\n const hasRequiredValidation = member.validation.some(\r\n (validation: any) => validation.type === 'required' && validation.value === true\r\n )\r\n if (hasRequiredValidation) {\r\n // validatedFields.push(fieldArrayName + '.' + member.name);\r\n validatedFields.push(member.name);\r\n }\r\n }\r\n });\r\n }\r\n })\r\n setValidRequiredFields(validatedFields);\r\n }\r\n }, [tabsData, activeTab]);\r\n\r\n useEffect(() => {\r\n if (watchedValues?.account_type) {\r\n\r\n const switchFormData: any[] = [];\r\n schema && schema.forEach((section: any) => {\r\n const sectionMembers = schema && section?.members?.map((ele: any) => ele) || [];\r\n\r\n const switchForms = schema && section?.switcher_forms?.map((form: any) => ({\r\n ...form,\r\n formMembers: sectionMembers.filter(\r\n (member: any) => member.section_form_id === form.id,\r\n ),\r\n }));\r\n if (switchForms) {\r\n switchFormData.push(switchForms)\r\n }\r\n })\r\n\r\n const selectValue = watchedValues?.account_type || \"Individual\";\r\n const switchData = switchFormData && Array.isArray(switchFormData[0])\r\n ? switchFormData[0].filter((form: any) => form.name === selectValue)\r\n : [];\r\n\r\n if (switchData) {\r\n validateRequiredSwitchFormData(switchData)\r\n }\r\n\r\n }\r\n }, [watchedValues?.account_type, schema, validateRequiredSwitchFormData]);\r\n\r\n useEffect(() => {\r\n if (validateRequiredFields.length > 0) {\r\n const updatedRequiredFields = getMissingFields(watchedValues, validateRequiredFields)\r\n\r\n // const updatedRequiredFields = validateRequiredFields.filter((fieldPath) => {\r\n // const watchedValue = watchedFields[fieldPath] ;\r\n // return watchedValue === undefined || watchedValue === null || watchedValue === 0 ;\r\n // });\r\n\r\n updatedRequiredFields.length === 0 ? setTabFormValid(true) : setTabFormValid(false);\r\n } else {\r\n setTabFormValid(true)\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [validateRequiredFields, watchedValues, activeTab])\r\n\r\n useEffect(() => {\r\n if (recieveIsValidForm) {\r\n recieveIsValidForm(isTabFormValid)\r\n }\r\n }, [recieveIsValidForm, isTabFormValid])\r\n\r\n\r\n return (\r\n // <FullScreenLayout>\r\n <Box sx={{ width: \"100%\", padding: \"2rem\", ...containerStyles }}>\r\n <FormProvider {...{ control, handleSubmit, setValue, reset, resetField, getValues, unregister, trigger, watch, errors, ...rest }}>\r\n <form id={fieldArrayName} name={fieldArrayName} onSubmit={handleSubmit(handleFormSubmit)}>\r\n {Boolean(tabsData?.length) && (\r\n <>\r\n {errorAlert &&\r\n <Alert severity='error' onClose={() => setErrorAlert(false)}>\r\n Please fill all the required fields.\r\n </Alert>\r\n }\r\n <TabBar\r\n tabs={tabsData}\r\n activeTabs={activeTabs}\r\n activeValue={activeTab}\r\n setActiveValue={setActiveTabValue}\r\n isFormTabValid={isTabFormValid}\r\n />\r\n </>\r\n )}\r\n {schema &&\r\n schema.map((section: any, index: number) => {\r\n const {\r\n isFormSwitcher,\r\n formSwitcherName,\r\n switchForms,\r\n members,\r\n values,\r\n } = getSectionData(section)\r\n\r\n return (\r\n <FormSection\r\n section={section}\r\n index={index}\r\n members={members}\r\n switchForms={switchForms}\r\n isFormSwitcher={isFormSwitcher}\r\n control={control}\r\n fieldArrayName={fieldArrayName}\r\n formSwitcherName={formSwitcherName}\r\n displayAvtar={displayAvtar}\r\n isButton={isButton}\r\n currencyOption={currencyOption}\r\n values={values}\r\n onBlur={onBlur}\r\n setValue={setValue}\r\n onSelectFooterClick={onSelectFooterClick}\r\n getSelectedData={getSelectedData}\r\n setCurrencyOptions={setCurrencyOptions}\r\n refreshOptions={refreshOptions}\r\n handleFieldCleanUp={handleFieldCleanUp}\r\n handleSetCountryCodeField={handleSetCountryCodeField}\r\n handleTableAddClick={handleTableAddClick}\r\n onTableCellChange={onTableCellChange}\r\n // setDetailsData={setDetailsData}\r\n t={t}\r\n images={images}\r\n />\r\n );\r\n })}\r\n </form>\r\n </FormProvider>\r\n </Box>\r\n // </FullScreenLayout>\r\n );\r\n};\r\n\r\nexport default FormParser;","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React, { useMemo } from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n team: {\r\n name: string;\r\n department_id: string | null;\r\n team_lead_id: string | null;\r\n member_ids: string[] | null;\r\n description: string;\r\n };\r\n}\r\n\r\nconst teamValidationSchema = Yup.object().shape({\r\n team: Yup.object().shape({\r\n name: Yup.string().required('Team Name is required'),\r\n department_id: Yup.string().nullable(),\r\n team_lead_id: Yup.string().nullable().required('Team Lead is required'),\r\n member_ids: Yup.array().nullable(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nconst DEFAULT_VALUES = {\r\n team: {\r\n name: '',\r\n department_id: null,\r\n team_lead_id: null,\r\n member_ids: null,\r\n description: '',\r\n }\r\n};\r\n\r\nexport const TeamAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, watch } = useForm<IFormValues>({\r\n mode: 'all',\r\n resolver: yupResolver(teamValidationSchema),\r\n defaultValues: DEFAULT_VALUES\r\n });\r\n\r\n const selectedDepartmentId = watch('team.department_id');\r\n const selectedTeamLeadId = watch('team.team_lead_id');\r\n\r\n const handleModalClose = () => {\r\n reset(DEFAULT_VALUES);\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n await onSave(values);\r\n handleModalClose();\r\n };\r\n\r\n // Memoize filters to prevent unnecessary re-renders of DynamicSearchSelect\r\n const leadFilter = useMemo(() => ({\r\n '&department_id.eq': selectedDepartmentId || 0\r\n }), [selectedDepartmentId]);\r\n\r\n const membersFilter = useMemo(() => ({\r\n '&department_id.eq': selectedDepartmentId || 0,\r\n ...(selectedTeamLeadId ? { '&id.ne': selectedTeamLeadId } : {})\r\n }), [selectedDepartmentId, selectedTeamLeadId]);\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.teamModal.title', 'Add Team')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Team Name - Required */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.teamModal.name_label', 'Team Name')}\r\n name='name'\r\n fieldArrayName='team'\r\n placeholder={t('hrms.organization_structure.teamModal.name_placeholder', 'Enter Team Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Department - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.department_label', 'Department')}\r\n name='department_id'\r\n placeholder={t('hrms.organization_structure.teamModal.department_placeholder', 'Select Department')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='department'\r\n required={false}\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Team Lead - Required */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.team_lead_label', 'Team Lead')}\r\n name='team_lead_id'\r\n placeholder={t('hrms.organization_structure.teamModal.team_lead_placeholder', 'Select Team Lead')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='employees'\r\n required\r\n options={[]}\r\n customeFilter={leadFilter}\r\n />\r\n </Grid>\r\n\r\n {/* Members - Optional, multi-select */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.teamModal.members_label', 'Members')}\r\n name='member_ids'\r\n placeholder={t('hrms.organization_structure.teamModal.members_placeholder', 'Select Members')}\r\n fieldArrayName='team'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n is_multiselect\r\n customeFilter={membersFilter}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.teamModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='team'\r\n placeholder={t('hrms.organization_structure.teamModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='submit'>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, DynamicToggleButton, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n department: {\r\n company_id: string | null;\r\n department_code: string;\r\n name: string;\r\n parent_department_id: string | null;\r\n department_head_id: string | null;\r\n cost_code: string;\r\n status: boolean;\r\n description: string;\r\n };\r\n}\r\n\r\nconst departmentValidationSchema = Yup.object().shape({\r\n department: Yup.object().shape({\r\n company_id: Yup.string().nullable().required('Company is required'),\r\n department_code: Yup.string().required('Department Code is required'),\r\n name: Yup.string().required('Department Name is required'),\r\n parent_department_id: Yup.string().nullable(),\r\n department_head_id: Yup.string().nullable(),\r\n cost_code: Yup.string(),\r\n status: Yup.boolean(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nexport const DepartmentAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger, watch } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(departmentValidationSchema),\r\n defaultValues: {\r\n department: {\r\n company_id: null,\r\n department_code: '',\r\n name: '',\r\n parent_department_id: null,\r\n department_head_id: null,\r\n cost_code: '',\r\n status: true,\r\n description: '',\r\n }\r\n }\r\n });\r\n\r\n const rootCompanyId = watch('department.company_id');\r\n\r\n const handleModalClose = () => {\r\n reset({\r\n department: {\r\n company_id: null,\r\n department_code: '',\r\n name: '',\r\n parent_department_id: null,\r\n department_head_id: null,\r\n cost_code: '',\r\n status: true,\r\n description: '',\r\n }\r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.departmentModal.title', 'Add Department')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Company - Required */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.company_label', 'Company')}\r\n name='company_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.company_placeholder', 'Select Company')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='company'\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Department Code - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.code_label', 'Department Code')}\r\n name='department_code'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.code_placeholder', 'Enter Department Code')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Department Name - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.name_label', 'Department Name')}\r\n name='name'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.name_placeholder', 'Enter Department Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Parent Department - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.parent_department_label', 'Parent Department')}\r\n name='parent_department_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.parent_department_placeholder', 'Select Parent Department')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='department'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n 'is_parent.eq': true,\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Department Head - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.departmentModal.department_head_label', 'Department Head')}\r\n name='department_head_id'\r\n placeholder={t('hrms.organization_structure.departmentModal.department_head_placeholder', 'Select Department Head')}\r\n fieldArrayName='department'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Cost Code - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.cost_code_label', 'Cost Code')}\r\n name='cost_code'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.cost_code_placeholder', 'Enter Cost Code')}\r\n />\r\n </Grid>\r\n\r\n {/* Status Toggle */}\r\n <Grid item sm={6}>\r\n <DynamicToggleButton\r\n formControl={control as any}\r\n name='status'\r\n fieldArrayName='department'\r\n label={t('hrms.organization_structure.departmentModal.status_label', 'Status')}\r\n title={t('common.active', 'Active')}\r\n titlePosition='end'\r\n position={3}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.departmentModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='department'\r\n placeholder={t('hrms.organization_structure.departmentModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useState } from 'react';\n\nimport Modal from '../../../../modal/modal';\nimport Typography from '../../../../typography/typography';\nimport DynamicInput from '../text';\nimport Button from '../../../../button/button';\nimport ModalLoader from '../../../../loaders/modal-loader';\nimport Toast from '../../../../toast/toast';\nimport { useTranslation } from 'react-i18next';\n\nimport {\n Box,\n DialogActions,\n DialogContent,\n DialogProps,\n DialogTitle,\n Grid,\n IconButton\n} from '@mui/material';\nimport Close from '@mui/icons-material/Close';\n\nimport { useForm } from 'react-hook-form';\nimport * as Yup from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\n\nimport './location-add-modal.scss';\nimport DynamicSearchSelect from '../dynamic-select';\ninterface BrandAddModalProps {\n isOpen: boolean;\n setIsOpen: () => void;\n modalProps?: DialogProps;\n onSave: (data: string) => void;\n isLoading?: boolean;\n}\n\ninterface IFormValues {\n location_data: {\n name: string;\n };\n}\n\ninterface IToast {\n type: 'normal' | 'alert';\n message: string;\n}\n\nconst validationSchema = Yup.object().shape({\n location_data: Yup.object().shape({\n name: Yup.string().required('Name is required')\n })\n});\n\nconst LocationAddModal: React.FC<BrandAddModalProps> = ({\n isOpen,\n setIsOpen,\n modalProps,\n onSave,\n isLoading\n}) => {\n const { t } = useTranslation();\n const [toast, setToast] = useState<IToast | null>(null);\n const { control, handleSubmit, reset } = useForm<any>({\n mode: 'all',\n resolver: yupResolver(validationSchema)\n });\n const handleModalClose = () => {\n reset({ location_data: undefined });\n setIsOpen();\n };\n\n const onSubmit = async (values: IFormValues) => {\n // handleModalClose();\n onSave(values?.location_data)\n };\n\n return (\n <Modal\n open={isOpen}\n onClose={handleModalClose}\n maxWidth='sm'\n fullWidth\n {...modalProps}>\n <>\n \n <form onSubmit={handleSubmit(onSubmit)}>\n {isLoading && (\n <ModalLoader />\n )}\n <DialogTitle className='brandAddModal--DialogTitle'>\n <Typography type='s3' color='inherit' weight='medium'>\n {t(\"inventory.item.locationModal.title\")}\n </Typography>\n <IconButton onClick={handleModalClose}>\n <Close fontSize='small' />\n </IconButton>\n </DialogTitle>\n <DialogContent className='brandAddModal--DialogContents'>\n \n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\n <Grid item sm={6}>\n <DynamicInput\n type='text'\n formControl={control}\n label={t(\"inventory.item.locationModal.location_name_label\")}\n name='name'\n fieldArrayName='location_data'\n placeholder={t(\"inventory.item.locationModal.location_name_placeholder\")}\n required\n />\n </Grid>\n <Grid item sm={6}>\n <DynamicInput\n type='text'\n formControl={control}\n label={t(\"inventory.item.locationModal.location_code_label\")}\n name='short_name'\n fieldArrayName='location_data'\n placeholder={t(\"inventory.item.locationModal.location_code_placeholder\")}\n required\n />\n </Grid>\n <Grid item sm={6}>\n <DynamicSearchSelect\n label={t(\n \"accounting.authorize_commission.fields.company_label\"\n )}\n name=\"company_id\"\n placeholder={t(\n \"accounting.authorize_commission.fields.company_placeholder\"\n )}\n fieldArrayName='location_data'\n formControl={control}\n apiType='company'\n getSelectedData={(data: any) =>\n // setSelectedData(name, data)\n console.log(\"data\", data)\n }\n required={true}\n />\n </Grid>\n </Grid>\n \n </DialogContent>\n <DialogActions className='brandAddModal--DialogAction'>\n <span></span>\n <Box display='flex' gap={1.5}>\n <Button\n className='brandAddModal--DialogAction--WhiteBtn'\n onClick={handleModalClose}>\n {t(\"common.cancel\")}\n </Button>\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\n </Box>\n </DialogActions>\n </form>\n </>\n <Toast\n open={Boolean(toast)}\n type={toast?.type}\n message={toast?.message}\n handleClose={() => setToast(null)}\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\n />\n </Modal>\n );\n};\n\nexport default LocationAddModal;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, DynamicSearchSelect, DynamicToggleButton, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n designation: {\r\n company_id: string | null;\r\n designation_code: string;\r\n name: string;\r\n reports_to: string | null;\r\n level: string;\r\n status: boolean;\r\n description: string;\r\n };\r\n}\r\n\r\nconst designationValidationSchema = Yup.object().shape({\r\n designation: Yup.object().shape({\r\n company_id: Yup.string().nullable().required('Company is required'),\r\n designation_code: Yup.string(),\r\n name: Yup.string().required('Designation Name is required'),\r\n reports_to: Yup.string().nullable(),\r\n level: Yup.number().nullable().typeError('Level must be a number'),\r\n status: Yup.boolean(),\r\n description: Yup.string(),\r\n })\r\n});\r\n\r\nexport const DesignationAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger, watch } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(designationValidationSchema),\r\n defaultValues: {\r\n designation: {\r\n company_id: null,\r\n designation_code: '',\r\n name: '',\r\n reports_to: null,\r\n level: null,\r\n status: true,\r\n description: '',\r\n }\r\n }\r\n });\r\n\r\n const rootCompanyId = watch('designation.company_id');\r\n\r\n const handleModalClose = () => {\r\n reset({\r\n designation: {\r\n company_id: null,\r\n designation_code: '',\r\n name: '',\r\n reports_to: null,\r\n level: null,\r\n status: true,\r\n description: '',\r\n }\r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t('hrms.organization_structure.designationModal.title', 'Add Designation')}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Company - Required */}\r\n <Grid item sm={12}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.designationModal.company_label', 'Company')}\r\n name='company_id'\r\n placeholder={t('hrms.organization_structure.designationModal.company_placeholder', 'Select Company')}\r\n fieldArrayName='designation'\r\n formControl={control as any}\r\n apiType='company'\r\n required\r\n options={[]}\r\n />\r\n </Grid>\r\n\r\n {/* Designation Code */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.code_label', 'Designation Code')}\r\n name='designation_code'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.code_placeholder', 'Enter Designation Code')}\r\n />\r\n </Grid>\r\n\r\n {/* Designation Name - Required */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.name_label', 'Designation Name')}\r\n name='name'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.name_placeholder', 'Enter Designation Name')}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* Reports To - Optional (employees) */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t('hrms.organization_structure.designationModal.reports_to_label', 'Reports To')}\r\n name='reports_to'\r\n placeholder={t('hrms.organization_structure.designationModal.reports_to_placeholder', 'Select Reports To')}\r\n fieldArrayName='designation'\r\n formControl={control as any}\r\n apiType='employees'\r\n required={false}\r\n options={[]}\r\n customeFilter={{\r\n '&company_id.eq': rootCompanyId || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Level - Optional */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='number'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.level_label', 'Level')}\r\n name='level'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.level_placeholder', 'Enter Level')}\r\n />\r\n </Grid>\r\n\r\n {/* Status Toggle */}\r\n <Grid item sm={6}>\r\n <DynamicToggleButton\r\n formControl={control as any}\r\n name='status'\r\n fieldArrayName='designation'\r\n label={t('hrms.organization_structure.designationModal.status_label', 'Status')}\r\n title={t('common.active', 'Active')}\r\n titlePosition='end'\r\n position={3}\r\n />\r\n </Grid>\r\n\r\n {/* Description - Optional, full width */}\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='textarea'\r\n formControl={control}\r\n label={t('hrms.organization_structure.designationModal.description_label', 'Description')}\r\n name='description'\r\n fieldArrayName='designation'\r\n placeholder={t('hrms.organization_structure.designationModal.description_placeholder', 'Enter Description')}\r\n is_multiline\r\n rows={3}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t('common.cancel')}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t('common.save')}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { useState, useEffect, useCallback } from 'react';\r\n\r\nimport Modal from '../../../../modal/modal';\r\nimport Typography from '../../../../typography/typography';\r\nimport DynamicInput from '../text';\r\nimport Button from '../../../../button/button';\r\nimport ModalLoader from '../../../../loaders/modal-loader';\r\nimport Toast from '../../../../toast/toast';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\n\r\nimport { FormProvider, useForm, useWatch } from 'react-hook-form';\r\nimport * as Yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\n\r\nimport DynamicSearchSelect from '../dynamic-select';\r\nimport DynamicSelect from '../select';\r\nimport { IModalComponentProps } from '../../index';\r\nimport { fetchOptions, skuGenerator } from '../../../../../utils/common';\r\n\r\nimport './fixed-asset-item-add-modal.scss';\r\n\r\ninterface IFormValues {\r\n inventory_fixed_asset_item: {\r\n name: string;\r\n sku: string;\r\n category: number | null;\r\n base_unit: number | null;\r\n company: number[];\r\n unit_of_measurement: number | null;\r\n stock_unit: number | null;\r\n purchase_unit: number | null;\r\n sales_unit: number | null;\r\n costing_method: string;\r\n depreciation_method: string;\r\n computation_method: string;\r\n default_tax_id: number | null;\r\n income_account_id: number | null;\r\n asset_account_id: number | null;\r\n cogs_account_id: number | null;\r\n fixed_asset_account_id: number | null;\r\n depreciation_account_id: number | null;\r\n declining_factor: number | null;\r\n };\r\n}\r\n\r\ninterface IToast {\r\n type: 'normal' | 'alert';\r\n message: string;\r\n}\r\n\r\nconst COSTING_METHODS = [\r\n { label: 'FIFO', value: 'FIFO' },\r\n { label: 'LIFO', value: 'LIFO' },\r\n { label: 'Weighted Average Cost', value: 'Weighted Average Cost' }\r\n];\r\n\r\nconst DEPRECIATION_METHODS = [\r\n { label: 'Straight line', value: 'Straight line' },\r\n { label: 'Declining', value: 'Declining' }\r\n];\r\n\r\nconst COMPUTATION_METHODS = [\r\n { label: 'Constant periods', value: 'Constant periods' },\r\n { label: 'Based on days per period', value: 'Based on days per period' }\r\n];\r\n\r\nconst validationSchema = Yup.object().shape({\r\n inventory_fixed_asset_item: Yup.object().shape({\r\n name: Yup.string().required('Name is required'),\r\n sku: Yup.string().required('SKU is required'),\r\n category: Yup.mixed().required('Category is required'),\r\n base_unit: Yup.mixed().required('Base Unit is required'),\r\n company: Yup.array().min(1, 'At least one company is required').required('Company is required'),\r\n unit_of_measurement: Yup.mixed().required('Unit of Measurement is required'),\r\n stock_unit: Yup.mixed().nullable(),\r\n purchase_unit: Yup.mixed().nullable(),\r\n sales_unit: Yup.mixed().nullable(),\r\n costing_method: Yup.string().required('Costing Method is required'),\r\n depreciation_method: Yup.string().required('Depreciation Method is required'),\r\n computation_method: Yup.string().required('Computation Method is required'),\r\n default_tax_id: Yup.mixed().required('Default Tax is required'),\r\n income_account_id: Yup.mixed().required('Income Account is required'),\r\n asset_account_id: Yup.mixed().required('Asset Account is required'),\r\n cogs_account_id: Yup.mixed().required('COGS Account is required'),\r\n fixed_asset_account_id: Yup.mixed().required('Fixed Asset Account is required'),\r\n depreciation_account_id: Yup.mixed().required('Depreciation Account is required'),\r\n declining_factor: Yup.number()\r\n .nullable()\r\n .when('depreciation_method', {\r\n is: 'Declining',\r\n then: (schema) => schema.required('Declining Factor is required').min(0, 'Must be positive'),\r\n otherwise: (schema) => schema.nullable(),\r\n }),\r\n })\r\n});\r\n\r\nconst FixedAssetItemAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n modalProps,\r\n onSave,\r\n isLoading\r\n}) => {\r\n const { t } = useTranslation();\r\n const [toast, setToast] = useState<IToast | null>(null);\r\n const [selectedCategoryData, setSelectedCategoryData] = useState<any>(null);\r\n const unitFields = ['stock_unit', 'purchase_unit', 'sales_unit', 'consumption_unit', 'base_unit'];\r\n const defaultValues = {\r\n inventory_fixed_asset_item: {\r\n name: '',\r\n sku: '',\r\n category: null,\r\n base_unit: null,\r\n company: [],\r\n unit_of_measurement: null,\r\n stock_unit: null,\r\n purchase_unit: null,\r\n sales_unit: null,\r\n costing_method: '',\r\n depreciation_method: '',\r\n computation_method: '',\r\n default_tax_id: null,\r\n income_account_id: null,\r\n asset_account_id: null,\r\n cogs_account_id: null,\r\n fixed_asset_account_id: null,\r\n depreciation_account_id: null,\r\n declining_factor: null,\r\n status: 1\r\n }\r\n }\r\n\r\n const methods = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(validationSchema),\r\n defaultValues: defaultValues,\r\n });\r\n const { control, handleSubmit, reset, setValue, trigger } = methods || {};\r\n\r\n // Watch name and category for auto-generating SKU\r\n const [watchedName, watchedCategory, watchedUom, watchedDepreciationMethod] = useWatch({\r\n control, name:\r\n ['inventory_fixed_asset_item.name',\r\n 'inventory_fixed_asset_item.category',\r\n 'inventory_fixed_asset_item.unit_of_measurement',\r\n 'inventory_fixed_asset_item.depreciation_method']\r\n });\r\n\r\n\r\n // Auto-generate SKU when name or category changes\r\n useEffect(() => {\r\n if (watchedName && selectedCategoryData?.category_name) {\r\n const generatedSku = skuGenerator({\r\n name: watchedName,\r\n category: selectedCategoryData.category_name\r\n });\r\n setValue('inventory_fixed_asset_item.sku', generatedSku);\r\n }\r\n }, [watchedName, selectedCategoryData, setValue]);\r\n\r\n const handleModalClose = () => {\r\n reset(defaultValues);\r\n setSelectedCategoryData(null);\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave({\r\n ...values.inventory_fixed_asset_item as any,\r\n type: 'inventory-fixed-asset',\r\n status: 1\r\n });\r\n handleModalClose();\r\n };\r\n\r\n const handleCategorySelect = useCallback((data: any) => {\r\n setSelectedCategoryData(data);\r\n }, []);\r\n\r\n const updateUomFields = useCallback(async () => {\r\n if (!watchedUom) return\r\n const filter = {\r\n '&template_id.eq': watchedUom,\r\n '&is_base_unit.eq': 1\r\n }\r\n const uomData = await fetchOptions('uom', filter, [], false)\r\n unitFields.forEach((item) => {\r\n setValue(`inventory_fixed_asset_item.${item}`, uomData?.id)\r\n })\r\n }, [watchedUom])\r\n useEffect(() => {\r\n updateUomFields()\r\n }, [updateUomFields])\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='md'\r\n fullWidth\r\n {...modalProps}>\r\n <>\r\n <FormProvider {...methods}>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && (\r\n <ModalLoader />\r\n )}\r\n <DialogTitle className='fixedAssetItemAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.fixed_asset_items.modal.title\", \"Add Fixed Asset Item\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='fixedAssetItemAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n {/* Name */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.name_label\", \"Name\")}\r\n name='name'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.name_placeholder\", \"Enter Name\")}\r\n required\r\n />\r\n </Grid>\r\n\r\n {/* SKU - Auto-generated */}\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.sku_label\", \"SKU\")}\r\n name='sku'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sku_placeholder\", \"Auto-generated\")}\r\n required\r\n disabled\r\n />\r\n </Grid>\r\n\r\n {/* Category */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.category_label\", \"Category\")}\r\n name=\"category\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.category_placeholder\", \"Select Category\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='categoryItems'\r\n options={[]}\r\n required={true}\r\n getSelectedData={handleCategorySelect}\r\n />\r\n </Grid>\r\n\r\n\r\n {/* Company */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.company_label\", \"Company\")}\r\n name=\"company\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.company_placeholder\", \"Select Company\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='company'\r\n options={[]}\r\n is_multiselect={true}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Costing Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.costing_method_label\", \"Costing Method\")}\r\n name=\"costing_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.costing_method_placeholder\", \"Select Costing Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={COSTING_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Unit of Measurement Section Header */}\r\n <Grid item xs={12} pt={2}>\r\n <Typography type='s3' weight='medium' color='theme.neutral.900'>\r\n {t(\"inventory.fixed_asset_items.modal.uom_section\", \"Unit of Measurement\")}\r\n </Typography>\r\n </Grid>\r\n\r\n {/* UOM Template */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.unit_of_measurement_label\", \"UOM Template\")}\r\n name=\"unit_of_measurement\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.unit_of_measurement_placeholder\", \"Select UOM Template\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom_templates'\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Stock Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.stock_unit_label\", \"Stock Unit\")}\r\n name=\"stock_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.stock_unit_placeholder\", \"Select Stock Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Purchase Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.purchase_unit_label\", \"Purchase Unit\")}\r\n name=\"purchase_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.purchase_unit_placeholder\", \"Select Purchase Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Sales Unit */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.sales_unit_label\", \"Consumption Unit\")}\r\n name=\"sales_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sales_unit_placeholder\", \"Select Sales Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.sales_unit_label\", \"Consumption Unit\")}\r\n name=\"consumption_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.sales_unit_placeholder\", \"Select Sales Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0\r\n }}\r\n />\r\n </Grid>\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.base_unit_label\", \"Base Unit\")}\r\n name=\"base_unit\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.base_unit_placeholder\", \"Select Base Unit\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n disabled\r\n apiType='uom'\r\n customFilter={{\r\n '&template_id.eq': watchedUom || 0,\r\n '&is_base_unit.eq': 1\r\n }}\r\n />\r\n </Grid>\r\n\r\n {/* Depreciation Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.depreciation_method_label\", \"Depreciation Method\")}\r\n name=\"depreciation_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.depreciation_method_placeholder\", \"Select Depreciation Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={DEPRECIATION_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Declining Factor */}\r\n {watchedDepreciationMethod === 'Declining' && (\r\n <Grid item sm={6}>\r\n <DynamicInput\r\n type='number'\r\n formControl={control}\r\n label={t(\"inventory.fixed_asset_items.modal.declining_factor_label\", \"Declining Factor\")}\r\n name='declining_factor'\r\n fieldArrayName='inventory_fixed_asset_item'\r\n placeholder={t(\"inventory.fixed_asset_items.modal.declining_factor_placeholder\", \"Enter Declining Factor\")}\r\n required\r\n />\r\n </Grid>\r\n )}\r\n\r\n {/* Computation Method */}\r\n <Grid item sm={6}>\r\n <DynamicSelect\r\n label={t(\"inventory.fixed_asset_items.modal.computation_method_label\", \"Computation Method\")}\r\n name=\"computation_method\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.computation_method_placeholder\", \"Select Computation Method\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n options={COMPUTATION_METHODS}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Accounting Section Header */}\r\n <Grid item xs={12} pt={2}>\r\n <Typography type='s3' weight='medium' color='theme.neutral.900'>\r\n {t(\"inventory.fixed_asset_items.modal.accounting_section\", \"Accounting\")}\r\n </Typography>\r\n </Grid>\r\n\r\n {/* Default Tax */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.default_tax_label\", \"Default Tax\")}\r\n name=\"default_tax_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.default_tax_placeholder\", \"Select Default Tax\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='taxTemplate'\r\n options={[]}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Income Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.income_account_label\", \"Income Account\")}\r\n name=\"income_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.income_account_placeholder\", \"Select Income Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.in': ['Income', 'Assets'] }}\r\n />\r\n </Grid>\r\n\r\n {/* Asset Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.asset_account_label\", \"Asset Account\")}\r\n name=\"asset_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.asset_account_placeholder\", \"Select Asset Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n\r\n {/* COGS Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.cogs_account_label\", \"COGS Account\")}\r\n name=\"cogs_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.cogs_account_placeholder\", \"Select COGS Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n />\r\n </Grid>\r\n\r\n {/* Fixed Asset Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.fixed_asset_account_label\", \"Fixed Asset Account\")}\r\n name=\"fixed_asset_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.fixed_asset_account_placeholder\", \"Select Fixed Asset Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n\r\n {/* Depreciation Account */}\r\n <Grid item sm={6}>\r\n <DynamicSearchSelect\r\n label={t(\"inventory.fixed_asset_items.modal.depreciation_account_label\", \"Depreciation Account\")}\r\n name=\"depreciation_account_id\"\r\n placeholder={t(\"inventory.fixed_asset_items.modal.depreciation_account_placeholder\", \"Select Depreciation Account\")}\r\n fieldArrayName='inventory_fixed_asset_item'\r\n formControl={control}\r\n apiType='accounts'\r\n options={[]}\r\n required={true}\r\n customeFilter={{ '&account_parent_type.eq': 'Assets' }}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='fixedAssetItemAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='fixedAssetItemAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}>\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type=\"button\" onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </FormProvider>\r\n </>\r\n <Toast\r\n open={Boolean(toast)}\r\n type={toast?.type}\r\n message={toast?.message}\r\n handleClose={() => setToast(null)}\r\n anchorOrigin={{ horizontal: 'right', vertical: 'bottom' }}\r\n />\r\n </Modal>\r\n );\r\n};\r\n\r\nexport default FixedAssetItemAddModal;\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n brand_data: {\r\n name: string;\r\n };\r\n}\r\n\r\nconst brandValidationSchema = Yup.object().shape({\r\n brand_data: Yup.object().shape({\r\n name: Yup.string().required('Name is required')\r\n })\r\n});\r\n\r\nexport const BrandAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(brandValidationSchema),\r\n defaultValues: {\r\n brand_data: {\r\n name: '',\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ brand_data: { name: '' } });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values?.brand_data as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='brandAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.item.brandModal.title\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='brandAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.brandModal.brand_name_label\")}\r\n name='name'\r\n fieldArrayName='brand_data'\r\n placeholder={t(\"inventory.item.brandModal.brand_name_placeholder\")}\r\n required\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='brandAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='brandAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IFormValues {\r\n category_data: {\r\n category_name: string;\r\n };\r\n}\r\n\r\nconst categoryValidationSchema = Yup.object().shape({\r\n category_data: Yup.object().shape({\r\n category_name: Yup.string().required('Category Name is required'),\r\n })\r\n});\r\n\r\nexport const CategoryAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(categoryValidationSchema),\r\n defaultValues: {\r\n category_data: {\r\n category_name: '',\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ category_data: { category_name: '' } });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave({\r\n category_data: {\r\n category_name: values.category_data.category_name,\r\n sku_prefix : values.category_data.sku_prefix,\r\n unique_items : values.category_data.unique_items,\r\n status: true,\r\n },\r\n attribute_data: [],\r\n } as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='categoryAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"inventory.item.categoryModal.title\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='categoryAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.category_name_label\")}\r\n name='category_name'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.category_name_placeholder\")}\r\n required\r\n />\r\n </Grid> \r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.sku_prefix_label\")}\r\n name='sku_prefix'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.sku_prefix_placeholder\")}\r\n />\r\n </Grid> \r\n\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"inventory.item.categoryModal.unique_items_label\")}\r\n name='unique_items'\r\n fieldArrayName='category_data'\r\n placeholder={t(\"inventory.item.categoryModal.unique_items_placeholder\")}\r\n />\r\n </Grid> \r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='categoryAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='categoryAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>{t(\"common.save\")}</Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React, { useState } from 'react';\r\nimport {\r\n\tBox,\r\n\tDialogActions,\r\n\tDialogContent,\r\n\tDialogTitle,\r\n\tGrid,\r\n\tIconButton,\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Button from '../button/button';\r\nimport { DynamicInput } from '../form-control';\r\nimport Modal from '../modal/modal';\r\nimport ModalLoader from '../loaders/modal-loader';\r\nimport Typography from '../typography/typography';\r\n\r\ninterface SourceTypeAddModalProps {\r\n\tisOpen: boolean;\r\n\tsetIsOpen: (isOpen?: boolean) => void;\r\n\tisLoading?: boolean;\r\n\tonSave: (data: any) => Promise<void> | void;\r\n\tmodalProps?: any;\r\n}\r\n\r\ninterface SourceTypeFormValues {\r\n\tsource_type: {\r\n\t\tname: string;\r\n\t\tdescription: string;\r\n\t};\r\n}\r\n\r\nconst validationSchema = Yup.object().shape({\r\n\tsource_type: Yup.object().shape({\r\n\t\tname: Yup.string()\r\n\t\t\t.trim()\r\n\t\t\t.required('common.source_type.source_type_name_required')\r\n\t\t\t.max(255, 'common.source_type.source_type_name_max'),\r\n\t\tdescription: Yup.string()\r\n\t\t\t.nullable()\r\n\t\t\t.max(1000, 'common.source_type.description_max'),\r\n\t}),\r\n});\r\n\r\nconst defaultValues: SourceTypeFormValues = {\r\n\tsource_type: {\r\n\t\tname: '',\r\n\t\tdescription: '',\r\n\t},\r\n};\r\n\r\nconst SourceTypeAddModal: React.FC<SourceTypeAddModalProps> = ({\r\n\tisOpen,\r\n\tsetIsOpen,\r\n\tisLoading = false,\r\n\tonSave,\r\n\tmodalProps,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\tconst [isSubmitting, setIsSubmitting] = useState(false);\r\n\r\n\tconst { control, handleSubmit, reset } = useForm<SourceTypeFormValues>({\r\n\t\tmode: 'all',\r\n\t\tresolver: yupResolver(validationSchema),\r\n\t\tdefaultValues,\r\n\t});\r\n\r\n\tconst handleClose = () => {\r\n\t\treset(defaultValues);\r\n\t\tsetIsOpen(false);\r\n\t};\r\n\r\n\tconst onSubmit = async (values: SourceTypeFormValues) => {\r\n\t\tsetIsSubmitting(true);\r\n\t\ttry {\r\n\t\t\tawait onSave({\r\n\t\t\t\t...values.source_type,\r\n\t\t\t\tdescription: values.source_type.description?.trim() || null,\r\n\t\t\t});\r\n\t\t\thandleClose();\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(t('common.source_type.error_creating_source_type'), error);\r\n\t\t} finally {\r\n\t\t\tsetIsSubmitting(false);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleSubmitForm = (e: React.FormEvent<HTMLFormElement>) => {\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t\thandleSubmit(onSubmit)(e);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<Modal\r\n\t\t\topen={isOpen}\r\n\t\t\tonClose={handleClose}\r\n\t\t\tmaxWidth={modalProps?.maxWidth || 'sm'}\r\n\t\t\tfullWidth={modalProps?.fullWidth ?? true}\r\n\t\t\t{...modalProps}\r\n\t\t>\r\n\t\t\t<form onSubmit={handleSubmitForm}>\r\n\t\t\t\t{(isSubmitting || isLoading) && <ModalLoader />}\r\n\t\t\t\t<DialogTitle className=\"brandAddModal--DialogTitle\">\r\n\t\t\t\t\t<Typography type=\"s3\" color=\"inherit\" weight=\"medium\">\r\n\t\t\t\t\t\t{t('common.source_type.create_new_source_type')}\r\n\t\t\t\t\t</Typography>\r\n\t\t\t\t\t<IconButton onClick={(e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\thandleClose();\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Close fontSize=\"small\" />\r\n\t\t\t\t\t</IconButton>\r\n\t\t\t\t</DialogTitle>\r\n\t\t\t\t<DialogContent dividers>\r\n\t\t\t\t\t<Grid container spacing={2}>\r\n\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\tlabel={t('common.source_type.source_type_name')}\r\n\t\t\t\t\t\t\t\tname=\"name\"\r\n\t\t\t\t\t\t\t\tfieldArrayName=\"source_type\"\r\n\t\t\t\t\t\t\t\tplaceholder={t('common.source_type.enter_source_type_name')}\r\n\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\tlabel={t('common.source_type.description')}\r\n\t\t\t\t\t\t\t\tname=\"description\"\r\n\t\t\t\t\t\t\t\tfieldArrayName=\"source_type\"\r\n\t\t\t\t\t\t\t\tplaceholder={t('common.source_type.enter_description_optional')}\r\n\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\tis_multiline\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t</Grid>\r\n\t\t\t\t</DialogContent>\r\n\t\t\t\t<DialogActions>\r\n\t\t\t\t\t<Box display=\"flex\" gap={1.5} width=\"100%\" justifyContent=\"flex-end\">\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\t\tonClick={(e) => {\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t\thandleClose();\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tdisabled={isSubmitting || isLoading}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.cancel')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant=\"contained\"\r\n\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\tonClick={(e) => e.stopPropagation()}\r\n\t\t\t\t\t\t\tloading={isSubmitting || isLoading}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.source_type.create_source_type')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</DialogActions>\r\n\t\t\t</form>\r\n\t\t</Modal>\r\n\t);\r\n};\r\n\r\nexport { SourceTypeAddModal };\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\nimport DynamicCheckBox from './form-control/form-builder/form-builder-element/checkbox';\r\n\r\ninterface IFormValues {\r\n journal_type_data: {\r\n name: string;\r\n is_payment: boolean;\r\n };\r\n}\r\n\r\nconst journalTypeValidationSchema = Yup.object().shape({\r\n journal_type_data: Yup.object().shape({\r\n name: Yup.string()\r\n .required('Name is required')\r\n .max(100, 'Name must be at most 100 characters'),\r\n is_payment: Yup.boolean()\r\n })\r\n});\r\n\r\nexport const JournalTypeAddModal: React.FC<IModalComponentProps> = ({\r\n isOpen,\r\n setIsOpen,\r\n onSave,\r\n isLoading,\r\n modalProps,\r\n}) => {\r\n const { t } = useTranslation();\r\n\r\n const { control, handleSubmit, reset, trigger } = useForm<any>({\r\n mode: 'all',\r\n resolver: yupResolver(journalTypeValidationSchema),\r\n defaultValues: {\r\n journal_type_data: {\r\n name: '',\r\n is_payment: false\r\n }\r\n }\r\n });\r\n\r\n const handleModalClose = () => {\r\n reset({ \r\n journal_type_data: { \r\n name: '', \r\n is_payment: false \r\n } \r\n });\r\n setIsOpen();\r\n };\r\n\r\n const onSubmit = async (values: IFormValues) => {\r\n const isValid = await trigger();\r\n if (!isValid) return;\r\n await onSave(values?.journal_type_data as any);\r\n handleModalClose();\r\n };\r\n\r\n return (\r\n <Modal\r\n open={isOpen}\r\n onClose={handleModalClose}\r\n maxWidth='sm'\r\n fullWidth\r\n {...modalProps}\r\n >\r\n <>\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n {isLoading && <ModalLoader />}\r\n <DialogTitle className='journalTypeAddModal--DialogTitle'>\r\n <Typography type='s3' color='inherit' weight='medium'>\r\n {t(\"accounting.journalType.addModal.title\", \"Create New Journal Type\")}\r\n </Typography>\r\n <IconButton onClick={handleModalClose}>\r\n <Close fontSize='small' />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent className='journalTypeAddModal--DialogContents'>\r\n <Grid container rowGap={1.5} columnSpacing={3} pt={3}>\r\n <Grid item sm={12}>\r\n <DynamicInput\r\n type='text'\r\n formControl={control}\r\n label={t(\"accounting.journalType.form.name_label\", \"Name\")}\r\n name='name'\r\n fieldArrayName='journal_type_data'\r\n placeholder={t(\"accounting.journalType.form.name_placeholder\", \"Enter journal type name\")}\r\n required\r\n />\r\n </Grid>\r\n <Grid item sm={12}>\r\n <DynamicCheckBox\r\n formControl={control}\r\n label={t(\"accounting.journalType.form.is_payment_label\", \"Is Payment\")}\r\n name='is_payment'\r\n fieldArrayName='journal_type_data'\r\n title={t(\"accounting.journalType.form.is_payment_label\", \"Is Payment\")}\r\n />\r\n </Grid>\r\n </Grid>\r\n </DialogContent>\r\n <DialogActions className='journalTypeAddModal--DialogAction'>\r\n <span></span>\r\n <Box display='flex' gap={1.5}>\r\n <Button\r\n className='journalTypeAddModal--DialogAction--WhiteBtn'\r\n onClick={handleModalClose}\r\n >\r\n {t(\"common.cancel\", \"Cancel\")}\r\n </Button>\r\n <Button type='button' onClick={handleSubmit(onSubmit)}>\r\n {t(\"common.save\", \"Save\")}\r\n </Button>\r\n </Box>\r\n </DialogActions>\r\n </form>\r\n </>\r\n </Modal>\r\n );\r\n};\r\n","import { getErrorMessage, getToken } from '../../../../utils/common';\r\nimport { postV1WarehouseLocation, postV1InventoryFixedAssetItems, postV1CategoryItems, postV1Brand } from '../../../../api-client/api.inventory/api';\r\nimport { PostV1WarehouseLocationRequest } from '../../../../api-client/api.inventory/api-types';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { postV1Parties, postV1PartiesIndustry, postV1JournalTypes } from '../../../../api-client/api.accounting/api';\r\nimport { postV1Teams, postV1Designation, postV1Departments, postV1DepartmentsTeams } from '../../../../api-client/api.hrms/api';\r\nimport { postV1SourceTypes } from '../../../../api-client/api.sales/api';\r\nimport { CustomerVendorModal } from '@/components/parties-modal';\r\nimport { TeamAddModal } from '../../../team-add-modal';\r\nimport { DepartmentAddModal } from '@/components/department-add-modal';\r\nimport { LocationAddModal } from './location-add-modal';\r\nimport { DesignationAddModal } from '@/components/designation-add-modal';\r\nimport { FixedAssetItemAddModal } from './fixed-asset-item-add-modal';\r\nimport { DialogProps } from '@mui/material';\r\nimport { BrandAddModal } from '@/components/brand-add-modal';\r\nimport { CategoryAddModal } from '@/components/category-add-modal';\r\nimport { IndustryAddModal } from '@/components/industry-add-modal';\r\nimport { SourceTypeAddModal } from '@/components/source-type-add-modal/source-type-add-modal';\r\nimport { JournalTypeAddModal } from '@/components/journal-type-add-modal';\r\n\r\nexport const createApiThunk = async (api: (payload: any) => Promise<any>, payload: any) => {\r\n\ttry {\r\n\t\treturn await api({ ...payload, ...getToken() })\r\n\t} catch (error) {\r\n\t\tenqueueSnackbar(getErrorMessage(error?.message), { variant: 'error' });\r\n\t\tthrow error;\r\n\t}\r\n}\r\n\r\nexport interface IAddConfig {\r\n\tapi: (payload: any) => Promise<any>;\r\n\tcomponent: any;\r\n}\r\n\r\nexport interface IModalComponentProps {\r\n\tisOpen: boolean;\r\n\tsetIsOpen: () => void;\r\n\tmodalProps?: DialogProps;\r\n\tonSave: (data: string) => void;\r\n\tisLoading?: boolean;\r\n}\r\n\r\nconst addMapper: Record<string, IAddConfig> = {\r\n\tlocation: {\r\n\t\tapi: (payload: PostV1WarehouseLocationRequest) => createApiThunk(postV1WarehouseLocation, payload),\r\n\t\tcomponent: LocationAddModal,\r\n\t},\r\n\tparty: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Parties, payload),\r\n\t\tcomponent: CustomerVendorModal,\r\n\t},\r\n\tdepartment: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Departments, payload),\r\n\t\tcomponent: DepartmentAddModal,\r\n\t},\r\n\tteam: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1DepartmentsTeams, payload),\r\n\t\tcomponent: TeamAddModal,\r\n\t},\r\n\tdesignation: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Designation, payload),\r\n\t\tcomponent: DesignationAddModal,\r\n\t},\r\n\tfixedAssetItem: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1InventoryFixedAssetItems, payload),\r\n\t\tcomponent: FixedAssetItemAddModal,\r\n\t},\r\n\tbrand: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1Brand, payload),\r\n\t\tcomponent: BrandAddModal,\r\n\t},\r\n\tcategory: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1CategoryItems, payload),\r\n\t\tcomponent: CategoryAddModal,\r\n\t},\r\n\tindustry: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1PartiesIndustry, payload),\r\n\t\tcomponent: IndustryAddModal,\r\n\t},\r\n\tsourceType: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1SourceTypes, payload),\r\n\t\tcomponent: SourceTypeAddModal,\r\n\t},\r\n\tjournalType: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1JournalTypes, payload),\r\n\t\tcomponent: JournalTypeAddModal,\r\n\t},\r\n\tjournal_type: {\r\n\t\tapi: (payload: any) => createApiThunk(postV1JournalTypes, payload),\r\n\t\tcomponent: JournalTypeAddModal,\r\n\t},\r\n};\r\n\r\nexport const dynamicSelectAdd = (addType: string): IAddConfig | null => {\r\n\tconst config = addMapper[addType];\r\n\r\n\tif (!config) {\r\n\t\tconsole.warn(`No configuration found for addType: ${addType}`);\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn {\r\n\t\t...config\r\n\t};\r\n};\r\n","/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport React from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport * as Yup from 'yup';\r\nimport {\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Grid,\r\n IconButton\r\n} from '@mui/material';\r\nimport Close from '@mui/icons-material/Close';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Modal from './modal/modal';\r\nimport Typography from './typography/typography';\r\nimport Button from './button/button';\r\nimport ModalLoader from './loaders/modal-loader';\r\nimport { DynamicInput, IModalComponentProps } from './form-control';\r\n\r\ninterface IndustryFormValues {\r\n\tindustry: {\r\n\t\tname: string;\r\n\t};\r\n}\r\n\r\ninterface IndustryAddModalProps extends IModalComponentProps {\r\n\ttype?: string;\r\n}\r\n\r\nexport const IndustryAddModal: React.FC<IndustryAddModalProps> = ({\r\n\tisOpen,\r\n\tsetIsOpen,\r\n\tonSave,\r\n\tisLoading,\r\n\tmodalProps,\r\n}) => {\r\n\tconst { t } = useTranslation();\r\n\r\n\tconst validationSchema = Yup.object().shape({\r\n\t\tindustry: Yup.object().shape({\r\n\t\t\tname: Yup.string()\r\n\t\t\t\t.required('Industry name is required')\r\n\t\t\t\t.max(255, 'Industry name must be at most 255 characters'),\r\n\t\t}),\r\n\t});\r\n\r\n\tconst { control, handleSubmit, reset } = useForm<IndustryFormValues>({\r\n\t\tresolver: yupResolver(validationSchema),\r\n\t\tmode: 'all',\r\n\t\tdefaultValues: {\r\n\t\t\tindustry: {\r\n\t\t\t\tname: '',\r\n\t\t\t},\r\n\t\t},\r\n\t});\r\n\r\n\tconst handleClose = () => {\r\n\t\treset({\r\n\t\t\tindustry: {\r\n\t\t\t\tname: '',\r\n\t\t\t},\r\n\t\t});\r\n\t\tsetIsOpen(false);\r\n\t};\r\n\r\n\tconst handleFormSubmit = (event?: React.BaseSyntheticEvent) => {\r\n\t\tevent?.preventDefault();\r\n\t\tevent?.stopPropagation();\r\n\r\n\t\treturn handleSubmit(onSubmit)(event);\r\n\t};\r\n\r\n\tconst onSubmit = async (data: IndustryFormValues) => {\r\n\t\ttry {\r\n\t\t\tawait onSave(data.industry as any);\r\n\t\t\thandleClose();\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error('❌ ~ Error saving industry:', error);\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<Modal\r\n\t\t\topen={isOpen}\r\n\t\t\tonClose={handleClose}\r\n\t\t\tmaxWidth={modalProps?.maxWidth || 'sm'}\r\n\t\t\tfullWidth={modalProps?.fullWidth || true}\r\n\t\t\tclassName=\"industry-add-modal\"\r\n\t\t>\r\n\t\t\t<DialogTitle>\r\n\t\t\t\t<Typography type=\"h5\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n\t\t\t\t\t{t('crm.leads.fields.create_industry_label', 'Create New Industry')}\r\n\t\t\t\t</Typography>\r\n\t\t\t\t<IconButton onClick={handleClose}>\r\n\t\t\t\t\t<Close fontSize='small' />\r\n\t\t\t\t</IconButton>\r\n\t\t\t</DialogTitle>\r\n\r\n\t\t\t<form onSubmit={handleFormSubmit}>\r\n\t\t\t\t<DialogContent>\r\n\t\t\t\t\t{isLoading ? (\r\n\t\t\t\t\t\t<ModalLoader />\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<Grid container spacing={3}>\r\n\t\t\t\t\t\t\t<Grid item xs={12}>\r\n\t\t\t\t\t\t\t\t<DynamicInput\r\n\t\t\t\t\t\t\t\t\tlabel={t('crm.leads.fields.industry_name_label', 'Industry Name')}\r\n\t\t\t\t\t\t\t\t\tname=\"name\"\r\n\t\t\t\t\t\t\t\t\tplaceholder={t('crm.leads.fields.industry_name_placeholder', 'Enter Industry Name')}\r\n\t\t\t\t\t\t\t\t\tfieldArrayName=\"industry\"\r\n\t\t\t\t\t\t\t\t\tformControl={control}\r\n\t\t\t\t\t\t\t\t\trequired\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t\t</Grid>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</DialogContent>\r\n\r\n\t\t\t\t<DialogActions>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\tvariant=\"outlined\"\r\n\t\t\t\t\t\tonClick={handleClose}\r\n\t\t\t\t\t\tdisabled={isLoading}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{t('common.cancel', 'Cancel')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\tvariant=\"contained\"\r\n\t\t\t\t\t\tdisabled={isLoading}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{t('common.save', 'Save')}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</DialogActions>\r\n\t\t\t</form>\r\n\t\t</Modal>\r\n\t);\r\n};\r\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\r\nimport {\r\n Box,\r\n CircularProgress,\r\n Divider,\r\n IconButton,\r\n InputAdornment,\r\n MenuItem,\r\n OutlinedInput,\r\n} from \"@mui/material\";\r\nimport Select from \"./select/select\";\r\nimport Checkbox from \"./checkbox/checkbox\";\r\nimport Typography from \"./typography/typography\";\r\nimport { Close } from \"./icons\";\r\nimport { debounce, sortBy } from \"lodash\";\r\nimport { fetchApi } from \"../utils/api\";\r\nimport ChipOrPlaceholder from \"./form-control/form-builder/form-builder-element/chip-or-placeholder\";\r\nimport { Add } from \"@mui/icons-material\";\r\nimport { useLanguage } from \"../hooks/useLangauge\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { dynamicSelectAdd } from \"./form-control/form-builder/form-builder-element/select-configuration\";\r\nimport { useAuth } from \"../hooks/useAuth\";\r\n\r\ninterface IOption {\r\n id: string | number;\r\n value: string | number;\r\n label: string | React.ReactNode;\r\n disabled?: boolean;\r\n isGroup?: boolean;\r\n options?: IOption[];\r\n searchLabel?: string;\r\n}\r\n\r\ninterface IPaginationState {\r\n page: number;\r\n hasMore: boolean;\r\n isLoadingMore: boolean;\r\n total: number;\r\n}\r\n\r\ninterface IMenuItems {\r\n options: IOption[];\r\n multiple: boolean;\r\n placeholder: string;\r\n with_checkboxes: boolean;\r\n values: string | string[];\r\n field: any;\r\n disabledIds: any[];\r\n handleClear: () => void;\r\n handleChange?: (value: string | string[]) => void;\r\n hasParent?: boolean;\r\n}\r\n\r\n// Custom API fetch function type for parent components\r\ninterface CustomFetchApiParams {\r\n search?: string;\r\n filters?: any;\r\n limit: number;\r\n skip: number;\r\n select?: string;\r\n order?: string;\r\n}\r\n\r\ninterface CustomFetchApiResponse {\r\n data: IOption[];\r\n pagination?: {\r\n totalCount: number;\r\n };\r\n}\r\n\r\ninterface SearchableSelectProps {\r\n labelId: string;\r\n label: string;\r\n value: any;\r\n onChange?: (event: any, selectedData?: any) => void;\r\n options: IOption[];\r\n multiple?: boolean;\r\n placeholder?: string;\r\n size?: \"small\" | \"medium\";\r\n searchPlaceholder?: string;\r\n CustomDropDownIcon: React.ReactNode;\r\n customStyle: any;\r\n name?: string;\r\n defaultValue?: any;\r\n apiType?: string;\r\n isInternal?: boolean;\r\n autoFocus?: any;\r\n error?: any;\r\n disabled: any;\r\n customeFilter?: string;\r\n attributes?: string;\r\n getSelectedData?: (row: any) => void;\r\n disabledIds: any[];\r\n labelKey?: string;\r\n valueKey?: string;\r\n inputStyle?: any;\r\n onChipRemove?: (value: string) => void;\r\n selectedLabel?: string;\r\n is_loading?: boolean;\r\n hasParent?: boolean;\r\n sortOrder?: string;\r\n handleChange?: (value: string | string[]) => void;\r\n enable_footer?: boolean;\r\n onFooterClick?: () => void;\r\n showCancelButton?: boolean;\r\n /** Custom API function to fetch options from parent component */\r\n customFetchApi?: (params: CustomFetchApiParams) => Promise<CustomFetchApiResponse>;\r\n addType?: string;\r\n isMergeOptions?: boolean;\r\n attributes?: string[];\r\n modalComponentProps?: any;\r\n}\r\n\r\nconst generateMenuItems = ({\r\n options,\r\n multiple,\r\n placeholder,\r\n with_checkboxes,\r\n values,\r\n field,\r\n disabledIds,\r\n handleClear,\r\n handleChange,\r\n hasParent = false,\r\n}: IMenuItems) => {\r\n const itemDisabled = (ls: any) => disabledIds?.includes(ls);\r\n const items: React.ReactElement[] = [];\r\n\r\n if (!multiple) {\r\n items.push(\r\n <MenuItem disabled value='' key=\"placeholder\" sx={{ opacity: `0 !important`, height: `0 !important`, p: `0 !important`, m: `0 !important` }}>\r\n <Typography type='s3' color='theme.secondary.1000'>\r\n <em>{placeholder}</em>\r\n </Typography>\r\n </MenuItem>\r\n );\r\n }\r\n\r\n const selectedValues = Array.isArray(values) ? values?.filter((value) => value) : [];\r\n\r\n // Parent selection handlers\r\n const handleParentChange = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n\r\n const isParentSelected = valueArray.includes(parentValue);\r\n const updatedValues = isParentSelected\r\n ? valueArray.filter((value) => value !== parentValue && !childValues.includes(value))\r\n : [...new Set([...valueArray, parentValue, ...childValues])];\r\n\r\n handleChange?.(updatedValues);\r\n };\r\n\r\n const isAllOptionsSelected = (parentValue: string, childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.every((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n const isSomeOptionsSelected = (childOptions: IOption[]) => {\r\n const childValues = childOptions.map((child) => child.value);\r\n const valueArray = Array.isArray(selectedValues) ? selectedValues : [selectedValues];\r\n return childValues.some((childValue) => valueArray.includes(childValue));\r\n };\r\n\r\n Array.isArray(options) && options?.length > 0 && options?.forEach((option, index) => {\r\n items.push(\r\n <MenuItem\r\n value={option?.value}\r\n key={`${option?.value}-${index}`}\r\n disabled={Boolean(option?.disabled) || itemDisabled(option?.value) || (hasParent && !multiple)}\r\n className={option?.isGroup ? 'select--MenuItemHeader' : ''}\r\n onClick={() => {\r\n if (values?.length == 1) {\r\n handleClear();\r\n }\r\n }}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={\r\n hasParent\r\n ? isAllOptionsSelected(option.value, option.options || [])\r\n : Boolean(Array.isArray(values) && values?.indexOf(option?.value) > -1)\r\n }\r\n indeterminate={\r\n hasParent && isSomeOptionsSelected(option.options || [])\r\n }\r\n onChange={() =>\r\n hasParent\r\n ? handleParentChange(option.value, option.options || [])\r\n : handleChange?.(option.value)\r\n }\r\n />\r\n )}\r\n <Typography\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(option.value)}\r\n >\r\n {option?.label}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n\r\n // Handle child options for grouped items\r\n if (option?.isGroup && Array.isArray(option?.options)) {\r\n option.options.forEach((opt, index) => {\r\n items.push(\r\n <MenuItem\r\n id={`${option.value}-${opt.value} ${index}`}\r\n value={opt.value}\r\n disabled={Boolean(opt.disabled) || itemDisabled(opt.value)}\r\n sx={{ pl: 5 }}\r\n onClick={() => {\r\n if (values?.length == 1) {\r\n handleClear();\r\n }\r\n }}\r\n key={`${option.value}-${opt.value} ${index}`}\r\n >\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n {multiple && with_checkboxes && (\r\n <Checkbox\r\n checked={Boolean(Array.isArray(values) && values?.indexOf(opt.value) > -1)}\r\n />\r\n )}\r\n <Typography\r\n id={`${option.value}-${opt.value} ${index}`}\r\n type='s3'\r\n color='theme.secondary.1000'\r\n onClick={() => handleChange?.(String(opt.value))}\r\n >\r\n {opt.label == \"Payment Entries\" ? \"Payment and Collection Entries\" : opt.label || opt.value}\r\n </Typography>\r\n </Box>\r\n </MenuItem>\r\n );\r\n });\r\n }\r\n });\r\n\r\n // Footer item\r\n if (field.enable_footer || field.addType) {\r\n items.push(\r\n <Box key=\"footer\" sx={{ position: 'sticky', bottom: 0, background: '#fff', zIndex: 1 }}>\r\n <Divider flexItem sx={{ mt: '0.25rem !important', mb: '0.25rem !important' }} />\r\n <MenuItem sx={{ gap: 1 }} onClick={() => {\r\n if (field.onFooterClick) {\r\n field.onFooterClick();\r\n } else if (field.handleModalOpen) {\r\n field.handleModalOpen();\r\n }\r\n }}>\r\n <Add fontSize='small' />\r\n <Typography type='s4' color='theme.secondary.1000'>\r\n Create New {field.label}\r\n </Typography>\r\n </MenuItem>\r\n </Box>\r\n );\r\n }\r\n\r\n // No data fallback\r\n if (!items.length || (items.length == 1 && !multiple)) {\r\n items.push(\r\n <MenuItem disabled key=\"no-data\">\r\n No data available\r\n </MenuItem>\r\n );\r\n }\r\n\r\n return items;\r\n};\r\n\r\nconst SearchableSelect: React.FC<SearchableSelectProps> = (props) => {\r\n const {\r\n labelId,\r\n label,\r\n value,\r\n onChange,\r\n options,\r\n multiple = false,\r\n size = \"small\",\r\n searchPlaceholder,\r\n placeholder,\r\n name,\r\n defaultValue,\r\n apiType,\r\n isInternal = false,\r\n autoFocus,\r\n error,\r\n disabled,\r\n customeFilter,\r\n attributes,\r\n getSelectedData,\r\n disabledIds,\r\n onChipRemove,\r\n selectedLabel,\r\n is_loading,\r\n customStyle = {},\r\n CustomDropDownIcon,\r\n labelKey,\r\n valueKey,\r\n inputStyle,\r\n hasParent = false,\r\n sortOrder = 'id:-1',\r\n handleChange,\r\n enable_footer = false,\r\n onFooterClick,\r\n showCancelButton = true,\r\n customFetchApi,\r\n addType,\r\n isMergeOptions = false,\r\n } = props;\r\n\r\n const [searchQuery, setSearchQuery] = useState(\"\");\r\n const [loading, setLoading] = useState<boolean>(false);\r\n const [dynamicOptions, setOptions] = useState<IOption[]>([]);\r\n const [selectedOptions, setSelectedOptions] = useState<IOption[]>([]);\r\n const [isAlreadyLoaded, setIsAlreadyLoaded] = useState(false);\r\n const [initailLoading, setInitialLoading] = useState(false);\r\n const [searchInitiate, setSearchInitiate] = useState(false);\r\n const [open, setOpen] = useState(false);\r\n const [prevFilter, setPrevFilter] = useState<any>(null);\r\n const [addConfig, setAddConfig] = useState<any>(null);\r\n const [isModalOpen, setIsModalOpen] = useState<boolean>(false);\r\n const [isAddLoading, setIsAddLoading] = useState<boolean>(false);\r\n const { t } = useTranslation();\r\n\r\n // Pagination state\r\n const [pagination, setPagination] = useState<IPaginationState>({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n\r\n const { isRtl } = useLanguage();\r\n const limit = 25;\r\n\r\n const isInternalOptions = useMemo(() => {\r\n if (isMergeOptions && (apiType || customFetchApi)) return false;\r\n return isInternal || (!apiType && !customFetchApi);\r\n }, [isInternal, apiType, customFetchApi, isMergeOptions]);\r\n\r\n // Local search function for internal options\r\n const searchOptionsLocally = useCallback((searchTerm: string, value: any): IOption[] => {\r\n const currentOptions: IOption[] = (options && options.length > 0) ? options : [];\r\n if (!searchTerm) return currentOptions;\r\n\r\n const lowercasedSearchTerm = searchTerm.toLowerCase();\r\n\r\n const filteredOptions = hasParent\r\n ? options?.reduce((acc: IOption[], opt) => {\r\n const searchedOptions = opt.options?.filter((item) => {\r\n const label = React.isValidElement(item.label) ? item.searchLabel : String(item.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n });\r\n\r\n if (searchedOptions?.length) {\r\n acc.push({ ...opt, options: searchedOptions });\r\n }\r\n\r\n return acc;\r\n }, []) || []\r\n : options?.filter((opt) => {\r\n const label = React.isValidElement(opt.label) ? opt.searchLabel : String(opt.label);\r\n return label?.toLowerCase().includes(lowercasedSearchTerm);\r\n }) || [];\r\n\r\n return sortBySelectedValues(filteredOptions, value);\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [options, hasParent]);\r\n\r\n // Clear Selected Options\r\n const handleClear = () => {\r\n onChange?.({ target: { value: multiple ? [] : null } });\r\n if (getSelectedData && typeof getSelectedData === \"function\") {\r\n getSelectedData(null);\r\n }\r\n };\r\n\r\n // Get unique options\r\n const getUniqueOptions = useCallback((data: IOption[]): IOption[] => {\r\n const uniqueOptions = [\r\n ...new Map(data?.map(item => [item.value, item])).values()\r\n ];\r\n return uniqueOptions;\r\n }, []);\r\n\r\n // Sort by selected values\r\n const sortBySelectedValues = useCallback((arrayToSort: IOption[], value: any): IOption[] => {\r\n const selectedValues = Array.isArray(value) ? value : [value];\r\n const sortedValue = sortBy(arrayToSort, (item) => {\r\n const index = selectedValues.indexOf(item.id || item.value);\r\n return index === -1 ? Infinity : index;\r\n });\r\n return sortedValue;\r\n }, []);\r\n\r\n // Options with search and pagination support\r\n const filteredOptions = useMemo(() => {\r\n if (isInternalOptions) {\r\n return searchOptionsLocally(searchQuery, value);\r\n }\r\n const apiOptions = sortBySelectedValues(getUniqueOptions([...dynamicOptions, ...selectedOptions]), value);\r\n if (isMergeOptions) {\r\n const localOptions = searchOptionsLocally(searchQuery, value);\r\n return getUniqueOptions([...localOptions, ...apiOptions]);\r\n }\r\n return apiOptions;\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [searchQuery, dynamicOptions, options, value, isInternalOptions, selectedOptions, searchOptionsLocally, sortBySelectedValues, getUniqueOptions, isMergeOptions]);\r\n\r\n // Handle scroll pagination\r\n const handleScroll = useCallback((event: React.UIEvent<HTMLDivElement>) => {\r\n const { scrollTop, scrollHeight, clientHeight } = event.currentTarget;\r\n const isBottom = scrollHeight - scrollTop <= clientHeight + 10;\r\n\r\n if (isBottom && pagination.hasMore && !pagination.isLoadingMore && !isInternalOptions) {\r\n const nextPage = pagination.page + 1;\r\n fetchOptions(searchQuery, customeFilter, nextPage, true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [pagination.hasMore, pagination.isLoadingMore, pagination.page, isInternalOptions, searchQuery, JSON.stringify(customeFilter)]);\r\n\r\n // Update Options\r\n const updateOptions = useCallback((newOptions: IOption[], append = false) => {\r\n setOptions((prevOptions) => {\r\n const oldOptions = append ? prevOptions : selectedOptions;\r\n const uniqueOptions = getUniqueOptions([...oldOptions, ...newOptions]);\r\n return uniqueOptions;\r\n });\r\n }, [selectedOptions, getUniqueOptions]);\r\n\r\n // Fetch Options with pagination support\r\n const fetchOptions = useCallback(async (searchTerm: any = '', filters = customeFilter, page = 1, append = false) => {\r\n // Skip if neither apiType nor customFetchApi is provided\r\n if (!apiType && !customFetchApi) return [];\r\n\r\n setLoading(true);\r\n if (page > 1) {\r\n setPagination(prev => ({ ...prev, isLoadingMore: true }));\r\n }\r\n\r\n try {\r\n let data: IOption[] = [];\r\n let paginationResult: { totalCount?: number } = {};\r\n\r\n // Use custom API if provided, otherwise use default fetchApi\r\n if (customFetchApi) {\r\n const response = await customFetchApi({\r\n search: searchTerm,\r\n filters,\r\n limit,\r\n skip: (page - 1) * limit,\r\n select: attributes,\r\n order: sortOrder\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n } else {\r\n const response = await fetchApi({\r\n apiKey: apiType!,\r\n filters: {\r\n limit,\r\n skip: (page - 1) * limit,\r\n search: searchTerm,\r\n filters,\r\n select: attributes,\r\n order: sortOrder\r\n },\r\n labelKey,\r\n valueKey\r\n });\r\n data = response?.data || [];\r\n paginationResult = response?.pagination || {};\r\n }\r\n\r\n if (data && Array.isArray(data)) {\r\n updateOptions(data, append);\r\n\r\n // Update pagination\r\n setPagination(prev => ({\r\n ...prev,\r\n page,\r\n hasMore: (paginationResult?.totalCount || 0) > (page * limit),\r\n total: paginationResult?.totalCount || 0,\r\n isLoadingMore: false\r\n }));\r\n\r\n if (data?.length > 0) {\r\n setSelectedData();\r\n }\r\n }\r\n\r\n return data || [];\r\n } catch (error) {\r\n console.error('Error fetching options:', error);\r\n setPagination(prev => ({ ...prev, isLoadingMore: false }));\r\n return [];\r\n } finally {\r\n setLoading(false);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [apiType, customFetchApi, attributes, sortOrder, limit, updateOptions, dynamicOptions]);\r\n\r\n // Search Options with debounce\r\n const debounceSearch = useMemo(\r\n () => debounce(async (searchTerm: string) => {\r\n if (loading) return;\r\n\r\n if (!searchTerm && !isInternalOptions && searchInitiate) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions('', customeFilter, 1, false);\r\n }\r\n if (searchTerm?.length > 1 && !isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n await fetchOptions(searchTerm, customeFilter, 1, false);\r\n }\r\n }, 700),\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n [isInternalOptions, searchInitiate, JSON.stringify(customeFilter)]\r\n );\r\n\r\n // Initial fetch with filter change detection\r\n const initialFetch = useCallback(async () => {\r\n const condition = JSON.stringify(customeFilter) !== JSON.stringify(prevFilter);\r\n\r\n if (condition && !isInternalOptions && !isAlreadyLoaded) {\r\n setPrevFilter(customeFilter);\r\n setOptions([]);\r\n setIsAlreadyLoaded(false);\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n }\r\n\r\n if (!isInternalOptions && !isAlreadyLoaded) {\r\n await fetchOptions(searchQuery, customeFilter, 1, false);\r\n setIsAlreadyLoaded(true);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [JSON.stringify(customeFilter), isInternalOptions, isAlreadyLoaded]);\r\n\r\n // Set Selected Data\r\n const setSelectedData = useCallback(() => {\r\n let hasOptions = false;\r\n const isInOptions = filteredOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n );\r\n\r\n if ((Array.isArray(isInOptions) && isInOptions?.length > 0)) {\r\n getSelectedData?.(multiple ? isInOptions : isInOptions[0]);\r\n hasOptions = true;\r\n }\r\n\r\n return hasOptions;\r\n }, [JSON.stringify(filteredOptions), value, multiple]);\r\n\r\n // Fetch Options for Selected Id\r\n const fetchIdOptions = useCallback(async () => {\r\n if (await setSelectedData()) return;\r\n if (open) return;\r\n\r\n const fValue = multiple ? value && value?.filter(v => Boolean(Number(v))) : value ? value : null;\r\n const condition = (multiple ? fValue?.length > 0 : fValue) && !isInternalOptions;\r\n\r\n if (condition) {\r\n setInitialLoading(true);\r\n await fetchOptions('', { ...customeFilter, ...{ '&id.in': fValue } }, 1, false);\r\n setInitialLoading(false);\r\n }\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [open, value, JSON.stringify(customeFilter)]);\r\n\r\n const hasValue = multiple\r\n ? Array.isArray(value) && value.length > 0\r\n : value !== null && value !== undefined && value !== \"\";\r\n\r\n // Effects\r\n useEffect(() => {\r\n if (open) {\r\n debounceSearch(searchQuery);\r\n }\r\n return () => debounceSearch.cancel();\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [searchQuery, JSON.stringify(customeFilter), open, isAlreadyLoaded, debounceSearch]);\r\n\r\n useEffect(() => {\r\n setSelectedData();\r\n }, [setSelectedData]);\r\n\r\n useEffect(() => {\r\n fetchIdOptions();\r\n }, [fetchIdOptions]);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n initialFetch();\r\n }\r\n }, [open, initialFetch]);\r\n\r\n useEffect(() => {\r\n const condition = JSON.stringify(customeFilter) !== JSON.stringify(prevFilter);\r\n if (customeFilter && condition) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n }, [customeFilter, prevFilter]);\r\n\r\n useEffect(() => {\r\n if (value && !open) {\r\n const currentOptions: IOption[] = (options && options.length > 0) ? options : [];\r\n const selectedData = currentOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n ) || [];\r\n setSelectedOptions(selectedData);\r\n }\r\n setSelectedOptions(filteredOptions?.filter((i: any) =>\r\n multiple ? value?.includes(i?.value) : i?.value == value\r\n ));\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [value, open, options, multiple]);\r\n\r\n const handleModalOpen = useCallback(() => {\r\n setIsModalOpen(true);\r\n }, []);\r\n\r\n // Handle modal save\r\n const handleModalSave = useCallback(async (payload: any) => {\r\n if (!addConfig || !addConfig.api) {\r\n console.error('Add configuration is not properly set');\r\n return;\r\n }\r\n\r\n setIsAddLoading(true);\r\n try {\r\n const result = await addConfig.api(payload);\r\n setIsAddLoading(false);\r\n setIsModalOpen(false);\r\n if (!isInternalOptions) {\r\n setPagination({\r\n page: 1,\r\n hasMore: true,\r\n isLoadingMore: false,\r\n total: 0\r\n });\r\n setIsAlreadyLoaded(false);\r\n await fetchOptions('', customeFilter, 1, false);\r\n }\r\n if (result && result.data) {\r\n const newValue = multiple\r\n ? [...(value || []), result.data.id]\r\n : result.data.id;\r\n }\r\n } catch (error) {\r\n console.log(\"error\", error);\r\n setIsAddLoading(false);\r\n }\r\n\r\n\r\n }, [addConfig, isInternalOptions, fetchOptions, customeFilter, multiple, name, value]);\r\n\r\n useEffect(() => {\r\n const config = dynamicSelectAdd(addType!);\r\n setAddConfig(config);\r\n }, [addType])\r\n\r\n const handleOnChange = (event: any) => {\r\n const { value } = event.target;\r\n if ((multiple && Array.isArray(value) && value?.filter(v => v).length == 0) || !value) return;\r\n\r\n const isSelected = (item: any) => {\r\n return multiple ? value?.includes(item?.value) : item?.value === value;\r\n };\r\n\r\n const selected = filteredOptions?.filter(isSelected);\r\n onChange?.(event, multiple ? selected : selected?.[0]);\r\n getSelectedData?.(multiple ? selected : selected?.[0]);\r\n\r\n };\r\n\r\n const removeUndefine = (selectOptions: any[]) => {\r\n return Array.isArray(selectOptions) && selectOptions?.length > 0 && selectOptions?.filter((option) => option);\r\n };\r\n\r\n const showGroupLabel = (item: any) => {\r\n if (!item?.length) {\r\n return undefined\r\n }\r\n const mergedOptions = item?.flatMap((i: any) => i?.options)\r\n return mergedOptions?.find((option: any) => option?.value === value)?.label\r\n }\r\n\r\n return (\r\n <Select\r\n labelId={labelId}\r\n name={name}\r\n defaultValue={defaultValue || (multiple ? [] : '')}\r\n placeholder={t(placeholder)}\r\n className=\"filter-select\"\r\n size={size}\r\n onOpen={() => setOpen(true)}\r\n onClose={() => {\r\n setOpen(false);\r\n if (searchQuery?.length > 0) {\r\n setIsAlreadyLoaded(false);\r\n }\r\n setSearchInitiate(false);\r\n setSearchQuery('');\r\n }}\r\n onChange={handleOnChange}\r\n showCancelButton={showCancelButton}\r\n multiple={multiple}\r\n label={t(label)}\r\n fullWidth\r\n displayEmpty\r\n autoFocus={autoFocus}\r\n error={Boolean(error)}\r\n disabled={disabled}\r\n value={initailLoading ? (multiple ? [] : '') : value?.id || value || (multiple ? [] : '')}\r\n searchPlaceholder={searchPlaceholder}\r\n CustomDropdownIcon={CustomDropDownIcon}\r\n sx={(multiple && value?.length) ? { ...customStyle, \"& .MuiSelect-select\": { padding: '5.5px !important' } } : customStyle}\r\n MenuProps={{\r\n PaperProps: {\r\n onScroll: handleScroll,\r\n style: { maxHeight: 295, maxWidth: 250 }\r\n }\r\n }}\r\n input={\r\n !disabled ? (\r\n <OutlinedInput\r\n label=\"\"\r\n sx={inputStyle}\r\n endAdornment={\r\n <InputAdornment position=\"end\">\r\n {loading || is_loading ? (\r\n <CircularProgress\r\n size={20}\r\n sx={{ mr: 3, color: \"#4AC08C\" }}\r\n />\r\n ) : (\r\n showCancelButton && hasValue && (\r\n <IconButton\r\n aria-label=\"clear selection\"\r\n onClick={handleClear}\r\n edge=\"end\"\r\n sx={isRtl ? { ml: 2.5 } : { mr: 1.5 }}\r\n size=\"small\"\r\n >\r\n <Close fontSize=\"small\" color='theme.primary.800' />\r\n </IconButton>\r\n )\r\n )}\r\n </InputAdornment>\r\n }\r\n />\r\n ) : undefined\r\n }\r\n renderValue={(selected?: string | string[]) => {\r\n return (\r\n <>\r\n {Array.isArray(selected) ? (\r\n <ChipOrPlaceholder\r\n selectedLabel={selectedLabel}\r\n data={removeUndefine(selected)}\r\n placeholder={placeholder}\r\n onDelete={onChipRemove}\r\n disabled={disabled}\r\n chipProps={{\r\n sx: {\r\n bgcolor: 'theme.primary.100',\r\n border: 0,\r\n // borderRadius: '15px',\r\n '& .MuiTypography-body1': {\r\n color: 'theme.primary.800',\r\n fontWeight: \"500\",\r\n }\r\n }\r\n }}\r\n />\r\n ) : (\r\n hasParent ? showGroupLabel(filteredOptions) :\r\n Array.isArray(filteredOptions) && filteredOptions?.length > 0 && filteredOptions?.find(\r\n (option: any) => option?.value == value\r\n )?.label || selected || placeholder\r\n )}\r\n </>\r\n );\r\n }}\r\n handleSearch={(text) => {\r\n setSearchQuery(text);\r\n setSearchInitiate(true);\r\n }}\r\n >\r\n {generateMenuItems({\r\n options: filteredOptions,\r\n multiple: Boolean(multiple),\r\n placeholder,\r\n values: value,\r\n with_checkboxes: true,\r\n field: {\r\n ...props,\r\n enable_footer,\r\n onFooterClick,\r\n label,\r\n handleModalOpen\r\n },\r\n disabledIds,\r\n handleClear,\r\n handleChange,\r\n hasParent,\r\n t: (key: string) => key\r\n })}\r\n {pagination.isLoadingMore && (\r\n <MenuItem disabled>\r\n <Box sx={{ display: 'flex', justifyContent: 'center', width: '100%' }}>\r\n <CircularProgress size={20} />\r\n </Box>\r\n </MenuItem>\r\n )}\r\n {/* Modal for adding new items */}\r\n {addConfig && addConfig.component && (\r\n <>\r\n {React.createElement(addConfig.component, {\r\n isOpen: isModalOpen,\r\n setIsOpen: setIsModalOpen,\r\n isLoading: isAddLoading,\r\n onSave: handleModalSave,\r\n modalProps: {\r\n maxWidth: 'md',\r\n fullWidth: true\r\n },\r\n ...props?.modalComponentProps\r\n })}\r\n </>\r\n )}\r\n </Select>\r\n );\r\n};\r\n\r\nexport default SearchableSelect;","import { useMemo, useCallback } from 'react';\r\nimport { Box } from '@mui/material';\r\nimport TextField from '../../text-field/text-field';\r\nimport { ValueEditorProps } from 'react-querybuilder';\r\nimport '../filter.scss';\r\nimport DatePicker from '../../date-picker/date-picker';\r\nimport dayjs from 'dayjs';\r\n\r\nimport SearchableSelect from '../../searchable-select';\r\nimport _ from 'lodash';\r\nimport { formatLabel } from '../../../utils/format-text';\r\nimport { getToken } from '@/utils';\r\nimport { getV1FilterFilterTable } from '../../../api-client/api.system-feature/api';\r\n\r\nconst getFilterTableFields = async (\r\n\ttableName: string,\r\n\tsearchText: string,\r\n\tlimit: number,\r\n\toffset: number = 0\r\n) => {\r\n\ttry {\r\n\t\tconst tokenObj = getToken();\r\n\t\tconst response = await getV1FilterFilterTable({\r\n\t\t\ttable: tableName,\r\n\t\t\tsearch: searchText,\r\n\t\t\tlimit: limit,\r\n\t\t\toffset: offset,\r\n\t\t\t'x-token': tokenObj['x-token'],\r\n\t\t\t'x-timezone': String(tokenObj['x-timezone'])\r\n\t\t});\r\n\r\n\t\t// response could be of several types, but use optional chaining and type narrowing\r\n\t\tif ('data' in response && response.data) {\r\n\t\t\tconst result: any[] = (response.data as any)?.result ?? [];\r\n\t\t\tconst totalCount: number = (response as any)?.pagination?.totalCount ?? result.length;\r\n\t\t\tconst items = result.map((r: any) => ({ label: r.name, value: r.id }));\r\n\t\t\treturn { items, totalCount };\r\n\t\t}\r\n\t\treturn { items: [], totalCount: 0 };\r\n\t} catch {\r\n\t\treturn { items: [], totalCount: 0 };\r\n\t}\r\n};\r\n\r\nconst ValueEditor = (props: ValueEditorProps) => {\r\n\t// eslint-disable-next-line\r\n\tlet { values, value, handleOnChange, fieldData, rule, ...rest } = props;\r\n\tconsole.log(\"🚀 ~ ValueEditor ~ values:\", values)\r\n\r\n\tif (!value && fieldData.inputType == 'select') {\r\n\t\tvalue = null;\r\n\t} else if (!Array.isArray(value) && fieldData.inputType == 'select') {\r\n\t\tvalue = [];\r\n\t}\r\n\r\n\tconst isDisabled = useMemo(() => {\r\n\t\treturn rule.operator === 'null' || rule.operator === 'notNull';\r\n\t}, [rule.operator]);\r\n\r\n\tconst customFetch = useCallback(\r\n\t\tasync (params: any) => {\r\n\t\t\tconst search = params?.search || '';\r\n\t\t\tconst limit = params?.limit || 25;\r\n\t\t\tconst offset = params?.skip || 0;\r\n\t\t\tif (fieldData.table) {\r\n\t\t\t\tconst data = await getFilterTableFields(fieldData.table, search, limit, offset);\r\n\t\t\t\tconst optionData = data.items.map((r: any) => ({ id: r.value, value: r.value, label: r.label }));\r\n\t\t\t\treturn { data: optionData, pagination: { totalCount: data.totalCount } };\r\n\t\t\t} else {\r\n\t\t\t\t// const searchedOptions =\r\n\t\t\t\t// \tvalues?.filter((opt) => opt.label?.toLowerCase().includes(search.toLowerCase())) ||\r\n\t\t\t\t// \t[];\r\n\t\t\t\tconst optionData = values?.map((item: any) => ({\r\n\t\t\t\t\t...item,\r\n\t\t\t\t\tvalue: item?.name,\r\n\t\t\t\t\tlabel: item.label ? formatLabel(item.label) : ''\r\n\t\t\t\t}));\r\n\t\t\t\treturn {\r\n\t\t\t\t\tdata: optionData,\r\n\t\t\t\t\tpagination: { totalCount: optionData.length }\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t},\r\n\t\t[fieldData.table, values]\r\n\t);\r\n\r\n\tconst renderOptions = () => {\r\n\t\tswitch (fieldData.inputType) {\r\n\t\t\tcase 'select':\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<SearchableSelect\r\n\t\t\t\t\t\tkey={fieldData.name}\r\n\t\t\t\t\t\tlabel=''\r\n\t\t\t\t\t\tname='insurance_account'\r\n\t\t\t\t\t\tplaceholder='Select'\r\n\t\t\t\t\t\tonChange={(e: any, selected: any) => {\r\n\t\t\t\t\t\t\tconsole.log(\"🚀 ~ renderOptions ~ selected:\", selected)\r\n\t\t\t\t\t\t\tconst mappedValue = selected?.map((i: any) => ({\r\n\t\t\t\t\t\t\t\t...i,\r\n\t\t\t\t\t\t\t\tname: i?.value\r\n\t\t\t\t\t\t\t}))\r\n\t\t\t\t\t\t\thandleOnChange(mappedValue)\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tvalue={value?.map(i => i?.value)}\r\n\t\t\t\t\t\tmultiple={true}\r\n\t\t\t\t\t\tcustomFetchApi={customFetch}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\tonChipRemove={() => handleOnChange([])}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\tcase 'date':\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<DatePicker\r\n\t\t\t\t\t\tonChange={(val) =>\r\n\t\t\t\t\t\t\thandleOnChange(\r\n\t\t\t\t\t\t\t\tdayjs(val).isValid() ? dayjs(val).format('YYYY-MM-DD') : ''\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvalue={value ? dayjs(value) : null}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\tslotProps={{\r\n\t\t\t\t\t\t\ttextField: {\r\n\t\t\t\t\t\t\t\tplaceholder: 'YYYY-MM-DD',\r\n\t\t\t\t\t\t\t\tclassName: 'select-drps'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tformat='YYYY-MM-DD'\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<TextField\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={(e: any) => {\r\n\t\t\t\t\t\t\thandleOnChange(e.target.value);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t{...rest}\r\n\t\t\t\t\t\tinputProps={{\r\n\t\t\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\t\t\tfontSize: '0.8125rem'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tclassName='select-drps'\r\n\t\t\t\t\t\ttype={fieldData.inputType}\r\n\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\treturn <Box width='100%'>{renderOptions()}</Box>;\r\n};\r\n\r\nexport { ValueEditor };\r\nexport default ValueEditor;\r\n","import { Box, MenuItem } from \"@mui/material\";\nimport Select from \"../../select/select\";\nimport Typography from \"../../typography/typography\";\nimport { OperatorSelectorProps } from \"react-querybuilder\";\nimport formatText from \"../../../utils/format-text\";\n\nconst OperatorSelect = (props: OperatorSelectorProps) => {\n const { handleOnChange, options, ...rest } = props;\n\n\n return (\n <Box width='100%'>\n <Select\n fullWidth\n {...rest}\n onChange={(e: any) => handleOnChange(e.target.value)}\n className=\"select-drps\"\n variant=\"outlined\"\n renderValue= {(selected: string) => {\n const dValue = options?.find(o => o.name==selected)?.label\n return dValue ? formatText(dValue) : selected\n }}\n >\n {options?.filter(o => Boolean(o.label?.trim()))?.map((op: any) => (\n <MenuItem key={op.name} value={op.name}>\n <Typography type=\"s4\" color=\"theme.secondary.1000\">\n {formatText(op.label)}\n </Typography>\n </MenuItem>\n ))}\n </Select>\n </Box>\n );\n};\n\nexport { OperatorSelect };\nexport default OperatorSelect;\n","import Button from \"../../button/button\";\n// import Typography from \"../../typography/typography\";\nimport { ActionProps } from \"react-querybuilder\";\nimport { Trash } from \"../../icons\";\n\nconst RemoveGroupAction = (props: ActionProps) => {\n const { handleOnClick } = props;\n\n return (\n <Button\n className=\"filterGrp-remove-btn\"\n variant=\"outlined\"\n onClick={handleOnClick}\n sx={({palette}) => ({\n marginRight: \"0px\",\n marginLeft: \"auto\",\n color: `${palette.theme.error?.[600]} !important`\n })}\n startIcon={<Trash color=\"theme.error.600\" fontSize=\"small\"/>}\n >\n Delete Group\n </Button>\n );\n};\n\nexport { RemoveGroupAction };\nexport default RemoveGroupAction;\n","import {\n Box,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n} from \"@mui/material\";\nimport Close from \"@mui/icons-material/Close\";\nimport { useEffect, useState } from \"react\";\nimport Modal from \"../modal/modal\";\nimport Typography from \"../typography/typography\";\nimport TextField from \"../text-field/text-field\";\nimport Button from \"../button/button\";\nimport { FolderSave } from \"../icons\";\n\ninterface SaveFilter {\n open: boolean;\n onClose: () => void;\n handleSubmit: (name: string) => void;\n oldName?: string;\n}\n\nconst SaveFilterModal = ({\n open,\n onClose,\n handleSubmit,\n oldName,\n}: SaveFilter) => {\n const [name, setName] = useState<string>(\"\");\n\n useEffect(() => {\n if (oldName !== undefined) {\n setName(oldName);\n }\n }, [oldName]);\n\n const handleSave = async (name: string) => {\n if (name) {\n const saved = await handleSubmit(name);\n\n if(saved) {\n setName(\"\");\n onClose();\n }\n }\n\n };\n\n return (\n <>\n <Modal fullWidth onClose={onClose} open={open}>\n <DialogTitle>\n <Box sx={{ display: 'flex', alignItems: 'center', gap:0.5 }}>\n <FolderSave sx={{ fontSize: '1.25rem'}}/>\n <Typography type=\"s2\" weight=\"medium\" color={\"theme.secondary.1000\"}>\n Save active filters\n </Typography>\n </Box>\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\n <Close fontSize=\"inherit\" />\n </IconButton>\n </DialogTitle>\n <DialogContent dividers>\n <TextField\n label=\"Name\"\n fullWidth\n placeholder=\"Name Filter\"\n value={name}\n onChange={(e: any) => setName(e.target.value)}\n />\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"outlined\"\n onClick={onClose}\n style={{\n color: \"black\",\n }}\n >\n Cancel\n </Button>\n <Button onClick={() => handleSave(name)}>\n {oldName ? \"Rename\" : \"Save\"}\n </Button>\n </DialogActions>\n </Modal>\n </>\n );\n};\n\nexport { SaveFilterModal };\nexport default SaveFilterModal;\n","/* eslint-disable */\r\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\r\nimport type { RuleGroupType } from \"react-querybuilder\";\r\nimport \"react-querybuilder/dist/query-builder.scss\";\r\nimport { QueryBuilder /* , formatQuery */ } from \"react-querybuilder\";\r\nimport { QueryBuilderMaterial } from \"@react-querybuilder/material\";\r\nimport {\r\n Box,\r\n IconButton,\r\n MenuItem,\r\n Dialog,\r\n DialogTitle,\r\n DialogContent,\r\n DialogActions,\r\n OutlinedInput,\r\n InputAdornment,\r\n Alert,\r\n} from \"@mui/material\";\r\nimport \"./filter.scss\";\r\nimport Select from \"../select/select\";\r\nimport Typography from \"../typography/typography\";\r\nimport { Close } from \"@mui/icons-material\";\r\nimport CombinatorSelect from \"./components/combinator-select\";\r\nimport RemoveAction from \"./components/remove-action\";\r\nimport FieldSelect from \"./components/field-select\";\r\nimport AddFilterButton from \"./components/add-filter\";\r\nimport AddGroupButton from \"./components/add-group\";\r\nimport ValueEditor from \"./components/value-editor\";\r\nimport OperatorSelect from \"./components/operator-select\";\r\nimport Button from \"../button/button\";\r\nimport RemoveGroupAction from \"./components/delete-group\";\r\nimport SearchBar from \"../search-bar/search-bar\";\r\nimport SaveFilterModal from \"../save-filter-modal/save-filter-modal\";\r\n\r\nimport {\r\n putV1FilterId,\r\n deleteV1FilterId,\r\n} from \"../../api-client/api.system-feature/api\";\r\nimport type * as Types from \"../../api-client/api.system-feature/api-types\";\r\nimport { auth } from \"../../constants/auth\";\r\nimport { generateFields, generateQueryString, getErrorMessage } from \"../../utils/common\";\r\nimport { usePages } from \"../../hooks/use-pages\";\r\nimport _ from \"lodash\";\r\nimport { Edit, Trash } from \"../icons\";\r\nimport { enqueueSnackbar } from \"notistack\";\r\nimport { IResources, routeToResourceMap } from \"../../constants/route-page-map\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\n\r\ninterface IFilter {\r\n open: boolean;\r\n onClose: () => void;\r\n activeView?: string;\r\n savedFilters?: SavedFilter[];\r\n fetchSavedFilters?: () => Promise<void>;\r\n setFilterBar?: any;\r\n onSaveFilter?: (query: RuleGroupType) => void;\r\n onSelectedFilter?: (filterName: string) => void;\r\n fields: any;\r\n applyFilter: any;\r\n isUseFields?: boolean;\r\n}\r\n\r\ninterface SavedFilter {\r\n id: string;\r\n name: string;\r\n query: RuleGroupType;\r\n}\r\n\r\nconst initialQuery: RuleGroupType = { combinator: \"and\", rules: [] };\r\n\r\nconst Filter = ({\r\n open,\r\n onClose,\r\n // activeView,\r\n savedFilters,\r\n fetchSavedFilters,\r\n onSaveFilter,\r\n onSelectedFilter,\r\n applyFilter,\r\n fields = [],\r\n isUseFields = false\r\n}: IFilter) => {\r\n const location = useLocation();\r\n\r\n const token = localStorage.getItem(auth.storageTokenKeyName);\r\n const { updatePageInfo, activePage, schemaFields, setActivePage } = usePages()\r\n\r\n fields = isUseFields ? generateFields(fields) : (schemaFields.length ? generateFields(schemaFields) : fields)\r\n const [query, setQuery] = useState<RuleGroupType>(initialQuery);\r\n const [filteredSavedFilters, setFilteredSavedFilters] = useState<\r\n SavedFilter[]\r\n >(savedFilters ?? []);\r\n const [selectedFilter, setSelectedFilter] = useState<any>(null);\r\n const [openRenameFilter, setIsOpenRenameFilter] = useState<any>(null);\r\n const [errorMessage, setErrorMessage] = useState<string | null>(null);\r\n const { isRtl } = useLanguage();\r\n const resources: IResources = useMemo(() => routeToResourceMap[location.pathname] || null, [location.pathname])\r\n\r\n useEffect(() => {\r\n savedFilters && setFilteredSavedFilters(savedFilters);\r\n }, [savedFilters]);\r\n\r\n\r\n const handleApplyFilter = useCallback((clear: boolean = false) => {\r\n let q = query\r\n const isInvalid = isDuplicatedFilters(q)\r\n if (isInvalid) {\r\n setErrorMessage(\"Invalid filter\")\r\n return\r\n }\r\n if (clear) {\r\n q = initialQuery\r\n setQuery(q)\r\n } else {\r\n const generatedSQLQuery = q ? generateQueryString(q) : q;\r\n updatePageInfo({ filters: q, filterQueryString: generatedSQLQuery })\r\n // applyFilter(generatedSQLQuery);\r\n onClose();\r\n }\r\n }, [query, applyFilter, onClose]);\r\n\r\n const handleQueryChange = (q: RuleGroupType) => {\r\n const updatedRules = q.rules.map((rule, i) => ({\r\n ...rule,\r\n value: rule.field !== query.rules?.[i]?.field || ['null', 'notNull'].includes(rule.operator) ? \"\" : rule.value\r\n }));\r\n let isValid = true;\r\n let errorMessage = '';\r\n\r\n // // Helper function to check for invalid aggregate usage, considering parent combinators\r\n // const checkForInvalidAggregateUsage = (rules: any[], combinator: string, parentCombinator: string | null): boolean => {\r\n // let hasAggregateField = false;\r\n // let hasNonAggregateField = false;\r\n\r\n // rules.forEach(rule => {\r\n // // Check nested groups\r\n // if (rule.rules) {\r\n // // If the current group or any parent has an 'OR', pass it down\r\n // const currentCombinator = combinator === 'or' || parentCombinator === 'or' ? 'or' : combinator;\r\n // checkForInvalidAggregateUsage(rule.rules, rule.combinator, currentCombinator);\r\n // } else {\r\n // // Find the field in the fields array and check if it's an aggregate\r\n // const field = fields.find((f: any) => f.name === rule.field);\r\n\r\n // if (field?.is_aggregate) {\r\n // hasAggregateField = true;\r\n // } else {\r\n // hasNonAggregateField = true;\r\n // }\r\n // }\r\n // });\r\n\r\n // // If any parent or current rule uses 'OR' with a mix of aggregate and non-aggregate fields, it's invalid\r\n // if ((combinator === 'or' || parentCombinator === 'or') && hasAggregateField && hasNonAggregateField) {\r\n // isValid = false;\r\n // errorMessage = 'Mixing aggregate and non-aggregate fields in OR conditions may lead to unexpected results.';\r\n // }\r\n\r\n // return isValid;\r\n // };\r\n\r\n // Start checking from the root level (no parent combinator initially)\r\n\r\n\r\n // Always set the query, regardless of validity\r\n setQuery({ ...q, rules: updatedRules });\r\n\r\n // Set error message if invalid, otherwise clear it\r\n if (!isValid) {\r\n setErrorMessage(errorMessage);\r\n } else {\r\n setErrorMessage(null);\r\n }\r\n\r\n // Always call onSaveFilter, if it exists\r\n if (onSaveFilter) {\r\n onSaveFilter(q);\r\n }\r\n };\r\n\r\n const handleFilterSwitch = (sf?: any) => {\r\n if (sf) {\r\n setSelectedFilter(sf);\r\n setQuery(sf.query);\r\n if (onSelectedFilter) {\r\n onSelectedFilter(sf);\r\n }\r\n } else {\r\n setSelectedFilter(null);\r\n setQuery(initialQuery);\r\n if (onSelectedFilter) {\r\n onSelectedFilter(null);\r\n }\r\n }\r\n };\r\n\r\n const handleSearchEvent = (searchText: string) => {\r\n const filteredFilters = savedFilters?.filter((filter: any) =>\r\n filter.name.toLowerCase().includes(searchText.toLowerCase())\r\n );\r\n if (filteredFilters) {\r\n setFilteredSavedFilters(filteredFilters);\r\n }\r\n };\r\n\r\n const handleRenameFilter = async (filterId: string, newName: string) => {\r\n const putFilterRequest: Types.PutV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: filterId,\r\n name: newName,\r\n module: resources?.fieldResource || resources?.pageResource\r\n };\r\n\r\n try {\r\n await putV1FilterId(putFilterRequest)\r\n // setSelectedFilter(newName);\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n enqueueSnackbar('Filters renamed successfully.')\r\n } catch (error) {\r\n let m: string = 'Something went wrong on saving filters'\r\n if (error instanceof Error) {\r\n m = getErrorMessage(error.message)\r\n }\r\n enqueueSnackbar(m, { variant: 'error' })\r\n return false\r\n }\r\n return true\r\n };\r\n const handleUpdateSelectedFilterQuery = async () => {\r\n if (selectedFilter) {\r\n\r\n const putFilterRequest: Types.PutV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: selectedFilter.id,\r\n data: query,\r\n };\r\n\r\n putV1FilterId(putFilterRequest)\r\n .then((response: any) => {\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n setActivePage((prev: any) => ({\r\n ...prev,\r\n filters: {\r\n ...prev.filters,\r\n rules: query.rules,\r\n combinator: query.combinator,\r\n name: selectedFilter.name\r\n\r\n }\r\n }));\r\n })\r\n .catch((err: any) => enqueueSnackbar(\"Error renaming saved filters:\", { variant: 'error' }));\r\n }\r\n };\r\n\r\n const handleSubmitRename = (name: string) => {\r\n if (openRenameFilter) {\r\n return handleRenameFilter(openRenameFilter.id, name);\r\n }\r\n };\r\n\r\n const handleDeleteFilter = async (filterId: string) => {\r\n const deleteFilterRequest: Types.DeleteV1FilterIdRequest = {\r\n \"x-token\": token,\r\n id: filterId,\r\n };\r\n\r\n deleteV1FilterId(deleteFilterRequest)\r\n .then((response: any) => {\r\n setSelectedFilter(null);\r\n setQuery(initialQuery);\r\n if (fetchSavedFilters) {\r\n fetchSavedFilters();\r\n }\r\n\r\n })\r\n .catch((err: any) => console.log(\"Error deleting saved filters:\", err));\r\n };\r\n\r\n useEffect(() => {\r\n let q = initialQuery\r\n if (!_.isEmpty(activePage.filters)) {\r\n q = activePage.filters\r\n }\r\n setQuery(q)\r\n const selectedFilter = savedFilters?.find((f: any) => f.name === activePage?.filters?.name);\r\n setSelectedFilter(selectedFilter || null);\r\n }, [activePage?.filters, savedFilters]);\r\n\r\n const isDuplicatedFilters = (rule) => {\r\n let uniques: string[] = []\r\n rule?.rules?.forEach((r: any) => {\r\n if (uniques.includes(r.field) && rule.combinator == 'and') {\r\n return true\r\n }\r\n uniques.push(r.field)\r\n })\r\n return uniques.length !== rule?.rules?.length\r\n }\r\n\r\n\r\n const isRuleInvalid = (rule: any): boolean => {\r\n // If it's a group (has nested rules), recurse\r\n if (Array.isArray(rule.rules)) {\r\n return rule.rules.length ? rule.rules.some(isRuleInvalid) : !rule.rules.length;\r\n }\r\n\r\n // Otherwise, validate individual rule\r\n return (\r\n !rule.field ||\r\n (_.isEmpty(rule.value) && !['null', 'notNull'].includes(rule.operator))\r\n );\r\n };\r\n\r\n const disabled = useMemo(() => isRuleInvalid(query) || errorMessage, [query, errorMessage])\r\n // const disabled = isRuleInvalid(query) || errorMessage;\r\n\r\n return (\r\n <div>\r\n <Dialog\r\n open={open}\r\n onClose={onClose}\r\n maxWidth='md'\r\n fullWidth={true}\r\n PaperProps={{\r\n sx: { borderRadius: 2 }\r\n }}\r\n >\r\n <DialogTitle className=\"filter-header\">\r\n <Typography type=\"s3\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n Filters\r\n </Typography>\r\n <Box gap={1} display={\"flex\"}>\r\n <Select\r\n fullWidth\r\n size=\"small\"\r\n className=\"filter-dropdown\"\r\n value={selectedFilter ? selectedFilter.name : \"Saved Filters\"}\r\n onChange={(event: any) => {\r\n const sf = savedFilters?.find(f => f.name == event.target.value)\r\n handleFilterSwitch(sf)\r\n }}\r\n variant=\"outlined\"\r\n onClose={() => {\r\n setTimeout(() => {\r\n handleSearchEvent(\"\")\r\n }, 500);\r\n }}\r\n input={\r\n selectedFilter ? (\r\n <OutlinedInput\r\n label=''\r\n endAdornment={\r\n <InputAdornment position='end'>\r\n <IconButton\r\n aria-label='clear selection'\r\n onClick={() => {\r\n handleFilterSwitch()\r\n }}\r\n edge='end'\r\n sx={{ mr: 1.5 }}\r\n size='small'>\r\n <Close sx={{ fontSize: '1rem' }} />\r\n </IconButton>\r\n </InputAdornment>\r\n }\r\n />\r\n ) : undefined\r\n }\r\n >\r\n <div className=\"searchbar-box-list\">\r\n <SearchBar\r\n placeholder={\"Search Filters\"}\r\n handleSearch={(e) => handleSearchEvent(e)}\r\n />\r\n </div>\r\n {/* <Typography\r\n color=\"theme.secondary.1000\"\r\n type=\"s4\"\r\n className=\"filter-title\"\r\n >\r\n Saved Filters\r\n </Typography> */}\r\n {filteredSavedFilters?.map((savedFilter: SavedFilter) => (\r\n <MenuItem\r\n key={savedFilter.id}\r\n value={savedFilter?.name}\r\n className=\"menu-list\"\r\n selected={selectedFilter?.name == savedFilter?.name}\r\n >\r\n <Typography color=\"theme.secondary.1000\" type=\"s3\">\r\n {savedFilter?.name}\r\n </Typography>\r\n\r\n <div className=\"icon-list\">\r\n <IconButton size=\"small\" onClick={(e) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n setIsOpenRenameFilter(savedFilter)\r\n }}>\r\n <Edit fontSize=\"small\" color={selectedFilter?.name == savedFilter?.name ? \"theme.primary.800\" : 'inherit'} />\r\n </IconButton>\r\n <IconButton size=\"small\" onClick={(e) => {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n handleDeleteFilter(savedFilter.id)\r\n }} color=\"error\">\r\n <Trash fontSize=\"small\" color=\"theme.error.600\" />\r\n </IconButton>\r\n </div>\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n <SaveFilterModal\r\n open={openRenameFilter !== null}\r\n onClose={() => setIsOpenRenameFilter(null)}\r\n handleSubmit={(name) => handleSubmitRename(name)}\r\n oldName={openRenameFilter?.name}\r\n />\r\n <Box>\r\n <IconButton size=\"small\" onClick={onClose}>\r\n <Close fontSize=\"small\" />\r\n </IconButton>\r\n </Box>\r\n </Box>\r\n </DialogTitle>\r\n <DialogContent className=\"content\">\r\n {/* Display error message */}\r\n {errorMessage && (\r\n <Alert severity=\"error\" sx={{ px: 1, pt: 0.5, mb: 1 }}>\r\n <Typography\r\n color=\"error\"\r\n type=\"s4\"\r\n >\r\n {errorMessage}\r\n </Typography>\r\n </Alert>\r\n )}\r\n <QueryBuilderMaterial>\r\n <QueryBuilder\r\n fields={fields || []}\r\n query={query}\r\n onQueryChange={handleQueryChange}\r\n showCombinatorsBetweenRules={true}\r\n controlClassnames={{\r\n header: \"actions\",\r\n }}\r\n controlElements={{\r\n addRuleAction: AddFilterButton,\r\n addGroupAction: AddGroupButton,\r\n combinatorSelector: CombinatorSelect,\r\n fieldSelector: FieldSelect,\r\n operatorSelector: OperatorSelect,\r\n removeRuleAction: RemoveAction,\r\n valueEditor: ValueEditor,\r\n removeGroupAction: RemoveGroupAction,\r\n }}\r\n />\r\n <Button\r\n variant=\"text\"\r\n className={isRtl ? 'remove-filters_rtl' : 'remove-filters'}\r\n onClick={() => {\r\n handleApplyFilter(true)\r\n }}\r\n disabled={disabled}\r\n >\r\n Clear all filters\r\n </Button>\r\n </QueryBuilderMaterial>\r\n </DialogContent>\r\n <DialogActions className=\"filter-footer\">\r\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: selectedFilter ? 'space-between' : 'flex-end', width: '100%' }}>\r\n {selectedFilter &&\r\n <Box>\r\n <Button onClick={handleUpdateSelectedFilterQuery}>\r\n Update Seleted filter\r\n </Button>\r\n </Box>\r\n }\r\n <Box sx={{ display: 'flex', gap: 1 }}>\r\n <Button className=\"cancel-filter-btn\" onClick={onClose}>\r\n Cancel\r\n </Button>\r\n <Button\r\n disabled={disabled}\r\n onClick={() => handleApplyFilter()}\r\n >\r\n Apply\r\n </Button>\r\n </Box>\r\n </Box>\r\n </DialogActions>\r\n </Dialog>\r\n </div>\r\n );\r\n};\r\n\r\nexport { Filter };\r\nexport default Filter;\r\n","import * as React from 'react';\nimport ButtonGroup, { ButtonGroupProps } from '@mui/material/ButtonGroup';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport Grow from '@mui/material/Grow';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport MenuItem from '@mui/material/MenuItem';\nimport MenuList from '@mui/material/MenuList';\nimport Button from '../button/button';\nimport { ArrowDownTwo } from '../icons';\nimport Typography from '../typography/typography';\nimport { ButtonProps, CircularProgress, SxProps } from '@mui/material';\nimport { useLanguage } from '../../hooks/useLangauge';\n\nexport interface IDropdownMenuOption {\n\tlabel: string | JSX.Element;\n\tcallback: (event?: any, index?: number) => void;\n\tcolor?: string;\n\tdisableToggle?: boolean;\n}\n\ninterface DropdownButtonProps extends ButtonProps {\n\tchildren?: React.ReactNode;\n\toptions: IDropdownMenuOption[];\n\tisMenuThirdItemDisabled?: boolean;\n\tisOnlyDropDownButton?: boolean;\n\tonlyDropDownButtonProps?: {\n\t\tstyle?: SxProps;\n\t};\n\tbuttonGroupProps?: ButtonGroupProps;\n\tdropdownButtonProps?: ButtonGroupProps;\n\ttoggleCallback?: (e?: boolean) => void;\n\tloading?: boolean;\n}\n\nconst DropdownButton: React.FC<DropdownButtonProps> = ({\n\tchildren,\n\toptions,\n\tisMenuThirdItemDisabled,\n\tisOnlyDropDownButton = false,\n\tonlyDropDownButtonProps = null,\n\tbuttonGroupProps = null,\n\tdropdownButtonProps=null,\n\ttoggleCallback,\n\tloading = false,\n\t...rest\n}) => {\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorRef = React.useRef<HTMLDivElement>(null);\n const {isRtl}=useLanguage();\n\tconst handleToggle = () => {\n\t\tsetOpen((prevOpen) => !prevOpen);\n\t};\n\n\tconst handleClose = (event: Event) => {\n\t\tif (\n\t\t\tanchorRef.current &&\n\t\t\tanchorRef.current.contains(event.target as HTMLElement)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetOpen(false);\n\t};\n\n\tReact.useEffect(() => {\n\t\ttoggleCallback?.(open);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [open]);\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<ButtonGroup\n\t\t\t\tsx={loading ? { boxShadow: 'none' } : isRtl?{flexDirection:'row-reverse'}:{}}\n\t\t\t\t{...buttonGroupProps}\n\t\t\t\tref={anchorRef}\n\t\t\t\tdisabled={loading}>\n\t\t\t\t{isOnlyDropDownButton ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\tborderRightColor: '#ffffff20 !important',\n\t\t\t\t\t\t\t...onlyDropDownButtonProps?.style\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={handleToggle}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\tsx={(theme) => ({\n\t\t\t\t\t\t\t\tborderRightColor: `${theme.palette.theme?.secondary[100]} !important`,\n\t\t\t\t\t\t\t\tborderRight: '1px solid',\n\t\t\t\t\t\t\t\tborderTopRightRadius: 0,\n\t\t\t\t\t\t\t\tborderBottomRightRadius: 0,\n\t\t\t\t\t\t\t\t...(typeof rest?.sx === 'function'\n\t\t\t\t\t\t\t\t\t? rest.sx(theme)\n\t\t\t\t\t\t\t\t\t: rest?.sx || {})\n\t\t\t\t\t\t\t})}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize='small'\n\t\t\t\t\t\t\taria-controls={open ? 'split-button-menu' : undefined}\n\t\t\t\t\t\t\taria-expanded={open ? 'true' : undefined}\n\t\t\t\t\t\t\taria-label='select merge strategy'\n\t\t\t\t\t\t\taria-haspopup='menu'\n\t\t\t\t\t\t\t{...dropdownButtonProps}\n\t\t\t\t\t\t\tsx={(theme) => ({\n\t\t\t\t\t\t\t\tp: 1,\n\t\t\t\t\t\t\t\tminWidth: 'unset !important',\n\t\t\t\t\t\t\t\tborderTopLeftRadius: 0,\n\t\t\t\t\t\t\t\tborderBottomLeftRadius: 0,\n\t\t\t\t\t\t\t\t...(typeof dropdownButtonProps?.sx === 'function'\n\t\t\t\t\t\t\t\t\t? dropdownButtonProps.sx(theme)\n\t\t\t\t\t\t\t\t\t: dropdownButtonProps?.sx || {})\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={handleToggle}>\n\t\t\t\t\t\t\t{loading ? (\n\t\t\t\t\t\t\t\t<CircularProgress size={15} color='inherit' />\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ArrowDownTwo fontSize='small' />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</ButtonGroup>\n\t\t\t<Popper\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1\n\t\t\t\t}}\n\t\t\t\topen={open}\n\t\t\t\tanchorEl={anchorRef.current}\n\t\t\t\trole={undefined}\n\t\t\t\ttransition\n\t\t\t\tdisablePortal>\n\t\t\t\t{({ TransitionProps, placement }) => (\n\t\t\t\t\t<Grow\n\t\t\t\t\t\t{...TransitionProps}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransformOrigin:\n\t\t\t\t\t\t\t\tplacement === 'bottom' ? 'center top' : 'center bottom'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t<Paper elevation={0} sx={{ border: '1px solid', borderColor: 'grey.300', borderRadius: '8px', mt:0.25}}>\n\t\t\t\t\t\t\t<ClickAwayListener onClickAway={handleClose}>\n\t\t\t\t\t\t\t\t<MenuList id='split-button-menu' autoFocusItem>\n\t\t\t\t\t\t\t\t\t{options.map((option, index) => (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={isMenuThirdItemDisabled ? false : index === 2}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\toption.callback(event, index);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!option?.disableToggle) {\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleToggle();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}} >\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\toption.color ? option.color : 'theme.secondary.1000'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tsx={{\n\t\t\t\t\t\t\t\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</MenuList>\n\t\t\t\t\t\t\t</ClickAwayListener>\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</Grow>\n\t\t\t\t)}\n\t\t\t</Popper>\n\t\t</React.Fragment>\n\t);\n};\n\nexport default DropdownButton;\n","import * as React from 'react';\nimport ClickAwayListener from '@mui/material/ClickAwayListener';\nimport Grow from '@mui/material/Grow';\nimport Paper from '@mui/material/Paper';\nimport Popper from '@mui/material/Popper';\nimport MenuItem from '@mui/material/MenuItem';\nimport MenuList from '@mui/material/MenuList';\nimport { ArrowDownTwo } from '../icons';\nimport Typography from '../typography/typography';\nimport { ButtonProps } from '@mui/material';\n\nexport interface ITitleDropdownMenuOption {\n\tlabel: string | JSX.Element;\n\tcallback: (event?: any, index?: number) => void;\n\tcolor?: string;\n}\n\ninterface TitleDropdownButtonProps extends ButtonProps {\n\tchildren: React.ReactNode;\n\toptions: ITitleDropdownMenuOption[];\n\tisMenuThirdItemDisabled: boolean;\n\tcurrentTitle: string;\n}\n\nconst TitleDropdownButton: React.FC<TitleDropdownButtonProps> = ({\n\tchildren,\n\toptions,\n\tisMenuThirdItemDisabled,\n\tcurrentTitle = '',\n}) => {\n\tconst [open, setOpen] = React.useState(false);\n\tconst anchorRef = React.useRef<HTMLDivElement>(null);\n\n\tconst handleToggle = () => {\n\t\tsetOpen((prevOpen) => !prevOpen);\n\t};\n\n\tconst handleClose = (event: Event) => {\n\t\tif (\n\t\t\tanchorRef.current &&\n\t\t\tanchorRef.current.contains(event.target as HTMLElement)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetOpen(false);\n\t};\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div style={{ display: 'flex', alignItems: 'flex-end', gap: '10px' }} ref={anchorRef}>\n\t\t\t\t<Typography type=\"h3\" weight=\"medium\" color=\"theme.secondary.1000\">\n\t\t\t\t\t{children}\n\t\t\t\t</Typography>\n\t\t\t\t<div\n\t\t\t\t\taria-controls={open ? 'split-button-menu' : undefined}\n\t\t\t\t\taria-expanded={open ? 'true' : undefined}\n\t\t\t\t\taria-label='select merge strategy'\n\t\t\t\t\taria-haspopup='menu'\n\t\t\t\t\tstyle={{ minWidth: 'unset !important', cursor: 'pointer' }}\n\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t>\n\t\t\t\t\t<ArrowDownTwo fontSize='small' />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<Popper\n\t\t\t\tsx={{\n\t\t\t\t\tzIndex: 1\n\t\t\t\t}}\n\t\t\t\topen={open}\n\t\t\t\tanchorEl={anchorRef.current}\n\t\t\t\trole={undefined}\n\t\t\t\ttransition\n\t\t\t\tdisablePortal>\n\t\t\t\t{({ TransitionProps, placement }) => (\n\t\t\t\t\t<Grow\n\t\t\t\t\t\t{...TransitionProps}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\ttransformOrigin:\n\t\t\t\t\t\t\t\tplacement === 'bottom' ? 'center top' : 'center bottom'\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t<Paper elevation={0} sx={{ border: '1px solid', borderRadius: 2, borderColor: 'theme.grey.200'}}>\n\t\t\t\t\t\t\t<ClickAwayListener onClickAway={handleClose}>\n\t\t\t\t\t\t\t\t<MenuList autoFocusItem>\n\t\t\t\t\t\t\t\t\t{options.map((option, index) => (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={isMenuThirdItemDisabled ? false : (index === 2)}\n\t\t\t\t\t\t\t\t\t\t\tselected={currentTitle?.trim() === option.label?.trim()}\n\t\t\t\t\t\t\t\t\t\t\tonClick={(event) => {\n\t\t\t\t\t\t\t\t\t\t\t\toption.callback(event, index);\n\t\t\t\t\t\t\t\t\t\t\t\thandleToggle();\n\t\t\t\t\t\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\toption.color ? option.color : 'theme.secondary.1000'\n\t\t\t\t\t\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</MenuList>\n\t\t\t\t\t\t\t</ClickAwayListener>\n\t\t\t\t\t\t</Paper>\n\t\t\t\t\t</Grow>\n\t\t\t\t)}\n\t\t\t</Popper>\n\t\t</React.Fragment>\n\t);\n};\n\nexport default TitleDropdownButton;\n","import React from \"react\";\r\nimport { useEffect, useRef, useState } from \"react\";\r\n\r\n\r\nimport Typography from \"../typography/typography\";\r\nimport Box from \"@mui/material/Box\";\r\nimport \"./upload-excel.scss\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport {\r\n CircularProgress,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Divider,\r\n Grow,\r\n IconButton,\r\n \r\n} from \"@mui/material\";\r\nimport RemoveIcon from \"@mui/icons-material/Remove\";\r\n// import Checkbox from \"../checkbox/checkbox\";\r\nimport Avatar from \"../avatar/avatar\";\r\nimport images from \"../../assets/images\";\r\nimport ModalLoader from '../loaders/modal-loader';\r\nimport {Trash} from '../icons';\r\n\r\nimport { KeyboardArrowDown, KeyboardArrowUp, Upload } from \"@mui/icons-material\";\r\nimport { postImportSheet } from \"../../utils/common\";\r\nimport Button from \"../button/button\";\r\n\r\n\r\ninterface UploadProps {\r\n open: boolean;\r\n title: string;\r\n multiple?: boolean;\r\n accept?: string;\r\n showCameraButton?: boolean;\r\n onClose: () => void;\r\n onConfirm: () => void;\r\n onSubmit?: (files: any[]) => void;\r\n existingDriveData?: any;\r\n importModuleName?: any;\r\n pageName?: any;\r\n handleSuccessImport?: (e?: any) => void;\r\n\r\n}\r\n\r\nconst formatBytes = (bytes: number, decimals = 2) => {\r\n if (bytes === 0) return \"0 Bytes\";\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\r\n};\r\n\r\nconst UploadExcel = (props: UploadProps) => {\r\n const {\r\n open,\r\n title,\r\n onClose,\r\n onConfirm,\r\n onSubmit,\r\n accept = \"*\",\r\n multiple = false,\r\n importModuleName,\r\n pageName,\r\n handleSuccessImport\r\n } = props;\r\n const [files, setFiles] = useState<\r\n {\r\n file: File;\r\n isPrivate: boolean;\r\n checkboxDisabled: boolean;\r\n status: string;\r\n uploadProgress: number;\r\n fileSize: number;\r\n fileName: string;\r\n fileType: string;\r\n location: string;\r\n message: string;\r\n }[]\r\n >([]);\r\n\r\n const [isCollapsed, setIsCollapsed] = useState(false);\r\n const [isDialogMinimized, setIsDialogMinimized] = useState(false);\r\n const [isDragOver, setIsDragOver] = useState(false);\r\n const [dataResult, setDataResult] = useState<any>(null);\r\n const [isLoading, setIsLoading] = useState<boolean>(false);\r\n \r\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\r\n onDropAccepted: (newFiles) => {\r\n setFiles([\r\n ...files,\r\n ...newFiles.map((file) => ({\r\n file,\r\n isPrivate: false,\r\n checkboxDisabled: false,\r\n status: \"pending\",\r\n uploadProgress: 0,\r\n fileSize: file.size,\r\n fileName: file.name,\r\n fileType: file.type,\r\n location: \"\",\r\n message: \"\",\r\n })),\r\n ]);\r\n setIsDragOver(false);\r\n },\r\n onDragEnter: () => {\r\n setIsDragOver(true);\r\n },\r\n onDragLeave: () => {\r\n setIsDragOver(false);\r\n },\r\n noClick: true,\r\n noKeyboard: true,\r\n multiple: multiple,\r\n accept: accept ? convertAcceptObject(accept) : accept,\r\n });\r\n\r\n const handleClose = () => {\r\n onClose()\r\n setDataResult(null);\r\n }\r\n\r\n const fileInputRef = useRef<HTMLInputElement>(null);\r\n\r\n // useEffect(() => {\r\n // const driveTitles = existingDriveData.map(item => item['title'])\r\n // setAllDriveData(driveTitles);\r\n // }, [existingDriveData]);\r\n\r\n\r\n useEffect(() => {\r\n const handleBeforeUnload = (event: any) => {\r\n \r\n const message =\r\n \"Are you sure you want to leave? Your uploads are not complete.\";\r\n event.returnValue = message; // Standard for most browsers\r\n return message; // For some older browsers\r\n \r\n };\r\n if (fileInputRef.current) {\r\n fileInputRef.current.multiple = multiple;\r\n }\r\n\r\n window.addEventListener(\"beforeunload\", handleBeforeUnload);\r\n\r\n return () => {\r\n // Clean up the event listener when the component unmounts\r\n window.removeEventListener(\"beforeunload\", handleBeforeUnload);\r\n };\r\n }, [ multiple]);\r\n\r\n \r\n\r\n function convertAcceptObject(types: string) {\r\n const accepts = types.split(\",\").map((item) => item.trim());\r\n const acceptObject = accepts.reduce((acc: any, type: string) => {\r\n acc[type] = [];\r\n return acc;\r\n }, {});\r\n return acceptObject;\r\n }\r\n\r\n const renderFileIcon = (file: any) => {\r\n const fileType = file?.type.split(\"/\")[0];\r\n switch (fileType) {\r\n case \"image\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#FFEBEB\" }}\r\n >\r\n <Avatar size={20} src={images.upload.documentPDF}></Avatar>\r\n </div>\r\n );\r\n case \"application\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#FFEBEB\" }}\r\n >\r\n <Avatar size={150} src={images.upload.documentPDF} alt={\"PDF\"}></Avatar>\r\n <Typography color=\"theme.secondary.1000\" weight=\"bold\" type=\"s2\">{file.name}</Typography>\r\n <Typography color=\"theme.secondary.800\" type=\"s5\">{formatBytes(file.size)}</Typography>\r\n </div>\r\n );\r\n case \"text\":\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#EBF9F2\" }}\r\n >\r\n <Avatar size={20} src={images.upload.docFile}></Avatar>\r\n </div>\r\n );\r\n default:\r\n return (\r\n <div\r\n className={\r\n isDialogMinimized ? \"document-icon-sm\" : \"document-icon-lg\"\r\n }\r\n style={{ backgroundColor: \"#EBF9F2\" }}\r\n >\r\n <Avatar size={20} src={images.upload.docFile}></Avatar>\r\n </div>\r\n );\r\n }\r\n };\r\n\r\n \r\n\r\n const handleChipClick = () => {\r\n if (fileInputRef.current) {\r\n // If multiple is true, set input for multiple files\r\n if (props.multiple) {\r\n fileInputRef.current.setAttribute(\"multiple\", \"true\");\r\n } else {\r\n // If multiple is false, set input for a single file\r\n fileInputRef.current.removeAttribute(\"multiple\");\r\n }\r\n fileInputRef.current.click();\r\n }\r\n };\r\n\r\n const handleFileChange = (e: any) => {\r\n // importData(e.target.files[0]);\r\n const file = e.target.files?.[0] || null;\r\n const f = {\r\n file,\r\n isPrivate: false,\r\n checkboxDisabled: false,\r\n status: \"pending\",\r\n uploadProgress: 0,\r\n fileSize: file.size,\r\n fileName: file.name,\r\n fileType: file.type,\r\n location: \"\",\r\n message: \"\",\r\n }\r\n\r\n \r\n setFiles([\r\n ...files,\r\n ...[f],\r\n ]);\r\n };\r\n\r\n const removeFile = (indexToRemove: number) => {\r\n\r\n setFiles((prevFiles) =>\r\n prevFiles.filter((file, index) =>index !== indexToRemove\r\n ),\r\n );\r\n };\r\n\r\n // const toggleIsPrivate = (index: number) => {\r\n // setFiles((prevFiles) =>\r\n // prevFiles.map((item, i) =>\r\n // i === index ? { ...item, isPrivate: !item.isPrivate } : item,\r\n // ),\r\n // );\r\n // };\r\n\r\n const toggleCollapse = () => {\r\n setIsCollapsed((prevIsCollapsed) => !prevIsCollapsed);\r\n };\r\n\r\n const handleMinimizeClick = () => {\r\n setIsDialogMinimized(!isDialogMinimized);\r\n isDialogMinimized ? onConfirm() : onClose();\r\n };\r\n\r\n const importData = async () => {\r\n const file = files[0].file\r\n\t\tconst formData = new FormData();\r\n\t\tformData.append('file', file); // Ensure the field name is correct.\r\n\t\tsetIsLoading(true)\r\n\t\ttry {\r\n\t\t\tconst response = await postImportSheet(formData, importModuleName, pageName);\r\n\t\t\tif(response) {\r\n\t\t\t\tsetDataResult(response.data)\r\n setIsLoading(false)\r\n if(response?.data?.failed?.length == 0){\r\n handleClose()\r\n handleSuccessImport(response?.data);\r\n }\r\n\t\t\t} \r\n\t\t} catch (error) {\r\n setIsLoading(false)\r\n\t\t}\r\n\r\n\t}\r\n\r\n useEffect(() => {\r\n open && setFiles([]);\r\n }, [open]);\r\n\r\n\r\n\r\n return (\r\n <>\r\n <Dialog open={open} onClose={handleClose} className=\"upload\">\r\n <DialogTitle className=\"upload--head\">\r\n <Box className=\"upload--title\">\r\n <Typography\r\n type=\"s3\"\r\n ml={1}\r\n weight=\"medium\"\r\n color=\"theme.secondary.1000\"\r\n >\r\n {title}\r\n </Typography>\r\n </Box>\r\n \r\n </DialogTitle>\r\n <Divider />\r\n <DialogContent className=\"upload--content\">\r\n {isLoading && <ModalLoader />}\r\n \r\n {files.length === 0 ? (\r\n <div\r\n className={`upload--fileContent ${isDragActive ? \"drag-active\" : \"\"\r\n }`}\r\n >\r\n <div {...getRootProps()} className=\"drop-view\">\r\n {!isDragOver ? (\r\n <>\r\n <input {...getInputProps()} ref={fileInputRef} />\r\n <p className=\"upload--text\">\r\n Drag and Drop files here or upload from\r\n </p>\r\n\r\n <div className=\"device-wrap\">\r\n <div className=\"select-button\" onClick={handleChipClick}>\r\n <img src={images.upload.monitor} />\r\n <Typography type=\"s5\">My Device</Typography>\r\n <input\r\n type=\"file\"\r\n {...getInputProps({ multiple: true })}\r\n ref={fileInputRef}\r\n style={{ display: \"none\" }}\r\n onChange={handleFileChange}\r\n accept={accept}\r\n />\r\n </div>\r\n \r\n </div>\r\n\r\n {dataResult?.successful?.length || dataResult?.failed?.length ? (\r\n <div className =\"mt-2\">\r\n {dataResult?.failed.length == 0 ? (\r\n <Typography type=\"s3\">\r\n All data imported successfully.\r\n </Typography> ) : (\r\n <Typography type=\"s4\" word-break=\"break-word\" color=\"theme.error.600\" weight=\"medium\">\r\n Failed to import the following records with IDs: {dataResult.failed?.map((item:any)=>item?.id).join(\", \")}\r\n </Typography> )\r\n } \r\n </div>\r\n ) : (\r\n \"\"\r\n )}\r\n </>\r\n ) : (\r\n <div className=\"after-drop\">\r\n <img src={images.upload.documentUpload} />\r\n <Typography type=\"s3\">\r\n Drag & Drop your files here\r\n </Typography>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n ) : (\r\n <Grow in={Boolean(files?.length)} timeout={500}>\r\n <Box>\r\n {files.map((file: any, index: number) => (\r\n <Box key={file?.file?.name} display='flex' width='100%' justifyContent='center' alignItems='center' flexDirection='column'>\r\n <Box className=\"icon-BG\">\r\n <IconButton onClick={() => removeFile(index)} className=\"remove-button\"><Trash fontSize='small' /> </IconButton>\r\n <Avatar size={150} src={images.upload.docFile} alt={\"PDF\"}></Avatar>\r\n </Box>\r\n <Typography type=\"s2\" weight=\"bold\" color='theme.secondary.1000'>{file?.file?.name}</Typography>\r\n <Typography type=\"s4\" color='theme.secondary.800'>{formatBytes(file?.file?.size)}</Typography>\r\n </Box>\r\n ))}\r\n {dataResult?.successful?.length || dataResult?.failed?.length ? (\r\n <div className =\"mt-2\">\r\n {dataResult?.failed.length == 0 ? (\r\n <Typography type=\"s3\">\r\n All data imported successfully.\r\n </Typography> ) : (\r\n <Typography type=\"s4\" word-break=\"break-word\" color=\"theme.error.600\" weight=\"medium\">\r\n Failed to import the following records with IDs: {dataResult?.failed?.map((item:any)=>item.id).join(\", \")}\r\n </Typography> )\r\n } \r\n </div>\r\n ) : (\r\n \"\"\r\n )}\r\n </Box>\r\n </Grow>\r\n )}\r\n </DialogContent>\r\n <DialogActions className=\"uploadActions\">\r\n <Button onClick={onSubmit ? ()=>{\r\n onSubmit(files)\r\n } : importData} startIcon={<Upload />}>Upload</Button>\r\n </DialogActions>\r\n </Dialog>\r\n {isDialogMinimized && (\r\n <div className=\"bottom-corner-box\">\r\n <div className=\"top-section\">\r\n <div className=\"top-text\">\r\n Uploading {files.length} Item{files.length !== 1 ? \"s\" : \"\"}\r\n </div>\r\n <div className=\"top-options\">\r\n <div className=\"btn\" onClick={handleMinimizeClick}>\r\n <RemoveIcon />\r\n </div>\r\n <div className=\"btn\" onClick={toggleCollapse}>\r\n <div className=\"arrow-btn\">\r\n {isCollapsed ? <KeyboardArrowUp /> : <KeyboardArrowDown />}\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n <div className=\"box-list\">\r\n {!isCollapsed &&\r\n files.map((file: any, index: number) => (\r\n <div className=\"bottom-section\">\r\n <div className=\"doc-icon\">{renderFileIcon(file?.file)}</div>\r\n <div className=\"file-detail\">\r\n <div className=\"file-name\">\r\n <div className=\"file-text\">\r\n {file?.file?.name}\r\n {index}\r\n </div>\r\n </div>\r\n <div className=\"file-status\">\r\n {file?.status !== \"canceled\" ? (\r\n <>\r\n {file.uploadProgress === 0 && (\r\n <div className=\"avatar-container\">\r\n <Avatar\r\n size={20}\r\n className=\"avatar\"\r\n src={images.upload.empty}\r\n ></Avatar>\r\n <Avatar\r\n size={20}\r\n onClick={() => removeFile(index)}\r\n src={images.upload.close}\r\n className=\"close-icon\"\r\n ></Avatar>\r\n </div>\r\n )}\r\n {file?.uploadProgress > 0 &&\r\n file?.uploadProgress < 100 && (\r\n <CircularProgress\r\n color=\"success\"\r\n variant=\"determinate\"\r\n value={file?.uploadProgress}\r\n />\r\n )}\r\n {file?.uploadProgress === 100 && (\r\n <div className=\"avatar-container\">\r\n <Avatar\r\n size={20}\r\n className=\"avatar\"\r\n src={images.upload.tick}\r\n ></Avatar>\r\n <Avatar\r\n size={20}\r\n src={images.upload.folder}\r\n className=\"close-icon\"\r\n ></Avatar>\r\n </div>\r\n )}\r\n </>\r\n ) : (\r\n <Typography type=\"s4\" className=\"canceled-text\">\r\n Upload Canceled\r\n </Typography>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport { UploadExcel };\r\nexport default UploadExcel;\r\n","import Button from '../button/button';\r\nimport Typography from '../typography/typography';\r\n/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport './action-bar.scss';\r\nimport {\r\n\t/* IconButton, */ Box,\r\n\tDivider,\r\n\tIconButton,\r\n\tMenu,\r\n\tMenuItem,\r\n\tuseMediaQuery,\r\n\tuseTheme\r\n} from '@mui/material';\r\nimport AddIcon from '@mui/icons-material/Add';\r\nimport ViewModal from '../view-modal/view-modal';\r\nimport HeaderCard from '../header-card/header-card';\r\nimport SearchBar from '../search-bar/search-bar';\r\nimport { useEffect, useMemo, useState } from 'react';\r\nimport images from '../../assets/images';\r\nimport Toggle from '../toggle/toggle';\r\nimport Filter from '../filter/filter';\r\nimport Select from '../select/select';\r\nimport { RuleGroupType } from 'react-querybuilder';\r\nimport SaveFilterModal from '../save-filter-modal/save-filter-modal';\r\nimport {\r\n\tsetBaseUrl,\r\n\tpostV1Filter,\r\n\tgetV1FilterResource\r\n} from '../../api-client/api.system-feature/api';\r\nimport type * as Types from '../../api-client/api.system-feature/api-types';\r\nimport { auth } from '../../constants/auth';\r\nimport DropdownButton from '../dropdown-button/dropdown-button';\r\nimport TitleDropdownButton from '../title-dropdown-button/title-dropdown-button';\r\nimport { useAppDispatch, useAppSelector } from '../../redux/hooks';\r\nimport { getToken } from '../../utils/common';\r\nimport React from 'react';\r\nimport UploadExcel from '../upload-excel/upload-excel';\r\nimport { generateQueryString, getErrorMessage, getExcelTemplateGenerateTemplate, getOperatorLabel, getExcelExportTemplate, getPdfExportTemplate } from '../../utils/common';\r\nimport { initialFilter, ViewType } from '../../contexts/page-context';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport Chip from '../chip/chip';\r\nimport formatText, { formatLabel } from '../../utils/format-text';\r\nimport { Cancel } from '@mui/icons-material';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { IResources, routeToResourceMap } from '../../constants/route-page-map';\r\nimport { enqueueSnackbar } from 'notistack';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FilterRemove, Filter as FilterIcon, Search, FolderSave, Export, Import, DocumentDownload } from '../icons';\r\nimport { co } from 'node_modules/@fullcalendar/core/internal-common';\r\n\r\ninterface ActionData {\r\n\tlabel: string;\r\n\tposition: number;\r\n}\r\ninterface ActionBarPropsType {\r\n\ttitle: string;\r\n\tdata: ActionData[];\r\n\tsetData: React.Dispatch<React.SetStateAction<ActionData[]>>;\r\n\tactive: string;\r\n\tsetActive: (view: ViewType) => void;\r\n\thandleAddButton?: (e?: any) => void;\r\n\tbutton?: boolean;\r\n\thandleSearch?: (value: string) => void;\r\n\tfilters?: string;\r\n\tdisabledViews?: string[];\r\n\tisDropdownMenuButton?: boolean;\r\n\titemListingDropdownOptions?: any;\r\n\tisTitleMenu?: boolean;\r\n\ttitleMenus?: any;\r\n\tfolderData?: any;\r\n\ttype?: any;\r\n\tfields?: any;\r\n\tapplyFilter?: any;\r\n\tsavedFilters?: SavedFilter;\r\n\tsetSavedFilters?: (view: SavedFilter) => void;\r\n\tisToggleButton?: boolean;\r\n\thandleToggleButton?: (e?: any) => void;\r\n\tshowView?: boolean;\r\n\tshowSearch?: boolean;\r\n\tshowFilter?: boolean;\r\n\tcustomButtons?: React.ReactNode[] | JSX.Element[];\r\n\tactionBtn?: React.ReactNode[] | JSX.Element[];\r\n\tpageName?: string;\r\n\timportModuleName?: string;\r\n\tsearchText?: string;\r\n\tselectedIds?: any;\r\n\tisUseFields?: boolean;\r\n\thandleSuccessImport?: (e?: any) => void;\r\n}\r\n\r\ninterface SavedFilter {\r\n\tid: string;\r\n\tname: string;\r\n\tquery: RuleGroupType;\r\n}\r\n\r\nconst ActionBar = React.memo((props: ActionBarPropsType) => {\r\n\tconst token = localStorage.getItem(auth.storageTokenKeyName) || undefined;\r\n\tconst location = useLocation();\r\n\r\n\tconst {\r\n\t\ttitle,\r\n\t\tdata,\r\n\t\tsetData,\r\n\t\tactive,\r\n\t\tsetActive,\r\n\t\thandleAddButton,\r\n\t\thandleSearch,\r\n\t\tbutton = true,\r\n\t\tdisabledViews,\r\n\t\tisDropdownMenuButton = false,\r\n\t\titemListingDropdownOptions = [],\r\n\t\tisTitleMenu = false,\r\n\t\ttitleMenus = [],\r\n\t\ttype,\r\n\t\tfields = [],\r\n\t\tapplyFilter,\r\n\t\t// setSavedFilters,\r\n\t\t// savedFilters,\r\n\t\tisToggleButton = false,\r\n\t\thandleToggleButton,\r\n\t\tshowSearch = true,\r\n\t\tshowFilter = true,\r\n\t\tshowView = true,\r\n\t\tcustomButtons,\r\n\t\tpageName,\r\n\t\tactionBtn,\r\n\t\timportModuleName,\r\n\t\tselectedIds,\r\n\t\tsearchText,\r\n\t\tisUseFields,\r\n\t\thandleSuccessImport\r\n\t} = props;\r\n\tconst dispatch = useAppDispatch();\r\n\tconst [isToggled, setIsToggled] = useState<boolean>(false);\r\n\tconst [isToggledForItem, setIsToggledForItem] = useState<boolean>(false);\r\n\tconst [openFilterPopup, setOpenFilterPopup] = useState<boolean>(false);\r\n\tconst [status, setStatus] = useState<string>('');\r\n\tconst [openSaveFilter, setIsOpenSaveFilter] = useState<boolean>(false);\r\n\tconst [rowAnchorEl, setRowAnchorEl] = useState<null | HTMLElement>(null);\r\n\tconst [isUploadModalOpen, setIsUploadModalOpen] = useState(false);\r\n\tconst [savedFilters, setSavedFilters] = useState<any[]>([]);\r\n\t// const [selectedSavedFilter, setSelectedSavedFilter] = useState<any>(null);\r\n\tconst [searchedText, setSearchedText] = useState<string>(\"\");\r\n\tconst { t } = useTranslation();\r\n\tconst theme = useTheme();\r\n\tconst isLgUp = useMediaQuery(theme.breakpoints.up('xl'));\r\n\tconst { activePage, updatePageInfo, schemaFields, setActivePage } = usePages();\r\n\tconst { filters } = activePage;\r\n\r\n\tconst resources: IResources = useMemo(() => routeToResourceMap[location.pathname] || null, [location.pathname])\r\n\r\n\t// const { filterBar, filterQuery } = useAppSelector((store) => {\r\n\t// \treturn store?.drive;\r\n\t// });\r\n\r\n\r\n\r\n\tuseEffect(() => {\r\n\t\tfetchSavedFilters();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tconst fetchSavedFilters = async (): Promise<void> => {\r\n\t\tif (resources?.pageResource || resources?.fieldResource) {\r\n\t\t\tgetV1FilterResource({ ...getToken(), resource: resources?.pageResource || resources?.fieldResource })\r\n\t\t\t\t.then((response: any) => {\r\n\t\t\t\t\tconst savedFilters = response.data.result.map((e: any) => {\r\n\t\t\t\t\t\treturn { id: e._id, name: e.name, query: e.data };\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tsetSavedFilters?.(savedFilters);\r\n\t\t\t\t})\r\n\t\t\t\t.catch((err: any) => console.log('Error fetching saved filters:', err));\r\n\t\t} else {\r\n\t\t\tsetSavedFilters([])\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tconst handleFilterHide = () => {\r\n\t\t// dispatch(setFilterBar(false));\r\n\t\treturn\r\n\t};\r\n\r\n\tconst handleStatusChange = (event: any) => {\r\n\t\tsetStatus(event.target.value);\r\n\t};\r\n\r\n\tconst handleSaveFilterClick = () => {\r\n\t\tif (filters?.rules) {\r\n\t\t\tsetIsOpenSaveFilter(true);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleImportClick = (event: any) => {\r\n\t\tsetRowAnchorEl(event.currentTarget);\r\n\t};\r\n\r\n\tconst handleActionsClose = () => {\r\n\t\tsetRowAnchorEl(null);\r\n\t};\r\n\r\n\tconst handleSaveFilter = (query: RuleGroupType) => {\r\n\t\t// dispatch(setFilterQuery(query));\r\n\t\treturn\r\n\t};\r\n\r\n\tconst handleSave = async (name: string, filterQuery: RuleGroupType) => {\r\n\r\n\t\t// dispatch(setFilterBar(false));\r\n\r\n\t\tconst postFilterRequest: Types.PostV1FilterRequest = {\r\n\t\t\t'x-token': token,\r\n\t\t\tmodule: resources?.pageResource || resources?.fieldResource || 'erp-common',\r\n\t\t\tname: name,\r\n\t\t\tis_applied: true,\r\n\t\t\tdata: filterQuery\r\n\t\t};\r\n\t\ttry {\r\n\t\t\tawait postV1Filter(postFilterRequest)\r\n\t\t\tenqueueSnackbar('Filters saved successfully.')\r\n\t\t\tsetActivePage((prev: any) => ({\r\n\t\t\t\t...prev,\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prev.filters,\r\n\t\t\t\t\tname,\r\n\t\t\t\t\trules: filterQuery.rules\r\n\t\t\t\t},\r\n\t\t\t\tfilterQueryString: generateQueryString(filterQuery)\r\n\t\t\t}));\r\n\t\t\tsetIsOpenSaveFilter(false);\r\n\t\t} catch (error) {\r\n\t\t\tlet m: string = 'Something went wrong on saving filters'\r\n\t\t\tif (error instanceof Error) {\r\n\t\t\t\tm = getErrorMessage(error.message)\r\n\t\t\t}\r\n\t\t\tenqueueSnackbar(m, { variant: 'error' })\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn true\r\n\t};\r\n\r\n\tconst handleToggle = () => {\r\n\t\tsetIsToggled((prev) => !prev);\r\n\t\talert('Toggled');\r\n\t};\r\n\r\n\tconst handleChangeToggleButton = () => {\r\n\t\tsetIsToggledForItem((prev) => !prev);\r\n\t\thandleToggleButton?.();\r\n\t};\r\n\r\n\tconst handleCloseFilter = () => {\r\n\t\tsetOpenFilterPopup(false);\r\n\t};\r\n\r\n\tconst handleActiveHeaderCard = (data: ActionData) => {\r\n\t\tsetActive(data?.label);\r\n\t};\r\n\r\n\tconst downloadTemplate = async (moduleName: string) => {\r\n\t\tconst templateURL: any = await getExcelTemplateGenerateTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tresource: moduleName\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.xlsx`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst exportExcel = async (moduleName: string, filterQueryString: string, selectedIds: any, title: string) => {\r\n\t\tconst templateURL: any = await getExcelExportTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tactivePage: activePage,\r\n\t\t\tfilterQueryString: filterQueryString,\r\n\t\t\tselectedIds: selectedIds,\r\n\t\t\ttitle: title\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.xlsx`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst exportPdf = async (moduleName: string, filterQueryString: string, selectedIds: any, title: string) => {\r\n\t\tconst columns = activePage.visible_columns.map((col: any) => ({\r\n\t\t\t...col,\r\n\t\t\theader: t(col.header) \r\n\t\t}));\r\n\t\tconst templateURL: any = await getPdfExportTemplate({\r\n\t\t\t'x-token': token,\r\n\t\t\tactivePage: activePage,\r\n\t\t\tfilterQueryString: filterQueryString,\r\n\t\t\tselectedIds: selectedIds,\r\n\t\t\ttitle: title,\r\n\t\t\tcolumns: columns\r\n\t\t});\r\n\t\tif (templateURL) {\r\n\t\t\tconst blob = await templateURL.blob();\r\n\r\n\t\t\tconst link = document.createElement('a');\r\n\r\n\t\t\tconst url = window.URL.createObjectURL(blob);\r\n\r\n\t\t\tlink.href = url;\r\n\t\t\tlink.download = `${moduleName}.pdf`;\r\n\r\n\t\t\tdocument.body.appendChild(link);\r\n\t\t\tlink.click();\r\n\t\t\tdocument.body.removeChild(link);\r\n\t\t\twindow.URL.revokeObjectURL(url);\r\n\t\t}\r\n\t};\r\n\r\n\tconst openImportTemplate = () => {\r\n\t\tsetIsUploadModalOpen(true);\r\n\t};\r\n\tconst rowActionMenu = [];\r\n\tif (pageName && (!importModuleName || selectedIds)) {\r\n\t\trowActionMenu.push({\r\n\t\t\tlabel: 'Export Excel',\r\n\t\t\thandleAction: (moduleName: string) => exportExcel(moduleName, activePage.filterQueryString, selectedIds, title),\r\n\t\t\ticon: <Export fontSize='small' />\r\n\t\t})\r\n\t}\r\n\tif(pageName && (!importModuleName || selectedIds)){\r\n\t\trowActionMenu.push({\r\n\t\t\tlabel: 'Export PDF',\r\n\t\t\thandleAction: (moduleName: string) => exportPdf(moduleName, activePage.filterQueryString, selectedIds, title),\r\n\t\t\ticon: <Export fontSize='small'/>\r\n\t\t})\r\n\t}\r\n\tif (pageName && importModuleName) {\r\n\t\t{\r\n\t\t\trowActionMenu.push({\r\n\t\t\t\tlabel: 'Download Template ',\r\n\t\t\t\thandleAction: (moduleName: string) => downloadTemplate(moduleName),\r\n\t\t\t\ticon: <DocumentDownload fontSize='small' />\r\n\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tlabel: 'Import Template',\r\n\t\t\t\t\thandleAction: (moduleName: string) => openImportTemplate(moduleName),\r\n\t\t\t\t\ticon: <Import fontSize='small' />\r\n\t\t\t\t})\r\n\t\t}\r\n\t}\r\n\r\n\tconst getFilterChipLabels = (rule: any) => {\r\n\t\trule = { ...rule, field: rule.field?.replace(\"__replaceKey\", '') }\r\n\t\tlet label = schemaFields.find((f: any) => f.key === rule.field)?.label || rule.field;\r\n\t\tlabel = formatLabel(label?.replace('_id', ' '));\r\n\t\tconst opLabel = getOperatorLabel(rule, schemaFields);\r\n\r\n\t\tlet value = rule.value;\r\n\t\tif (Array.isArray(rule.value)) {\r\n\t\t\trule.value = rule.value.map(rv => formatLabel(typeof rv === 'object' ? (rv.label) : rv))\r\n\t\t\tvalue = rule.value.join(', ');\r\n\t\t}\r\n\r\n\t\treturn <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\r\n\t\t\t<Typography type='s5' color='theme.secondary.800' weight='medium'>{label}</Typography>\r\n\t\t\t<Divider orientation='vertical' flexItem />\r\n\t\t\t<Typography type='s5' color='theme.primary.800' weight='medium'>{formatText(opLabel)} {value}</Typography>\r\n\t\t</Box>\r\n\t\t// `${label}: ${value}`;\r\n\t};\r\n\r\n\tconst getFilterChip = (rr: any, index: any) => {\r\n\t\treturn (\r\n\t\t\t<Chip\r\n\t\t\t\tlabel={getFilterChipLabels(rr)}\r\n\t\t\t\tvariant='outlined'\r\n\t\t\t\tactive\r\n\t\t\t\tsx={({ palette }) => ({\r\n\t\t\t\t\tbackgroundColor: 'grey.200',\r\n\t\t\t\t\tborderColor: `${palette.grey[300]} !important`,\r\n\t\t\t\t\topacity: 0.8,\r\n\t\t\t\t\t'&:hover': { backgroundColor: `${palette.grey[200]} !important` },\r\n\t\t\t\t\tflexDirection: 'row-reverse',\r\n\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\tgap: 0.75,\r\n\t\t\t\t\tcursor: 'unset'\r\n\t\t\t\t})}\r\n\t\t\t\tdeleteIcon={\r\n\t\t\t\t\t<Cancel\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tfontSize: '1rem !important',\r\n\t\t\t\t\t\t\tcolor: '#919294 !important',\r\n\t\t\t\t\t\t\tmarginRight: 'auto !important',\r\n\t\t\t\t\t\t\tmarginLeft: `0 !important`,\r\n\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\tcolor: 'inherit !important'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t}\r\n\t\t\t\tonDelete={() => removeSignleFilter(index)}\r\n\t\t\t\tclickable={false}\r\n\t\t\t/>\r\n\t\t)\r\n\t}\r\n\r\n\tconst removeSignleFilter = (ruleIndex: number) => {\r\n\t\tconst uRules: any[] = filters.rules.filter(\r\n\t\t\t(_, index) => index !== ruleIndex\r\n\t\t);\r\n\t\tconst uFilters = { ...filters, rules: uRules };\r\n\t\tconst filterQueryString = generateQueryString(uFilters);\r\n\r\n\t\tupdatePageInfo({\r\n\t\t\tfilters: uFilters,\r\n\t\t\tfilterQueryString\r\n\t\t});\r\n\t};\r\n\r\n\tconst isFilterApplied = (flt: any): boolean => Boolean(flt?.rules?.length);\r\n\tconst [searchAnchorEl, setSearchAnchorEl] = useState<HTMLElement | null>(null);\r\n\t// useEffect(() => {\r\n\t// \tif(activePage?.active_view ){\r\n\t// \t\tconst updateViews=activePage?.views?.length?activePage.views:[{\r\n\t// \t\t\tlabel:activePage?.active_view,\r\n\t// \t\t\tposition:0\r\n\t// \t\t}]\r\n\t// \t\tsetData(updateViews)\r\n\t// \t}\t\t\r\n\t// \t//eslint-disable-next-line\r\n\t// },[isCreatePage,activePage?.active_view])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (activePage?.search) {\r\n\t\t\tsetSearchedText(activePage?.search)\r\n\t\t}\r\n\t}, [activePage?.search])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (searchedText) {\r\n\t\t\thandleSearch?.(searchedText);\r\n\t\t\tupdatePageInfo({ search: searchedText });\r\n\t\t}\r\n\t\t//eslint-disable-next-line\r\n\t}, [searchedText])\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t<div className='action-bar'>\r\n\t\t\t\t<div className='action-bar--LeftContent'>\r\n\t\t\t\t\t{isTitleMenu ? (\r\n\t\t\t\t\t\t<div style={{ zIndex: 999 }}>\r\n\t\t\t\t\t\t\t<TitleDropdownButton\r\n\t\t\t\t\t\t\t\tonClick={handleAddButton}\r\n\t\t\t\t\t\t\t\toptions={titleMenus}\r\n\t\t\t\t\t\t\t\tisMenuThirdItemDisabled={true}\r\n\t\t\t\t\t\t\t\tcurrentTitle={title}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t\t</TitleDropdownButton>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<Typography type='h3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{title}\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t<div className='action-bar--HeaderCard'>\r\n\t\t\t\t\t\t{Boolean(data) &&\r\n\t\t\t\t\t\t\tdata\r\n\t\t\t\t\t\t\t\t.map((ele) => ele)\r\n\t\t\t\t\t\t\t\t.sort((a, b) => a.position - b.position)\r\n\t\t\t\t\t\t\t\t.map((item: ActionData) => (\r\n\t\t\t\t\t\t\t\t\t<HeaderCard\r\n\t\t\t\t\t\t\t\t\t\tkey={item?.position}\r\n\t\t\t\t\t\t\t\t\t\ttitle={item?.label}\r\n\t\t\t\t\t\t\t\t\t\tactive={active}\r\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleActiveHeaderCard(item)}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t{showView && (\r\n\t\t\t\t\t\t\t<ViewModal\r\n\t\t\t\t\t\t\t\tsetData={setData}\r\n\t\t\t\t\t\t\t\tdata={data}\r\n\t\t\t\t\t\t\t\tsetActive={setActive}\r\n\t\t\t\t\t\t\t\tdisabledViews={disabledViews}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div className='action-bar--RightContent' style={{ gap: isLgUp ? `1rem` : `0.5rem` }}>\r\n\t\t\t\t\t{isToggleButton && (\r\n\t\t\t\t\t\t<div className='item--VariantDisplay'>\r\n\t\t\t\t\t\t\t<div className='item--VariantHeading'>Variant:</div>\r\n\t\t\t\t\t\t\t<div className='item--VariantToggal'>\r\n\t\t\t\t\t\t\t\t<Toggle\r\n\t\t\t\t\t\t\t\t\tchecked={isToggledForItem}\r\n\t\t\t\t\t\t\t\t\tonChange={handleChangeToggleButton}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{showSearch && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{isLgUp ?\r\n\t\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\t\tplaceholder='Search'\r\n\t\t\t\t\t\t\t\t\thandleSearch={(e) => {\r\n\t\t\t\t\t\t\t\t\t\tsetSearchedText(e);\r\n\t\t\t\t\t\t\t\t\t\thandleSearch?.(e);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdebounceTime={1000}\r\n\t\t\t\t\t\t\t\t\tisDrivePage={true}\r\n\t\t\t\t\t\t\t\t\tsearchText={searchedText}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t<IconButton size='small' onClick={(e) => setSearchAnchorEl(e.currentTarget)}><Search fontSize='small' color='grey.1000' /> </IconButton>\r\n\t\t\t\t\t\t\t\t\t<Menu\r\n\t\t\t\t\t\t\t\t\t\tanchorEl={searchAnchorEl}\r\n\t\t\t\t\t\t\t\t\t\topen={Boolean(searchAnchorEl)}\r\n\t\t\t\t\t\t\t\t\t\tonClose={() => setSearchAnchorEl(null)}\r\n\t\t\t\t\t\t\t\t\t\tanchorOrigin={{\r\n\t\t\t\t\t\t\t\t\t\t\tvertical: 'top',\r\n\t\t\t\t\t\t\t\t\t\t\thorizontal: 'right',\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\ttransformOrigin={{\r\n\t\t\t\t\t\t\t\t\t\t\tvertical: 'top',\r\n\t\t\t\t\t\t\t\t\t\t\thorizontal: 'right',\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\tsx={{ '& ul': { p: 0 }, '& .MuiMenu-paper': { boxShadow: `0px 4px 6px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.06);` } }}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<SearchBar\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder='Search'\r\n\t\t\t\t\t\t\t\t\t\t\thandleSearch={(e) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetSearchedText(e);\r\n\t\t\t\t\t\t\t\t\t\t\t\thandleSearch?.(e);\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tdebounceTime={1000}\r\n\t\t\t\t\t\t\t\t\t\t\tisDrivePage={true}\r\n\t\t\t\t\t\t\t\t\t\t\tsearchText={searchText || searchedText}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</Menu>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{showFilter && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{isLgUp ?\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t// sx={{display:\"none\"}}\r\n\t\t\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\t\t\tstartIcon={<FilterIcon fontSize='small' />}\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tsetOpenFilterPopup(true);\r\n\t\t\t\t\t\t\t\t\t\tfetchSavedFilters();\r\n\t\t\t\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t\t\t\t{t('common.filter')}\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\t\t<IconButton onClick={() => {\r\n\t\t\t\t\t\t\t\t\tsetOpenFilterPopup(true);\r\n\t\t\t\t\t\t\t\t\tfetchSavedFilters();\r\n\t\t\t\t\t\t\t\t}} size='small'>\r\n\t\t\t\t\t\t\t\t\t<FilterIcon fontSize='small' color='grey.1000' />\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{customButtons}\r\n\t\t\t\t\t{actionBtn}\r\n\t\t\t\t\t{button && (\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\t\t\tstartIcon={<AddIcon />}\r\n\t\t\t\t\t\t\tonClick={handleAddButton}>\r\n\t\t\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{isDropdownMenuButton && (\r\n\t\t\t\t\t\t<div style={{ zIndex: 999 }}>\r\n\t\t\t\t\t\t\t<DropdownButton\r\n\t\t\t\t\t\t\t\tonClick={handleAddButton}\r\n\t\t\t\t\t\t\t\toptions={itemListingDropdownOptions}\r\n\t\t\t\t\t\t\t\tstartIcon={<AddIcon />}\r\n\t\t\t\t\t\t\t\tisMenuThirdItemDisabled={true}>\r\n\t\t\t\t\t\t\t\t{t('common.add')}\r\n\t\t\t\t\t\t\t</DropdownButton>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{pageName ? (\r\n\t\t\t\t\t\t<IconButton onClick={(e) => handleImportClick(e)}>\r\n\t\t\t\t\t\t\t<img src={images.more} alt='More Icon' />\r\n\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t''\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t<Menu\r\n\t\t\t\t\t\tanchorEl={rowAnchorEl}\r\n\t\t\t\t\t\topen={Boolean(rowAnchorEl)}\r\n\t\t\t\t\t\tonClose={handleActionsClose}>\r\n\t\t\t\t\t\t{rowActionMenu?.map((option: any) => {\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\toption.handleAction(pageName);\r\n\t\t\t\t\t\t\t\t\t\tsetRowAnchorEl(null);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tsx={{ alignItems: 'center', gap: 0.5 }}\r\n\t\t\t\t\t\t\t\t\tdisabled={\r\n\t\t\t\t\t\t\t\t\t\ttypeof option.disabled === 'function'\r\n\t\t\t\t\t\t\t\t\t\t\t? option.disabled()\r\n\t\t\t\t\t\t\t\t\t\t\t: Boolean(option.disabled)\r\n\t\t\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\t\t{option?.icon}\r\n\t\t\t\t\t\t\t\t\t<Typography type='s4' color='inherit'>\r\n\t\t\t\t\t\t\t\t\t\t{option.label}\r\n\t\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t</Menu>\r\n\r\n\t\t\t\t\t<Filter\r\n\t\t\t\t\t\topen={openFilterPopup}\r\n\t\t\t\t\t\tonClose={handleCloseFilter}\r\n\t\t\t\t\t\tactiveView={active}\r\n\t\t\t\t\t\tsavedFilters={savedFilters}\r\n\t\t\t\t\t\tfetchSavedFilters={fetchSavedFilters}\r\n\t\t\t\t\t\tonSaveFilter={handleSaveFilter}\r\n\t\t\t\t\t\ttype={type}\r\n\t\t\t\t\t\tisUseFields={isUseFields}\r\n\t\t\t\t\t\tfields={fields}\r\n\t\t\t\t\t\tonSelectedFilter={f => setSelectedSavedFilter(f)}\r\n\t\t\t\t\t\tapplyFilter={applyFilter}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\r\n\t\t\t{/* Applied Filters view (Start) */}\r\n\t\t\t{isFilterApplied(filters) && (\r\n\t\t\t\t<Box\r\n\t\t\t\t\tmb={1}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\tjustifyContent: 'space-between'\r\n\t\t\t\t\t}}>\r\n\t\t\t\t\t<Box\r\n\t\t\t\t\t\tmb={1}\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\t\tgap: 1,\r\n\t\t\t\t\t\t\tmaxWidth: 400\r\n\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t<Typography type='s3' weight='medium' color='theme.secondary.1000'>\r\n\t\t\t\t\t\t\t{t('common.filters')}:{' '}\r\n\t\t\t\t\t\t</Typography>\r\n\r\n\t\t\t\t\t\t{filters?.rules?.map((r, rIndex) => (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{r?.rules?.length ? (\r\n\t\t\t\t\t\t\t\t\tr?.rules?.map((rr, rrIndex) => (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{getFilterChip(rr, rrIndex)}\r\n\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t\t) : <>\r\n\t\t\t\t\t\t\t\t\t{getFilterChip(r, rIndex)}\r\n\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t\t<Box>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tstartIcon={<FolderSave fontSize='small' />}\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t<span> {t('common.saveFilter')}</span>\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t{/* {selectedSavedFilter && \r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tstartIcon={<img src={images.common.saveFilterIcon} alt='Add Icon' />}\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t\t<Typography type='s3' color=\"theme.secondary.1000\" weight='medium'>\r\n\t\t\t\t\t\t\t\t\tUpdate Filter <Typography type='s3' weight='medium'>{`(${selectedSavedFilter.name})`}</Typography>\r\n\t\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t} */}\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tstartIcon={<FilterRemove fontSize='small' />}\r\n\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\tupdatePageInfo({\r\n\t\t\t\t\t\t\t\t\tfilters: initialFilter,\r\n\t\t\t\t\t\t\t\t\tfilterQueryString: ''\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t{t('common.clearFilter')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</Box>\r\n\t\t\t\t</Box>\r\n\t\t\t)}\r\n\t\t\t{/* Applied Filters view (End) */}\r\n\r\n\t\t\t{/* {filterBar && (\r\n\t\t\t\t<div className='filter-bar'>\r\n\t\t\t\t\t<div className='filter-bar--LeftContent'>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<Select\r\n\t\t\t\t\t\t\t\tfullWidth\r\n\t\t\t\t\t\t\t\tplaceholder='Placeholder'\r\n\t\t\t\t\t\t\t\tsize={'small'}\r\n\t\t\t\t\t\t\t\tclassName='status-changes-drp'\r\n\t\t\t\t\t\t\t\tvalue={status}\r\n\t\t\t\t\t\t\t\tonChange={handleStatusChange}\r\n\t\t\t\t\t\t\t\tvariant='outlined'>\r\n\t\t\t\t\t\t\t\t<MenuItem value={'Status'}>{t('common.status')}</MenuItem>\r\n\t\t\t\t\t\t\t\t<MenuItem value={'Show'}>{t('common.show')}</MenuItem>\r\n\t\t\t\t\t\t\t</Select>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<Typography className='subtask-switch' variant='h6'>\r\n\t\t\t\t\t\t\t{t('common.subtask')}\r\n\t\t\t\t\t\t\t<Toggle checked={isToggled} onChange={handleToggle} />\r\n\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t|\r\n\t\t\t\t\t\t<Button className='hide-btn' onClick={handleFilterHide}>\r\n\t\t\t\t\t\t\t{t('common.hide')}\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className='filter-bar--RightContent'>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tvariant='text'\r\n\t\t\t\t\t\t\tclassName='enable-filter-btn'\r\n\t\t\t\t\t\t\tonClick={handleSaveFilterClick}>\r\n\t\t\t\t\t\t\t<img src={images.common.saveFilterIcon} alt='Add Icon' />\r\n\t\t\t\t\t\t\t<span>{t('common.saveFilter')}</span>\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t)} */}\r\n\t\t\t<SaveFilterModal\r\n\t\t\t\topen={openSaveFilter}\r\n\t\t\t\tonClose={() => setIsOpenSaveFilter(false)}\r\n\t\t\t\thandleSubmit={(name: any) =>\r\n\t\t\t\t\thandleSave(name, filters as RuleGroupType)\r\n\t\t\t\t}\r\n\t\t\t/>\r\n\t\t\t<UploadExcel\r\n\t\t\t\topen={isUploadModalOpen}\r\n\t\t\t\tshowCameraButton={false}\r\n\t\t\t\tonClose={() => setIsUploadModalOpen(false)}\r\n\t\t\t\tonConfirm={() => setIsUploadModalOpen(true)}\r\n\t\t\t\ttitle='Upload'\r\n\t\t\t\tmultiple={false}\r\n\t\t\t\timportModuleName={importModuleName}\r\n\t\t\t\tpageName={importModuleName}\r\n\t\t\t\thandleSuccessImport={handleSuccessImport}\r\n\t\t\t\taccept='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n});\r\n\r\nexport { ActionBar };\r\nexport default ActionBar;\r\n","import { Box, Breadcrumbs, BreadcrumbsProps } from '@mui/material';\nimport Typography from '../typography/typography';\nimport { Link } from 'react-router-dom';\n\ninterface BreadCrumbSlot {\n\tlink?: string;\n\tlabel: string | JSX.Element;\n\tlinkState?: any;\n\tonClick?: () => void;\n}\n\ninterface PropsType extends BreadcrumbsProps {\n\tpath: BreadCrumbSlot[];\n}\n\nconst BreadCrumb = (props: PropsType) => {\n\tconst { path } = props;\n\n\treturn (\n\t\t<>\n\t\t\t<Breadcrumbs\n\t\t\t\tsx={{\n\t\t\t\t\t'& .MuiBreadcrumbs-separator': {\n\t\t\t\t\t\tcolor: 'theme.secondary.600'\n\t\t\t\t\t}\n\t\t\t\t}}>\n\t\t\t\t{path?.map((slot, index) => (\n\t\t\t\t\t<Box key={index}>\n\t\t\t\t\t\t{index < path?.length - 1 ? (\n\t\t\t\t\t\t\t// <Link\n\t\t\t\t\t\t\t// \tto={String(slot?.link) ?? undefined}\n\t\t\t\t\t\t\t// \tstyle={{ display: 'block' }}>\n\t\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\t\tcolor='theme.secondary.600'\n\t\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\t\tcomponent={slot?.link ? Link : undefined}\n\t\t\t\t\t\t\t\t\tto={String(slot?.link) ?? undefined}\n\t\t\t\t\t\t\t\t\tstate={slot?.linkState}\n\t\t\t\t\t\t\t\t\tonClick={slot?.onClick} style={{ display: 'block' }}>\n\t\t\t\t\t\t\t\t\t{slot?.label}\n\t\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t\t// </Link>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Typography\n\t\t\t\t\t\t\t\ttype='s4'\n\t\t\t\t\t\t\t\tweight='medium'\n\t\t\t\t\t\t\t\tcolor='theme.secondary.1000'>\n\t\t\t\t\t\t\t\t{slot?.label}\n\t\t\t\t\t\t\t</Typography>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Box>\n\t\t\t\t))}\n\t\t\t</Breadcrumbs>\n\t\t</>\n\t);\n};\n\nexport { BreadCrumb };\nexport default BreadCrumb;\n","import { Box, IconButton, MenuItem, SelectChangeEvent, TextField } from \"@mui/material\";\r\nimport Typography from \"../typography/typography\";\r\nimport Select from \"../select/select\";\r\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\r\nimport ChevronRightICon from \"@mui/icons-material/ChevronRight\";\r\nimport \"./pagination.scss\";\r\nimport { IPaginationModel } from \"../../@types/pagination-model\";\r\nimport { useLanguage } from \"../../hooks/useLangauge\";\r\nimport { usePages } from \"../../hooks/use-pages\";\r\nimport { useEffect } from \"react\";\r\n\r\ninterface IPagination {\r\n paginationModel: IPaginationModel;\r\n handlePaginationModel: (model: IPaginationModel) => void;\r\n totalPages: number;\r\n}\r\n\r\nconst Pagination = ({\r\n paginationModel,\r\n totalPages,\r\n handlePaginationModel,\r\n}: IPagination) => {\r\n const { pageNo, limit } = paginationModel;\r\n const skip=limit*(pageNo-1)\r\n const pageSizeOptions = [10, 20, 50];\r\n const {isRtl}=useLanguage();\r\n const {setIsChanged,setActivePage,activePage}=usePages();\r\n const handleLimitChange = (e: SelectChangeEvent<unknown>) => {\r\n const newModel = {\r\n ...paginationModel,\r\n page: 1,\r\n pageNo: 1,\r\n limit: e?.target?.value as number,\r\n };\r\n handlePaginationModel(newModel);\r\n };\r\n\r\n const handleNextPage = () => {\r\n if (pageNo < totalPages) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(pageNo) + 1,\r\n };\r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n };\r\n const handlePrevPage = () => {\r\n if (pageNo > 1) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(pageNo) - 1,\r\n };\r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n };\r\n\r\n const handleEnterKey = (event) => {\r\n if (event.key === 'Enter') {\r\n const value = event.target.value;\r\n if (parseInt(value) > 0 && parseInt(value) <= totalPages) {\r\n const newModel = {\r\n ...paginationModel,\r\n pageNo: parseInt(value),\r\n }; \r\n handlePaginationModel(newModel);\r\n setIsChanged(true)\r\n }\r\n \r\n }\r\n };\r\n\r\n useEffect(()=>{\r\n setActivePage({...activePage,skip,pageNo})\r\n //eslint-disable-next-line react-hooks/exhaustive-deps\r\n },[pageNo])\r\n\r\n\r\n\r\n return (\r\n <Box className=\"pagination\" borderTop={\"2px solid theme.secondary.200\"}>\r\n <Typography color=\"theme.secondary.800\" type=\"s4\">\r\n Items per page :\r\n </Typography>\r\n <Select\r\n value={limit}\r\n size=\"small\"\r\n className=\"page-size-select page-size-select-pagination\"\r\n onChange={handleLimitChange}\r\n variant=\"outlined\"\r\n MenuProps={{\r\n sx:{\r\n maxWidth:\"unset\"\r\n }\r\n }}\r\n >\r\n {pageSizeOptions?.map((size) => (\r\n <MenuItem key={size} value={size}>\r\n {size}\r\n </MenuItem>\r\n ))}\r\n </Select>\r\n\r\n <Typography color=\"theme.secondary.800\" type=\"s4\">\r\n Go To :\r\n </Typography>\r\n\r\n <TextField\r\n type=\"number\"\r\n className=\"goto-box\"\r\n id=\"outlined-required\"\r\n defaultValue=\"\"\r\n onKeyDown={handleEnterKey}\r\n />\r\n\r\n <IconButton onClick={handlePrevPage} size=\"small\" disabled={paginationModel.pageNo === 1}>\r\n {isRtl ? <ChevronRightICon /> : <ChevronLeftIcon />} \r\n </IconButton>\r\n <Typography\r\n sx={{\r\n ...(isRtl ? { ml: 0.5 } : { mr: 0.5 })\r\n }}\r\n type=\"s4\"\r\n weight=\"normal\"\r\n color=\"theme.secondary.700\"\r\n >\r\n Page{\" \"}\r\n </Typography>\r\n {/* <input value={pageNo} type=\"number\" className=\"page-input\" />{\" \"} */}\r\n <Typography type=\"s4\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {pageNo}{\" \"}\r\n </Typography>\r\n <Typography\r\n mx={0.5}\r\n type=\"s4\"\r\n weight=\"normal\"\r\n color=\"theme.secondary.700\"\r\n >\r\n of{\" \"}\r\n </Typography>\r\n <Typography type=\"s4\" weight=\"medium\" color=\"theme.secondary.1000\">\r\n {totalPages || 1}\r\n </Typography>\r\n {/* </Box> */}\r\n <IconButton onClick={handleNextPage} size=\"small\" disabled={paginationModel.pageNo === totalPages}>\r\n {isRtl ? <ChevronLeftIcon /> :<ChevronRightICon />}\r\n </IconButton>\r\n </Box>\r\n );\r\n};\r\n\r\nexport { Pagination };\r\nexport default Pagination;\r\n","import {\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n IconButton,\r\n} from \"@mui/material\";\r\nimport Close from \"@mui/icons-material/Close\";\r\nimport Typography from \"../../typography/typography\";\r\nimport TextField from \"../../text-field/text-field\";\r\nimport Button from \"../../button/button\";\r\nimport Modal from \"../../modal/modal\";\r\nimport { useEffect, useMemo, useState } from \"react\";\r\nimport { IPage } from \"../../../@types/page\";\r\n\r\ninterface IAddPage {\r\n open: boolean;\r\n onClose: () => void;\r\n page?: IPage;\r\n handleSubmit: (page: IPage) => void;\r\n pages?: IPage[];\r\n}\r\n\r\nconst AddPageModal = ({ open, onClose, page, handleSubmit, pages }: IAddPage) => {\r\n const [name, setName] = useState<string>();\r\n const [error, setError] = useState<string>(\"\");\r\n const pageNames = useMemo(() => pages?.map((page) => page?.name || \"\"), [pages])\r\n\r\n useEffect(() => {\r\n setName(page?.name);\r\n }, [page]);\r\n\r\n useEffect(() => {\r\n setError(\"\")\r\n }, []);\r\n\r\n const handleSave = () => {\r\n let newPage: any = {};\r\n if (page) {\r\n newPage = {\r\n ...page,\r\n };\r\n }\r\n newPage[\"name\"] = name;\r\n\r\n handleSubmit(newPage);\r\n setName(\"\");\r\n onClose();\r\n };\r\n\r\n const handleInputChange = (e: any) => {\r\n const value = e.target.value\r\n\r\n setName(value)\r\n if (pageNames?.includes(value.trim())) {\r\n setError(\"Page name already in use\")\r\n } else if (!value.trim()) {\r\n setError(\"Page name can not be empty\")\r\n } else {\r\n setError(\"\")\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n <Modal fullWidth onClose={onClose} open={open}>\r\n <DialogTitle>\r\n <Typography type=\"s3\" weight=\"medium\" color={\"theme.secondary.1000\"}>\r\n {page ? \"Edit\" : \"Add\"} New View\r\n </Typography>\r\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent dividers>\r\n <TextField\r\n label=\"View Name\"\r\n fullWidth\r\n placeholder=\"Enter view name\"\r\n error={error}\r\n helperText={error}\r\n value={name}\r\n onChange={handleInputChange}\r\n />\r\n </DialogContent>\r\n <DialogActions>\r\n <Button\r\n variant=\"outlined\"\r\n onClick={()=>{\r\n onClose();\r\n setName(\"\");\r\n }}\r\n style={{\r\n color: \"black\",\r\n }}\r\n >\r\n Cancel\r\n </Button>\r\n <Button disabled={error || !name} onClick={handleSave}>Save</Button>\r\n </DialogActions>\r\n </Modal>\r\n </>\r\n );\r\n};\r\n\r\nexport { AddPageModal };\r\nexport default AddPageModal;\r\n","import Typography from \"../../typography/typography\";\nimport images from \"../../../assets/images\";\nimport { Box, Tab, Tabs } from \"@mui/material\";\nimport { SyntheticEvent, useState } from \"react\";\n\nfunction SharedPageView(props: any) {\n const { pageValue, pages, onChange } = props;\n const [value, setValue] = useState(pages[pageValue]?.viewStyle - 1);\n\n const handleChange = (_event: SyntheticEvent, newValue: number) => {\n setValue(newValue);\n onChange(newValue + 1);\n };\n\n const renderContentView = () => {\n switch (value) {\n case 0:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.kanbanView}\n alt=\"Kanban View\"\n />\n );\n case 1:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.calendarView}\n alt=\"Gantt View\"\n />\n );\n case 2:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.tableView}\n alt=\"Grid View\"\n />\n );\n case 3:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.ganttView}\n alt=\"Table View\"\n />\n );\n case 4:\n return (\n <img\n className=\"shared-img\"\n src={images.sharedPage.gridView}\n alt=\"Calendar View\"\n />\n );\n default:\n return null;\n }\n };\n\n const renderViewName = (index: number) => {\n switch (index) {\n case 0:\n return value === 0 ? \"Kanban View\" : \"1\";\n case 1:\n return value === 1 ? \"Calendar View\" : \"2\";\n case 2:\n return value === 2 ? \"List View\" : \"3\";\n case 3:\n return value === 3 ? \"Timeline View\" : \"4\";\n case 4:\n return value === 4 ? \"Grid\" : \"5\";\n default:\n return \"\";\n }\n };\n\n return (\n <>\n <div className=\"shared-img-wrap\">\n <Typography>{renderContentView()}</Typography>\n <div className=\"shared-img-tab\">\n <Box sx={{ width: \"100%\" }}>\n <Tabs value={value} onChange={handleChange} centered>\n <Tab key={0} label={renderViewName(0)} />\n <Tab key={1} label={renderViewName(1)} />\n <Tab key={2} label={renderViewName(2)} />\n <Tab key={3} label={renderViewName(3)} />\n <Tab key={4} label={renderViewName(4)} />\n </Tabs>\n </Box>\n </div>\n </div>\n </>\n );\n}\n\nexport { SharedPageView };\nexport default SharedPageView;\n","import {\r\n Box,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n FormControlLabel,\r\n Grid,\r\n IconButton,\r\n Tab,\r\n Tabs,\r\n} from \"@mui/material\";\r\nimport Close from \"@mui/icons-material/Close\";\r\nimport Typography from \"../../typography/typography\";\r\nimport Button from \"../../button/button\";\r\nimport Modal from \"../../modal/modal\";\r\nimport \"./shared-page-modal.scss\";\r\nimport { useEffect, useState } from \"react\";\r\nimport SearchBar from \"../../search-bar/search-bar\";\r\nimport Toggle from \"../../toggle/toggle\";\r\nimport SharedPageView from \"./shared-page-view\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { setSharedPage } from \"../../../views/afterAuth/dashboard/redux/reducer\";\r\n\r\ninterface IAddPage {\r\n open: boolean;\r\n onClose: () => void;\r\n pages?: any;\r\n handleSubmit: (page: any) => void;\r\n}\r\n\r\ninterface TabPanelProps {\r\n children?: React.ReactNode;\r\n index: number;\r\n value: number;\r\n}\r\n\r\nfunction TabPanel(props: TabPanelProps) {\r\n const { children, value, index, ...other } = props;\r\n\r\n return (\r\n <div\r\n className=\"shared-tab\"\r\n role=\"tabpanel\"\r\n hidden={value !== index}\r\n id={`vertical-tabpanel-${index}`}\r\n aria-labelledby={`vertical-tab-${index}`}\r\n {...other}\r\n >\r\n {value === index && (\r\n <Box sx={{ p: 3 }}>\r\n <Typography>{children}</Typography>\r\n </Box>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nfunction a11yProps(index: number) {\r\n return {\r\n id: `vertical-tab-${index}`,\r\n \"aria-controls\": `vertical-tabpanel-${index}`,\r\n };\r\n}\r\n\r\nconst SharedPageModal = ({ open, onClose, pages, handleSubmit }: IAddPage) => {\r\n const [value, setValue] = useState(0);\r\n const [sharedPages, setSharedPages] = useState(pages);\r\n const [searchQuery, setSearchQuery] = useState(\"\");\r\n\r\n const dispatch = useDispatch();\r\n\r\n useEffect(() => {\r\n dispatch(setSharedPage(sharedPages));\r\n }, [dispatch, sharedPages]);\r\n\r\n const handleChange = (_event: React.SyntheticEvent, newValue: number) => {\r\n setValue(newValue);\r\n };\r\n\r\n const handleSave = () => {\r\n handleSubmit(pages[value]);\r\n };\r\n\r\n const renderTabs = () => {\r\n const filteredPages = sharedPages.filter((page: any) =>\r\n page.name.toLowerCase().includes(searchQuery.toLowerCase()),\r\n );\r\n\r\n return filteredPages.map((page: any, index: number) => (\r\n <Tab key={index} label={page.name} {...a11yProps(index)} />\r\n ));\r\n };\r\n\r\n const PageDescription = ({ page }: { page: any }) => {\r\n let viewsMessage = \"\",\r\n filtersMessage = \"\";\r\n\r\n if (page?.details?.views?.length === 1) {\r\n viewsMessage = `This page has 1 view, you can customize it`;\r\n } else if (page?.details?.views?.length) {\r\n viewsMessage = `This page has ${page?.details?.views?.length} different views, you can customize them`;\r\n } else {\r\n viewsMessage = `In this page you can add different views and customize them`;\r\n }\r\n\r\n if (page?.details?.filters?.length === 1) {\r\n filtersMessage = `, and it also have a saved filters to make things easier for you.`;\r\n } else if (page?.details?.filters?.length) {\r\n filtersMessage = `, and there are also ${page?.details?.filters?.length} saved filters to make things easier for you.`;\r\n } else {\r\n filtersMessage = `, and you can also add filters to make things easier for you`;\r\n }\r\n\r\n return <p>{viewsMessage + filtersMessage}</p>;\r\n };\r\n\r\n const handleToggle = () => {\r\n setSharedPages((prevPages: any) => {\r\n const updatedPages = prevPages.map((page: any, index: any) => {\r\n if (index === value) {\r\n return {\r\n ...page,\r\n isPinToDashboard: !page.isPinToDashboard,\r\n };\r\n }\r\n return page;\r\n });\r\n return updatedPages;\r\n });\r\n };\r\n\r\n const handleSharedView = (viewStyle: number) => {\r\n setSharedPages((prevPages: any) => {\r\n const updatedPages = prevPages.map((page: any, index: any) => {\r\n if (index === value) {\r\n return {\r\n ...page,\r\n viewStyle: viewStyle,\r\n };\r\n }\r\n return page;\r\n });\r\n return updatedPages;\r\n });\r\n };\r\n\r\n const handleSearchBar = (value: string) => {\r\n setSearchQuery(value);\r\n setValue(0);\r\n };\r\n return (\r\n <>\r\n <Modal\r\n fullWidth\r\n onClose={onClose}\r\n open={open}\r\n className=\"shared-pages-modal\"\r\n >\r\n <DialogTitle>\r\n <Typography type=\"s3\" weight=\"medium\" color={\"theme.secondary.1000\"}>\r\n Shared Views\r\n </Typography>\r\n <IconButton edge=\"end\" onClick={onClose} size=\"small\">\r\n <Close fontSize=\"inherit\" />\r\n </IconButton>\r\n </DialogTitle>\r\n <DialogContent dividers>\r\n {sharedPages?.length ?\r\n <Box>\r\n <Grid container spacing={2}>\r\n <Grid item xs={4} className=\"tab-title-wrap\">\r\n <div className=\"tab-search-wrap\">\r\n <SearchBar\r\n placeholder={\"Search User\"}\r\n handleSearch={handleSearchBar}\r\n />\r\n </div>\r\n <Tabs\r\n orientation=\"vertical\"\r\n variant=\"scrollable\"\r\n value={value}\r\n onChange={handleChange}\r\n aria-label=\"Vertical tabs example\"\r\n sx={{ borderRight: 1, borderColor: \"divider\" }}\r\n >\r\n {renderTabs()}\r\n </Tabs>\r\n </Grid>\r\n <Grid className=\"shared-grid-wrap\" item xs={8}>\r\n {sharedPages\r\n .filter((page: any) =>\r\n page.name.toLowerCase().includes(searchQuery.toLowerCase()),\r\n )\r\n .map((page: any, index: number) => (\r\n <TabPanel value={value} index={index} key={index}>\r\n <div className=\"shared-pages-main\">\r\n <SharedPageView\r\n pageValue={index}\r\n pages={sharedPages}\r\n onChange={handleSharedView}\r\n />\r\n </div>\r\n <div className=\"tab-info-wrap\">\r\n <div className=\"tab-inner-info\">\r\n <div>\r\n <h1>{page.name}</h1>\r\n </div>\r\n <div className=\"tab-toggle\">\r\n <div>\r\n <FormControlLabel\r\n control={\r\n <Toggle\r\n checked={page.isPinToDashboard}\r\n onChange={handleToggle}\r\n />\r\n }\r\n label=\"Pined to dashboard\"\r\n labelPlacement=\"start\"\r\n />\r\n </div>\r\n <div className=\"owner-name-wrap\">\r\n <p>\r\n <span>Owner:</span> {page.owner}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"tab-content\">\r\n <PageDescription page={page} />\r\n </div>\r\n </div>\r\n </TabPanel>\r\n ))}\r\n </Grid>\r\n </Grid>\r\n </Box>\r\n : <Box display='flex' width='100%' height='100%' alignItems='center' justifyContent='center'><Typography type=\"s1\" color='theme.secondary.800'>No Views has been shared with you</Typography></Box>}\r\n </DialogContent>\r\n <DialogActions>\r\n <Button\r\n variant=\"outlined\"\r\n onClick={onClose}\r\n style={{\r\n color: \"black\",\r\n }}\r\n disabled={!sharedPages?.length}\r\n >\r\n Cancel\r\n </Button>\r\n <Button onClick={handleSave} disabled={!sharedPages?.length}>Duplicate</Button>\r\n </DialogActions>\r\n </Modal>\r\n </>\r\n );\r\n};\r\n\r\nexport { SharedPageModal };\r\nexport default SharedPageModal;\r\n","import React from \"react\";\r\nimport { IconButton, Menu, MenuItem } from \"@mui/material\";\r\nimport AddCircleOutlineRoundedIcon from \"@mui/icons-material/AddCircleOutlineRounded\";\r\nimport Typography from \"../../typography/typography\";\r\nimport AddPageModal from \"./add-page-modal\";\r\nimport KeyboardArrowRightIcon from \"@mui/icons-material/KeyboardArrowRight\";\r\nimport { IPage } from \"../../../@types/page\";\r\nimport SharedPageModal from \"./shared-page-modal\";\r\n\r\ninterface IAddPage {\r\n sharedPages: any;\r\n handleAddPage: (view: IPage) => void;\r\n pages?: IPage[];\r\n}\r\n\r\nconst AddPage = ({ sharedPages, handleAddPage, pages }: IAddPage) => {\r\n const [isAddMenuOpen, setIsAddMenuOpen] = React.useState<null | HTMLElement>(\r\n null,\r\n );\r\n const [isAddPageModalOpen, setIsAddPageModalOpen] = React.useState(false);\r\n const [isSharedPageModalOpen, setIsSharedPageModalOpen] =\r\n React.useState(false);\r\n\r\n const handleAddMenuOpen = (event: React.MouseEvent<HTMLButtonElement>) => {\r\n event.stopPropagation();\r\n setIsAddMenuOpen(event.currentTarget);\r\n };\r\n const handleAddMenuClose = () => setIsAddMenuOpen(null);\r\n\r\n const handleOpenAddPageModal = () => {\r\n handleAddMenuClose();\r\n setIsAddPageModalOpen(true);\r\n };\r\n const handleCloseAddPageModal = () => setIsAddPageModalOpen(false);\r\n\r\n const handleCloseSharedModal = () => {\r\n setIsSharedPageModalOpen(false);\r\n };\r\n const handleOpenSharedPageModal = () => {\r\n setIsSharedPageModalOpen(true);\r\n setIsAddMenuOpen(null);\r\n };\r\n const handleShared = (page: any) => {\r\n const newPage: any = { ...page.details, name: page.name };\r\n handleAddPage(newPage);\r\n setIsSharedPageModalOpen(false);\r\n };\r\n\r\n return (\r\n <>\r\n <IconButton size=\"small\" sx={{ ml: 1 }} onClick={handleAddMenuOpen}>\r\n <AddCircleOutlineRoundedIcon fontSize=\"inherit\" />\r\n </IconButton>\r\n <Menu\r\n open={Boolean(isAddMenuOpen)}\r\n anchorEl={isAddMenuOpen}\r\n onClose={handleAddMenuClose}\r\n >\r\n <MenuItem onClick={handleOpenAddPageModal}>\r\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\r\n Create New View\r\n </Typography>\r\n </MenuItem>\r\n <MenuItem onClick={handleOpenSharedPageModal}>\r\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\r\n Shared Views\r\n </Typography>\r\n <KeyboardArrowRightIcon fontSize=\"small\" />\r\n </MenuItem>\r\n </Menu>\r\n\r\n <AddPageModal\r\n pages={pages}\r\n open={isAddPageModalOpen}\r\n onClose={handleCloseAddPageModal}\r\n handleSubmit={handleAddPage}\r\n />\r\n <SharedPageModal\r\n open={isSharedPageModalOpen}\r\n pages={sharedPages || []}\r\n onClose={handleCloseSharedModal}\r\n handleSubmit={handleShared}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport { AddPage };\r\nexport default AddPage;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport {\n Box,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Divider,\n IconButton,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n List,\n ListItem,\n ListItemText,\n ListItemAvatar,\n MenuItem,\n FormControlLabel,\n} from \"@mui/material\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Typography from \"../typography/typography\";\n\nimport Button from \"../button/button\";\nimport Avatar from \"../avatar/avatar\";\nimport Select from \"../select/select\";\nimport \"./share-modal.scss\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { useAppDispatch, useAppSelector } from \"../../redux/hooks\";\nimport { getAllUserAndDepartmentDropdown } from \"./redux/actionCreator\";\nimport React from \"react\";\nimport Toggle from \"../toggle/toggle\";\nimport SearchableSelect from \"../searchable-select\";\nimport { flatMap } from \"lodash\";\nimport Checkbox from \"../checkbox/checkbox\";\n\ninterface SharePopUpProps {\n open: boolean;\n title: string;\n onClose: () => void;\n roles?: any;\n toggleSwitch: boolean;\n onSubmit: (selectedUsers: any) => void;\n value?: any;\n isPeopleAccessVisible?: boolean;\n}\ninterface UserDropdownData {\n isRoleVisible: boolean;\n selectedUsers: any[];\n}\n\nconst SharePopUp = (props: SharePopUpProps) => {\n const {\n open,\n title,\n onClose,\n roles,\n toggleSwitch,\n onSubmit,\n value = {},\n isPeopleAccessVisible = false,\n } = props;\n\n const { share } = useAppSelector((store) => store);\n\n const dispatch = useAppDispatch();\n\n const [isPublic, setIsPublic] = useState(value.isPublic || false);\n const [selectedOptions, setSelectedOptions] = useState(\n value.selectedUsers || [],\n );\n const [roleValue, setRoleValue] = useState([]);\n const [availableRole, setAvailableRole] = useState([]);\n\n const [userDropdownData, setUserDropdownData] = useState<UserDropdownData>({\n isRoleVisible: false,\n selectedUsers: [],\n });\n\nconst filteredOptions=useMemo(()=>userDropdownData?.isRoleVisible ? share.departments : share.users,[share,userDropdownData?.isRoleVisible])\nconst [selectedUsers, setSelectedUsers] = useState<any[]>([]);\n useEffect(() => {\n const role: any = [];\n const selRole: any = [];\n roles &&\n roles.map((item: any) => {\n const userRole: any = {};\n if (item.role !== \"Owner\") {\n role.push(item.role);\n userRole.id = item.id;\n userRole.role = item.role;\n selRole.push(userRole);\n }\n setAvailableRole(role);\n setRoleValue(selRole);\n });\n }, [roles]);\n\nuseEffect(()=>{\n if(!value?.selectedUsers?.length && !value?.role_id){\n resetOptions()\nreturn\n }\n userDropdownData.isRoleVisible=value.is_role\n setUserDropdownData(userDropdownData)\n setSelectedOptions({\n ...value,\n selectedUsers:value.is_role?value?.role_id:value?.selectedUsers\n })\n //eslint-disable-next-line\n},[value?.selectedUsers,open])\n\n const handleShareSubmit = () => {\n if(!selectedUsers?.length) return\n const uIds = flatMap(selectedUsers, 'userIds').filter(i=>i);\n let sOptions = selectedUsers\n if( Array.isArray(uIds) && uIds?.length) {\n sOptions = share.users?.filter(u => uIds.includes(u.id))\n \n }\n const sharedData = {\n is_private: !isPublic,\n selectedUsers: [...new Set(sOptions)],\n is_role:userDropdownData?.isRoleVisible,\n role_id:userDropdownData?.isRoleVisible?selectedUsers?.map((u: any) => u?.id):[],\n };\n onSubmit(sharedData);\n \n };\n\n const resetOptions=()=> {\n setSelectedOptions({\n ...value\n });\n setUserDropdownData((prevData) => ({\n ...prevData,\n selectedUsers: [],\n }));\n };\n\n\n\n const handleRoleChange = (event: any, id: any, user: any) => {\n const changeRole: any = roleValue.map((item: any) => {\n if (item.id === id) {\n item.role = event.target.value;\n }\n return item;\n });\n setRoleValue(changeRole);\n };\n\n const handleToggleChange = () => {\n setUserDropdownData((prevSettings) => ({\n ...prevSettings,\n isRoleVisible: !prevSettings.isRoleVisible,\n }));\n setSelectedOptions([]);\n setSelectedUsers(value.selectedUsers || []);\n };\n\n const handleChage=(value:any)=>{\n if(userDropdownData.isRoleVisible){\n setSelectedOptions({...selectedOptions,role_id:value})\n }\n setSelectedOptions({...selectedOptions,selectedUsers:value})\n }\n\n const toggleMakeItPublic = () => {\n setIsPublic(!isPublic);\n }\n \n useEffect(() => {\n if(!open)resetOptions()\n if (open) {\n dispatch(getAllUserAndDepartmentDropdown());\n }\n // eslint-disable-next-line\n }, [open]);\n\n\n\n return (\n <div>\n <Dialog open={open} onClose={onClose} className=\"share\">\n <DialogTitle className=\"share--head\">\n <Box className=\"share--title\">\n <Typography type=\"s3\" ml={1} className=\"dialog-box-title\">\n {title}\n </Typography>\n </Box>\n <IconButton disableRipple onClick={onClose}>\n <CloseIcon />\n </IconButton>\n </DialogTitle>\n\n <Divider />\n\n <DialogContent className=\"share--content\">\n <Box m={1} display={'flex'} alignItems={'center'} justifyContent={'space-between'}>\n <Typography type=\"s3\" className=\"input-label\">\n Add users\n </Typography>\n <FormControlLabel\n control={<Box mb={0.5} mr={0.5}><Toggle checked={userDropdownData?.isRoleVisible} onChange={handleToggleChange} /></Box>}\n label={\n <Typography type=\"s3\" className=\"input-label\">Show only Roles</Typography>\n }\n />\n </Box>\n \n\n {toggleSwitch && (\n <>\n \n <Box mb={4} className=\"d-flex\">\n \n <SearchableSelect \n options={filteredOptions}\n multiple\n value={selectedOptions?.selectedUsers}\n onChange={(e) =>handleChage(e.target.value)}\n placeholder={\n selectedOptions && selectedOptions.length\n ? \"\"\n : \"Add people and roles\"\n }\n getSelectedData={row=>setSelectedUsers(row)}\n />\n </Box>\n </>\n )}\n \n {isPeopleAccessVisible && (\n <div className={ \"share--blurClass\"}>\n <Accordion className=\"people-access-accordion\">\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>People with access</Typography>\n </AccordionSummary>\n <AccordionDetails className=\"user-accordion-details\">\n <List className=\"accordion-list\">\n {roles &&\n roles.map((user: any) => {\n const userRole: any =\n roleValue?.length > 0 &&\n roleValue?.filter((item: any) => item.id === user.id);\n return (\n <ListItem alignItems=\"flex-start\">\n <ListItemAvatar>\n <Avatar size={40} alt=\"Person\" icon />\n </ListItemAvatar>\n <ListItemText\n className=\"primary-user-name\"\n primary={user.name}\n secondary={\n <Typography\n component=\"span\"\n variant=\"body2\"\n className=\"secondary-email-text\"\n >\n {user.email}\n </Typography>\n }\n />\n {user.role == \"Owner\" ? (\n <p className=\"owner-role-badge\">{user.role}</p>\n ) : (\n <div>\n <Select\n className=\"role-edit-select-box\"\n value={\n userRole?.length > 0 ? userRole[0].role : \"\"\n }\n onChange={(e: any) =>\n handleRoleChange(e, user.id, user)\n }\n variant=\"outlined\"\n >\n {availableRole.map((role: any) => (\n <MenuItem\n className=\"select-menu-items\"\n value={role}\n >\n {role}\n </MenuItem>\n ))}\n </Select>\n </div>\n )}\n </ListItem>\n );\n })}\n </List>\n </AccordionDetails>\n </Accordion>\n </div>\n )}\n\n <div className=\"checkbox\">\n <Checkbox\n checked={isPublic}\n onChange={toggleMakeItPublic}\n />\n <div className=\"checkbox-text\">Make it public</div>\n </div>\n </DialogContent>\n\n <Divider />\n\n <DialogActions className=\"share--actions\">\n <Button className=\"cancel-btn\" variant=\"text\" onClick={onClose}>\n Cancel\n </Button>\n <Button className=\"success-btn\" onClick={handleShareSubmit}>\n Save and Share\n </Button>\n </DialogActions>\n </Dialog>\n </div>\n );\n};\n\nexport { SharePopUp };\nexport default SharePopUp;\n","export const userRoles = [\r\n {\r\n id: 1,\r\n name: \"Prasun Singh\",\r\n email: \"prasun@goldenflitch.com\",\r\n role: \"Owner\",\r\n },\r\n {\r\n id: 2,\r\n name: \"Sidhant Chandel\",\r\n email: \"sidhant@goldenflitch.com\",\r\n role: \"Editor\",\r\n },\r\n {\r\n id: 3,\r\n name: \"Amrit Sonar\",\r\n email: \"amrit@goldenflitch.com\",\r\n role: \"Viewer\",\r\n },\r\n];\r\n","import { Divider, MenuItem } from \"@mui/material\";\nimport Menu from \"../../menu/menu\";\nimport Typography from \"../../typography/typography\";\nimport { useEffect, useState } from \"react\";\nimport AddPageModal from \"./add-page-modal\";\nimport { IPage } from \"../../../@types/page\";\nimport SharePopUp from \"../../share-modal/share-modal\";\nimport { userRoles } from \"../../../views/beforeAuth/components/share-modal-data/share-modal-data\";\nimport ConfirmPopUp from \"../../confirm-modal/confirm-modal\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { pinToDashboardList } from \"../../../views/afterAuth/dashboard/redux/reducer\";\nimport {\n // deleteV1DashboardId,\n // putV1DashboardId,\n} from \"../../../api-client/api.system-feature/api\";\n// import type * as Types from \"../../api-client/api.system-feature/api-types\";\nimport { sharePage } from \"../../share-modal/redux/actionCreator\";\nimport { useAppDispatch } from \"../../../redux/hooks\";\nimport { generateRandomId } from \"../../../utils/common\";\nimport { usePages } from \"../../../hooks/use-pages\";\n\ninterface IPageAction {\n open: null | HTMLElement;\n onClose: () => void;\n page?: IPage;\n pages: IPage[];\n setCurrentPage: React.Dispatch<React.SetStateAction<number>>;\n setPages: React.Dispatch<React.SetStateAction<IPage[]>>;\n resource: string;\n handlePageDelete: (pages: any[]) => void;\n}\n\nconst moveLeft = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n if (index === 0) return;\n\n const elementToShift = updatedArray.splice(index, 1)[0];\n updatedArray.splice(index - 1, 0, elementToShift);\n return updatedArray;\n};\n\nconst moveRight = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n if (index === updatedArray.length - 1) return;\n\n const elementToShift = updatedArray.splice(index, 1)[0];\n updatedArray.splice(index + 1, 0, elementToShift);\n return updatedArray;\n};\n\nconst deletePage = (arr: IPage[], pageValue: number) => {\n const updatedArray = [...arr];\n if (updatedArray.length <= 1) return;\n\n const index = updatedArray.findIndex((item) => item._id === pageValue);\n\n updatedArray.splice(index, 1);\n return updatedArray;\n};\n\nconst PageAction = ({\n open,\n onClose,\n page,\n pages,\n setCurrentPage,\n setPages,\n resource,\n handlePageDelete,\n}: IPageAction) => {\n \n const [isEditPageModalOpen, setIsEditPageModalOpen] = useState(false);\n const [isShareModalOpen, setIsShareModalOpen] = useState(false);\n const [isConfirmOpen, setIsConfirmOpen] = useState(false);\n const [deletePageNo, setDeletePageNo] = useState<any>({});\n const [defaultSharedData, setDefaultSharedData] = useState<any>({});\n const [pageSharedData, setPageSharedData] = useState<any>([]);\n const pinToDashboardStore = useSelector((state: any) => state);\n const [pinToDashboardData, setPinToDashboardData] = useState<any>(\n pinToDashboardStore?.dashboard?.pinToDashboardList || [],\n );\n\n\n const appDispatch = useAppDispatch();\n const dispatch = useDispatch();\n const {setIsCreatePage}=usePages()\n // const token = zI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OSwiaWF0IjoxNzA2NDcwNzQwfQ.6dtxBVGl4hF0TrNDanSBTiFtV_TUshjaiaYe9XT2Ld8\";\n useEffect(() => {\n dispatch(pinToDashboardList(pinToDashboardData));\n }, [dispatch, pageSharedData, pinToDashboardData]);\n\n useEffect(()=>{\n \n if(page){\n setPageSharedData([...pageSharedData,{\n page:{\n ...page,\n value:page?._id\n },\n isPublic: true,\n shareUsers:page?.selectedUsers,\n }])\n }\n //eslint-disable-next-line\n },[page])\n \n\n const handleOpenEditModal = () => {\n onClose();\n setIsEditPageModalOpen(true);\n };\n\n const handleCloseEditModal = () => {\n setIsEditPageModalOpen(false);\n };\n\n const handleShare = (pageData: any) => {\n pageData.pages = pages;\n appDispatch(sharePage(pageData)).then((res) => {\n if (res?.payload?.data?.pages?.length) {\n setPages(res?.payload?.data?.pages);\n }\n setIsShareModalOpen(false);\n });\n };\n\n const handleSharePage = (page: any) => {\n const defaultData = pageSharedData.find(\n (item: any) => item.page?.value === page?.value,\n );\n if (defaultData) {\n setDefaultSharedData({\n isPublic: defaultData.isPublic,\n selectedUsers: defaultData.shareUsers,\n \n });\n } else {\n setDefaultSharedData({\n isPublic: page?.selectedUsers?.length>0,\n ...page,\n });\n }\n setIsShareModalOpen(true);\n setIsShareModalOpen(true);\n };\n\n const handleDuplicatePage = (page: any) => {\n const labelExists = (label: string) =>\n pages.some((item) => item.name === label);\n const { uniqueNumberId: _id } = generateRandomId();\n let newLabel = page.name;\n\n if (labelExists(newLabel)) {\n let counter = 1;\n while (labelExists(`${page.name} ${counter}`)) {\n counter++;\n }\n newLabel = `${page.name} ${counter}`;\n }\n const updatedPage = [\n ...pages,\n { ...page, name: newLabel, _id, data: page.data, isShared: false },\n ];\n\n setPages(updatedPage);\n setIsCreatePage(true)\n };\n\n const handleEdit = (newPage: IPage) => {\n const updatedPages = pages.map((page) => {\n if (page._id === newPage._id) {\n return {\n ...page,\n name: newPage.name\n }\n }\n return page\n })\n\n setPages(updatedPages);\n setIsCreatePage(true)\n // const putDashboardRequest: Types.PutV1DashboardIdRequest = {\n // \"x-token\": token,\n // module: \"user\",\n // user_id: \"1\",\n // name: newPage.name,\n // id: newPage._id,\n // };\n // putV1DashboardId(putDashboardRequest)\n // .then((response: any) => {\n // const prevPages = [...pages];\n // const updatedPages = prevPages.map((page) =>\n // page._id === newPage._id ? newPage : page,\n // );\n // setPages(updatedPages);\n // updatePinToDashboardPage(updatedPages);\n // })\n // .catch((err: any) => console.log(\"Error in adding page\", err));\n };\n\n // const updatePinToDashboardPage = (updatedPages: any) => {\n // const currentPageLabel = updatedPages.find(\n // (item: any) => item.value === page?._id,\n // )?.label;\n\n // const updatedPinToDashboardData = pinToDashboardData.map((data: any) => ({\n // ...data,\n // label: data.value === page?._id ? currentPageLabel : data.label,\n // }));\n\n // setPinToDashboardData(updatedPinToDashboardData);\n // };\n\n const handleMoveLeft = (pageValue: any) => {\n const updatedArray = moveLeft(pages, pageValue?._id);\n if (updatedArray) setPages(updatedArray);\n };\n\n const handleMoveRight = (pageValue: any) => {\n const updatedArray = moveRight(pages, pageValue?._id);\n if (updatedArray) setPages(updatedArray);\n };\n\n const handleDeletePage = (pageValue: any) => {\n setIsConfirmOpen(true);\n setDeletePageNo(pageValue);\n };\n\n const handleConfirmDelete = () => {\n // if (!isNaN(deletePageNo._id)) {\n // const deleteDashboardRequest: Types.DeleteV1DashboardIdRequest = {\n // \"x-token\": token,\n // id: deletePageNo._id,\n // };\n // deleteV1DashboardId(deleteDashboardRequest)\n // .then((response: any) => {\n // })\n // .catch((err: any) => console.log(\"Error in deleting page\", err));\n // }\n \n const updatedArray = deletePage(pages, deletePageNo?._id);\n deletePinToDashboardPage();\n setDeletePageNo({});\n setIsConfirmOpen(false);\n if (updatedArray) {\n setCurrentPage(updatedArray[0]);\n setPages(updatedArray);\n handlePageDelete(updatedArray);\n } else {\n handlePageDelete([]);\n setPages([]);\n }\n };\n\n const deletePinToDashboardPage = () => {\n const updatedPinToDashboardData = pinToDashboardData.filter(\n (data: any) => data.value !== page?._id,\n );\n setPinToDashboardData(updatedPinToDashboardData);\n };\n\n const handleShareModal = (selectedUsers: any) => {\n\n let updatedData: any[] = [];\n const existingItem = pageSharedData.find(\n (item: any) => item.page.value === page?._id,\n );\n\n if (existingItem) {\n updatedData = pageSharedData.map((item: any) => {\n if (item.page.value === page?._id) {\n return {\n ...item,\n isPublic: selectedUsers.isPublic,\n shareUsers: selectedUsers.selectedUsers,\n };\n }\n return item;\n });\n } else {\n updatedData = [\n ...pageSharedData,\n {\n page: page,\n isPublic: selectedUsers.isPublic,\n shareUsers: selectedUsers.selectedUsers,\n viewStyle: 1,\n owner: 0,\n },\n ];\n }\n setPageSharedData(updatedData);\n handleShare({ ...selectedUsers, page: page, resource });\n };\n\n const handlePinToDashboard = () => {\n const index = pinToDashboardData.findIndex(\n (item: any) => item.value === page?._id,\n );\n\n if (index !== -1) {\n setPinToDashboardData((prevData: any) => {\n const updatedData = [...prevData];\n updatedData[index] = { ...updatedData[index], label: page?.name };\n return updatedData;\n });\n } else {\n setPinToDashboardData((prevData: any) => [...prevData, page]);\n }\n };\n\n const actions = [\n {\n label: \"Rename\",\n func: handleOpenEditModal,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Duplicate\",\n func: handleDuplicatePage,\n },\n {\n label: \"Share\",\n func: handleSharePage,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Pin to dashboard\",\n func: handlePinToDashboard,\n disabled: Boolean(page?.isShared)\n },\n {\n label: \"Move Right\",\n func: handleMoveRight,\n disabled: (pages?.length <= 1) || Boolean(page?.isShared)\n },\n {\n label: \"Move Left\",\n func: handleMoveLeft,\n disabled: (pages?.length <= 1) || Boolean(page?.isShared)\n },\n ];\n\n const handleAction = (func: any) => {\n func(page);\n onClose();\n };\n\n return (\n <>\n <Menu open={Boolean(open)} anchorEl={open} onClose={onClose}>\n {actions?.map((action) => (\n <MenuItem\n key={action?.label}\n onClick={() => handleAction(action.func)}\n disabled={Boolean(action?.disabled)}\n >\n <Typography color=\"theme.secondary.1000\" type=\"s4\">\n {action?.label}\n </Typography>\n </MenuItem>\n ))}\n <Divider sx={{ mt: `4px !important`, mb: `4px !important` }}/>\n <MenuItem onClick={() => handleAction(handleDeletePage)} disabled={Boolean(page?.isShared)}\n sx={{\n '&:hover': {\n backgroundColor: 'theme.error.100'\n }\n }}\n >\n <Typography color=\"theme.error.500\" type=\"s4\">\n Delete\n </Typography>\n </MenuItem>\n </Menu>\n\n <AddPageModal\n open={isEditPageModalOpen}\n page={page}\n pages={pages}\n onClose={handleCloseEditModal}\n handleSubmit={handleEdit}\n />\n\n <ConfirmPopUp\n open={isConfirmOpen}\n onClose={() => setIsConfirmOpen(false)}\n onConfirm={handleConfirmDelete}\n title=\"Delete Confirmation?\"\n description=\"Are you sure you want to delete this page ?\"\n />\n <SharePopUp\n open={isShareModalOpen}\n onClose={() => setIsShareModalOpen(false)}\n title={`Share page ${page?.name}`}\n roles={userRoles}\n toggleSwitch={true}\n value={defaultSharedData}\n onSubmit={handleShareModal}\n />\n </>\n );\n};\n\nexport { PageAction };\nexport default PageAction;\n","/* eslint-disable no-mixed-spaces-and-tabs */\r\nimport { useCallback, useEffect, useState } from 'react';\r\nimport {\r\n\tTabs,\r\n\tTab as MUITab,\r\n\tstyled,\r\n\tIconButton,\r\n\tMenuItem,\r\n\tDivider,\r\n\tBox,\r\n\tCircularProgress\r\n} from '@mui/material';\r\nimport MenuIcon from '@mui/icons-material/Menu';\r\nimport KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown';\r\nimport Typography from '../typography/typography';\r\nimport Menu from '../menu/menu';\r\nimport AddPage from './components/add-page';\r\nimport PageAction from './components/page-action';\r\nimport Tooltip from '../tooltip/Tooltip';\r\nimport { IPage } from '../../@types/page';\r\nimport { defaultPageState } from '../../contexts/page-context';\r\nimport { usePages } from '../../hooks/use-pages';\r\nimport Button from '../button/button';\r\nimport _ from 'lodash';\r\nimport { Save, Share } from '@mui/icons-material';\r\nimport './page-navigator.scss';\r\nimport React from 'react';\r\n\r\nconst StyledTabs = styled(Tabs)(() => ({\r\n\tminHeight: 'fit-content',\r\n\r\n\t'.MuiTabs-indicator': {\r\n\t\theight: '0px !important'\r\n\t},\r\n\t'& .MuiTabs-flexContainer': {\r\n\t\tgap: '4px'\r\n\t}\r\n}));\r\n\r\nconst StyledTab = styled(MUITab)(({ theme: { palette } }) => ({\r\n\tminHeight: '2rem',\r\n\ttextTransform: 'none',\r\n\tpadding: '0rem 1rem',\r\n\tminWidth: 'fit-content',\r\n\tborderRadius: 4,\r\n\t'&.Mui-selected': {\r\n\t\tbackground: palette.theme?.primary[100],\r\n\t\tcolor: palette.theme?.primary[700],\r\n\t\tborderTop: `2px solid ${palette.theme?.primary[700]}`\r\n\t},\r\n\t'.MuiIconButton-root': {\r\n\t\tpadding: '0rem'\r\n\t},\r\n\t\"&:hover\": {\r\n\t\tbackground: palette.theme?.primary[100]\r\n\t}\r\n}));\r\n\r\nconst title = `successfully created, complete with your saved filters, sorting options, and views.`;\r\n\r\nexport interface IPageNavigator {\r\n\tpages: IPage[];\r\n\tsetPages: React.Dispatch<React.SetStateAction<IPage[]>>;\r\n\tcurrentPage: string | number;\r\n\tsetCurrentPage: React.Dispatch<React.SetStateAction<number>>;\r\n\tsharedPages: any;\r\n\tresource: string;\r\n\thandlePageDelete: (pages: any[]) => void;\r\n\tisPageSaving?: boolean;\r\n}\r\n\r\nexport const PageNavigator = ({\r\n\t// sharedPages,\r\n\tresource,\r\n\t// handlePageDelete\r\n}: IPageNavigator) => {\r\n\tconst { pages, setPages, setActivePage, activePage, savePages,setIsChanged, isSaving, generatedColumns, sharedPages, isChanged,deletePage,isCreatePage,setIsCreatePage ,addOrDeletePage} = usePages();\r\n\tconst shareTitle = (owner) => `shared by ${owner}`;\r\n\tconst [isActionsMenuOpen, setIsActionsMenuOpen] =\r\n\t\tuseState<null | HTMLElement>(null);\r\n\tconst [page, setPage] = useState<IPage>();\r\n\r\n\tconst [isAllPagesMenuOpen, setIsAllPagesMenuOpen] =\r\n\t\tuseState<null | HTMLElement>(null);\r\n\r\n\tconst handleChangePage = (_: React.SyntheticEvent, newValue: number) => {\r\n\t\tconst pg = pages.find((p) => p?._id == newValue);\r\n\t\tsetActivePage(pg);\r\n\t};\r\n\r\n\tconst handleOpenActionsMenu = (\r\n\t\tevent: React.MouseEvent<HTMLButtonElement>,\r\n\t\tclickedPage: IPage\r\n\t) => {\r\n\t\tevent.stopPropagation();\r\n\t\tsetPage(clickedPage);\r\n\t\tsetIsActionsMenuOpen(event.currentTarget);\r\n\t};\r\n\tconst handleCloseActionsMenu = () => setIsActionsMenuOpen(null);\r\n\r\n\tconst handleOpenAllPagesMenu = (\r\n\t\tevent: React.MouseEvent<HTMLButtonElement>\r\n\t) => {\r\n\t\tevent.stopPropagation();\r\n\t\tsetIsAllPagesMenuOpen(event.currentTarget);\r\n\t};\r\n\tconst handleCloseAllPagesMenu = () => setIsAllPagesMenuOpen(null);\r\n\r\n\tconst handleChangePageFromMenu = (val: number) => {\r\n\t\tsetActivePage(val);\r\n\t\thandleCloseAllPagesMenu();\r\n\t};\r\n\r\n\tconst handleAddPage = (newPage: IPage) => {\r\n\t\tconst nPage = {\r\n\t\t\t...defaultPageState,\r\n\t\t\t...newPage,\r\n\t\t\tname: newPage.name,\r\n\t\t\tvisible_columns: generatedColumns.columns,\r\n\t\t\tcolumn_order: _.uniq(generatedColumns.orderKeys),\r\n\t\t\t_id: pages.length + 1,\r\n\t\t\tactive_view:'Table',\r\n\t\t\tviews:[{\r\n\t\t\t\tlabel:'Table',\r\n\t\t\t\tposition:0\r\n\t\t\t}]\r\n\t\t};\r\n\t\tconst updatedPages: any = [\r\n\t\t\t...pages,\r\n\t\t\t...[nPage]\r\n\t\t];\r\n\t\tsetActivePage({...nPage});\r\n\t\tsetPages([...updatedPages]);\r\n\t\tsetIsCreatePage(true)\r\n\t\t\r\n\t};\r\n\r\n\tconst handlePageDeleteFunction=(pages:any[])=>{\r\n\t\t\r\n\t\tdeletePage(pages)\r\n\t}\r\n\r\n\r\n\tconst handleAddOrdeletePage =useCallback(async\t () => {\r\n\t\tif(isCreatePage){\r\n\t\t\tconst res=await addOrDeletePage();\r\n\t\t\tif(res.status_code===200){\r\n\t\t\t\tsetPages(res?.data?.pages);\r\n\t\t\t\tsetIsChanged(false)\r\n\t\t\t}}\r\n\t\tsetTimeout(()=>{\r\n\t\t\tsetIsCreatePage(false);\r\n\t\t\t\r\n\t\t},2000)\r\n\t\t//eslint-disable-next-line\r\n\t},[isCreatePage])\r\n\r\n\tuseEffect(()=>{\r\n\t\thandleAddOrdeletePage()\r\n\t\t//eslint-disable-next-line\r\n\t},[handleAddOrdeletePage])\r\n\r\n\treturn (\r\n\t\t<Box display=\"flex\" gap={2} alignItems={'center'} className='page-navigator-container'>\r\n\t\t\t<Box\r\n\t\t\t\tdisplay={'flex'}\r\n\t\t\t\tclassName='page-navigator'\r\n\t\t\t\tsx={{ display: 'flex', opacity: isSaving ? 0.5 : 1 }}>\r\n\t\t\t\t<IconButton\r\n\t\t\t\t\t// size='small'\r\n\t\t\t\t\tonClick={handleOpenAllPagesMenu}\r\n\t\t\t\t\tdisabled={isSaving}>\r\n\t\t\t\t\t<MenuIcon fontSize='small' />\r\n\t\t\t\t</IconButton>\r\n\t\t\t\t<StyledTabs\r\n\t\t\t\t\tvalue={activePage?._id}\r\n\t\t\t\t\tvariant='scrollable'\r\n\t\t\t\t\tonChange={handleChangePage}\r\n\t\t\t\t\taria-label='basic tabs example'>\r\n\t\t\t\t\t{pages?.map((page) => (\r\n\t\t\t\t\t\t<StyledTab\r\n\t\t\t\t\t\t\ticonPosition='end'\r\n\t\t\t\t\t\t\tdisableRipple\r\n\t\t\t\t\t\t\tkey={page}\r\n\t\t\t\t\t\t\ticon={\r\n\t\t\t\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\t\t\tedge='end'\r\n\t\t\t\t\t\t\t\t\tonClick={(e) => handleOpenActionsMenu(e, page)}\r\n\t\t\t\t\t\t\t\t\tdisabled={isSaving}>\r\n\t\t\t\t\t\t\t\t\t<KeyboardArrowDown fontSize='small' color={activePage?._id === page?._id ? 'primary' : undefined}/>\r\n\t\t\t\t\t\t\t\t</IconButton>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t<Tooltip\r\n\t\t\t\t\t\t\t\t\ttitle={`The '${page.name}' page has been ${page?.isShared ? shareTitle(page?.owner) : title}`}\r\n\t\t\t\t\t\t\t\t\tkey={page._id}\r\n\t\t\t\t\t\t\t\t\tplacement='top'\r\n\t\t\t\t\t\t\t\t\tarrow>\r\n\t\t\t\t\t\t\t\t\t\t<Box sx={{ display: 'flex', alignItems: 'center', gap:1 }}>\r\n\t\t\t\t\t\t\t\t\t\t\t{page?.isShared && <Share sx={{fontSize:'20px',color:'#4AC08C'}}/>}\r\n\t\t\t\t\t\t\t\t\t\t\t<span>{page.name}</span>\r\n\t\t\t\t\t\t\t\t\t\t</Box>\r\n\t\t\t\t\t\t\t\t</Tooltip>\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={page?._id}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</StyledTabs>\r\n\r\n\t\t\t\t<Divider\r\n\t\t\t\t\torientation='vertical'\r\n\t\t\t\t\tvariant='middle'\r\n\t\t\t\t\tflexItem\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tml: 2,\r\n\t\t\t\t\t\tborderWidth: '1px'\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t\t<Box display=\"flex\" alignItems={'center'}>\r\n\t\t\t\t\t<AddPage\r\n\t\t\t\t\t\tpages={pages}\r\n\t\t\t\t\t\thandleAddPage={handleAddPage}\r\n\t\t\t\t\t\tsharedPages={sharedPages}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</Box>\r\n\r\n\t\t\t\t<PageAction\r\n\t\t\t\t\topen={isActionsMenuOpen}\r\n\t\t\t\t\tonClose={handleCloseActionsMenu}\r\n\t\t\t\t\tpage={page}\r\n\t\t\t\t\tsetPages={setPages}\r\n\t\t\t\t\tsetCurrentPage={setActivePage}\r\n\t\t\t\t\tpages={pages}\r\n\t\t\t\t\tresource={resource}\r\n\t\t\t\t\thandlePageDelete={handlePageDeleteFunction}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<Menu\r\n\t\t\t\t\topen={Boolean(isAllPagesMenuOpen)}\r\n\t\t\t\t\tanchorEl={isAllPagesMenuOpen}\r\n\t\t\t\t\tonClose={handleCloseAllPagesMenu}>\r\n\t\t\t\t\t{pages?.map((page) => (\r\n\t\t\t\t\t\t<MenuItem\r\n\t\t\t\t\t\t\tselected={page._id === activePage?._id}\r\n\t\t\t\t\t\t\tkey={page._id}\r\n\t\t\t\t\t\t\tonClick={() => handleChangePageFromMenu(page)}>\r\n\t\t\t\t\t\t\t<Typography color='theme.secondary.1000' type='s4'>\r\n\t\t\t\t\t\t\t\t{page.name}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</MenuItem>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Menu>\r\n\t\t\t</Box>\r\n\t\t\t<Box display=\"flex\" alignItems={'center'}>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tsize='small'\r\n\t\t\t\t\tvariant='contained'\r\n\t\t\t\t\tonClick={() => savePages()}\r\n\t\t\t\t\t// sx={{fontWeight:600, marginBottom:'2px',px:3}}\r\n\t\t\t\t\tendIcon={\r\n\t\t\t\t\t\tisSaving ? <CircularProgress size={15} color='inherit' /> : <Save fontSize='small'/>\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdisabled={!isChanged || isSaving}>\r\n\t\t\t\t\tSave\r\n\t\t\t\t</Button>\r\n\t\t\t</Box>\r\n\t\t</Box>\r\n\t);\r\n};\r\n\r\nexport default PageNavigator;\r\n","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable unused-imports/no-unused-vars */\nimport { Box } from \"@mui/material\";\nimport Pagination from \"../pagination/pagination\";\nimport PageNavigator from \"../page-navigator/page-navigator\";\nimport \"./footer.scss\";\nimport { IPaginationModel } from \"../../@types/pagination-model\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IFooter {\n pages: any;\n setPages: any;\n currentPage: string | number;\n setCurrentPage: any;\n total: number;\n paginationModel: IPaginationModel;\n handlePaginationModel: (model: IPaginationModel) => void;\n sharedPages: any;\n resource: string;\n savePageConfiguration: () => void;\n handlePageDelete: (pages: any[]) => void;\n enablePages: boolean\n isPaginationDisplayed?: boolean\n isPageSaving?: boolean\n}\n\nconst Footer = React.memo(({\n pages,\n setPages,\n currentPage,\n setCurrentPage,\n total, // total number of pages in footer pagination\n paginationModel,\n handlePaginationModel,\n sharedPages,\n resource,\n savePageConfiguration,\n handlePageDelete,\n enablePages,\n isPaginationDisplayed = true,\n isPageSaving = false\n}: IFooter) => {\n const [isDrawerOpen, setIsDrawerOpen] = useState(\n window.localStorage.getItem('_is_drawer_open') === 'true'\n );\n\n useEffect(() => {\n const handleStorageChange = () => {\n setIsDrawerOpen(window.localStorage.getItem('_is_drawer_open') === 'true');\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n const interval = setInterval(handleStorageChange, 10); \n\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n clearInterval(interval);\n };\n }, []);\n\n // useEffect(()=>{\n // handlePaginationModel({...paginationModel,pageNo:activePage?.pageNo})\n // //eslint-disable-next-line react-hooks/exhaustive-deps\n // },[activePage?.pageNo])\n\n return (\n <Box className={`${!isDrawerOpen?'footer--drawerContainer':'footer--Container'}`} sx={{justifyContent: enablePages? 'space-between': 'flex-end'}}>\n \n \n {Boolean(enablePages) && <PageNavigator\n pages={pages}\n setPages={setPages}\n currentPage={currentPage}\n setCurrentPage={setCurrentPage}\n resource={resource}\n sharedPages={sharedPages}\n handlePageDelete={handlePageDelete}\n />}\n <Box>\n {isPaginationDisplayed && (\n <Pagination\n paginationModel={paginationModel}\n handlePaginationModel={handlePaginationModel}\n totalPages={total}\n />\n )}\n </Box>\n </Box>\n );\n});\n\nexport { Footer };\nexport default Footer;\n","import { Switch, styled } from \"@mui/material\";\r\n\r\nconst Android12Switch = styled(Switch)(({ theme }) => ({\r\n padding: 8,\r\n '& .MuiSwitch-track': {\r\n borderRadius: 22 / 2,\r\n '&::before, &::after': {\r\n content: '\"\"',\r\n position: 'absolute',\r\n top: '50%',\r\n transform: 'translateY(-50%)',\r\n width: 16,\r\n height: 16,\r\n },\r\n '&::before': {\r\n backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 24 24\"><path fill=\"${encodeURIComponent(\r\n theme.palette.getContrastText(theme.palette.primary.main),\r\n )}\" d=\"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z\"/></svg>')`,\r\n left: 12,\r\n },\r\n '&::after': {\r\n backgroundImage: `url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"16\" width=\"16\" viewBox=\"0 0 24 24\"><path fill=\"${encodeURIComponent(\r\n theme.palette.getContrastText(theme.palette.primary.main),\r\n )}\" d=\"M19,13H5V11H19V13Z\" /></svg>')`,\r\n right: 12,\r\n },\r\n },\r\n '& .MuiSwitch-thumb': {\r\n boxShadow: 'none',\r\n width: 16,\r\n height: 16,\r\n margin: 2,\r\n // color: theme.palette.theme.primary[800]\r\n },\r\n '& .Mui-checked': {\r\n color: `${theme.palette.theme.primary[800]} !important`,\r\n },\r\n '& .Mui-checked+.MuiSwitch-track': {\r\n backgroundColor: `${theme.palette.theme.primary[800]} !important`,\r\n },\r\n}));\r\n\r\nexport { Android12Switch };\r\nexport default Android12Switch;","import { InputAdornment } from \"@mui/material\";\nimport TextField from \"../text-field/text-field\";\nimport ColorLensIcon from '@mui/icons-material/ColorLens';\nimport _ from \"lodash\";\nimport React from \"react\";\n\nconst ColorPickerInput = ({value, onChange, label, ...props}) => {\n\n // Debounced function to update text\n const debouncedSetColor = (\n _.debounce((value) => {\n onChange(value)\n }, 500)\n );\n\n const handleColorChange = (e) => {\n debouncedSetColor(e.target.value);\n };\n\n return (\n <TextField\n label={label || ''}\n variant='outlined'\n type=\"color\"\n value={value}\n onChange={handleColorChange}\n size=\"small\"\n fullWidth\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <ColorLensIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n }}\n {...props}\n />\n );\n}\n \nexport { ColorPickerInput };\nexport default ColorPickerInput;","import Typography from \"../typography/typography\";\nimport { Box } from \"@mui/material\";\nimport \"./fallback.scss\";\n\ninterface FallbackProps {\n heading: string;\n subHeading: string;\n icon: React.ReactNode;\n children?: React.ReactNode;\n}\n\nconst Fallback = (props: FallbackProps) => {\n const { heading, subHeading, icon, children, ...rest } = props;\n return (\n <Box className=\"fallback\" {...rest}>\n {icon}\n <Typography\n type=\"h5\"\n weight=\"medium\"\n color=\"theme.secondary.1000\"\n className=\"fallback--Text\"\n >\n {heading}\n </Typography>\n <Typography\n type=\"s3\"\n weight=\"medium\"\n color=\"theme.secondary.800\"\n className=\"fallback--Text\"\n >\n {subHeading}\n </Typography>\n <div>{children}</div>\n </Box>\n );\n};\n\nexport { Fallback };\nexport default Fallback;\n","import React from \"react\";\nimport BreadCrumb from \"../bread-crumb/bread-crumb\";\nimport \"./form-header.scss\";\n\ninterface BreadCrumbSlot {\n link: string;\n label: string | JSX.Element;\n linkState?: any;\n}\n\ninterface FormHeaderProps {\n breadCrumbPath: BreadCrumbSlot[];\n children?: React.ReactNode;\n containerProps?:any;\n}\nconst FormHeader = (props: FormHeaderProps) => {\n const { breadCrumbPath, children, containerProps } = props;\n return (\n <div className=\"formHeader--Header\" {...containerProps}>\n <BreadCrumb path={breadCrumbPath} />\n <div>{children}</div>\n </div>\n );\n};\n\nexport { FormHeader };\nexport default FormHeader;\n","const Loader = () => {\n return (\n <div className=\"loader loader--style1\" title=\"0\">\n <svg\n version=\"1.1\"\n id=\"loader-1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n x=\"0px\"\n y=\"0px\"\n width=\"80px\"\n height=\"80px\"\n viewBox=\"0 0 40 40\"\n enableBackground=\"new 0 0 40 40\"\n >\n <path\n opacity=\"0.2\"\n fill=\"#333\"\n d=\"M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946\n s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634\n c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z\"\n />\n <path\n fill=\"#333\"\n d=\"M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0\n C22.32,8.481,24.301,9.057,26.013,10.047z\"\n >\n <animateTransform\n attributeType=\"xml\"\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 20 20\"\n to=\"360 20 20\"\n dur=\"0.9s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </svg>\n </div>\n );\n};\n\nexport { Loader };\nexport default Loader;\n","import { Link } from \"react-router-dom\";\nimport CardMedia from \"@mui/material/CardMedia\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"../typography/typography\";\nimport \"./module-button.scss\"; // Import the external CSS file\n\nexport interface IModuleTile {\n module: {\n bg: string;\n icon: string;\n label: string;\n link: string;\n };\n}\n\nexport const ModuleTile = (props: IModuleTile) => {\n const bgClass = props.module.bg === \"transparent\" ? \"transparent\" : \"\";\n\n return (\n <Link to={props.module.link}>\n <Box className=\"module-tile-container\">\n <Box\n className={`module-box ${bgClass}`}\n style={{ background: props.module.bg }}\n >\n <CardMedia\n component=\"img\"\n image={props.module.icon}\n alt={`${props.module.label} logo`}\n />\n </Box>\n <Typography type=\"s3\" className=\"module-label\">\n {props.module.label}\n </Typography>\n </Box>\n </Link>\n );\n}\n\nexport default ModuleTile;"],"names":["Accordion","memo","props","title","children","accordionProps","accordianProps","jsxs","StyledAccordion","jsx","AccordionSummary","expandIcon","ExpandMoreIcon","id","AccordionDetails","styled","MUIAccordion","theme","palette","color","_a","secondary","fontSize","boxShadow","padding","minHeight","borderBottomWidth","borderBottomStyle","borderBottomColor","_b","margin","ViewModal","data","setData","setActive","disabledViews","openModal","setOpenModal","useState","value","setValue","disable","setDisable","useTheme","isMdUp","useMediaQuery","breakpoints","up","TabData","label","icon","logo","TableIcon","desc","image","src","table","GridIcon","grid","className","Button","variant","startIcon","AddIcon","sx","pr","onClick","Boolean","find","item","toLowerCase","Modal","open","onClose","DialogTitle","Typography","type","weight","IconButton","CloseIcon","Tabs","orientation","onChange","_","newValue","map","Tab","iconPosition","disabled","includes","hidden","viewTypes","KANBAN","CALENDAR","Select","placeholder","size","defaultValue","MenuItem","DialogActions","backgroundColor","selectedTabData","some","position","length","HeaderCard","active","key","rest","TABLE","GRID","GANTT","GanttIcon","CalenderIcon","KanbanIcon","CHART","ChartIcon","ToggleWrapper","Box","primary","display","Toggle","CombinatorSelect","handleOnChange","options","showDropdown","path","Fragment","e","target","name","RemoveAction","isRtl","useLanguage","btnStyles","marginRight","handleOnClick","disableRipple","Trash","FieldSelect","t","useTranslation","filteredOptions","setFilteredOptions","useEffect","filter","o","trim","width","fullWidth","renderValue","formatText","_c","opttion","replace","replaceAll","SearchBar","handleSearch","searchText","filteredData","option","handleSearchEvent","op","StyledAddButton","AddFilterButton","Add","AddGroupButton","StyledDatePicker","Date","borderColor","borderWidth","borderStyle","_d","_e","error","background","_f","_g","_h","opacity","marginLeft","_i","_j","fontWeight","DatePicker","helperText","dataName","dataPosition","disableFutureDates","required","disablePastDates","textFieldProps","format","LocalizationProvider","dateAdapter","AdapterDayjs","mb","disableFuture","disablePast","slotProps","textField","desktopPaper","bgcolor","slots","openPickerIcon","dayjs","StyledCheckbox","MUICheckbox","borderRadius","Checkbox","RecgtangleIcon","checkedIcon","CheckBoxIcon","ChipOrPlaceholder","onDelete","chipProps","selectedLabel","Chip","onMouseDown","event","stopPropagation","Radio","MUIRadio","BlankCircle","FilledCircle","BorderedOption","shouldForwardProp","prop","bordered","alignItems","border","divider","shape","spacing","height","alignContent","action","hover","DynamicRadioButton","formControl","fieldArrayName","titlePosition","Controller","control","render","field","fieldState","RadioGroup","row","gap","isSelected","FormControlLabel","checked","message","PARTIES_FORM_ARRAY_NAME","PARTIES_FIELDS","partyType","addressPayload","parties_id","address_type","contact_name","street_1","street_2","city","zip_code","state","country","email","mobile","phone","street_3","summary","default_shipping_address","default_billing_address","country_code","contactPayload","contact_no","addressColumns","header","accessorKey","visible","editVariant","editProperties","field_name","validations","msg_en","msg_ar","editSelectOptions","enableEditing","valueKey","apiType","customeFilter","values","country_name","contactColumns","addressOmitKeys","contactOmitKeys","processPartiesPayload","payload","addresses","contacts","address","omit","contact","generateValidationSchema1","yupResolver","Yup","object","PARTIES_FIELDS_TYPE","string","PARTIES_FIELDS_FIRST_NAME","when","is","val","then","otherwise","optional","nullable","PARTIES_FIELDS_LAST_NAME","PARTIES_FIELDS_COMPANY_NAME","PARTIES_FIELDS_VAT_NUMBER","PARTIES_FIELDS_CRN","PARTIES_FIELDS_COMPANY","mixed","PARTIES_FIELDS_CURRENCY","array","PARTIES_FIELDS_RESPONSIBLE_PERSON","PARTIES_FIELDS_ADDRESS","notRequired","PARTIES_FIELDS_CONTACTS","min","PARTIES_FIELDS_RECEIVABLE_ACCOUNT","number","PARTIES_FIELDS_TAX_TEMPLATE","getEffectiveUser","contextUser","stored","window","localStorage","getItem","auth","storageUserKeyName","JSON","parse","setCompany","user","company_id","company_data","configMapper","company","callBack","generateMenuItems","multiple","with_checkboxes","disabledIds","handleChange","hasParent","itemDisabled","items","push","p","m","selectedValues","Array","isArray","isAllOptionsSelected","parentValue","childOptions","childValues","child","valueArray","every","childValue","isSomeOptionsSelected","forEach","isGroup","indeterminate","updatedValues","Set","handleParentChange","opt","pl","String","SelectedItems","filteredDisplayTitle","selectedItem","mt","slice","join","MoreIcon","Loading","fontStyle","DynamicSearchSelect","React","watchedValue","useWatch","formContext","useFormContext","contextSetValue","mfeFallbackSetValue","useCallback","fieldPath","ctrl","parts","split","obj","_formValues","i","_subjects","next","authUser","useAuth","useMemo","selectRef","useRef","setOptions","selectedValue","setSelectedValue","selectedOptions","setSelectedOptions","loading","setLoading","setOpen","isAlreadyLoaded","setIsAlreadyLoaded","prevFilter","setPrevFilter","initialLoading","setInitialLoading","searchQuery","setSearchQuery","searchInitiate","setSearchInitiate","addConfig","setAddConfig","isModalOpen","setIsModalOpen","isAddLoading","setIsAddLoading","pagination","setPagination","page","hasMore","isLoadingMore","total","handleOptions","isInternal","getSelectedData","attributes","filterKey","refresh","sortOrder","addType","showCancelButton","customFetchApi","isMergeOptions","showItemTooltip","limit","isInternalOptions","cf","stringify","defaultOptions","setDefaultOptions","config","getDefaultConfig","is_multiselect","useDefaultConfig","searchOptionsLocally","searchTerm","currentOptions","lowercasedSearchTerm","reduce","acc","searchedOptions","isValidElement","searchLabel","sortBySelectedValues","getUniqueOptions","Map","arrayToSort","Number","sortBy","index","indexOf","Infinity","apiOptions","localOptions","getSelectedDataOptions","fetchOptions","async","flt","append","prev","paginationResult","response","search","filters","skip","select","order","fetchApi","apiKey","newOptions","updateOptions","handleSelectedValue","totalCount","console","handleScroll","scrollTop","scrollHeight","clientHeight","currentTarget","nextPage","uniqueOptions","filterValue","isInOptions","fetchIdOptions","initialFetch","debouncedSearch","debounce","resetValue","handleClose","handleModalOpen","handleModalSave","api","result","log","cancel","selectedData","removeUndefined","selectOptions","dynamicSelectAdd","Tooltip","placement","arrow","popper","modifiers","offset","tooltip","maxWidth","ref","onOpen","setTimeout","searchInput","document","querySelector","focus","searchValue","formType","MenuProps","PaperProps","onScroll","style","maxHeight","selected","is_loading","onChipRemove","selectedOption","searchPlaceholder","text","onBlur","input","OutlinedInput","endAdornment","InputAdornment","CircularProgress","mr","edge","ml","Close","enable_footer","bottom","zIndex","Divider","flexItem","onFooterClick","justifyContent","component","createElement","isOpen","setIsOpen","isLoading","onSave","modalProps","modalComponentProps","propTypes","PropTypes","isRequired","arrayOf","oneOfType","node","any","bool","typeOfField","func","footer_action","StyledInput","ReactPhoneInput","direction","textAlign","left","right","borderBottom","images","backgroundRepeat","backgroundPosition","paddingLeft","paddingRight","_k","HelperTextWrapper","marginTop","PhoneInput","default_value","setCountryCodeField","isInlineEditing","dropdown","positionDropdown","rect","getBoundingClientRect","top","addEventListener","body","contains","appendChild","fixPhoneDropdown","dialCode","dropdownContainer","specialLabel","enableSearch","isValid","searchNotFound","inputProps","DynamicPhone","register","DateTimePicker","UploadMedia","max_size","VisuallyHiddenInput","clip","clipPath","overflow","whiteSpace","StyledButton","marginBottom","allowedImageTypes","allowedFileTypes","getFileName","file","File","f","uploadImage","uploadDocument","accept","filterredFiles","files","isValidFileType","enqueueSnackbar","Document","noWrap","getSelectedFiles","InlineEditFields","column","col","errors","validationSchema","setValidationErrors","onChangeRowField","inputValue","setInputValue","isInitialSet","setIsInitialSet","customFilter","editCols","getAllCells","columnDef","fieldProperties","fieldDisbled","_valuesCache","handleCustomFilter","current","is_multiple","get","original","v","validateAt","abortEarly","fe","err","yup","ValidationError","inner","em","validate","editFields","Object","keys","dValues","cell","vl","handleMinDate","TextField","autoFocus","flexDirection","SearchableSelect","labelKey","bindingKey","dateFormat","minDate","min_date","maxDate","defaultChecked","TableWrapper","disableMaxHeight","borderLeft","lineHeight","MaterialTable","enablePagination","rows","columns","totalPages","paginationModel","columnOrder","updateData","handleColumnOrdering","enableColumnDragging","states","rowActionMenu","destructiveActionMenu","disableDefaultActionColumn","enableRowSelection","defaultActionColumnItems","enableBottomToolbar","SetSelectedRowId","isResetRow","onCreateRow","onEditRow","onDeleteRow","editDisplayMode","enableRowCreate","onSelectRow","enableColumnResizing","selectedRowIds","onColumnVisibility","onSortingChange","disabledDefaultActionColumnIcon","enableAddCustomField","enableRowDragging","handleColumnResizing","columnSizes","showPreview","handlePreview","formData","updatePageInfo","activePage","aPage","usePages","useDeepMemo","pageNo","setRow","tableColumns","setTableColumns","anchorEl","setAnchorEl","popUpShow","setPopupShow","rowAnchorEl","setRowAnchorEl","visibleColumns","hiddenColumns","selectedRow","setSelectedRow","validationErrors","setValidationSchema","isCreatingRow","setIsCreatingRow","isEditingRow","setIsEditingRow","isDeletingRow","setIsDeletingRow","rowToDelete","setRowToDelete","rowSelection","setRowSelection","isChecked","setIsChecked","sorting","setSorting","disableNextEdit","setDisableNextEdit","columnSizing","setColumnSizing","column_sizes","columnSizingInfo","setColumnSizingInfo","columnSizingStart","deltaOffset","deltaPercentage","isResizingColumn","startOffset","startSize","navigate","useNavigate","currentModule","location","pathname","redirectionPath","PathnameAccounting","CUSTOM_FORM","PathnameInventory","PathnameManufacturing","PathnamePurchase","PathnameCrm","PathnameUsers","PathnameRental","PathnameDocument","ADD_CUSTOM_FIELDS","validationReducer","validation","vld","typeError","max","test","relation","thenValidations","otherWiseValidations","schema","clm","fieldValidations","transform","originalValue","matches","excludeEmptyString","getValidationType","generateValidationSchema","handleHeaderClick","formtValues","cells","c","checkRequired","selectedRows","Function","sortingArray","resetRowSelection","getTextWidth","ctx","getContext","measureText","useMaterialReactTable","defaultColumn","minSize","Math","Edit","callback","s","Header","maxSize","common","eyeIcon","alt","muiTableHeadCellProps","muiTableBodyCellProps","Cell","handlePreviewClick","arrowIcon","updatedProps","cloneElement","handleActionsClick","more","muiTableContainerProps","muiTablePaperProps","tableLayout","columnResizeMode","onEditingRowSave","setEditingRow","Error","onCreatingRowSave","setCreatingRow","onCreatingRowCancel","onEditingRowCancel","displayColumnDefOptions","onKeyUp","renderRowActions","enableExpanding","parentId","renderBottomToolbarCustomActions","onRowSelectionChange","enableColumnOrdering","createDisplayMode","enableTopToolbar","enableColumnActions","enableSorting","enableGrouping","enableStickyHeader","enableSortingRemoval","columnPinning","isSaving","showProgressBars","getRowId","muiTableBodyRowProps","editingRowId","getState","editingRow","creatingRow","isErrorRow","has_error","handleRowClick","rowId","cursor","onColumnOrderChange","colOrder","onColumnSizingChange","onColumnSizingInfoChange","renderEmptyRowsFallback","tableNoData","paginationDisplayMode","muiPaginationProps","count","showRowsPerPage","boundaryCount","muiEditTextFieldProps","InputProps","disableUnderline","muiCircularProgressProps","letterSpacing","muiTableBodyProps","muiTableHeadProps","muiSelectCheckboxProps","muiSelectAllCheckboxProps","muiBottomToolbarProps","layoutMode","icons","ArrowDownwardIcon","ArrowUpDown","SortIcon","SyncAltIcon","CancelIcon","SaveIcon","Save","getSelectedRowModel","selectedRowModels","selection","traverseRows","parentKey","rowKey","subRows","getRowModel","MaterialReactTable","Menu","ListItemIcon","ChevronLeftIcon","ListItemText","filteredColumns","updatedColumns","updatedFilteredOptions","handleAddColumn","addIcon","handleVisibleColumn","dotsIcon","ChevronRightIcon","handleAction","ConfirmPopUp","onConfirm","handleRowDelete","description","Loader","LoaderContainer","ModalLoader","defaultLocationState","CustomerVendorModal","handleModalClose","partyCreated","dispatch","useDispatch","locationRef","addressRows","setAddressRows","contactRows","setContactRows","isCreating","setIsCreating","formState","trigger","getValues","handleSubmit","resetField","reset","watch","getFieldState","useForm","defaultValues","status","parties","account_type","mode","resolver","fieldToUpdate","useAccountingSetting","companyField","formMethods","isUpdateAccount","selectedType","responsiblePerson","mainContactNo","mainEmailIds","tableRows","phoneNumberCache","transformTableColumns","currencySymbol","translationFn","enableFooter","redirectionLink","redirectionLinkState","statusClasses","customizeValue","columnAccessorKey","pointerEvents","phoneKey","has","parsed","parsePhoneNumberFromString","set","nationalNumber","countryCodeKey","countryCallingCode","handleRowOperation","eData","setState","isAddress","editRow","processedValues","dropdowns","addressValues","validateAddressDefaults","state_name","country_data","state_data","country_id","state_id","ar","Promise","reject","u_data","splice","hasDefault","d","deleteRow","rowIndex","resolve","onChangeAddressTableField","r","fieldName","summaryFields","idx","EMAIL_REGEX","onSubmit","formValues","emailArray","email_ids","email_id","match","party","res","createParties","meta","requestStatus","closeModal","errorMessage","getErrorMessage","resetForm","addressData","a","contactData","companyId","entity_priority","company_currencies","currencies","firstContactRow","parsedCountryCode","firstEmail","updatedFirstRow","updatedRows","firstRow","hasAddressDetails","contactChanged","phoneChanged","basicDetailsSection","defaultExpanded","Grid","container","xs","sm","DynamicInput","accountingSection","addressSection","contactSection","overflowY","DialogContent","fDisplayTitle","DynamicSelect","removeUndefine","handleSetOptions","DynamicButton","DynamicCheckBox","titleColor","checkboxProps","stackProps","Stack","DynamicDate","max_date","is_future_dates_allowed","is_past_dates_allowed","views","displayName","DynamicCurrency","multiline","is_multiline","is_required","step","float_step","min_length","max_length","inputMode","pattern","is_negative","startAdornment","borderRight","borderBottomLeftRadius","borderTopLeftRadius","currencyType","numericValue","_formState","DynamicElementHOC","useDrag","drop","useDrop","draggedElement","draggedIndex","dropIndex","swap","elementSwap","activeClassName","activeIndex","defaultClassName","element","duplicate","handleDuplicate","removeElement","setElementHoc","elementPerRow","DynamicInputSelect","defaultOption","setSelectOption","handleOptionChange","boxSizing","IconComponent","KeyboardArrowDownOutlinedIcon","DynamicTagsInput","tags","tag","handleKeyDown","trimmedInputValue","preventDefault","newValueString","Autocomplete","clearIcon","freeSolo","renderTags","renderTagProps","renderInput","params","onKeyDown","InfoCard","info","DynamicInfo","DynamicMedia","field_type","DynamicSectionHOC","handleAccordion","remove_section","removeSection","isFormSwitcher","handleAddButton","$parse","$stringify","Primitive","primitive","ignore","noop","primitives","Primitives","known","reviver","$","lazy","revive","output","ke","y","k","tmp","call","add","replacer","space","firstRun","after","this","DynamicTable","onAddClick","is_button","disableTableAddButton","otherButtons","onTableCellChange","cs","currency_data","symbol","currencyFormat","number_format","symbolPosition","takeCurencyOrPercentage","isCellChangeAFunc","renderedCellValue","toFixedWithNumbers","formatLabel","formatDate","formatAmount","promotion_map_data","rcv","uRows","flexWrap","valueGet","StyledTimePicker","Time","TimePicker","is24hrFormat","DynamicTime","CustomisedSwitch","Switch","focusVisibleClassName","transitionDuration","grey","transition","transitions","create","duration","ToggleSwitch","labelPosition","typographyProps","DynamicToggleButton","toggleSwitchProps","TabBar","tabs","onEditTabTitle","activeValue","setActiveValue","handleTabChange","handleRemoveTab","containerProps","editableTabId","setEditableTabId","TabContext","TabList","_event","scrollButtons","overflowX","tab","tab_order","handleEditTabTitle","tabId","remove_tab","wrapped","onDoubleClick","handleTabDoubleClick","content","TabPanel","toString","StyledAlert","MUIAlert","tertiary6","svg","Alert","ChipContainer","main","disabledBackground","InlineInput","outline","flexGrow","minWidth","fontFamily","typography","InlineChip","ChipGenerator","maxChips","allowDuplicates","endIcon","externalError","onChipAdd","customChipProps","allowMultipleAdd","delimiters","dataType","separator","validationError","setValidationError","focused","setFocused","inputRef","containerRef","validateChip","trimmedValue","isValidEmail","isValidPhone","validator","stringToArray","str","arrayToString","arr","removeChip","chipToRemove","currentChips","newChips","processInput","inputStr","currentValue","valuesToAdd","delimiterPattern","regex","RegExp","parseMultipleValues","addedCount","errorMessages","addChips","handleContainerClick","hasError","FormControl","chip","outputValue","lastIndex","handleKeyPress","onFocus","handleBlur","onPaste","pastedText","clipboardData","getData","handlePaste","FormHelperText","LocationSearchSelect","selectedCompany","propControl","propSetValue","locationFieldName","filterField","dynamicSearchSelectProps","contextControl","contextWatch","contextGetFieldState","controlToUse","setValueToUse","getFieldStateToUse","filterFieldValue","isDirty","prevFilterFieldValue","isValueChanged","isEqual","locationFilter","useLocationFilter","warn","defaultProps","FormSwitcher","formSwitcherName","MemoizedField","sectionLabel","gridSize","is_fullwidth","custom_width","fieldKey","commonProps","iconSrc","sms","url","currency","dollar","geoLocation","relationLabel","renderField","handleSetCountryCodeField","field_properties","onSelectFooterClick","setCurrencyOptions","refreshOptions","title_position","table_columns","table_rows","handleTableAddClick","isButton","currencyOption","MemoizedFormSwitcher","section","switchForms","handleFieldCleanUp","form_switcher_label","forms","FormSection","members","displayAvtar","setDetailsData","visibleMembers","is_hidden","fieldsWithNames","sectionHeader","avatarDisplay","fieldProps","is_accordion","fieldIndex","teamValidationSchema","team","department_id","team_lead_id","member_ids","DEFAULT_VALUES","TeamAddModal","selectedDepartmentId","selectedTeamLeadId","leadFilter","membersFilter","rowGap","columnSpacing","pt","departmentValidationSchema","department","department_code","parent_department_id","department_head_id","cost_code","boolean","location_data","designationValidationSchema","designation","designation_code","reports_to","level","COSTING_METHODS","DEPRECIATION_METHODS","COMPUTATION_METHODS","inventory_fixed_asset_item","sku","category","base_unit","unit_of_measurement","stock_unit","purchase_unit","sales_unit","costing_method","depreciation_method","computation_method","default_tax_id","income_account_id","asset_account_id","cogs_account_id","fixed_asset_account_id","depreciation_account_id","declining_factor","brandValidationSchema","brand_data","categoryValidationSchema","category_data","category_name","source_type","SourceTypeAddModal","isSubmitting","setIsSubmitting","dividers","journalTypeValidationSchema","journal_type_data","is_payment","JournalTypeAddModal","createApiThunk","getToken","addMapper","postV1WarehouseLocation","toast","setToast","Toast","anchorOrigin","horizontal","vertical","postV1Parties","postV1Departments","rootCompanyId","postV1DepartmentsTeams","postV1Designation","fixedAssetItem","postV1InventoryFixedAssetItems","selectedCategoryData","setSelectedCategoryData","unitFields","methods","watchedName","watchedCategory","watchedUom","watchedDepreciationMethod","generatedSku","skuGenerator","handleCategorySelect","updateUomFields","uomData","FormProvider","brand","postV1Brand","postV1CategoryItems","sku_prefix","unique_items","attribute_data","industry","postV1PartiesIndustry","sourceType","postV1SourceTypes","journalType","postV1JournalTypes","journal_type","handleClear","ls","labelId","customStyle","CustomDropDownIcon","inputStyle","dynamicOptions","initailLoading","prevOptions","setSelectedData","debounceSearch","hasOptions","fValue","hasValue","condition","showGroupLabel","mergedOptions","flatMap","displayEmpty","CustomDropdownIcon","ValueEditor","fieldData","rule","inputType","isDisabled","operator","customFetch","tableName","tokenObj","getV1FilterFilterTable","getFilterTableFields","optionData","mappedValue","OperatorSelect","dValue","RemoveGroupAction","SaveFilterModal","oldName","setName","FolderSave","handleSave","initialQuery","combinator","rules","Filter","savedFilters","fetchSavedFilters","onSaveFilter","onSelectedFilter","applyFilter","fields","isUseFields","useLocation","token","storageTokenKeyName","schemaFields","setActivePage","generateFields","query","setQuery","filteredSavedFilters","setFilteredSavedFilters","selectedFilter","setSelectedFilter","openRenameFilter","setIsOpenRenameFilter","setErrorMessage","resources","routeToResourceMap","handleApplyFilter","clear","q","isDuplicatedFilters","generatedSQLQuery","generateQueryString","filterQueryString","handleFilterSwitch","sf","filteredFilters","isEmpty","uniques","isRuleInvalid","Dialog","savedFilter","filterId","deleteFilterRequest","deleteV1FilterId","catch","handleDeleteFilter","newName","putFilterRequest","module","fieldResource","pageResource","putV1FilterId","handleRenameFilter","handleSubmitRename","severity","px","QueryBuilderMaterial","QueryBuilder","onQueryChange","updatedRules","showCombinatorsBetweenRules","controlClassnames","controlElements","addRuleAction","addGroupAction","combinatorSelector","fieldSelector","operatorSelector","removeRuleAction","valueEditor","removeGroupAction","DropdownButton","isMenuThirdItemDisabled","isOnlyDropDownButton","onlyDropDownButtonProps","buttonGroupProps","dropdownButtonProps","toggleCallback","anchorRef","handleToggle","prevOpen","ButtonGroup","borderRightColor","borderTopRightRadius","borderBottomRightRadius","ArrowDownTwo","Popper","role","disablePortal","TransitionProps","Grow","transformOrigin","Paper","elevation","ClickAwayListener","onClickAway","MenuList","autoFocusItem","disableToggle","TitleDropdownButton","currentTitle","formatBytes","bytes","decimals","dm","floor","parseFloat","pow","toFixed","UploadExcel","importModuleName","handleSuccessImport","setFiles","isCollapsed","setIsCollapsed","isDialogMinimized","setIsDialogMinimized","isDragOver","setIsDragOver","dataResult","setDataResult","setIsLoading","getRootProps","getInputProps","isDragActive","useDropzone","onDropAccepted","newFiles","isPrivate","checkboxDisabled","uploadProgress","fileSize","fileName","fileType","onDragEnter","onDragLeave","noClick","noKeyboard","types","fileInputRef","handleBeforeUnload","returnValue","removeEventListener","renderFileIcon","Avatar","upload","documentPDF","docFile","removeFile","indexToRemove","prevFiles","documentUpload","setAttribute","removeAttribute","click","monitor","successful","failed","in","timeout","FormData","postImportSheet","Upload","RemoveIcon","prevIsCollapsed","KeyboardArrowUp","KeyboardArrowDown","empty","close","tick","folder","ActionBar","button","isDropdownMenuButton","itemListingDropdownOptions","isTitleMenu","titleMenus","isToggleButton","handleToggleButton","showSearch","showFilter","showView","customButtons","pageName","actionBtn","selectedIds","useAppDispatch","isToggledForItem","setIsToggledForItem","openFilterPopup","setOpenFilterPopup","openSaveFilter","setIsOpenSaveFilter","isUploadModalOpen","setIsUploadModalOpen","setSavedFilters","searchedText","setSearchedText","isLgUp","getV1FilterResource","resource","_id","moduleName","templateURL","getExcelExportTemplate","blob","link","URL","createObjectURL","href","download","removeChild","revokeObjectURL","exportExcel","Export","visible_columns","getPdfExportTemplate","exportPdf","getExcelTemplateGenerateTemplate","downloadTemplate","DocumentDownload","Import","getFilterChipLabels","opLabel","getOperatorLabel","rv","getFilterChip","rr","deleteIcon","Cancel","removeSignleFilter","clickable","ruleIndex","uRules","uFilters","searchAnchorEl","setSearchAnchorEl","ele","sort","b","debounceTime","isDrivePage","Search","FilterIcon","activeView","setSelectedSavedFilter","rIndex","rrIndex","FilterRemove","initialFilter","filterQuery","postFilterRequest","is_applied","postV1Filter","showCameraButton","BreadCrumb","Breadcrumbs","slot","Link","to","linkState","Pagination","handlePaginationModel","pageSizeOptions","setIsChanged","borderTop","newModel","parseInt","ChevronRightICon","mx","AddPageModal","pages","setError","pageNames","newPage","SharedPageView","pageValue","viewStyle","renderViewName","sharedPage","kanbanView","calendarView","tableView","ganttView","gridView","centered","other","a11yProps","SharedPageModal","sharedPages","setSharedPages","setSharedPage","PageDescription","viewsMessage","filtersMessage","details","_l","prevPages","isPinToDashboard","handleSharedView","labelPlacement","owner","AddPage","handleAddPage","isAddMenuOpen","setIsAddMenuOpen","isAddPageModalOpen","setIsAddPageModalOpen","isSharedPageModalOpen","setIsSharedPageModalOpen","handleAddMenuClose","AddCircleOutlineRoundedIcon","KeyboardArrowRightIcon","SharePopUp","roles","toggleSwitch","isPeopleAccessVisible","share","useAppSelector","store","isPublic","setIsPublic","selectedUsers","roleValue","setRoleValue","availableRole","setAvailableRole","userDropdownData","setUserDropdownData","isRoleVisible","departments","users","setSelectedUsers","selRole","userRole","role_id","is_role","resetOptions","prevData","getAllUserAndDepartmentDropdown","prevSettings","handleChage","List","ListItem","ListItemAvatar","changeRole","handleRoleChange","uIds","sOptions","u","sharedData","is_private","userRoles","PageAction","setCurrentPage","setPages","handlePageDelete","isEditPageModalOpen","setIsEditPageModalOpen","isShareModalOpen","setIsShareModalOpen","isConfirmOpen","setIsConfirmOpen","deletePageNo","setDeletePageNo","defaultSharedData","setDefaultSharedData","pageSharedData","setPageSharedData","pinToDashboardStore","useSelector","pinToDashboardData","setPinToDashboardData","dashboard","pinToDashboardList","appDispatch","setIsCreatePage","shareUsers","handleDeletePage","actions","isShared","labelExists","uniqueNumberId","generateRandomId","newLabel","counter","updatedPage","defaultData","findIndex","updatedData","updatedArray","elementToShift","moveRight","moveLeft","updatedPages","deletePage","updatedPinToDashboardData","deletePinToDashboardPage","pageData","sharePage","StyledTabs","StyledTab","MUITab","textTransform","PageNavigator","savePages","generatedColumns","isChanged","isCreatePage","addOrDeletePage","isActionsMenuOpen","setIsActionsMenuOpen","setPage","isAllPagesMenuOpen","setIsAllPagesMenuOpen","handleCloseAllPagesMenu","handleAddOrdeletePage","status_code","MenuIcon","pg","handleOpenActionsMenu","clickedPage","Share","nPage","defaultPageState","column_order","uniq","orderKeys","active_view","Footer","currentPage","savePageConfiguration","enablePages","isPaginationDisplayed","isPageSaving","isDrawerOpen","setIsDrawerOpen","handleStorageChange","interval","setInterval","clearInterval","Android12Switch","backgroundImage","encodeURIComponent","getContrastText","debouncedSetColor","ColorLensIcon","heading","subHeading","breadCrumbPath","handleFormSubmit","onTableAddClick","handleFormValues","getFormMethods","setFields","setActiveTabValue","activeTab","recieveTabDataLenght","recieveIsValidForm","activeTabs","containerStyles","convertNestedFieldSchemaObject","nestedFields","hasOwn","unregister","yupSchemaObject","nestedFielvalidations","nestedYupSchemaObj","dotNotationString","existingObject","currentLevel","convertToNestedObject","watchedValues","setSchema","tabsData","setTabsData","errorAlert","setErrorAlert","isTabFormValid","setTabFormValid","validateRequiredFields","setValidRequiredFields","getSectionData","sectionMembers","section_type","SECTION_TYPES","FORM_SWITCH_SECTION","form_switcher_name","switcher_forms","form","formMembers","member","section_form_id","selectedSectionForm","is_form_switcher_section","oldVal","country_code_field_name","newVal","is_country_code_separate","memberName","newData","createNestedObjectFromDot","fieldValue","hours","minutes","seconds","removeMatchingKeyValuePairs","obj1","obj2","forOwn","validateRequiredSwitchFormData","switchData","requiredFields","thenValidation","getMissingFields","watchedFields","validationReqFields","missingFields","handleMessage","origin","formBuilderDeConversion","dVals","wVals","nestedFormValues","is_section_field","finalFormValues","validatedFields","switchFormData","selectValue","isFormTabValid","version","xmlns","x","viewBox","enableBackground","fill","attributeType","attributeName","from","dur","repeatCount","bgClass","bg","CardMedia"],"mappings":"4oGAeMA,GAAYC,EAAAA,KAAMC,IACtB,MAAQC,MAAAA,EAAAA,SAAOC,EAAUC,eAAgBC,GAAmBJ,EAE5D,SACEK,KAACC,GAAA,IAAoBF,EACnBF,SAAA,CAAAK,EAAAA,IAACC,EAAAA,iBAAA,CACCC,iBAAaC,GAAA,IACb,gBAAc,iBACdC,GAAG,gBAEFT,SAAAD,UAEFW,EAAAA,kBAAkBV,kBAMnBI,GAAkBO,EAAAA,OAAOC,YAAPD,CAAqB,EAAGE,OAASC,uBAAiB,MAAA,CACxEC,MAAO,OAAAC,EAAAF,EAAQD,YAAR,EAAAG,EAAeC,UAAU,KAChCC,SAAU,YACVC,UAAW,OACX,4BAA6B,CAC3BC,QAAS,kBACTC,UAAW,iBACXC,kBAAmB,MACnBC,kBAAmB,QACnBC,kBAAmB,OAAAC,EAAAX,EAAQD,YAAR,EAAAY,EAAeR,UAAU,MAE9C,+BAAgC,CAC9BS,OAAQ,IACR,iBAAkB,C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