@flipdish/portal-library 2.0.0 → 2.0.1
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/assets/images/fd-loader.gif.cjs.js +2 -0
- package/dist/assets/images/fd-loader.gif.cjs.js.map +1 -0
- package/dist/components/Chip/index.cjs.js +2 -0
- package/dist/components/Chip/index.cjs.js.map +1 -0
- package/dist/components/FDErrorBoundary/index.cjs.js +2 -0
- package/dist/components/FDErrorBoundary/index.cjs.js.map +1 -0
- package/dist/components/FlipdishLogoLoader/index.cjs.js +2 -0
- package/dist/components/FlipdishLogoLoader/index.cjs.js.map +1 -0
- package/dist/components/FlipdishStaffContainer/index.cjs.js +2 -0
- package/dist/components/FlipdishStaffContainer/index.cjs.js.map +1 -0
- package/dist/components/Form/FormItemLayout/index.cjs.js +2 -0
- package/dist/components/Form/FormItemLayout/index.cjs.js.map +1 -0
- package/dist/components/Form/GenericAutocompleteField/index.cjs.js +2 -0
- package/dist/components/Form/GenericAutocompleteField/index.cjs.js.map +1 -0
- package/dist/components/Form/GenericFormContainer/index.cjs.js +2 -0
- package/dist/components/Form/GenericFormContainer/index.cjs.js.map +1 -0
- package/dist/components/Form/GenericTextField/index.cjs.js +2 -0
- package/dist/components/Form/GenericTextField/index.cjs.js.map +1 -0
- package/dist/components/Form/PaginatedAutocompleteField/index.cjs.js +2 -0
- package/dist/components/Form/PaginatedAutocompleteField/index.cjs.js.map +1 -0
- package/dist/components/GenericDatePickerField/GenericDateFieldBase.cjs.js +2 -0
- package/dist/components/GenericDatePickerField/GenericDateFieldBase.cjs.js.map +1 -0
- package/dist/components/GenericDatePickerField/index.cjs.js +2 -0
- package/dist/components/GenericDatePickerField/index.cjs.js.map +1 -0
- package/dist/components/GenericDateTimePickerField/index.cjs.js +2 -0
- package/dist/components/GenericDateTimePickerField/index.cjs.js.map +1 -0
- package/dist/components/GenericRadioButtons/index.cjs.js +2 -0
- package/dist/components/GenericRadioButtons/index.cjs.js.map +1 -0
- package/dist/components/GenericTable/HighlightScrollbar.cjs.js +2 -0
- package/dist/components/GenericTable/HighlightScrollbar.cjs.js.map +1 -0
- package/dist/components/GenericTable/index.cjs.js +18 -0
- package/dist/components/GenericTable/index.cjs.js.map +1 -0
- package/dist/components/GenericTableBody/index.cjs.js +2 -0
- package/dist/components/GenericTableBody/index.cjs.js.map +1 -0
- package/dist/components/GenericTableBodyRow/index.cjs.js +2 -0
- package/dist/components/GenericTableBodyRow/index.cjs.js.map +1 -0
- package/dist/components/GenericTableTitle/index.cjs.js +2 -0
- package/dist/components/GenericTableTitle/index.cjs.js.map +1 -0
- package/dist/components/LazyComponent/index.cjs.js +2 -0
- package/dist/components/LazyComponent/index.cjs.js.map +1 -0
- package/dist/components/ListItemLink/index.cjs.js +2 -0
- package/dist/components/ListItemLink/index.cjs.js.map +1 -0
- package/dist/components/ListItemLinkButton/index.cjs.js +2 -0
- package/dist/components/ListItemLinkButton/index.cjs.js.map +1 -0
- package/dist/components/NoResults/index.cjs.js +2 -0
- package/dist/components/NoResults/index.cjs.js.map +1 -0
- package/dist/components/NotFoundPage/index.cjs.js +2 -0
- package/dist/components/NotFoundPage/index.cjs.js.map +1 -0
- package/dist/components/PageLayout/DocumentTitle.cjs.js +2 -0
- package/dist/components/PageLayout/DocumentTitle.cjs.js.map +1 -0
- package/dist/components/PageLayout/FullWidthContainer.cjs.js +2 -0
- package/dist/components/PageLayout/FullWidthContainer.cjs.js.map +1 -0
- package/dist/components/PageLayout/GlobalSpacingStyles.cjs.js +2 -0
- package/dist/components/PageLayout/GlobalSpacingStyles.cjs.js.map +1 -0
- package/dist/components/PageLayout/index.cjs.js +2 -0
- package/dist/components/PageLayout/index.cjs.js.map +1 -0
- package/dist/components/PortalMock/index.cjs.js +2 -0
- package/dist/components/PortalMock/index.cjs.js.map +1 -0
- package/dist/components/Spacer/index.cjs.js +2 -0
- package/dist/components/Spacer/index.cjs.js.map +1 -0
- package/dist/components/Switch/index.cjs.js +2 -0
- package/dist/components/Switch/index.cjs.js.map +1 -0
- package/dist/components/Tooltip/index.cjs.js +2 -0
- package/dist/components/Tooltip/index.cjs.js.map +1 -0
- package/dist/custom-hooks/useMicroFrontendAttributes.cjs.js +2 -0
- package/dist/custom-hooks/useMicroFrontendAttributes.cjs.js.map +1 -0
- package/dist/custom-hooks/useRenderValidText.cjs.js +2 -0
- package/dist/custom-hooks/useRenderValidText.cjs.js.map +1 -0
- package/dist/custom-hooks/useToasts.cjs.js +2 -0
- package/dist/custom-hooks/useToasts.cjs.js.map +1 -0
- package/dist/icons/AccessTimeIcon.cjs.js +2 -0
- package/dist/icons/AccessTimeIcon.cjs.js.map +1 -0
- package/dist/{Icons/AccessTimeIcon/index.js → icons/AccessTimeIcon.js} +1 -1
- package/dist/icons/AccessTimeIcon.js.map +1 -0
- package/dist/icons/CalenderTodayIcon.cjs.js +2 -0
- package/dist/icons/CalenderTodayIcon.cjs.js.map +1 -0
- package/dist/{Icons/CalenderTodayIcon/index.js → icons/CalenderTodayIcon.js} +1 -1
- package/dist/icons/CalenderTodayIcon.js.map +1 -0
- package/dist/icons/DoneIcon.cjs.js +2 -0
- package/dist/icons/DoneIcon.cjs.js.map +1 -0
- package/dist/{Icons/DoneIcon/index.js → icons/DoneIcon.js} +1 -1
- package/dist/icons/DoneIcon.js.map +1 -0
- package/dist/icons/SearchIcon.cjs.js +2 -0
- package/dist/icons/SearchIcon.cjs.js.map +1 -0
- package/dist/{Icons/SearchIcon/index.js → icons/SearchIcon.js} +1 -1
- package/dist/icons/SearchIcon.js.map +1 -0
- package/dist/icons/logo/Deliveroo.cjs.js +2 -0
- package/dist/icons/logo/Deliveroo.cjs.js.map +1 -0
- package/dist/{Icons/logo/Deliveroo/index.js → icons/logo/Deliveroo.js} +1 -1
- package/dist/icons/logo/Deliveroo.js.map +1 -0
- package/dist/localization/de.json.cjs.js +2 -0
- package/dist/localization/de.json.cjs.js.map +1 -0
- package/dist/localization/dev-lang.json.cjs.js +2 -0
- package/dist/localization/dev-lang.json.cjs.js.map +1 -0
- package/dist/localization/en-US.json.cjs.js +2 -0
- package/dist/localization/en-US.json.cjs.js.map +1 -0
- package/dist/localization/en.json.cjs.js +2 -0
- package/dist/localization/en.json.cjs.js.map +1 -0
- package/dist/localization/es-MX.json.cjs.js +2 -0
- package/dist/localization/es-MX.json.cjs.js.map +1 -0
- package/dist/localization/es.json.cjs.js +2 -0
- package/dist/localization/es.json.cjs.js.map +1 -0
- package/dist/localization/fr.json.cjs.js +2 -0
- package/dist/localization/fr.json.cjs.js.map +1 -0
- package/dist/localization/it.json.cjs.js +2 -0
- package/dist/localization/it.json.cjs.js.map +1 -0
- package/dist/localization/nl.json.cjs.js +2 -0
- package/dist/localization/nl.json.cjs.js.map +1 -0
- package/dist/localization/pt.json.cjs.js +2 -0
- package/dist/localization/pt.json.cjs.js.map +1 -0
- package/dist/providers/DateTimeLocalizationProvider.cjs.js +2 -0
- package/dist/providers/DateTimeLocalizationProvider.cjs.js.map +1 -0
- package/dist/providers/ToastProvider.cjs.js +2 -0
- package/dist/providers/ToastProvider.cjs.js.map +1 -0
- package/dist/providers/TranslationProvider.cjs.js +2 -0
- package/dist/providers/TranslationProvider.cjs.js.map +1 -0
- package/dist/stories/utilities/MockPageContent.cjs.js +2 -0
- package/dist/stories/utilities/MockPageContent.cjs.js.map +1 -0
- package/dist/themes/flipdishPublicTheme.cjs.js +2 -0
- package/dist/themes/flipdishPublicTheme.cjs.js.map +1 -0
- package/dist/utilities/formValidation.cjs.js +2 -0
- package/dist/utilities/formValidation.cjs.js.map +1 -0
- package/dist/utilities/genericUtilities.cjs.js +2 -0
- package/dist/utilities/genericUtilities.cjs.js.map +1 -0
- package/dist/utilities/renderUtilities.cjs.js +2 -0
- package/dist/utilities/renderUtilities.cjs.js.map +1 -0
- package/dist/utilities/validation.cjs.js +2 -0
- package/dist/utilities/validation.cjs.js.map +1 -0
- package/package.json +14 -9
- package/dist/Icons/AccessTimeIcon/index.js.map +0 -1
- package/dist/Icons/CalenderTodayIcon/index.js.map +0 -1
- package/dist/Icons/DoneIcon/index.js.map +0 -1
- package/dist/Icons/SearchIcon/index.js.map +0 -1
- package/dist/Icons/logo/Deliveroo/index.js.map +0 -1
- /package/dist/{Icons/AccessTimeIcon/index.d.ts → icons/AccessTimeIcon.d.ts} +0 -0
- /package/dist/{Icons/CalenderTodayIcon/index.d.ts → icons/CalenderTodayIcon.d.ts} +0 -0
- /package/dist/{Icons/DoneIcon/index.d.ts → icons/DoneIcon.d.ts} +0 -0
- /package/dist/{Icons/SearchIcon/index.d.ts → icons/SearchIcon.d.ts} +0 -0
- /package/dist/{Icons/logo/Deliveroo/index.d.ts → icons/logo/Deliveroo.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fd-loader.gif.cjs.js","sources":["../../../src/assets/images/fd-loader.gif"],"sourcesContent":["export default \"7cb5b036a5bc98d2.gif\""],"names":[],"mappings":"4BAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Chip"),l=require("@mui/material/styles");const o=["filled","outlined"],t=(e,r,l)=>({blue:{filled:{backgroundColor:r.palette.flippyBlue.light,color:r.palette.flippyBlue.dark},outlined:{borderColor:r.palette.flippyBlue.dark,color:r.palette.flippyBlue.dark}},success:{filled:{backgroundColor:r.palette.success.light,color:r.palette.success.dark},outlined:{borderColor:r.palette.success.main,color:r.palette.success.main}},warning:{filled:{backgroundColor:r.palette.warning.light,color:r.palette.warning.dark},outlined:{borderColor:r.palette.warning.main,color:r.palette.warning.dark}},error:{filled:{backgroundColor:r.palette.error.light,color:r.palette.error.dark},outlined:{borderColor:r.palette.error.main,color:r.palette.error.main}},default:{filled:{},outlined:{}}}[e][l]),a=l.styled(r,{shouldForwardProp:e=>"colour"!==e&&"rounded"!==e})((({theme:e,colour:r,rounded:l,variant:a=o[0]})=>({borderRadius:l?"100px":"5px","& .MuiChip-icon":{color:"inherit"},...t(r,e,a)})));exports.CHIP_COLORS=["default","blue","success","warning","error"],exports.CHIP_VARIANTS=o,exports.default=({label:r,color:l="default",size:o="medium",variant:t="filled",icon:i,rounded:d=!0})=>e.jsx(a,{icon:i,label:r,colour:l,size:o,variant:t,rounded:d});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/Chip/index.tsx"],"sourcesContent":["import MuiChip, { type ChipProps as MuiChipProps } from '@mui/material/Chip';\nimport { styled, type Theme } from '@mui/material/styles';\n\nexport const CHIP_COLORS = ['default', 'blue', 'success', 'warning', 'error'] as const;\nexport type ChipColor = (typeof CHIP_COLORS)[number];\n\nexport const CHIP_VARIANTS = ['filled', 'outlined'] as const;\nexport type ChipVariant = (typeof CHIP_VARIANTS)[number];\n\nexport type ChipProps = {\n label: string;\n color?: ChipColor;\n size?: MuiChipProps['size'];\n variant?: ChipVariant;\n icon?: MuiChipProps['icon'];\n rounded?: boolean;\n};\n\ntype StyledChipProps = {\n colour: ChipColor;\n rounded: boolean;\n variant?: ChipVariant;\n};\n\nconst getColorStyles = (colour: ChipColor, theme: Theme, variant: ChipVariant) => {\n const colorMap = {\n blue: {\n filled: {\n backgroundColor: theme.palette.flippyBlue.light,\n color: theme.palette.flippyBlue.dark,\n },\n outlined: {\n borderColor: theme.palette.flippyBlue.dark,\n color: theme.palette.flippyBlue.dark,\n },\n },\n success: {\n filled: {\n backgroundColor: theme.palette.success.light,\n color: theme.palette.success.dark,\n },\n outlined: {\n borderColor: theme.palette.success.main,\n color: theme.palette.success.main,\n },\n },\n warning: {\n filled: {\n backgroundColor: theme.palette.warning.light,\n color: theme.palette.warning.dark,\n },\n outlined: {\n borderColor: theme.palette.warning.main,\n color: theme.palette.warning.dark,\n },\n },\n error: {\n filled: {\n backgroundColor: theme.palette.error.light,\n color: theme.palette.error.dark,\n },\n outlined: {\n borderColor: theme.palette.error.main,\n color: theme.palette.error.main,\n },\n },\n default: {\n filled: {},\n outlined: {},\n },\n } satisfies Record<ChipColor, Record<ChipVariant, object>>;\n\n return colorMap[colour][variant];\n};\n\nconst StyledChip = styled(MuiChip, {\n shouldForwardProp: (prop) => prop !== 'colour' && prop !== 'rounded',\n})<StyledChipProps>(({ theme, colour, rounded, variant = CHIP_VARIANTS[0] }) => ({\n borderRadius: rounded ? '100px' : '5px',\n '& .MuiChip-icon': {\n color: 'inherit',\n },\n ...getColorStyles(colour, theme, variant),\n}));\n\nconst Chip = ({ label, color = 'default', size = 'medium', variant = 'filled', icon, rounded = true }: ChipProps) => (\n <StyledChip icon={icon} label={label} colour={color} size={size} variant={variant} rounded={rounded} />\n);\n\nexport default Chip;\n"],"names":["CHIP_VARIANTS","getColorStyles","colour","theme","variant","blue","filled","backgroundColor","palette","flippyBlue","light","color","dark","outlined","borderColor","success","main","warning","error","default","StyledChip","styled","MuiChip","shouldForwardProp","prop","rounded","borderRadius","label","size","icon","_jsx"],"mappings":"yKAGO,MAGMA,EAAgB,CAAC,SAAU,YAkBlCC,EAAiB,CAACC,EAAmBC,EAAcC,KACpC,CACbC,KAAM,CACFC,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQC,WAAWC,MAC1CC,MAAOR,EAAMK,QAAQC,WAAWG,MAEpCC,SAAU,CACNC,YAAaX,EAAMK,QAAQC,WAAWG,KACtCD,MAAOR,EAAMK,QAAQC,WAAWG,OAGxCG,QAAS,CACLT,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQO,QAAQL,MACvCC,MAAOR,EAAMK,QAAQO,QAAQH,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQO,QAAQC,KACnCL,MAAOR,EAAMK,QAAQO,QAAQC,OAGrCC,QAAS,CACLX,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQS,QAAQP,MACvCC,MAAOR,EAAMK,QAAQS,QAAQL,MAEjCC,SAAU,CACNC,YAAaX,EAAMK,QAAQS,QAAQD,KACnCL,MAAOR,EAAMK,QAAQS,QAAQL,OAGrCM,MAAO,CACHZ,OAAQ,CACJC,gBAAiBJ,EAAMK,QAAQU,MAAMR,MACrCC,MAAOR,EAAMK,QAAQU,MAAMN,MAE/BC,SAAU,CACNC,YAAaX,EAAMK,QAAQU,MAAMF,KACjCL,MAAOR,EAAMK,QAAQU,MAAMF,OAGnCG,QAAS,CACLb,OAAQ,CAAE,EACVO,SAAU,CAAE,IAIJX,GAAQE,IAGtBgB,EAAaC,EAAMA,OAACC,EAAS,CAC/BC,kBAAoBC,GAAkB,WAATA,GAA8B,YAATA,GADnCH,EAEC,EAAGlB,QAAOD,SAAQuB,UAASrB,UAAUJ,EAAc,OAAU,CAC7E0B,aAAcD,EAAU,QAAU,MAClC,kBAAmB,CACfd,MAAO,cAERV,EAAeC,EAAQC,EAAOC,2BA/EV,CAAC,UAAW,OAAQ,UAAW,UAAW,iDAkFxD,EAAGuB,QAAOhB,QAAQ,UAAWiB,OAAO,SAAUxB,UAAU,SAAUyB,OAAMJ,WAAU,KAC3FK,MAACV,EAAU,CAACS,KAAMA,EAAMF,MAAOA,EAAOzB,OAAQS,EAAOiB,KAAMA,EAAMxB,QAASA,EAASqB,QAASA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("react-error-boundary"),t=require("../../providers/TranslationProvider.cjs.js");require("react");const n=require("@mui/material/styles").styled("div")((({theme:r})=>({marginTop:r.spacing(2),display:"flex",justifyContent:"center",alignItems:"center"}))),s=()=>{const{translate:e}=t.useTranslation();return r.jsx(n,{children:e("Something_went_wrong_please_refresh_the_page")})};module.exports=({identifier:t,children:n})=>r.jsx(e.ErrorBoundary,{FallbackComponent:s,onError:(r,e)=>{window.fdlogger?.error(`${t?.toString()} Error Boundary`,{message:r?.message,stack:e})},children:n});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/FDErrorBoundary/index.tsx"],"sourcesContent":["import { ErrorBoundary } from 'react-error-boundary';\nimport { useTranslation } from '../../providers/TranslationProvider';\nimport { type ReactNode } from 'react';\nimport { styled } from '@mui/material/styles';\n\nconst StyledTextContainer = styled('div')(({ theme }) => ({\n marginTop: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n}));\n\nconst FallbackComponent = () => {\n const { translate } = useTranslation();\n return <StyledTextContainer>{translate('Something_went_wrong_please_refresh_the_page')}</StyledTextContainer>;\n};\n\nconst FDErrorBoundary = ({ identifier, children }: { identifier: string; children: ReactNode }) => {\n return (\n <ErrorBoundary\n FallbackComponent={FallbackComponent}\n onError={(error, info) => {\n window.fdlogger?.error(`${identifier?.toString()} Error Boundary`, {\n message: error?.message,\n stack: info,\n });\n }}\n >\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default FDErrorBoundary;\n"],"names":["StyledTextContainer","styled","theme","marginTop","spacing","display","justifyContent","alignItems","FallbackComponent","translate","useTranslation","_jsx","children","identifier","jsx","ErrorBoundary","onError","error","info","window","fdlogger","toString","message","stack"],"mappings":"2JAKA,MAAMA,kCAAsBC,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACtDC,UAAWD,EAAME,QAAQ,GACzBC,QAAS,OACTC,eAAgB,SAChBC,WAAY,aAGVC,EAAoB,KACtB,MAAMC,UAAEA,GAAcC,EAAAA,iBACtB,OAAOC,EAAAA,IAACX,EAAqB,CAAAY,SAAAH,EAAU,iDAAsE,iBAGzF,EAAGI,aAAYD,cAE/BD,EAAAG,IAACC,EAAaA,cAAA,CACVP,kBAAmBA,EACnBQ,QAAS,CAACC,EAAOC,KACbC,OAAOC,UAAUH,MAAM,GAAGJ,GAAYQ,4BAA6B,CAC/DC,QAASL,GAAOK,QAChBC,MAAOL,GACT,EAGLN,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),i=require("../../assets/images/fd-loader.gif.cjs.js"),r=require("@mui/material/Typography");const l=t.styled("div")((({theme:e,fullscreen:t})=>({display:"flex",alignItems:"center",justifyContent:"center",background:e.palette.white.main,flexDirection:"column",...t&&{width:"100vw",height:"100vh",position:"absolute",top:0,left:0}}))),a=t.styled("div")((({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"160px",height:"160px",borderRadius:"80px",background:e.palette.white.main,boxShadow:"0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)",marginBottom:"32px"}))),s=t.styled("img")({height:"96px",width:"96px"}),n=t.styled(r)((({theme:e})=>({color:e.palette.flippyBlue.dark,lineHeight:"1.2",marginBottom:"4px"}))),o=t.styled(r)({fontSize:"20px",color:"rgba(0, 0, 0, 0.54)",lineHeight:"1.4",letterSpacing:"normal"});module.exports=({headline:t,subHeadline:r,fullscreen:d=!1})=>e.jsxs(l,{fullscreen:d,"data-testid":"FlipdishLogoLoader",children:[e.jsx(a,{children:e.jsx(s,{src:i,alt:"Flipdish Logo Loader"})}),e.jsx(n,{variant:"h2",children:t}),r&&e.jsx(o,{children:r})]});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/FlipdishLogoLoader/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport FdLoader from '../../assets/images/fd-loader.gif';\nimport Typography from '@mui/material/Typography';\n\nconst StyledContainer = styled('div')<{ fullscreen?: boolean }>(({ theme, fullscreen }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: theme.palette.white.main,\n flexDirection: 'column',\n ...(fullscreen && {\n width: '100vw',\n height: '100vh',\n position: 'absolute',\n top: 0,\n left: 0,\n }),\n}));\n\nconst ImageContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '160px',\n height: '160px',\n borderRadius: '80px',\n background: theme.palette.white.main,\n boxShadow: '0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)',\n marginBottom: '32px',\n}));\n\nconst StyledImage = styled('img')({\n height: '96px',\n width: '96px',\n});\n\nconst StyledHeadline = styled(Typography)(({ theme }) => ({\n color: theme.palette.flippyBlue.dark,\n lineHeight: '1.2',\n marginBottom: '4px',\n}));\n\nconst StyledSubHeadline = styled(Typography)({\n fontSize: '20px',\n color: 'rgba(0, 0, 0, 0.54)',\n lineHeight: '1.4',\n letterSpacing: 'normal',\n});\n\ntype FlipdishLogoLoaderProps = {\n headline: string;\n subHeadline?: string;\n fullscreen?: boolean;\n};\n\nconst FlipdishLogoLoader = ({ headline, subHeadline, fullscreen = false }: FlipdishLogoLoaderProps) => {\n return (\n <StyledContainer fullscreen={fullscreen} data-testid=\"FlipdishLogoLoader\">\n <ImageContainer>\n <StyledImage src={FdLoader} alt=\"Flipdish Logo Loader\" />\n </ImageContainer>\n <StyledHeadline variant=\"h2\">{headline}</StyledHeadline>\n {subHeadline && <StyledSubHeadline>{subHeadline}</StyledSubHeadline>}\n </StyledContainer>\n );\n};\n\nexport default FlipdishLogoLoader;\n"],"names":["StyledContainer","styled","theme","fullscreen","display","alignItems","justifyContent","background","palette","white","main","flexDirection","width","height","position","top","left","ImageContainer","borderRadius","boxShadow","marginBottom","StyledImage","StyledHeadline","Typography","color","flippyBlue","dark","lineHeight","StyledSubHeadline","fontSize","letterSpacing","headline","subHeadline","_jsxs","children","_jsx","src","FdLoader","alt","variant","jsx"],"mappings":"8KAIA,MAAMA,EAAkBC,EAAMA,OAAC,MAAPA,EAAwC,EAAGC,QAAOC,iBAAkB,CACxFC,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBC,WAAYL,EAAMM,QAAQC,MAAMC,KAChCC,cAAe,YACXR,GAAc,CACdS,MAAO,QACPC,OAAQ,QACRC,SAAU,WACVC,IAAK,EACLC,KAAM,OAIRC,EAAiBhB,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACjDE,QAAS,OACTC,WAAY,SACZC,eAAgB,SAChBM,MAAO,QACPC,OAAQ,QACRK,aAAc,OACdX,WAAYL,EAAMM,QAAQC,MAAMC,KAChCS,UAAW,4GACXC,aAAc,WAGZC,EAAcpB,EAAAA,OAAO,MAAPA,CAAc,CAC9BY,OAAQ,OACRD,MAAO,SAGLU,EAAiBrB,EAAAA,OAAOsB,EAAPtB,EAAmB,EAAGC,YAAa,CACtDsB,MAAOtB,EAAMM,QAAQiB,WAAWC,KAChCC,WAAY,MACZP,aAAc,UAGZQ,EAAoB3B,EAAAA,OAAOsB,EAAPtB,CAAmB,CACzC4B,SAAU,OACVL,MAAO,sBACPG,WAAY,MACZG,cAAe,0BASQ,EAAGC,WAAUC,cAAa7B,cAAa,KAE1D8B,EAAAA,KAACjC,EAAe,CAACG,WAAYA,gBAAwB,qBAAoB+B,SAAA,CACrEC,EAAAA,IAAClB,EAAc,CAAAiB,SACXC,EAAAA,IAACd,EAAW,CAACe,IAAKC,EAAUC,IAAI,2BAEpCH,MAACb,GAAeiB,QAAQ,KAAML,SAAAH,IAC7BC,GAAeG,EAACK,IAAAZ,YAAmBI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("react");var r=require("../../providers/TranslationProvider.cjs.js"),i=require("@mui/icons-material/SupportAgentOutlined"),t=require("@mui/material/Grid"),a=require("@mui/material/styles"),s=require("@mui/material/Typography"),n=require("@mui/material/Box");const l=a.styled(n)((({theme:e})=>({backgroundColor:e.palette.grey[200],borderRadius:"4px",padding:e.spacing(2)}))),d=a.styled(t)((({theme:e})=>({alignItems:"center",display:"flex",marginBottom:e.spacing(1.5)}))),o=a.styled(s)((({theme:e})=>({fontWeight:500,marginLeft:e.spacing(1)})));module.exports=({titleOverride:t,children:a})=>{const{translate:s}=r.useTranslation();return e.jsxs(l,{"data-testid":"flipdish-staff-only-container",children:[e.jsxs(d,{children:[e.jsx(i,{}),e.jsx(o,{children:t||s("Flipdish_staff_only")})]}),a]})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/FlipdishStaffContainer/index.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\nimport { useTranslation } from '../../providers/TranslationProvider';\nimport SupportAgentOutlinedIcon from '@mui/icons-material/SupportAgentOutlined';\nimport Grid from '@mui/material/Grid';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\n\nconst StyledContainer = styled(Box)(({ theme }) => ({\n backgroundColor: theme.palette.grey[200],\n borderRadius: '4px',\n padding: theme.spacing(2),\n}));\n\nconst TitleContainer = styled(Grid)(({ theme }) => ({\n alignItems: 'center',\n display: 'flex',\n marginBottom: theme.spacing(1.5),\n}));\n\nconst Title = styled(Typography)(({ theme }) => ({\n fontWeight: 500,\n marginLeft: theme.spacing(1),\n}));\n\ntype Props = {\n titleOverride?: string;\n children: ReactNode;\n};\n\nconst FlipdishStaffContainer = ({ titleOverride, children }: Props) => {\n const { translate } = useTranslation();\n\n return (\n <StyledContainer data-testid=\"flipdish-staff-only-container\">\n <TitleContainer>\n <SupportAgentOutlinedIcon />\n <Title>{titleOverride || translate('Flipdish_staff_only')}</Title>\n </TitleContainer>\n\n {children}\n </StyledContainer>\n );\n};\n\nexport default FlipdishStaffContainer;\n"],"names":["StyledContainer","styled","Box","theme","backgroundColor","palette","grey","borderRadius","padding","spacing","TitleContainer","Grid","alignItems","display","marginBottom","Title","Typography","fontWeight","marginLeft","titleOverride","children","translate","useTranslation","_jsxs","_jsx","jsx","SupportAgentOutlinedIcon"],"mappings":"0TAQA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAa,CAChDC,gBAAiBD,EAAME,QAAQC,KAAK,KACpCC,aAAc,MACdC,QAASL,EAAMM,QAAQ,OAGrBC,EAAiBT,EAAAA,OAAOU,EAAPV,EAAa,EAAGE,YAAa,CAChDS,WAAY,SACZC,QAAS,OACTC,aAAcX,EAAMM,QAAQ,SAG1BM,EAAQd,EAAAA,OAAOe,EAAPf,EAAmB,EAAGE,YAAa,CAC7Cc,WAAY,IACZC,WAAYf,EAAMM,QAAQ,sBAQC,EAAGU,gBAAeC,eAC7C,MAAMC,UAAEA,GAAcC,EAAAA,iBAEtB,OACIC,OAACvB,EAAe,CAAA,cAAa,gCAA+BoB,SAAA,CACxDG,EAAAA,KAACb,EACG,CAAAU,SAAA,CAAAI,EAAAC,IAACC,EAAwB,IACzBF,EAAAC,IAACV,EAAK,CAAAK,SAAED,GAAiBE,EAAU,4BAGtCD,IAEP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime");require("react");var e=require("@mui/material/Grid"),t=require("@mui/material/styles"),i=require("@mui/material/Typography");const a=t.styled(e)((({theme:r})=>({padding:r.spacing(4.75,0,2.5,0),alignItems:"flex-start",flexWrap:"wrap",borderBottom:"1px solid rgba(0,0,0,0.2)"}))),s=t.styled("div")((({theme:r})=>({paddingBottom:r.spacing(2),paddingRight:r.spacing(1.75)})));module.exports=t=>{const{children:n,description:l,descriptionTranslated:d,label:o,labelTranslated:m,mdProportion:p,smProportion:c}=t,[x,u]=p?p.split("x").map((r=>parseInt(r,10))):[4,8],[h,g]=c?c.split("x").map((r=>parseInt(r,10))):[];return r.jsxs(a,{container:!0,children:[r.jsxs(e,{item:!0,xs:12,sm:h,md:x,children:[r.jsx(i,{variant:"subtitle1",component:"h3",color:"textPrimary",children:m||o||null}),d||l?r.jsx(s,{children:r.jsx(i,{variant:"caption",color:"textSecondary",children:d||l||null})}):null]}),r.jsx(e,{item:!0,xs:12,sm:g,md:u,children:n})]})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/Form/FormItemLayout/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport Grid, { type GridSize } from '@mui/material/Grid';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nconst StyledGrid = styled(Grid)(({ theme }) => ({\n padding: theme.spacing(4.75, 0, 2.5, 0),\n alignItems: 'flex-start',\n flexWrap: 'wrap',\n borderBottom: '1px solid rgba(0,0,0,0.2)',\n}));\n\nconst StyledDescription = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(2),\n paddingRight: theme.spacing(1.75),\n}));\n\nexport interface FormItemLayoutProps {\n children: React.ReactNode;\n description?: React.ReactNode;\n descriptionTranslated?: string;\n label?: React.ReactNode;\n labelTranslated?: string;\n mdProportion?: '4x8' | '8x4' | '10x2' | '12x12';\n smProportion?: '4x8' | '8x4' | '10x2' | '12x12';\n}\n\ntype Props = FormItemLayoutProps;\nconst FormItemLayout = (props: Props) => {\n const { children, description, descriptionTranslated, label, labelTranslated, mdProportion, smProportion } = props;\n\n const [titleProportion, dataProportion] = mdProportion ? mdProportion.split('x').map((m) => parseInt(m, 10)) : [4, 8];\n const [titleProportionSm, dataProportionSm] = smProportion ? smProportion.split('x').map((m) => parseInt(m, 10)) : [];\n const castToGridSize = (data: unknown) => data as GridSize;\n\n return (\n <StyledGrid container>\n <Grid item xs={12} sm={castToGridSize(titleProportionSm)} md={castToGridSize(titleProportion)}>\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {labelTranslated || label || null}\n </Typography>\n\n {descriptionTranslated || description ? (\n <StyledDescription>\n <Typography variant=\"caption\" color=\"textSecondary\">\n {descriptionTranslated || description || null}\n </Typography>\n </StyledDescription>\n ) : null}\n </Grid>\n <Grid item xs={12} sm={castToGridSize(dataProportionSm)} md={castToGridSize(dataProportion)}>\n {children}\n </Grid>\n </StyledGrid>\n );\n};\n\nexport default FormItemLayout;\n"],"names":["StyledGrid","styled","Grid","theme","padding","spacing","alignItems","flexWrap","borderBottom","StyledDescription","paddingBottom","paddingRight","props","children","description","descriptionTranslated","label","labelTranslated","mdProportion","smProportion","titleProportion","dataProportion","split","map","m","parseInt","titleProportionSm","dataProportionSm","_jsxs","container","item","xs","sm","md","_jsx","Typography","variant","component","color"],"mappings":"6KAMA,MAAMA,EAAaC,EAAAA,OAAOC,EAAPD,EAAa,EAAGE,YAAa,CAC5CC,QAASD,EAAME,QAAQ,KAAM,EAAG,IAAK,GACrCC,WAAY,aACZC,SAAU,OACVC,aAAc,gCAGZC,EAAoBR,EAAAA,OAAO,MAAPA,EAAc,EAAGE,YAAa,CACpDO,cAAeP,EAAME,QAAQ,GAC7BM,aAAcR,EAAME,QAAQ,yBAcRO,IACpB,MAAMC,SAAEA,EAAQC,YAAEA,EAAWC,sBAAEA,EAAqBC,MAAEA,EAAKC,gBAAEA,EAAeC,aAAEA,EAAYC,aAAEA,GAAiBP,GAEtGQ,EAAiBC,GAAkBH,EAAeA,EAAaI,MAAM,KAAKC,KAAKC,GAAMC,SAASD,EAAG,MAAO,CAAC,EAAG,IAC5GE,EAAmBC,GAAoBR,EAAeA,EAAaG,MAAM,KAAKC,KAAKC,GAAMC,SAASD,EAAG,MAAO,GAGnH,OACII,EAAAA,KAAC5B,EAAW,CAAA6B,uBACRD,OAAC1B,EAAK,CAAA4B,MAAK,EAAAC,GAAI,GAAIC,GAAmBN,EAAoBO,GAAmBb,EACzEP,SAAA,CAAAqB,EAAAA,IAACC,EAAU,CAACC,QAAQ,YAAYC,UAAU,KAAKC,MAAM,cAAazB,SAC7DI,GAAmBD,GAAS,OAGhCD,GAAyBD,EACtBoB,EAAAA,IAACzB,EAAiB,CAAAI,SACdqB,EAAAA,IAACC,GAAWC,QAAQ,UAAUE,MAAM,gBAC/BzB,SAAAE,GAAyBD,GAAe,SAGjD,QAERoB,EAAAA,IAAChC,EAAK,CAAA4B,MAAK,EAAAC,GAAI,GAAIC,GAAmBL,EAAmBM,GAAmBZ,EAAeR,SACtFA,MAGX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@mui/material/Autocomplete"),i=require("@mui/material/CircularProgress"),r=require("@mui/material/TextField"),t=require("@mui/material/Typography"),a=require("formik");require("react");var o=require("../../../custom-hooks/useRenderValidText.cjs.js"),n=require("../FormItemLayout/index.cjs.js");const u=({field:t,form:a,fieldName:n,options:u,label:d,variant:s,placeholder:p,getOptionLabel:m,isOptionEqualToValue:h,onChange:c,onInputChange:g,onScroll:x,layout:q="horizontal",disabled:v=!1,loading:b=!1,required:j=!1,multiple:T=!1,limitTags:f})=>{const{errors:y,touched:C,isSubmitting:I}=a,O=y[t.name],E=!!O&&C[t.name],F=o({fieldError:O,showError:E,touched:!!C[t.name],value:t.value});return e.jsx(l,{options:u,getOptionLabel:m,isOptionEqualToValue:h,onChange:(e,l)=>{a.setFieldValue(n,l),c&&c(e,l)},onInputChange:g,disabled:I||v,fullWidth:!0,value:t.value||(T?[]:null),loading:b,renderInput:l=>e.jsx(r,{...l,label:"standard"===s?void 0:d,variant:s,"data-testid":`text-field-${n}`,fullWidth:!0,style:{paddingRight:"horizontal"===q?16:0},placeholder:p||void 0,required:j,error:E,helperText:F,slotProps:{input:{...l.InputProps,endAdornment:e.jsxs(e.Fragment,{children:[b&&e.jsx(i,{color:"inherit",size:25}),l.InputProps.endAdornment]})},formHelperText:{children:" ",style:{textAlign:"right"}}}}),multiple:T,limitTags:T?f??2:void 0,slotProps:{listbox:{onScroll:x}}})};module.exports=({label:l,fieldName:i,options:r,placeholder:o,getOptionLabel:d,validation:s,onChange:p,onInputChange:m,isOptionEqualToValue:h,onScroll:c,layout:g="horizontal",variant:x="outlined",disabled:q=!1,loading:v=!1,required:b=!1,multiple:j=!1,limitTags:T})=>{const f=()=>e.jsx(a.Field,{name:i,validate:s,children:t=>e.jsx(u,{...t,fieldName:i,options:r,label:l,variant:x,placeholder:o,getOptionLabel:d,isOptionEqualToValue:h,onChange:p,onInputChange:m,onScroll:c,layout:g,disabled:q,loading:v,required:b,multiple:j,limitTags:T})});return"vertical"===g?e.jsxs(e.Fragment,{children:["standard"===x&&e.jsx(t,{variant:"subtitle1",component:"h3",color:"textPrimary",children:l}),f()]}):e.jsx(n,{label:l,children:f()})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/Form/GenericAutocompleteField/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Autocomplete from '@mui/material/Autocomplete';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport TextField, { type TextFieldProps } from '@mui/material/TextField';\nimport Typography from '@mui/material/Typography';\nimport { Field, type FieldProps } from 'formik';\nimport { type SyntheticEvent } from 'react';\nimport useRenderValidText from '../../../custom-hooks/useRenderValidText';\nimport FormItemLayout from '../FormItemLayout';\n\nexport type Props<T> = {\n label: string;\n fieldName: string;\n options: T[];\n placeholder?: string;\n getOptionLabel?: (option: T) => string;\n validation?: (value: T | T[]) => string | undefined;\n onChange?: (e: SyntheticEvent, value: T | T[]) => void;\n onInputChange?: (e: SyntheticEvent, value: string) => void;\n isOptionEqualToValue?: (option: T, value: T) => boolean;\n onScroll?: (e: React.UIEvent<HTMLUListElement, UIEvent>) => void;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n loading?: boolean;\n required?: boolean;\n multiple?: boolean;\n limitTags?: number;\n};\n\ntype AutocompleteFieldProps<T> = {\n field: FieldProps['field'];\n form: FieldProps['form'];\n fieldName: string;\n options: T[];\n label: string;\n variant: TextFieldProps['variant'];\n placeholder?: string;\n getOptionLabel?: (option: T) => string;\n isOptionEqualToValue?: (option: T, value: T) => boolean;\n onChange?: (e: SyntheticEvent, value: T | T[]) => void;\n onInputChange?: (e: SyntheticEvent, value: string) => void;\n onScroll?: (e: React.UIEvent<HTMLUListElement, UIEvent>) => void;\n layout?: 'horizontal' | 'vertical';\n disabled?: boolean;\n loading?: boolean;\n required?: boolean;\n multiple?: boolean;\n limitTags?: number;\n};\n\nconst AutocompleteFieldComponent = <T,>({\n field,\n form,\n fieldName,\n options,\n label,\n variant,\n placeholder,\n getOptionLabel,\n isOptionEqualToValue,\n onChange,\n onInputChange,\n onScroll,\n layout = 'horizontal',\n disabled = false,\n loading = false,\n required = false,\n multiple = false,\n limitTags,\n}: AutocompleteFieldProps<T>) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <Autocomplete\n options={options}\n getOptionLabel={getOptionLabel}\n isOptionEqualToValue={isOptionEqualToValue}\n onChange={(e: SyntheticEvent, value: T[]) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(fieldName, value);\n if (onChange) {\n onChange(e, value);\n }\n }}\n onInputChange={onInputChange}\n disabled={isSubmitting || disabled}\n fullWidth\n value={field.value || (multiple ? [] : null)}\n loading={loading}\n renderInput={(params) => (\n <TextField\n {...params}\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n data-testid={`text-field-${fieldName}`}\n fullWidth\n style={{ paddingRight: layout === 'horizontal' ? 16 : 0 }}\n placeholder={placeholder || undefined}\n required={required}\n error={showError}\n helperText={helperText}\n slotProps={{\n input: {\n ...params.InputProps,\n endAdornment: (\n <>\n {loading && <CircularProgress color=\"inherit\" size={25} />}\n {params.InputProps.endAdornment}\n </>\n ),\n },\n formHelperText: {\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n },\n }}\n />\n )}\n multiple={multiple}\n limitTags={multiple ? (limitTags ?? 2) : undefined}\n slotProps={{\n listbox: {\n onScroll,\n },\n }}\n />\n );\n};\n\nconst GenericAutocompleteField = <T,>({\n label,\n fieldName,\n options,\n placeholder,\n getOptionLabel,\n validation,\n onChange,\n onInputChange,\n isOptionEqualToValue,\n onScroll,\n layout = 'horizontal',\n variant = 'outlined',\n disabled = false,\n loading = false,\n required = false,\n multiple = false,\n limitTags = undefined,\n}: Props<T>) => {\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {(fieldProps: FieldProps) => (\n <AutocompleteFieldComponent<T>\n {...fieldProps}\n fieldName={fieldName}\n options={options}\n label={label}\n variant={variant}\n placeholder={placeholder}\n getOptionLabel={getOptionLabel}\n isOptionEqualToValue={isOptionEqualToValue}\n onChange={onChange}\n onInputChange={onInputChange}\n onScroll={onScroll}\n layout={layout}\n disabled={disabled}\n loading={loading}\n required={required}\n multiple={multiple}\n limitTags={limitTags}\n />\n )}\n </Field>\n );\n };\n\n if (layout === 'vertical') {\n return (\n <>\n {variant === 'standard' && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericAutocompleteField;\n"],"names":["AutocompleteFieldComponent","field","form","fieldName","options","label","variant","placeholder","getOptionLabel","isOptionEqualToValue","onChange","onInputChange","onScroll","layout","disabled","loading","required","multiple","limitTags","errors","touched","isSubmitting","fieldError","name","showError","helperText","useRenderValidText","value","_jsx","Autocomplete","e","setFieldValue","fullWidth","renderInput","params","TextField","undefined","style","paddingRight","error","slotProps","input","InputProps","endAdornment","_jsxs","jsxs","_Fragment","children","jsx","CircularProgress","color","size","formHelperText","textAlign","listbox","validation","renderField","Field","validate","fieldProps","Typography","component","FormItemLayout"],"mappings":"iWAmDA,MAAMA,EAA6B,EAC/BC,QACAC,OACAC,YACAC,UACAC,QACAC,UACAC,cACAC,iBACAC,uBACAC,WACAC,gBACAC,WACAC,SAAS,aACTC,YAAW,EACXC,WAAU,EACVC,YAAW,EACXC,YAAW,EACXC,gBAEA,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBnB,EACpCoB,EAAaH,EAAOlB,EAAMsB,MAC1BC,IAAcF,GAAeF,EAAQnB,EAAMsB,MAC3CE,EAAaC,EAAmB,CAClCJ,aACAE,YACAJ,UAAWA,EAAQnB,EAAMsB,MACzBI,MAAO1B,EAAM0B,QAGjB,OACIC,MAACC,EAAY,CACTzB,QAASA,EACTI,eAAgBA,EAChBC,qBAAsBA,EACtBC,SAAU,CAACoB,EAAmBH,KAE1BzB,EAAK6B,cAAc5B,EAAWwB,GAC1BjB,GACAA,EAASoB,EAAGH,EACf,EAELhB,cAAeA,EACfG,SAAUO,GAAgBP,EAC1BkB,aACAL,MAAO1B,EAAM0B,QAAUV,EAAW,GAAK,MACvCF,QAASA,EACTkB,YAAcC,GACVN,EAAAA,IAACO,EACO,IAAAD,EACJ7B,MAAmB,aAAZC,OAAyB8B,EAAY/B,EAC5CC,QAASA,EAAO,cACH,cAAcH,IAC3B6B,WACA,EAAAK,MAAO,CAAEC,aAAyB,eAAXzB,EAA0B,GAAK,GACtDN,YAAaA,QAAe6B,EAC5BpB,SAAUA,EACVuB,MAAOf,EACPC,WAAYA,EACZe,UAAW,CACPC,MAAO,IACAP,EAAOQ,WACVC,aACIC,EACKC,KAAAC,WAAA,CAAAC,SAAA,CAAAhC,GAAWa,EAACoB,IAAAC,EAAiB,CAAAC,MAAM,UAAUC,KAAM,KACnDjB,EAAOQ,WAAWC,iBAI/BS,eAAgB,CACZL,SAAU,IACVV,MAAO,CAAEgB,UAAW,aAKpCpC,SAAUA,EACVC,UAAWD,EAAYC,GAAa,OAAKkB,EACzCI,UAAW,CACPc,QAAS,CACL1C,cAId,iBAG2B,EAC7BP,QACAF,YACAC,UACAG,cACAC,iBACA+C,aACA7C,WACAC,gBACAF,uBACAG,WACAC,SAAS,aACTP,UAAU,WACVQ,YAAW,EACXC,WAAU,EACVC,YAAW,EACXC,YAAW,EACXC,gBAEA,MAAMsC,EAAc,IAEZ5B,MAAC6B,EAAAA,OAAMlC,KAAMpB,EAAWuD,SAAUH,EAAUR,SACtCY,GACE/B,MAAC5B,EAA0B,IACnB2D,EACJxD,UAAWA,EACXC,QAASA,EACTC,MAAOA,EACPC,QAASA,EACTC,YAAaA,EACbC,eAAgBA,EAChBC,qBAAsBA,EACtBC,SAAUA,EACVC,cAAeA,EACfC,SAAUA,EACVC,OAAQA,EACRC,SAAUA,EACVC,QAASA,EACTC,SAAUA,EACVC,SAAUA,EACVC,UAAWA,MAO/B,MAAe,aAAXL,EAEI+B,EAAAC,KAAAC,WAAA,CAAAC,SAAA,CACiB,aAAZzC,GACGsB,EAAAoB,IAACY,EAAU,CAACtD,QAAQ,YAAYuD,UAAU,KAAKX,MAAM,cAChDH,SAAA1C,IAGRmD,OAKN5B,EAAAoB,IAACc,EAAc,CAACzD,MAAOA,EAAQ0C,SAAAS,KAA+B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/Button"),t=require("formik");module.exports=({fields:r,onSubmit:a,handleError:n,submitButtonText:u})=>{const s=r.reduce(((e,i)=>(e[i.fieldName]=i.defaultValue,e)),{});return e.jsx(t.Formik,{initialValues:s,onSubmit:async e=>{try{await a(e)}catch(e){n&&n(e)}},children:({isSubmitting:a})=>e.jsxs(t.Form,{children:[r.map(((i,t)=>e.jsx("div",{children:i.component},`field_${i.fieldName}_${t}`))),e.jsx(i,{variant:"contained",type:"submit",disabled:a,sx:{marginTop:4},"data-testid":"submit-form-button",children:u})]})})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/Form/GenericFormContainer/index.tsx"],"sourcesContent":["import Button from '@mui/material/Button';\nimport { Form, Formik } from 'formik';\n\ntype GenericFormContainerProps = {\n fields: {\n fieldName: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultValue: any;\n component: React.ReactNode;\n }[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onSubmit: (values: any) => Promise<void>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handleError?: (error: any) => void;\n submitButtonText: string;\n};\n\nconst GenericFormContainer = ({ fields, onSubmit, handleError, submitButtonText }: GenericFormContainerProps) => {\n const initialValues = fields.reduce((acc, field) => {\n acc[field.fieldName] = field.defaultValue;\n return acc;\n }, {});\n\n return (\n <Formik\n initialValues={initialValues}\n onSubmit={async (values) => {\n try {\n await onSubmit(values);\n } catch (error) {\n if (handleError) {\n handleError(error);\n }\n }\n }}\n >\n {({ isSubmitting }) => (\n <Form>\n {fields.map((field, index) => (\n <div key={`field_${field.fieldName}_${index}`}>{field.component}</div>\n ))}\n\n <Button variant=\"contained\" type=\"submit\" disabled={isSubmitting} sx={{ marginTop: 4 }} data-testid=\"submit-form-button\">\n {submitButtonText}\n </Button>\n </Form>\n )}\n </Formik>\n );\n};\n\nexport default GenericFormContainer;\n"],"names":["fields","onSubmit","handleError","submitButtonText","initialValues","reduce","acc","field","fieldName","defaultValue","_jsx","Formik","async","values","error","children","isSubmitting","_jsxs","jsxs","Form","map","index","component","jsx","Button","variant","type","disabled","sx","marginTop"],"mappings":"qHAiB6B,EAAGA,SAAQC,WAAUC,cAAaC,uBAC3D,MAAMC,EAAgBJ,EAAOK,QAAO,CAACC,EAAKC,KACtCD,EAAIC,EAAMC,WAAaD,EAAME,aACtBH,IACR,CAAE,GAEL,OACII,EAAAA,IAACC,EAAAA,OAAM,CACHP,cAAeA,EACfH,SAAUW,MAAOC,IACb,UACUZ,EAASY,EAClB,CAAC,MAAOC,GACDZ,GACAA,EAAYY,EAEnB,GAGJC,SAAA,EAAGC,kBACAC,EAACC,KAAAC,OACI,CAAAJ,SAAA,CAAAf,EAAOoB,KAAI,CAACb,EAAOc,IAChBX,MAAA,MAAA,CAAAK,SAAgDR,EAAMe,WAA5C,SAASf,EAAMC,aAAaa,OAG1CX,EAAAa,IAACC,EAAO,CAAAC,QAAQ,YAAYC,KAAK,SAASC,SAAUX,EAAcY,GAAI,CAAEC,UAAW,GAAG,cAAc,qBAAoBd,SACnHZ,QAKnB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("react");var t=require("formik"),i=require("@mui/material/TextField"),r=require("../../../custom-hooks/useRenderValidText.cjs.js"),a=require("../FormItemLayout/index.cjs.js"),l=require("@mui/material/Typography"),o=require("@mui/material/InputAdornment");const n=({field:t,form:a,fieldName:l,label:n,placeholder:d,onChange:s,multiline:u,minRows:m,maxRows:h,layout:p="horizontal",variant:c="standard",disabled:v=!1,required:x=!1,showHelperTextWhenValid:g=!1,startIcon:f,endIcon:j,value:w,type:y="text"})=>{const{errors:b,touched:q,isSubmitting:R}=a,I=b[t.name],T=!!I&&q[t.name],C=r({fieldError:I,showError:T,touched:!!q[t.name],value:t.value});return e.jsx(i,{label:"standard"===c?void 0:n,variant:c,value:w??t.value,"data-testid":`text-field-${l??n.toLowerCase().replace(/\s+/g,"-")}`,autoComplete:"off",fullWidth:!0,multiline:u,minRows:m??(u?3:void 0),maxRows:h??(u?10:void 0),style:{paddingRight:"horizontal"===p?16:0},placeholder:d||void 0,disabled:R||v,required:x,error:T,helperText:T||g?C:void 0,onChange:e=>{"number"===y&&isNaN(Number(e.target.value))||(a.setFieldValue(l,e.target.value),s&&s(e))},slotProps:{htmlInput:{style:{paddingTop:"outlined"!==c?0:void 0,height:"1.1876em"}},formHelperText:{children:" ",style:{textAlign:"right"}}},InputProps:{startAdornment:f?e.jsx(o,{position:"start",children:f}):void 0,endAdornment:j?e.jsx(o,{position:"end",children:j}):void 0}})};module.exports=({label:r,fieldName:d,placeholder:s,validation:u,onChange:m,multiline:h,minRows:p,maxRows:c,layout:v="horizontal",variant:x="standard",disabled:g=!1,required:f=!1,showHelperTextWhenValid:j=!1,startIcon:w,endIcon:y,value:b,type:q="text"})=>{const R=!!d,I=()=>R?e.jsx(t.Field,{name:d,validate:u,children:t=>e.jsx(n,{...t,fieldName:d,label:r,placeholder:s,onChange:m,multiline:h,minRows:p,maxRows:c,layout:v,variant:x,disabled:g,required:f,showHelperTextWhenValid:j,startIcon:w,endIcon:y,value:b,type:q})}):e.jsx(i,{label:"standard"===x?void 0:r,variant:x,value:b,"data-testid":`text-field-${d??r.toLowerCase().replace(/\s+/g,"-")}`,autoComplete:"off",fullWidth:!0,multiline:h,minRows:p??(h?3:void 0),maxRows:c??(h?10:void 0),style:{paddingRight:"horizontal"===v?16:0},placeholder:s||void 0,disabled:g,required:f,onChange:m,slotProps:{htmlInput:{style:{paddingTop:"outlined"!==x?0:void 0,height:"1.1876em"}},formHelperText:{children:" ",style:{textAlign:"right"}}},InputProps:{startAdornment:w?e.jsx(o,{position:"start",children:w}):void 0,endAdornment:y?e.jsx(o,{position:"end",children:y}):void 0}});return"vertical"===v?e.jsxs(e.Fragment,{children:["standard"===x&&e.jsx(l,{variant:"subtitle1",component:"h3",color:"textPrimary",children:r}),I()]}):e.jsx(a,{label:r,children:I()})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/Form/GenericTextField/index.tsx"],"sourcesContent":["import { type ChangeEvent } from 'react';\n\nimport { type FieldProps, Field } from 'formik';\nimport TextField, { type TextFieldProps } from '@mui/material/TextField';\nimport useRenderValidText from '../../../custom-hooks/useRenderValidText';\nimport FormItemLayout from '../FormItemLayout';\nimport Typography from '@mui/material/Typography';\nimport InputAdornment from '@mui/material/InputAdornment';\n\ntype Props = {\n label: string;\n fieldName?: string;\n placeholder?: string;\n validation?: (value: string) => string | undefined;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n multiline?: boolean;\n minRows?: number;\n maxRows?: number;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n required?: boolean;\n showHelperTextWhenValid?: boolean;\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n value?: string;\n type?: 'number' | 'text';\n};\n\ntype TextFieldComponentProps = {\n field: FieldProps['field'];\n form: FieldProps['form'];\n fieldName: string;\n label: string;\n placeholder?: string;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n multiline?: boolean;\n minRows?: number;\n maxRows?: number;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldProps['variant'];\n disabled?: boolean;\n required?: boolean;\n showHelperTextWhenValid?: boolean;\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n value?: string;\n type?: 'number' | 'text';\n};\n\nconst TextFieldComponent = ({\n field,\n form,\n fieldName,\n label,\n placeholder,\n onChange,\n multiline,\n minRows,\n maxRows,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n required = false,\n showHelperTextWhenValid = false,\n startIcon,\n endIcon,\n value,\n type = 'text',\n}: TextFieldComponentProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={value ?? field.value}\n data-testid={`text-field-${fieldName ?? label.toLowerCase().replace(/\\s+/g, '-')}`}\n autoComplete=\"off\"\n fullWidth\n multiline={multiline}\n minRows={minRows ?? (multiline ? 3 : undefined)}\n maxRows={maxRows ?? (multiline ? 10 : undefined)}\n style={{ paddingRight: layout === 'horizontal' ? 16 : 0 }}\n placeholder={placeholder || undefined}\n disabled={isSubmitting || disabled}\n required={required}\n error={showError}\n helperText={(() => {\n if (showError) return helperText;\n if (showHelperTextWhenValid) return helperText;\n return undefined;\n })()}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n if (type === 'number' && isNaN(Number(e.target.value))) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(fieldName, e.target.value);\n if (onChange) {\n onChange(e);\n }\n }}\n slotProps={{\n htmlInput: {\n style: {\n paddingTop: variant !== 'outlined' ? 0 : undefined,\n height: '1.1876em',\n },\n },\n formHelperText: {\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n },\n }}\n InputProps={{\n startAdornment: startIcon ? <InputAdornment position=\"start\">{startIcon}</InputAdornment> : undefined,\n endAdornment: endIcon ? <InputAdornment position=\"end\">{endIcon}</InputAdornment> : undefined,\n }}\n />\n );\n};\n\nconst GenericTextField = ({\n label,\n fieldName = undefined,\n placeholder,\n validation,\n onChange,\n multiline,\n minRows,\n maxRows,\n layout = 'horizontal',\n variant = 'standard',\n disabled = false,\n required = false,\n showHelperTextWhenValid = false,\n startIcon = undefined,\n endIcon = undefined,\n value,\n type = 'text',\n}: Props) => {\n const useFormik = !!fieldName;\n\n const renderField = () => {\n if (!useFormik) {\n return (\n <TextField\n label={variant === 'standard' ? undefined : label}\n variant={variant}\n value={value}\n data-testid={`text-field-${fieldName ?? label.toLowerCase().replace(/\\s+/g, '-')}`}\n autoComplete=\"off\"\n fullWidth\n multiline={multiline}\n minRows={minRows ?? (multiline ? 3 : undefined)}\n maxRows={maxRows ?? (multiline ? 10 : undefined)}\n style={{ paddingRight: layout === 'horizontal' ? 16 : 0 }}\n placeholder={placeholder || undefined}\n disabled={disabled}\n required={required}\n onChange={onChange}\n slotProps={{\n htmlInput: {\n style: {\n paddingTop: variant !== 'outlined' ? 0 : undefined,\n height: '1.1876em',\n },\n },\n formHelperText: {\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n },\n }}\n InputProps={{\n startAdornment: startIcon ? <InputAdornment position=\"start\">{startIcon}</InputAdornment> : undefined,\n endAdornment: endIcon ? <InputAdornment position=\"end\">{endIcon}</InputAdornment> : undefined,\n }}\n />\n );\n }\n\n return (\n <Field name={fieldName} validate={validation}>\n {(fieldProps: FieldProps) => (\n <TextFieldComponent\n {...fieldProps}\n fieldName={fieldName}\n label={label}\n placeholder={placeholder}\n onChange={onChange}\n multiline={multiline}\n minRows={minRows}\n maxRows={maxRows}\n layout={layout}\n variant={variant}\n disabled={disabled}\n required={required}\n showHelperTextWhenValid={showHelperTextWhenValid}\n startIcon={startIcon}\n endIcon={endIcon}\n value={value}\n type={type}\n />\n )}\n </Field>\n );\n };\n\n if (layout === 'vertical') {\n return (\n <>\n {variant === 'standard' && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericTextField;\n"],"names":["TextFieldComponent","field","form","fieldName","label","placeholder","onChange","multiline","minRows","maxRows","layout","variant","disabled","required","showHelperTextWhenValid","startIcon","endIcon","value","type","errors","touched","isSubmitting","fieldError","name","showError","helperText","useRenderValidText","_jsx","jsx","TextField","undefined","toLowerCase","replace","autoComplete","fullWidth","style","paddingRight","error","e","isNaN","Number","target","setFieldValue","slotProps","htmlInput","paddingTop","height","formHelperText","children","textAlign","InputProps","startAdornment","InputAdornment","position","endAdornment","validation","useFormik","renderField","Field","validate","fieldProps","_jsxs","jsxs","_Fragment","Typography","component","color","FormItemLayout"],"mappings":"uTAkDA,MAAMA,EAAqB,EACvBC,QACAC,OACAC,YACAC,QACAC,cACAC,WACAC,YACAC,UACAC,UACAC,SAAS,aACTC,UAAU,WACVC,YAAW,EACXC,YAAW,EACXC,2BAA0B,EAC1BC,YACAC,UACAC,QACAC,OAAO,WAEP,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBnB,EACpCoB,EAAaH,EAAOlB,EAAMsB,MAC1BC,IAAcF,GAAeF,EAAQnB,EAAMsB,MAC3CE,EAAaC,EAAmB,CAClCJ,aACAE,YACAJ,UAAWA,EAAQnB,EAAMsB,MACzBN,MAAOhB,EAAMgB,QAGjB,OACIU,EAAAC,IAACC,EAAS,CACNzB,MAAmB,aAAZO,OAAyBmB,EAAY1B,EAC5CO,QAASA,EACTM,MAAOA,GAAShB,EAAMgB,MACT,cAAA,cAAcd,GAAaC,EAAM2B,cAAcC,QAAQ,OAAQ,OAC5EC,aAAa,MACbC,WAAS,EACT3B,UAAWA,EACXC,QAASA,IAAYD,EAAY,OAAIuB,GACrCrB,QAASA,IAAYF,EAAY,QAAKuB,GACtCK,MAAO,CAAEC,aAAyB,eAAX1B,EAA0B,GAAK,GACtDL,YAAaA,QAAeyB,EAC5BlB,SAAUS,GAAgBT,EAC1BC,SAAUA,EACVwB,MAAOb,EACPC,WACQD,GACAV,EADkBW,OACtB,EAGJnB,SAAWgC,IACM,WAATpB,GAAqBqB,MAAMC,OAAOF,EAAEG,OAAOxB,UAK/Cf,EAAKwC,cAAcvC,EAAWmC,EAAEG,OAAOxB,OACnCX,GACAA,EAASgC,GACZ,EAELK,UAAW,CACPC,UAAW,CACPT,MAAO,CACHU,WAAwB,aAAZlC,EAAyB,OAAImB,EACzCgB,OAAQ,aAGhBC,eAAgB,CACZC,SAAU,IACVb,MAAO,CAAEc,UAAW,WAG5BC,WAAY,CACRC,eAAgBpC,EAAYY,MAACyB,EAAc,CAACC,SAAS,QAASL,SAAAjC,SAA8Be,EAC5FwB,aAActC,EAAUW,MAACyB,EAAc,CAACC,SAAS,MAAOL,SAAAhC,SAA4Bc,IAG9F,iBAGmB,EACrB1B,QACAD,YACAE,cACAkD,aACAjD,WACAC,YACAC,UACAC,UACAC,SAAS,aACTC,UAAU,WACVC,YAAW,EACXC,YAAW,EACXC,2BAA0B,EAC1BC,YACAC,UACAC,QACAC,OAAO,WAEP,MAAMsC,IAAcrD,EAEdsD,EAAc,IACXD,EAsCD7B,MAAC+B,EAAAA,OAAMnC,KAAMpB,EAAWwD,SAAUJ,EAAUP,SACtCY,GACEjC,MAAC3B,EAAkB,IACX4D,EACJzD,UAAWA,EACXC,MAAOA,EACPC,YAAaA,EACbC,SAAUA,EACVC,UAAWA,EACXC,QAASA,EACTC,QAASA,EACTC,OAAQA,EACRC,QAASA,EACTC,SAAUA,EACVC,SAAUA,EACVC,wBAAyBA,EACzBC,UAAWA,EACXC,QAASA,EACTC,MAAOA,EACPC,KAAMA,MAvDdS,EAACC,IAAAC,EACG,CAAAzB,MAAmB,aAAZO,OAAyBmB,EAAY1B,EAC5CO,QAASA,EACTM,MAAOA,EACM,cAAA,cAAcd,GAAaC,EAAM2B,cAAcC,QAAQ,OAAQ,OAC5EC,aAAa,MACbC,WAAS,EACT3B,UAAWA,EACXC,QAASA,IAAYD,EAAY,OAAIuB,GACrCrB,QAASA,IAAYF,EAAY,QAAKuB,GACtCK,MAAO,CAAEC,aAAyB,eAAX1B,EAA0B,GAAK,GACtDL,YAAaA,QAAeyB,EAC5BlB,SAAUA,EACVC,SAAUA,EACVP,SAAUA,EACVqC,UAAW,CACPC,UAAW,CACPT,MAAO,CACHU,WAAwB,aAAZlC,EAAyB,OAAImB,EACzCgB,OAAQ,aAGhBC,eAAgB,CACZC,SAAU,IACVb,MAAO,CAAEc,UAAW,WAG5BC,WAAY,CACRC,eAAgBpC,EAAYY,MAACyB,EAAc,CAACC,SAAS,QAASL,SAAAjC,SAA8Be,EAC5FwB,aAActC,EAAUW,MAACyB,EAAc,CAACC,SAAS,MAAOL,SAAAhC,SAA4Bc,KAiCxG,MAAe,aAAXpB,EAEImD,EAAAC,KAAAC,WAAA,CAAAf,SAAA,CACiB,aAAZrC,GACGgB,EAAAC,IAACoC,EAAU,CAACrD,QAAQ,YAAYsD,UAAU,KAAKC,MAAM,cAChDlB,SAAA5C,IAGRqD,OAKN9B,EAAAC,IAACuC,EAAc,CAAC/D,MAAOA,EAAQ4C,SAAAS,KAA+B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("formik"),r=require("react"),n=require("../GenericAutocompleteField/index.cjs.js"),u=require("lodash.debounce"),o=require("@tanstack/react-query");module.exports=a=>{const{fieldName:s,fetch:c,onChange:i,onInputChange:l,onScroll:d}=a,{values:g}=t.useFormikContext(),[h,q]=r.useState(g[s]?[g[s]]:[]),[f,m]=r.useState(1),[p,y]=r.useState(""),[C,S]=r.useState(!0),{data:x,isLoading:j}=o.useQuery({queryKey:[`PaginatedAutocompleteField-${s}`,f,p],queryFn:()=>c(f,p),retry:1});r.useEffect((()=>{x&&0!==x.length?(S(!0),q(1===f?x:e=>[...e,...x])):S(!1)}),[x]);const k=r.useCallback((()=>{!j&&C&&m((e=>e+1))}),[j,C]),F=u((e=>{m(1),y(e),S(!0)}),500);return r.useEffect((()=>()=>{F.cancel()}),[F]),e.jsx(n,{...a,options:h,loading:j,onChange:(e,t)=>{y(""),i&&i(e,t)},onInputChange:(e,t)=>{F(t),l&&l(e,t)},onScroll:e=>{(e=>{const t=e.currentTarget;t.scrollTop+t.clientHeight>=t.scrollHeight-100&&k()})(e),d&&d(e)}})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../src/components/Form/PaginatedAutocompleteField/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useFormikContext } from 'formik';\nimport { type SyntheticEvent, useCallback, useEffect, useState } from 'react';\nimport GenericAutocompleteField, { type Props as GenericAutocompleteFieldProps } from '../GenericAutocompleteField';\nimport debounce from 'lodash.debounce';\nimport { useQuery } from '@tanstack/react-query';\n\ntype Props<T> = Omit<GenericAutocompleteFieldProps<T>, 'options'> & {\n fetch: (page: number, search: string) => Promise<T[]>;\n};\n\nconst PaginatedAutocompleteField = <T,>(props: Props<T>) => {\n const { fieldName, fetch, onChange, onInputChange, onScroll } = props;\n const { values } = useFormikContext<{ [key: string]: any }>();\n\n const [options, setOptions] = useState<T[]>(values[fieldName] ? [values[fieldName]] : []);\n const [page, setPage] = useState(1);\n const [searchQuery, setSearchQuery] = useState('');\n const [hasMore, setHasMore] = useState(true);\n\n const { data: queryResult, isLoading } = useQuery({\n queryKey: [`PaginatedAutocompleteField-${fieldName}`, page, searchQuery],\n queryFn: () => fetch(page, searchQuery),\n retry: 1,\n });\n\n useEffect(() => {\n if (!queryResult || queryResult.length === 0) {\n setHasMore(false);\n return;\n }\n setHasMore(true);\n if (page === 1) {\n setOptions(queryResult);\n } else {\n setOptions((prevVouchers) => [...prevVouchers, ...queryResult]);\n }\n }, [queryResult]);\n\n const loadMore = useCallback(() => {\n if (isLoading || !hasMore) {\n return;\n }\n setPage((prevPage) => prevPage + 1);\n }, [isLoading, hasMore]);\n\n const handleScroll = (event: React.UIEvent<HTMLUListElement, UIEvent>) => {\n const listboxNode = event.currentTarget;\n if (\n listboxNode.scrollTop + listboxNode.clientHeight >=\n listboxNode.scrollHeight - 100 // Trigger 100px before the bottom\n ) {\n loadMore();\n }\n };\n\n const handleInputChange = debounce((value: string) => {\n setPage(1);\n setSearchQuery(value);\n setHasMore(true);\n }, 500);\n\n useEffect(() => {\n return () => {\n handleInputChange.cancel();\n };\n }, [handleInputChange]);\n\n return (\n <GenericAutocompleteField\n {...props}\n options={options}\n loading={isLoading}\n onChange={(e: SyntheticEvent, value: T[]) => {\n setSearchQuery('');\n if (onChange) {\n onChange(e, value);\n }\n }}\n onInputChange={(e: SyntheticEvent, value: string) => {\n handleInputChange(value);\n if (onInputChange) {\n onInputChange(e, value);\n }\n }}\n onScroll={(e: React.UIEvent<HTMLUListElement, UIEvent>) => {\n handleScroll(e);\n if (onScroll) {\n onScroll(e);\n }\n }}\n />\n );\n};\n\nexport default PaginatedAutocompleteField;\n"],"names":["props","fieldName","fetch","onChange","onInputChange","onScroll","values","useFormikContext","options","setOptions","useState","page","setPage","searchQuery","setSearchQuery","hasMore","setHasMore","data","queryResult","isLoading","useQuery","queryKey","queryFn","retry","useEffect","length","prevVouchers","loadMore","useCallback","prevPage","handleInputChange","debounce","value","cancel","_jsx","GenericAutocompleteField","loading","e","event","listboxNode","currentTarget","scrollTop","clientHeight","scrollHeight","handleScroll"],"mappings":"4NAWwCA,IACpC,MAAMC,UAAEA,EAASC,MAAEA,EAAKC,SAAEA,EAAQC,cAAEA,EAAaC,SAAEA,GAAaL,GAC1DM,OAAEA,GAAWC,EAAAA,oBAEZC,EAASC,GAAcC,EAAQA,SAAMJ,EAAOL,GAAa,CAACK,EAAOL,IAAc,KAC/EU,EAAMC,GAAWF,EAAQA,SAAC,IAC1BG,EAAaC,GAAkBJ,EAAQA,SAAC,KACxCK,EAASC,GAAcN,EAAQA,UAAC,IAE/BO,KAAMC,EAAWC,UAAEA,GAAcC,EAAAA,SAAS,CAC9CC,SAAU,CAAC,8BAA8BpB,IAAaU,EAAME,GAC5DS,QAAS,IAAMpB,EAAMS,EAAME,GAC3BU,MAAO,IAGXC,EAAAA,WAAU,KACDN,GAAsC,IAAvBA,EAAYO,QAIhCT,GAAW,GAEPP,EADS,IAATE,EACWO,EAECQ,GAAiB,IAAIA,KAAiBR,KAPlDF,GAAW,EAQd,GACF,CAACE,IAEJ,MAAMS,EAAWC,EAAAA,aAAY,MACrBT,GAAcJ,GAGlBH,GAASiB,GAAaA,EAAW,GAAE,GACpC,CAACV,EAAWJ,IAYTe,EAAoBC,GAAUC,IAChCpB,EAAQ,GACRE,EAAekB,GACfhB,GAAW,EAAK,GACjB,KAQH,OANAQ,EAAAA,WAAU,IACC,KACHM,EAAkBG,QAAQ,GAE/B,CAACH,IAGAI,MAACC,EAAwB,IACjBnC,EACJQ,QAASA,EACT4B,QAASjB,EACThB,SAAU,CAACkC,EAAmBL,KAC1BlB,EAAe,IACXX,GACAA,EAASkC,EAAGL,EACf,EAEL5B,cAAe,CAACiC,EAAmBL,KAC/BF,EAAkBE,GACd5B,GACAA,EAAciC,EAAGL,EACpB,EAEL3B,SAAWgC,IAvCE,CAACC,IAClB,MAAMC,EAAcD,EAAME,cAEtBD,EAAYE,UAAYF,EAAYG,cACpCH,EAAYI,aAAe,KAE3BhB,GACH,EAiCOiB,CAAaP,GACThC,GACAA,EAASgC,EACZ,GAGX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("formik"),i=require("../Form/FormItemLayout/index.cjs.js"),a=require("@mui/material/styles");require("@mui/material/TextField");var t=require("@mui/material/Box"),l=require("@mui/material/Typography"),s=require("../../custom-hooks/useRenderValidText.cjs.js"),n=require("moment");require("@mui/x-date-pickers/DatePicker"),require("@mui/x-date-pickers/DateTimePicker");const o=a.styled("div")((({theme:e})=>({marginTop:e.spacing(2),"& > div":{width:"100%"}})));module.exports=({label:d,fieldName:u,description:m,validation:c,variant:h="standard",layout:x,onChange:p,disabled:v=!1,disablePast:j=!1,disablefuture:b=!1,placeholder:g,showHelperTextWhenValid:q=!1,pickerComponent:y})=>{const F=a.useTheme(),T=()=>e.jsx(r.Field,{name:u,validate:c,children:({field:r,form:i})=>{const{errors:a,touched:c,isSubmitting:T}=i,k=a[r.name],P=!!k&&c[r.name],f=s({fieldError:k,showError:P,touched:!!c[r.name],value:r.value});return e.jsxs(t,{sx:{paddingRight:"horizontal"===x?"16px":0},children:[e.jsx(o,{children:e.jsx(y,{label:"standard"===h?void 0:d,value:n.isMoment(r.value)?r.value:n(r.value),onChange:e=>{const a=n.isMoment(e)?e:n(e);i.setFieldValue(r.name,a),p&&p(a)},name:u,slotProps:{textField:{variant:h,placeholder:g,error:P,helperText:P||q?f:void 0,FormHelperTextProps:{children:" ",style:{textAlign:"right"}}}},disabled:T||v,disablePast:j,disableFuture:b})}),m&&e.jsx(l,{variant:"caption",sx:{color:F.palette.text.secondary},children:m})]})}});return"vertical"===x?e.jsxs(e.Fragment,{children:["standard"===h&&e.jsx(l,{variant:"subtitle1",component:"h3",color:"textPrimary",children:d}),T()]}):e.jsx(i,{label:d,children:T()})};
|
|
2
|
+
//# sourceMappingURL=GenericDateFieldBase.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericDateFieldBase.cjs.js","sources":["../../../src/components/GenericDatePickerField/GenericDateFieldBase.tsx"],"sourcesContent":["import { type FieldProps, Field } from 'formik';\nimport FormItemLayout from '../Form/FormItemLayout';\nimport { styled, useTheme } from '@mui/material/styles';\nimport { type TextFieldVariants } from '@mui/material/TextField';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport moment from 'moment';\nimport { DatePicker } from '@mui/x-date-pickers/DatePicker';\nimport { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';\n\nconst StyledPickerBase = styled('div')(({ theme }) => ({\n marginTop: theme.spacing(2),\n '& > div': {\n width: '100%',\n },\n}));\n\nexport type GenericDateFieldBaseProps = {\n label: string;\n placeholder?: string;\n fieldName: string;\n description?: string;\n validation?: (value: string) => string | undefined;\n layout?: 'horizontal' | 'vertical';\n variant?: TextFieldVariants;\n disabled?: boolean;\n disablePast?: boolean;\n disablefuture?: boolean;\n onChange?: (dateTime: moment.Moment) => void;\n showHelperTextWhenValid?: boolean;\n pickerComponent: typeof DatePicker | typeof DateTimePicker;\n};\n\nconst GenericDateFieldBase = ({\n label,\n fieldName,\n description,\n validation,\n variant = 'standard',\n layout,\n onChange,\n disabled = false,\n disablePast = false,\n disablefuture = false,\n placeholder = undefined,\n showHelperTextWhenValid = false,\n pickerComponent: PickerComponent,\n}: GenericDateFieldBaseProps) => {\n const theme = useTheme();\n\n const renderField = () => {\n return (\n <Field name={fieldName} validate={validation}>\n {({ field, form }: FieldProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <Box sx={{ paddingRight: layout === 'horizontal' ? '16px' : 0 }}>\n <StyledPickerBase>\n <PickerComponent\n label={variant === 'standard' ? undefined : label}\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n value={moment.isMoment(field.value) ? field.value : moment(field.value)}\n onChange={(value) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n const momentValue = moment.isMoment(value) ? value : moment(value);\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(field.name, momentValue);\n if (onChange) {\n onChange(momentValue);\n }\n }}\n name={fieldName}\n slotProps={{\n textField: {\n variant,\n placeholder,\n error: showError,\n helperText: (() => {\n if (showError) return helperText;\n if (showHelperTextWhenValid) return helperText;\n return undefined;\n })(),\n FormHelperTextProps: {\n children: ' ',\n style: { textAlign: 'right' },\n },\n },\n }}\n disabled={isSubmitting || disabled}\n disablePast={disablePast}\n disableFuture={disablefuture}\n />\n </StyledPickerBase>\n {description && (\n <Typography variant=\"caption\" sx={{ color: theme.palette.text.secondary }}>\n {description}\n </Typography>\n )}\n </Box>\n );\n }}\n </Field>\n );\n };\n\n if (layout === 'vertical') {\n return (\n <>\n {variant === 'standard' && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericDateFieldBase;\n"],"names":["StyledPickerBase","styled","theme","marginTop","spacing","width","label","fieldName","description","validation","variant","layout","onChange","disabled","disablePast","disablefuture","placeholder","showHelperTextWhenValid","pickerComponent","PickerComponent","useTheme","renderField","_jsx","Field","name","validate","children","field","form","errors","touched","isSubmitting","fieldError","showError","helperText","useRenderValidText","value","_jsxs","jsxs","Box","sx","paddingRight","undefined","moment","isMoment","momentValue","setFieldValue","slotProps","textField","error","FormHelperTextProps","style","textAlign","disableFuture","Typography","color","palette","text","secondary","_Fragment","jsx","component","FormItemLayout"],"mappings":"yaAWA,MAAMA,EAAmBC,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACnDC,UAAWD,EAAME,QAAQ,GACzB,UAAW,CACPC,MAAO,2BAoBc,EACzBC,QACAC,YACAC,cACAC,aACAC,UAAU,WACVC,SACAC,WACAC,YAAW,EACXC,eAAc,EACdC,iBAAgB,EAChBC,cACAC,2BAA0B,EAC1BC,gBAAiBC,MAEjB,MAAMjB,EAAQkB,EAAAA,WAERC,EAAc,IAEZC,MAACC,EAAAA,OAAMC,KAAMjB,EAAWkB,SAAUhB,EAAUiB,SACvC,EAAGC,QAAOC,WACP,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBH,EACpCI,EAAaH,EAAOF,EAAMH,MAC1BS,IAAcD,GAAeF,EAAQH,EAAMH,MAC3CU,EAAaC,EAAmB,CAClCH,aACAC,YACAH,UAAWA,EAAQH,EAAMH,MACzBY,MAAOT,EAAMS,QAGjB,OACIC,EAACC,KAAAC,GAAIC,GAAI,CAAEC,aAAyB,eAAX9B,EAA0B,OAAS,GAAGe,SAAA,CAC3DJ,EAAAA,IAACtB,EAAgB,CAAA0B,SACbJ,MAACH,EAAe,CACZb,MAAmB,aAAZI,OAAyBgC,EAAYpC,EAE5C8B,MAAOO,EAAOC,SAASjB,EAAMS,OAAST,EAAMS,MAAQO,EAAOhB,EAAMS,OACjExB,SAAWwB,IAEP,MAAMS,EAAcF,EAAOC,SAASR,GAASA,EAAQO,EAAOP,GAE5DR,EAAKkB,cAAcnB,EAAMH,KAAMqB,GAC3BjC,GACAA,EAASiC,EACZ,EAELrB,KAAMjB,EACNwC,UAAW,CACPC,UAAW,CACPtC,UACAM,cACAiC,MAAOhB,EACPC,WACQD,GACAhB,EADkBiB,OACtB,EAGJgB,oBAAqB,CACjBxB,SAAU,IACVyB,MAAO,CAAEC,UAAW,YAIhCvC,SAAUkB,GAAgBlB,EAC1BC,YAAaA,EACbuC,cAAetC,MAGtBP,GACGc,EAAAA,IAACgC,EAAU,CAAC5C,QAAQ,UAAU8B,GAAI,CAAEe,MAAOrD,EAAMsD,QAAQC,KAAKC,WAAWhC,SACpElB,MAIf,IAMlB,MAAe,aAAXG,EAEI0B,EAAAC,KAAAqB,WAAA,CAAAjC,SAAA,CACiB,aAAZhB,GACGY,EAAAsC,IAACN,EAAU,CAAC5C,QAAQ,YAAYmD,UAAU,KAAKN,MAAM,cAChD7B,SAAApB,IAGRe,OAKNC,EAAAsC,IAACE,EAAc,CAACxD,MAAOA,EAAQoB,SAAAL,KAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericDatePickerField/index.tsx"],"sourcesContent":["import { DatePicker } from '@mui/x-date-pickers/DatePicker';\nimport GenericDateFieldBase, { type GenericDateFieldBaseProps } from './GenericDateFieldBase';\n\ntype Props = Omit<GenericDateFieldBaseProps, 'pickerComponent'>;\n\nconst GenericDatePickerField = (props: Props) => {\n return <GenericDateFieldBase {...props} pickerComponent={DatePicker} />;\n};\n\nexport default GenericDatePickerField;\n"],"names":["props","_jsx","GenericDateFieldBase","pickerComponent","DatePicker"],"mappings":"sJAKgCA,GACrBC,EAAAA,IAACC,EAAyB,IAAAF,EAAOG,gBAAiBC,EAAUA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericDateTimePickerField/index.tsx"],"sourcesContent":["import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';\nimport GenericDateFieldBase, { type GenericDateFieldBaseProps } from '../GenericDatePickerField/GenericDateFieldBase';\n\ntype Props = Omit<GenericDateFieldBaseProps, 'pickerComponent'>;\n\nconst GenericDateTimePickerField = (props: Props) => {\n return <GenericDateFieldBase {...props} pickerComponent={DateTimePicker} />;\n};\n\nexport default GenericDateTimePickerField;\n"],"names":["props","_jsx","GenericDateFieldBase","pickerComponent","DateTimePicker"],"mappings":"kLAKoCA,GACzBC,EAAAA,IAACC,EAAyB,IAAAF,EAAOG,gBAAiBC,EAAcA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("formik"),i=require("../Form/FormItemLayout/index.cjs.js"),a=require("@mui/material/Box"),o=require("@mui/material/Typography"),t=require("../../custom-hooks/useRenderValidText.cjs.js"),l=require("@mui/material/Radio"),s=require("@mui/material/FormControlLabel"),n=require("@mui/material/RadioGroup");require("react");var u=require("../Spacer/index.cjs.js"),d=require("@mui/material/styles");const m=d.styled(a)((({theme:e})=>({marginLeft:e.spacing(4)}))),h=d.styled(o,{shouldForwardProp:e=>"showError"!==e})((({theme:e,showError:r})=>({color:r?e.palette.error.main:"inherit",textAlign:"right"}))),c=({field:r,form:i,onChange:o,options:d,layout:c,showHelperTextWhenValid:x=!1})=>{const{errors:j,touched:p,isSubmitting:v}=i,g=j[r.name],q=!!g&&p[r.name],b=t({fieldError:g,showError:q,touched:!!p[r.name],value:r.value});return e.jsxs(a,{sx:{paddingRight:"horizontal"===c?"16px":0},children:[e.jsx(n,{name:"radio-buttons-group",value:r.value,onChange:e=>{i.setFieldValue(r.name,e.target.value),o&&o(e)},children:d.map((i=>e.jsxs("div",{children:[e.jsx(s,{value:i.value,control:e.jsx(l,{}),label:i.label,disabled:v||i.disabled}),i.selectedContent&&r.value===i.value&&e.jsxs(m,{children:[i.selectedContent,e.jsx(u,{size:8,variant:"horizontal"})]})]},i.value)))}),e.jsx(h,{showError:q,children:q||x?b:void 0})]})};module.exports=({label:a,fieldName:t,layout:l,onChange:s,options:n,showHelperTextWhenValid:u=!1})=>{const d=()=>e.jsx(r.Field,{name:t,children:r=>e.jsx(c,{...r,onChange:s,options:n,layout:l,showHelperTextWhenValid:u})});return"vertical"===l?e.jsxs(e.Fragment,{children:[a&&e.jsx(o,{variant:"subtitle1",component:"h3",color:"textPrimary",children:a}),d()]}):e.jsx(i,{label:a,children:d()})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericRadioButtons/index.tsx"],"sourcesContent":["import { type FieldProps, Field } from 'formik';\nimport FormItemLayout from '../Form/FormItemLayout';\nimport Box from '@mui/material/Box';\nimport Typography from '@mui/material/Typography';\nimport useRenderValidText from '../../custom-hooks/useRenderValidText';\nimport Radio from '@mui/material/Radio';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport { type ChangeEvent, type ReactNode } from 'react';\nimport Spacer from '../Spacer';\nimport { styled } from '@mui/material/styles';\n\ntype Props = {\n label?: string;\n fieldName: string;\n layout?: 'horizontal' | 'vertical';\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n showHelperTextWhenValid?: boolean;\n options: {\n label: string;\n value: string;\n disabled?: boolean;\n selectedContent?: ReactNode;\n }[];\n};\n\ntype RadioButtonsComponentProps = {\n field: FieldProps['field'];\n form: FieldProps['form'];\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n showHelperTextWhenValid?: boolean;\n options: Props['options'];\n layout?: 'horizontal' | 'vertical';\n};\n\nconst StyledSelectedContent = styled(Box)(({ theme }) => ({\n marginLeft: theme.spacing(4),\n}));\n\nconst StyledHelperText = styled(Typography, {\n shouldForwardProp: (prop) => prop !== 'showError',\n})<{ showError: boolean }>(({ theme, showError }) => ({\n color: showError ? theme.palette.error.main : 'inherit',\n textAlign: 'right',\n}));\n\nconst RadioButtonsComponent = ({ field, form, onChange, options, layout, showHelperTextWhenValid = false }: RadioButtonsComponentProps) => {\n const { errors, touched, isSubmitting } = form;\n const fieldError = errors[field.name] as string | undefined;\n const showError = !!fieldError && (touched[field.name] as boolean | undefined);\n const helperText = useRenderValidText({\n fieldError,\n showError,\n touched: !!touched[field.name],\n value: field.value,\n });\n\n return (\n <Box sx={{ paddingRight: layout === 'horizontal' ? '16px' : 0 }}>\n <RadioGroup\n name=\"radio-buttons-group\"\n value={field.value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n form.setFieldValue(field.name, e.target.value);\n if (onChange) {\n onChange(e);\n }\n }}\n >\n {options.map((option) => (\n <div key={option.value}>\n <FormControlLabel value={option.value} control={<Radio />} label={option.label} disabled={isSubmitting || option.disabled} />\n {option.selectedContent && field.value === option.value && (\n <StyledSelectedContent>\n {option.selectedContent}\n <Spacer size={8} variant=\"horizontal\" />\n </StyledSelectedContent>\n )}\n </div>\n ))}\n </RadioGroup>\n <StyledHelperText showError={showError}>\n {(() => {\n if (showError) return helperText;\n if (showHelperTextWhenValid) return helperText;\n return undefined;\n })()}\n </StyledHelperText>\n </Box>\n );\n};\n\nconst GenericRadioButtons = ({ label, fieldName, layout, onChange, options, showHelperTextWhenValid = false }: Props) => {\n const renderField = () => (\n <Field name={fieldName}>\n {(fieldProps: FieldProps) => (\n <RadioButtonsComponent\n {...fieldProps}\n onChange={onChange}\n options={options}\n layout={layout}\n showHelperTextWhenValid={showHelperTextWhenValid}\n />\n )}\n </Field>\n );\n\n if (layout === 'vertical') {\n return (\n <>\n {label && (\n <Typography variant=\"subtitle1\" component=\"h3\" color=\"textPrimary\">\n {label}\n </Typography>\n )}\n {renderField()}\n </>\n );\n }\n\n return <FormItemLayout label={label}>{renderField()}</FormItemLayout>;\n};\n\nexport default GenericRadioButtons;\n"],"names":["StyledSelectedContent","styled","Box","theme","marginLeft","spacing","StyledHelperText","Typography","shouldForwardProp","prop","showError","color","palette","error","main","textAlign","RadioButtonsComponent","field","form","onChange","options","layout","showHelperTextWhenValid","errors","touched","isSubmitting","fieldError","name","helperText","useRenderValidText","value","_jsxs","jsxs","sx","paddingRight","children","_jsx","RadioGroup","e","setFieldValue","target","map","option","FormControlLabel","control","Radio","label","disabled","selectedContent","Spacer","size","variant","jsx","fieldName","renderField","Field","fieldProps","_Fragment","component","FormItemLayout"],"mappings":"kcAmCA,MAAMA,EAAwBC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAa,CACtDC,WAAYD,EAAME,QAAQ,OAGxBC,EAAmBL,EAAMA,OAACM,EAAY,CACxCC,kBAAoBC,GAAkB,cAATA,GADRR,EAEE,EAAGE,QAAOO,gBAAiB,CAClDC,MAAOD,EAAYP,EAAMS,QAAQC,MAAMC,KAAO,UAC9CC,UAAW,YAGTC,EAAwB,EAAGC,QAAOC,OAAMC,WAAUC,UAASC,SAAQC,2BAA0B,MAC/F,MAAMC,OAAEA,EAAMC,QAAEA,EAAOC,aAAEA,GAAiBP,EACpCQ,EAAaH,EAAON,EAAMU,MAC1BjB,IAAcgB,GAAeF,EAAQP,EAAMU,MAC3CC,EAAaC,EAAmB,CAClCH,aACAhB,YACAc,UAAWA,EAAQP,EAAMU,MACzBG,MAAOb,EAAMa,QAGjB,OACIC,EAACC,KAAA9B,GAAI+B,GAAI,CAAEC,aAAyB,eAAXb,EAA0B,OAAS,GAAGc,SAAA,CAC3DC,MAACC,EAAU,CACPV,KAAK,sBACLG,MAAOb,EAAMa,MACbX,SAAWmB,IAEPpB,EAAKqB,cAActB,EAAMU,KAAMW,EAAEE,OAAOV,OACpCX,GACAA,EAASmB,EACZ,EACJH,SAEAf,EAAQqB,KAAKC,GACVX,EAAAA,KACI,MAAA,CAAAI,SAAA,CAAAC,EAAAA,IAACO,EAAiB,CAAAb,MAAOY,EAAOZ,MAAOc,QAASR,EAAAA,IAACS,MAAUC,MAAOJ,EAAOI,MAAOC,SAAUtB,GAAgBiB,EAAOK,WAChHL,EAAOM,iBAAmB/B,EAAMa,QAAUY,EAAOZ,OAC9CC,EAAAA,KAAC/B,EAAqB,CAAAmC,SAAA,CACjBO,EAAOM,gBACRZ,EAAAA,IAACa,GAAOC,KAAM,EAAGC,QAAQ,oBAL3BT,EAAOZ,WAWzBM,EAAAgB,IAAC9C,EAAiB,CAAAI,UAAWA,EAASyB,SAE1BzB,GACAY,EADkBM,OACtB,MAKd,iBAGsB,EAAGkB,QAAOO,YAAWhC,SAAQF,WAAUC,UAASE,2BAA0B,MAClG,MAAMgC,EAAc,IAChBlB,MAACmB,EAAAA,MAAK,CAAC5B,KAAM0B,WACPG,GACEpB,EAAAA,IAACpB,MACOwC,EACJrC,SAAUA,EACVC,QAASA,EACTC,OAAQA,EACRC,wBAAyBA,MAMzC,MAAe,aAAXD,EAEIU,EAAAC,KAAAyB,WAAA,CAAAtB,SAAA,CACKW,GACGV,MAAC7B,EAAU,CAAC4C,QAAQ,YAAYO,UAAU,KAAK/C,MAAM,cAAawB,SAC7DW,IAGRQ,OAKNlB,EAAAgB,IAACO,EAAc,CAACb,MAAOA,EAAQX,SAAAmB,KAA+B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("@mui/material/styles"),o=require("react");const t=e.styled("div")((({hovered:r,isScrolling:e})=>({overflowX:"auto","&::-webkit-scrollbar":{padding:"2px 0",height:"6px",border:"1px solid #d5d5d5"},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:r?"rgba(5, 20, 158, 0.3)":"#f5f5f5",borderRadius:"3px"},"&::-webkit-scrollbar-thumb:horizontal:active, &::-webkit-scrollbar-thumb:vertical:active":{background:r?"rgba(5, 20, 158, 0.6)":"#f5f5f5"},"&:hover .sticky":{boxShadow:e?"0px 2px 6px rgba(0, 0, 0, 0.5)":"none",transition:"box-shadow 200ms"}})));module.exports=e=>{const{children:l,onScroll:i,setIsScrolling:a,setScrollStarted:s}=e,[c,b]=o.useState(!1);return r.jsx(t,{hovered:c,isScrolling:!!a,onMouseEnter:()=>b(!0),onMouseLeave:()=>{b(!1),a&&a(!1),s&&s(!1)},onScroll:i,children:l})};
|
|
2
|
+
//# sourceMappingURL=HighlightScrollbar.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightScrollbar.cjs.js","sources":["../../../src/components/GenericTable/HighlightScrollbar.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport React, { useState } from 'react';\n\ntype HighlightScrollbarProps = {\n children: React.ReactNode;\n onScroll?: () => void;\n setIsScrolling?: React.Dispatch<React.SetStateAction<boolean>>;\n setScrollStarted?: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\ninterface ContainerProps {\n hovered: boolean;\n isScrolling: boolean;\n}\n\nconst StyledContainer = styled('div')<ContainerProps>(({ hovered, isScrolling }) => ({\n overflowX: 'auto',\n '&::-webkit-scrollbar': {\n padding: '2px 0',\n height: '6px',\n border: '1px solid #d5d5d5',\n },\n '&::-webkit-scrollbar-track': {\n background: '#f1f1f1',\n },\n '&::-webkit-scrollbar-thumb': {\n background: hovered ? 'rgba(5, 20, 158, 0.3)' : '#f5f5f5',\n borderRadius: '3px',\n },\n '&::-webkit-scrollbar-thumb:horizontal:active, &::-webkit-scrollbar-thumb:vertical:active': {\n background: hovered ? 'rgba(5, 20, 158, 0.6)' : '#f5f5f5',\n },\n '&:hover .sticky': {\n boxShadow: isScrolling ? '0px 2px 6px rgba(0, 0, 0, 0.5)' : 'none',\n transition: 'box-shadow 200ms',\n },\n}));\n\nconst HighlightScrollbar: React.FC<React.PropsWithChildren<HighlightScrollbarProps>> = (props) => {\n const { children, onScroll, setIsScrolling, setScrollStarted } = props;\n const [hoveredTable, setHoveredTable] = useState(false);\n\n const highlightScrollbar = () => setHoveredTable(true);\n\n const fadeScrollbar = () => {\n setHoveredTable(false);\n if (setIsScrolling) setIsScrolling(false);\n if (setScrollStarted) setScrollStarted(false);\n };\n\n return (\n <StyledContainer\n hovered={hoveredTable}\n isScrolling={!!setIsScrolling}\n onMouseEnter={highlightScrollbar}\n onMouseLeave={fadeScrollbar}\n onScroll={onScroll}\n >\n {children}\n </StyledContainer>\n );\n};\n\nexport default HighlightScrollbar;\n"],"names":["StyledContainer","styled","hovered","isScrolling","overflowX","padding","height","border","background","borderRadius","boxShadow","transition","props","children","onScroll","setIsScrolling","setScrollStarted","hoveredTable","setHoveredTable","useState","_jsx","onMouseEnter","onMouseLeave"],"mappings":"qGAeA,MAAMA,EAAkBC,EAAMA,OAAC,MAAPA,EAA8B,EAAGC,UAASC,kBAAmB,CACjFC,UAAW,OACX,uBAAwB,CACpBC,QAAS,QACTC,OAAQ,MACRC,OAAQ,qBAEZ,6BAA8B,CAC1BC,WAAY,WAEhB,6BAA8B,CAC1BA,WAAYN,EAAU,wBAA0B,UAChDO,aAAc,OAElB,2FAA4F,CACxFD,WAAYN,EAAU,wBAA0B,WAEpD,kBAAmB,CACfQ,UAAWP,EAAc,iCAAmC,OAC5DQ,WAAY,uCAIoEC,IACpF,MAAMC,SAAEA,EAAQC,SAAEA,EAAQC,eAAEA,EAAcC,iBAAEA,GAAqBJ,GAC1DK,EAAcC,GAAmBC,EAAQA,UAAC,GAUjD,OACIC,EAAAA,IAACpB,EAAe,CACZE,QAASe,EACTd,cAAeY,EACfM,aAZmB,IAAMH,GAAgB,GAazCI,aAXc,KAClBJ,GAAgB,GACZH,GAAgBA,GAAe,GAC/BC,GAAkBA,GAAiB,EAAM,EASzCF,SAAUA,EAAQD,SAEjBA,GAEP"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@mui/material/styles"),r=require("@mui/material/Table"),t=require("@mui/material/TableCell"),a=require("@mui/material/TableHead"),l=require("@mui/material/TableRow"),s=require("@mui/material/useMediaQuery"),o=require("../GenericTableTitle/index.cjs.js"),n=require("./HighlightScrollbar.cjs.js"),d=require("../GenericTableBody/index.cjs.js"),u=require("@mui/material/Card"),c=require("@mui/icons-material/InfoOutlined"),m=require("@mui/material/Tooltip"),h=require("@mui/material/IconButton");const p=i.styled("div")`
|
|
2
|
+
overflow-x: auto;
|
|
3
|
+
&::-webkit-scrollbar {
|
|
4
|
+
padding: 2px 0;
|
|
5
|
+
height: 6px;
|
|
6
|
+
border: 1px solid #d5d5d5;
|
|
7
|
+
}
|
|
8
|
+
&::-webkit-scrollbar-track {
|
|
9
|
+
background: #f1f1f1;
|
|
10
|
+
}
|
|
11
|
+
&::-webkit-scrollbar-thumb {
|
|
12
|
+
background: #f5f5f5;
|
|
13
|
+
border-radius: 3px;
|
|
14
|
+
}
|
|
15
|
+
`,b=i.styled(t,{shouldForwardProp:e=>"isSticky"!==e&&"titleVariant"!==e})((({theme:e,isSticky:i,titleVariant:r})=>({fontSize:13,fontWeight:"light"===r?400:e.typography.fontWeightMedium,color:"light"===r?"rgba(0, 0, 0, 0.54)":e.palette.text.primary,padding:e.spacing(1.25,2),whiteSpace:"nowrap",position:i?"sticky":"relative",zIndex:i?1:"auto"}))),x=i.styled(u)`
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
`,g=i.styled(m)((({theme:e})=>({marginLeft:e.spacing(.5),svg:{fontSize:e.typography.body1.fontSize}})));module.exports=({data:t,title:u,subTitle:m,showTitle:j=!0,onRowClick:f,loading:y,metadata:k,titleVariant:q="default"})=>{const w=new Set(k.filter((e=>e.isVisible)).sort(((e,i)=>e.ordinal-i.ordinal)).map((e=>e.columnName))),T=k.reduce(((e,i)=>(e[i.columnName]=i,e)),{}),S=i.useTheme(),v=!s(S.breakpoints.up("sm")),z=v?"normal":"sticky";return e.jsxs(p,{children:[j&&e.jsx(o,{title:u,subTitle:m}),e.jsx(x,{children:e.jsx(n,{children:e.jsxs(r,{"aria-label":u,"data-testid":"generic-table"+(j?`-${u.replace(" ","-").toLowerCase()}`:""),children:[e.jsx(a,{children:e.jsx(l,{children:Array.from(w).map(((i,r)=>{const{columnName:t,columnTitle:a,align:l="left",tooltip:s}=T[i];return e.jsx(b,{align:l,isSticky:0===r&&!v,titleVariant:q,children:e.jsxs("div",{children:[e.jsx("span",{children:a}),s&&e.jsx(g,{title:s,placement:"right-start",children:e.jsx(h,{size:"small",children:e.jsx(c,{fontSize:"small"})})})]})},t)}))})}),e.jsx(d,{type:z,data:t,columns:w,onRowClick:f,loading:y,meta:T})]})})})]})};
|
|
18
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericTable/index.tsx"],"sourcesContent":["import { styled, useTheme } from '@mui/material/styles';\n\nimport Table from '@mui/material/Table';\nimport TableCell from '@mui/material/TableCell';\nimport TableHead from '@mui/material/TableHead';\nimport TableRow from '@mui/material/TableRow';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport GenericTableTitle from '../GenericTableTitle';\nimport HighlightScrollbar from './HighlightScrollbar';\nimport GenericTableBody, { type GenericTableColumns } from '../GenericTableBody';\nimport Card from '@mui/material/Card';\nimport InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';\nimport Tooltip from '@mui/material/Tooltip';\nimport IconButton from '@mui/material/IconButton';\n\ntype GenericTableProps = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: any[];\n loading?: boolean;\n metadata: GenericTableColumns[];\n // eslint-disable-next-line @typescript-eslint/ban-types\n onRowClick?: Function;\n showTitle?: boolean;\n subTitle?: string;\n title?: string;\n titleVariant?: 'default' | 'light';\n};\n\nconst StyledContainer = styled('div')`\n overflow-x: auto;\n &::-webkit-scrollbar {\n padding: 2px 0;\n height: 6px;\n border: 1px solid #d5d5d5;\n }\n &::-webkit-scrollbar-track {\n background: #f1f1f1;\n }\n &::-webkit-scrollbar-thumb {\n background: #f5f5f5;\n border-radius: 3px;\n }\n`;\n\nconst StyledTableCell = styled(TableCell, {\n shouldForwardProp: (prop) => prop !== 'isSticky' && prop !== 'titleVariant',\n})<{ isSticky: boolean; titleVariant: 'default' | 'light' }>(({ theme, isSticky, titleVariant }) => ({\n fontSize: 13,\n fontWeight: titleVariant === 'light' ? 400 : theme.typography.fontWeightMedium,\n color: titleVariant === 'light' ? 'rgba(0, 0, 0, 0.54)' : theme.palette.text.primary,\n padding: theme.spacing(1.25, 2),\n whiteSpace: 'nowrap',\n position: isSticky ? 'sticky' : 'relative',\n zIndex: isSticky ? 1 : 'auto',\n}));\n\nconst StyledPaper = styled(Card)`\n overflow: hidden;\n`;\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n marginLeft: theme.spacing(0.5),\n svg: {\n fontSize: theme.typography.body1.fontSize,\n },\n}));\n\nconst GenericTable = ({ data, title, subTitle, showTitle = true, onRowClick, loading, metadata, titleVariant = 'default' }: GenericTableProps) => {\n const columns = new Set(\n metadata\n .filter((m) => m.isVisible)\n .sort((a, b) => a.ordinal - b.ordinal)\n .map((m) => m.columnName),\n );\n const tableMeta = metadata.reduce<{ [key: string]: GenericTableColumns }>((obj, mData) => {\n obj[mData.columnName] = mData;\n return obj;\n }, {});\n\n const theme = useTheme();\n const isMobile = !useMediaQuery(theme.breakpoints.up('sm'));\n\n // We never want sticky on mobile - only on desktop\n const firstColumnStylePosition = isMobile ? 'normal' : 'sticky';\n\n const renderTableHeader = () => (\n <TableHead>\n <TableRow>\n {Array.from(columns).map((prop, idx) => {\n const { columnName, columnTitle, align = 'left', tooltip } = tableMeta[prop];\n return (\n <StyledTableCell key={columnName} align={align} isSticky={idx === 0 && !isMobile} titleVariant={titleVariant}>\n <div>\n <span>{columnTitle}</span>\n {tooltip && (\n <StyledTooltip title={tooltip} placement=\"right-start\">\n <IconButton size=\"small\">\n <InfoOutlinedIcon fontSize=\"small\" />\n </IconButton>\n </StyledTooltip>\n )}\n </div>\n </StyledTableCell>\n );\n })}\n </TableRow>\n </TableHead>\n );\n\n return (\n <StyledContainer>\n {showTitle && <GenericTableTitle title={title} subTitle={subTitle}></GenericTableTitle>}\n <StyledPaper>\n <HighlightScrollbar>\n <Table aria-label={title} data-testid={`generic-table` + (showTitle ? `-${title.replace(' ', '-').toLowerCase()}` : '')}>\n {renderTableHeader()}\n <GenericTableBody\n type={firstColumnStylePosition}\n data={data}\n columns={columns}\n onRowClick={onRowClick}\n loading={loading}\n meta={tableMeta}\n />\n </Table>\n </HighlightScrollbar>\n </StyledPaper>\n </StyledContainer>\n );\n};\n\nexport default GenericTable;\n"],"names":["StyledContainer","styled","StyledTableCell","TableCell","shouldForwardProp","prop","theme","isSticky","titleVariant","fontSize","fontWeight","typography","fontWeightMedium","color","palette","text","primary","padding","spacing","whiteSpace","position","zIndex","StyledPaper","Card","StyledTooltip","Tooltip","marginLeft","svg","body1","data","title","subTitle","showTitle","onRowClick","loading","metadata","columns","Set","filter","m","isVisible","sort","a","b","ordinal","map","columnName","tableMeta","reduce","obj","mData","useTheme","isMobile","useMediaQuery","breakpoints","up","firstColumnStylePosition","_jsxs","jsxs","_jsx","GenericTableTitle","children","HighlightScrollbar","Table","replace","toLowerCase","jsx","TableHead","TableRow","Array","from","idx","columnTitle","align","tooltip","placement","IconButton","size","InfoOutlinedIcon","GenericTableBody","type","meta"],"mappings":"uiBA4BA,MAAMA,EAAkBC,EAAAA,OAAO,MAAM;;;;;;;;;;;;;;EAgB/BC,EAAkBD,EAAMA,OAACE,EAAW,CACtCC,kBAAoBC,GAAkB,aAATA,GAAgC,iBAATA,GADhCJ,EAEqC,EAAGK,QAAOC,WAAUC,mBAAoB,CACjGC,SAAU,GACVC,WAA6B,UAAjBF,EAA2B,IAAMF,EAAMK,WAAWC,iBAC9DC,MAAwB,UAAjBL,EAA2B,sBAAwBF,EAAMQ,QAAQC,KAAKC,QAC7EC,QAASX,EAAMY,QAAQ,KAAM,GAC7BC,WAAY,SACZC,SAAUb,EAAW,SAAW,WAChCc,OAAQd,EAAW,EAAI,WAGrBe,EAAcrB,EAAAA,OAAOsB,EAAK;;EAI1BC,EAAgBvB,EAAAA,OAAOwB,EAAPxB,EAAgB,EAAGK,YAAa,CAClDoB,WAAYpB,EAAMY,QAAQ,IAC1BS,IAAK,CACDlB,SAAUH,EAAMK,WAAWiB,MAAMnB,6BAIpB,EAAGoB,OAAMC,QAAOC,WAAUC,aAAY,EAAMC,aAAYC,UAASC,WAAU3B,eAAe,cAC3G,MAAM4B,EAAU,IAAIC,IAChBF,EACKG,QAAQC,GAAMA,EAAEC,YAChBC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,QAAUD,EAAEC,UAC7BC,KAAKN,GAAMA,EAAEO,cAEhBC,EAAYZ,EAASa,QAA+C,CAACC,EAAKC,KAC5ED,EAAIC,EAAMJ,YAAcI,EACjBD,IACR,CAAE,GAEC3C,EAAQ6C,EAAAA,WACRC,GAAYC,EAAc/C,EAAMgD,YAAYC,GAAG,OAG/CC,EAA2BJ,EAAW,SAAW,SA0BvD,OACIK,EAACC,KAAA1D,aACIgC,GAAa2B,MAACC,EAAiB,CAAC9B,MAAOA,EAAOC,SAAUA,IACzD4B,EAAAA,IAACrC,EAAW,CAAAuC,SACRF,MAACG,EAAkB,CAAAD,SACfJ,EAAAA,KAACM,EAAK,CAAA,aAAajC,EAAoB,cAAA,iBAAmBE,EAAY,IAAIF,EAAMkC,QAAQ,IAAK,KAAKC,gBAAkB,IAC/GJ,SAAA,CA7BjBF,EAAAO,IAACC,EAAS,CAAAN,SACNF,EAAAA,IAACS,EACI,CAAAP,SAAAQ,MAAMC,KAAKlC,GAASS,KAAI,CAACxC,EAAMkE,KAC5B,MAAMzB,WAAEA,EAAU0B,YAAEA,EAAWC,MAAEA,EAAQ,OAAMC,QAAEA,GAAY3B,EAAU1C,GACvE,OACIsD,MAACzD,EAAe,CAAkBuE,MAAOA,EAAOlE,SAAkB,IAARgE,IAAcnB,EAAU5C,aAAcA,EAC5FqD,SAAAJ,OAAA,MAAA,CAAAI,SAAA,CACIF,EAAAA,IAAO,OAAA,CAAAE,SAAAW,IACNE,GACGf,EAAAA,IAACnC,EAAc,CAAAM,MAAO4C,EAASC,UAAU,cACrCd,SAAAF,EAAAA,IAACiB,EAAU,CAACC,KAAK,QAAOhB,SACpBF,EAACO,IAAAY,EAAiB,CAAArE,SAAS,kBANzBqC,EAYxB,QAaEa,EAAAO,IAACa,EACG,CAAAC,KAAMxB,EACN3B,KAAMA,EACNO,QAASA,EACTH,WAAYA,EACZC,QAASA,EACT+C,KAAMlC,aAM5B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material/styles"),r=require("@mui/material/TableBody"),l=require("@mui/material/TableCell"),a=require("@mui/material/TableRow"),o=require("@mui/material/Skeleton"),n=require("../GenericTableBodyRow/index.cjs.js");const s=t.styled(l,{shouldForwardProp:e=>"align"!==e&&"titleCell"!==e&&"warning"!==e&&"sticky"!==e&&"isTitleRow"!==e})((({align:e,titleCell:i,warning:t,sticky:r,isTitleRow:l})=>({textAlign:e,fontWeight:i||l?"bold":"normal",backgroundColor:t?"#ffcccb":"inherit",position:r?"sticky":"static"}))),c=({colIdx:t,colName:r,hasWarning:l,hasTitle:a,meta:o,row:n,type:c})=>{const d=n[r],m=o[r].align??"left",u=o[r].hideWhenEmpty??!1?"":"-",w={align:m,warning:l,titleCell:a,sticky:"sticky"===c&&0===t,"data-testid":`col-${r}`,isTitleRow:n.isTitleRow??!1};if(i.isValidElement(d))return e.jsx(s,{...w,children:d});switch(o[r].columnType){case"String":default:return e.jsx(s,{...w,children:d??u});case"Custom":return e.jsx(s,{...w,children:d?o[r].customComponent(d,n):u})}};module.exports=({columns:i,data:t,loading:l,type:d,onRowClick:m,meta:u})=>e.jsx(r,{children:l?Array.from(Array(5)).map(((t,r)=>e.jsx(a,{"data-testid":"row-loader",children:Array.from(i).map(((i,t)=>e.jsx(s,{align:"left",titleCell:!1,warning:!1,sticky:!1,"data-testid":`col-${i}`,isTitleRow:!1,children:e.jsx(o,{width:"90%",height:22})},`col-${i}-loader-${t}`)))},`row-loader-${r}`))):t?.map(((t,r)=>e.jsx(n,{onRowClick:m,row:t,tableRowTestKey:r.toString(),children:Array.from(i).map(((i,r)=>e.jsx(c,{colIdx:r,colName:i,row:t,type:d,meta:u},`cell-${i}-${r}`)))},`row-${r}`)))});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericTableBody/index.tsx"],"sourcesContent":["import React from 'react';\nimport { styled } from '@mui/material/styles';\nimport MuiTableBody from '@mui/material/TableBody';\nimport TableCell from '@mui/material/TableCell';\nimport TableRow from '@mui/material/TableRow';\n\nimport Skeleton from '@mui/material/Skeleton';\nimport GenericTableBodyRow from '../GenericTableBodyRow';\n\nexport type GenericTableColumns = {\n columnName: string;\n columnTitle: string;\n columnType: 'String' | 'Custom';\n align?: 'left' | 'right';\n isVisible: boolean;\n ordinal: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n customComponent?: (data: any, row: any) => JSX.Element;\n tooltip?: string;\n hideWhenEmpty?: boolean;\n};\n\nconst StyledTableCell = styled(TableCell, {\n shouldForwardProp: (prop) => prop !== 'align' && prop !== 'titleCell' && prop !== 'warning' && prop !== 'sticky' && prop !== 'isTitleRow',\n})<{ align: string; titleCell: boolean; warning: boolean; sticky: boolean; isTitleRow: boolean }>(\n ({ align, titleCell, warning, sticky, isTitleRow }) => ({\n textAlign: align,\n fontWeight: titleCell || isTitleRow ? 'bold' : 'normal',\n backgroundColor: warning ? '#ffcccb' : 'inherit',\n position: sticky ? 'sticky' : 'static',\n }),\n);\n\nexport type TableCellProps = {\n colIdx: number;\n colName: string;\n hasWarning?: boolean;\n hasTitle?: boolean;\n meta: { [key: string]: GenericTableColumns };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n row: Record<string, any>;\n type: 'sticky' | 'normal';\n};\n\nconst RenderTableCell: React.FC<TableCellProps> = ({ colIdx, colName, hasWarning, hasTitle, meta, row, type }) => {\n const prop = row[colName];\n const align = meta[colName].align ?? 'left';\n const hideWhenEmpty = meta[colName].hideWhenEmpty ?? false;\n const fallbackValue = hideWhenEmpty ? '' : '-';\n const tableCellProps = {\n align,\n warning: hasWarning,\n titleCell: hasTitle,\n sticky: type === 'sticky' && colIdx === 0,\n 'data-testid': `col-${colName}`,\n isTitleRow: row.isTitleRow ?? false,\n };\n\n // When prop is a React element render it as is\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n if (React.isValidElement(prop)) {\n return <StyledTableCell {...tableCellProps}>{prop}</StyledTableCell>;\n }\n\n switch (meta[colName].columnType) {\n case 'String':\n return <StyledTableCell {...tableCellProps}>{prop ?? fallbackValue}</StyledTableCell>;\n case 'Custom':\n return <StyledTableCell {...tableCellProps}>{prop ? meta[colName].customComponent(prop, row) : fallbackValue}</StyledTableCell>;\n default:\n return <StyledTableCell {...tableCellProps}>{prop ?? fallbackValue}</StyledTableCell>;\n }\n};\n\ntype TableBodyProps = {\n columns: Set<string>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data?: any[];\n loading?: boolean;\n meta?: { [key: string]: GenericTableColumns };\n // eslint-disable-next-line @typescript-eslint/ban-types\n onRowClick?: Function;\n type: 'sticky' | 'normal';\n};\n\nconst GenericTableBody: React.FC<TableBodyProps> = ({ columns, data, loading, type, onRowClick, meta }) => {\n const rowsPerPage = 5;\n return (\n <MuiTableBody>\n {loading\n ? Array.from(Array(rowsPerPage)).map((_, idx) => (\n <TableRow key={`row-loader-${idx}`} data-testid=\"row-loader\">\n {Array.from(columns).map((columnName, colIdx) => (\n <StyledTableCell\n key={`col-${columnName}-loader-${colIdx}`}\n align={'left'}\n titleCell={false}\n warning={false}\n sticky={false}\n data-testid={`col-${columnName}`}\n isTitleRow={false}\n >\n <Skeleton width=\"90%\" height={22} />\n </StyledTableCell>\n ))}\n </TableRow>\n ))\n : data?.map((row, rowIdx) => (\n <GenericTableBodyRow key={`row-${rowIdx}`} onRowClick={onRowClick} row={row} tableRowTestKey={rowIdx.toString()}>\n {Array.from(columns).map((colName, colIdx) => (\n <RenderTableCell\n key={`cell-${colName}-${colIdx}`}\n colIdx={colIdx}\n colName={colName}\n row={row}\n type={type}\n meta={meta}\n />\n ))}\n </GenericTableBodyRow>\n ))}\n </MuiTableBody>\n );\n};\n\nexport default GenericTableBody;\n"],"names":["StyledTableCell","styled","TableCell","shouldForwardProp","prop","align","titleCell","warning","sticky","isTitleRow","textAlign","fontWeight","backgroundColor","position","RenderTableCell","colIdx","colName","hasWarning","hasTitle","meta","row","type","fallbackValue","hideWhenEmpty","tableCellProps","React","isValidElement","_jsx","children","columnType","jsx","customComponent","columns","data","loading","onRowClick","MuiTableBody","Array","from","map","_","idx","TableRow","columnName","Skeleton","width","height","rowIdx","GenericTableBodyRow","tableRowTestKey","toString"],"mappings":"wSAsBA,MAAMA,EAAkBC,EAAMA,OAACC,EAAW,CACtCC,kBAAoBC,GAAkB,UAATA,GAA6B,cAATA,GAAiC,YAATA,GAA+B,WAATA,GAA8B,eAATA,GADhGH,EAGpB,EAAGI,QAAOC,YAAWC,UAASC,SAAQC,iBAAkB,CACpDC,UAAWL,EACXM,WAAYL,GAAaG,EAAa,OAAS,SAC/CG,gBAAiBL,EAAU,UAAY,UACvCM,SAAUL,EAAS,SAAW,aAehCM,EAA4C,EAAGC,SAAQC,UAASC,aAAYC,WAAUC,OAAMC,MAAKC,WACnG,MAAMjB,EAAOgB,EAAIJ,GACXX,EAAQc,EAAKH,GAASX,OAAS,OAE/BiB,EADgBH,EAAKH,GAASO,gBAAiB,EACf,GAAK,IACrCC,EAAiB,CACnBnB,QACAE,QAASU,EACTX,UAAWY,EACXV,OAAiB,WAATa,GAAgC,IAAXN,EAC7B,cAAe,OAAOC,IACtBP,WAAYW,EAAIX,aAAc,GAKlC,GAAIgB,EAAMC,eAAetB,GACrB,OAAOuB,EAAAA,IAAC3B,EAAe,IAAKwB,EAAiBI,SAAAxB,IAGjD,OAAQe,EAAKH,GAASa,YAClB,IAAK,SAIL,QACI,OAAOF,EAAAG,IAAC9B,EAAoB,IAAAwB,WAAiBpB,GAAQkB,IAHzD,IAAK,SACD,OAAOK,EAAAA,IAAC3B,EAAe,IAAKwB,EAAcI,SAAGxB,EAAOe,EAAKH,GAASe,gBAAgB3B,EAAMgB,GAAOE,IAGtG,iBAc8C,EAAGU,UAASC,OAAMC,UAASb,OAAMc,aAAYhB,UAGxFQ,MAACS,EAAY,CAAAR,SACRM,EACKG,MAAMC,KAAKD,MAJL,IAIyBE,KAAI,CAACC,EAAGC,IACnCd,EAAAA,IAACe,iBAA+C,aAAYd,SACvDS,MAAMC,KAAKN,GAASO,KAAI,CAACI,EAAY5B,IAClCY,EAAAA,IAAC3B,EAAe,CAEZK,MAAO,OACPC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACK,cAAA,OAAOmC,IACpBlC,YAAY,EAEZmB,SAAAD,EAAAG,IAACc,EAAQ,CAACC,MAAM,MAAMC,OAAQ,MARzB,OAAOH,YAAqB5B,QAH9B,cAAc0B,OAgBjCR,GAAMM,KAAI,CAACnB,EAAK2B,IACZpB,EAAAA,IAACqB,GAA0Cb,WAAYA,EAAYf,IAAKA,EAAK6B,gBAAiBF,EAAOG,WAChGtB,SAAAS,MAAMC,KAAKN,GAASO,KAAI,CAACvB,EAASD,IAC/BY,EAAAA,IAACb,EAEG,CAAAC,OAAQA,EACRC,QAASA,EACTI,IAAKA,EACLC,KAAMA,EACNF,KAAMA,GALD,QAAQH,KAAWD,QAHV,OAAOgC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime");require("react");var r=require("@mui/material/TableRow");const t=require("@mui/material/styles").styled(r,{shouldForwardProp:e=>"isTitleRow"!==e})((({theme:e,isTitleRow:r})=>r?{backgroundColor:e.palette.grey[100]}:{}));module.exports=i=>{const{onRowClick:o,row:l,children:a,tableRowTestKey:s}=i,c=e=>{e.preventDefault(),o?.(l)};return o?e.jsx(t,{onClick:c,hover:void 0!==c,"data-testid":`row-clickable-${s}`,isTitleRow:l.isTitleRow??!1,children:a}):e.jsx(r,{"data-testid":`row-${s}`,children:a})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericTableBodyRow/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport TableRow from '@mui/material/TableRow';\nimport { styled } from '@mui/material/styles';\n\nexport type TableBodyRowProps = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n row: any;\n // eslint-disable-next-line @typescript-eslint/ban-types\n onRowClick?: Function;\n tableRowTestKey: string;\n};\n\nconst StyledTableRow = styled(TableRow, {\n shouldForwardProp: (prop) => prop !== 'isTitleRow',\n})<{ isTitleRow: boolean }>(({ theme, isTitleRow }) => {\n if (!isTitleRow) {\n return {};\n }\n\n return {\n backgroundColor: theme.palette.grey[100],\n };\n});\n\ntype TableBodyRowProp = TableBodyRowProps & { children: React.ReactNode };\n\nconst GenericTableBodyRow: React.FC<React.PropsWithChildren<TableBodyRowProp>> = (props) => {\n const { onRowClick, row, children, tableRowTestKey } = props;\n\n const onClick = (e) => {\n e.preventDefault();\n onRowClick?.(row);\n };\n\n if (onRowClick) {\n return (\n <StyledTableRow\n onClick={onClick}\n hover={onClick !== undefined}\n data-testid={`row-clickable-${tableRowTestKey}`}\n isTitleRow={row.isTitleRow ?? false}\n >\n {children}\n </StyledTableRow>\n );\n }\n\n return <TableRow data-testid={`row-${tableRowTestKey}`}>{children}</TableRow>;\n};\n\nexport default GenericTableBodyRow;\n"],"names":["StyledTableRow","styled","TableRow","shouldForwardProp","prop","theme","isTitleRow","backgroundColor","palette","grey","props","onRowClick","row","children","tableRowTestKey","onClick","e","preventDefault","_jsx","jsx","hover","undefined"],"mappings":"yGAaA,MAAMA,kCAAuBC,OAACC,EAAU,CACpCC,kBAAoBC,GAAkB,eAATA,GADVH,EAEK,EAAGI,QAAOC,gBAC7BA,EAIE,CACHC,gBAAiBF,EAAMG,QAAQC,KAAK,MAJ7B,oBAUmEC,IAC9E,MAAMC,WAAEA,EAAUC,IAAEA,EAAGC,SAAEA,EAAQC,gBAAEA,GAAoBJ,EAEjDK,EAAWC,IACbA,EAAEC,iBACFN,IAAaC,EAAI,EAGrB,OAAID,EAEIO,EAAAC,IAACnB,EAAc,CACXe,QAASA,EACTK,WAAmBC,IAAZN,EAAqB,cACf,iBAAiBD,IAC9BR,WAAYM,EAAIN,aAAc,EAAKO,SAElCA,IAKNK,MAAChB,EAAsB,CAAA,cAAA,OAAOY,IAAiBD,SAAGA,GAAoB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=require("react/jsx-runtime");require("react");var e=require("@mui/material/Grid"),r=require("@mui/material/Typography"),t=require("@mui/material/styles");const a=t.styled(e,{shouldForwardProp:i=>"titlePadding"!==i})((({theme:i,titlePadding:e})=>{switch(e){case"small":return{padding:i.spacing(3,0,1.5),[i.breakpoints.down("md")]:{padding:i.spacing(3,2,1.5)}};case"medium":return{padding:i.spacing(4,0,2),[i.breakpoints.down("md")]:{padding:i.spacing(4,2,2)}};default:return{padding:0}}})),d=t.styled(r)({width:191,height:16,fontSize:12,fontWeight:"normal",lineHeight:1.33,letterSpacing:.4,color:"rgba(0, 0, 0, 0.38)"});module.exports=({maxGridWidth:t=12,subTitle:n,title:s,children:l,titlePadding:c="medium"})=>i.jsxs(a,{container:!0,titlePadding:c,children:[i.jsxs(e,{item:!0,xs:t,sm:t,children:[s&&i.jsx(r,{variant:"h5",children:s}),n&&i.jsx("div",{children:i.jsx(d,{variant:"caption",children:n})})]}),l]});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/GenericTableTitle/index.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\nimport Grid from '@mui/material/Grid';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\n\ntype OuterProps = {\n maxGridWidth?: boolean | 'auto' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n subTitle?: string;\n title?: string;\n children?: ReactNode;\n titlePadding?: 'small' | 'medium';\n};\n\nconst HeaderContainer = styled(Grid, {\n shouldForwardProp: (prop) => prop !== 'titlePadding',\n})<{ titlePadding: OuterProps['titlePadding'] }>(({ theme, titlePadding }) => {\n switch (titlePadding) {\n case 'small':\n return {\n padding: theme.spacing(3, 0, 1.5),\n [theme.breakpoints.down('md')]: {\n padding: theme.spacing(3, 2, 1.5),\n },\n };\n case 'medium':\n return {\n padding: theme.spacing(4, 0, 2),\n [theme.breakpoints.down('md')]: {\n padding: theme.spacing(4, 2, 2),\n },\n };\n default:\n return { padding: 0 };\n }\n});\n\nconst SubTitle = styled(Typography)({\n width: 191,\n height: 16,\n fontSize: 12,\n fontWeight: 'normal',\n lineHeight: 1.33,\n letterSpacing: 0.4,\n color: 'rgba(0, 0, 0, 0.38)',\n});\n\nconst GenericTableTitle = ({ maxGridWidth = 12, subTitle, title, children, titlePadding = 'medium' }: OuterProps) => {\n return (\n <HeaderContainer container titlePadding={titlePadding}>\n <Grid item xs={maxGridWidth} sm={maxGridWidth}>\n {title && <Typography variant=\"h5\">{title}</Typography>}\n {subTitle && (\n <div>\n <SubTitle variant=\"caption\">{subTitle}</SubTitle>\n </div>\n )}\n </Grid>\n\n {children}\n </HeaderContainer>\n );\n};\n\nexport default GenericTableTitle;\n"],"names":["HeaderContainer","styled","Grid","shouldForwardProp","prop","theme","titlePadding","padding","spacing","breakpoints","down","SubTitle","Typography","width","height","fontSize","fontWeight","lineHeight","letterSpacing","color","maxGridWidth","subTitle","title","children","_jsxs","jsxs","container","item","xs","sm","_jsx","jsx","variant"],"mappings":"6KAaA,MAAMA,EAAkBC,EAAMA,OAACC,EAAM,CACjCC,kBAAoBC,GAAkB,iBAATA,GADTH,EAEyB,EAAGI,QAAOC,mBACvD,OAAQA,GACJ,IAAK,QACD,MAAO,CACHC,QAASF,EAAMG,QAAQ,EAAG,EAAG,KAC7B,CAACH,EAAMI,YAAYC,KAAK,OAAQ,CAC5BH,QAASF,EAAMG,QAAQ,EAAG,EAAG,OAGzC,IAAK,SACD,MAAO,CACHD,QAASF,EAAMG,QAAQ,EAAG,EAAG,GAC7B,CAACH,EAAMI,YAAYC,KAAK,OAAQ,CAC5BH,QAASF,EAAMG,QAAQ,EAAG,EAAG,KAGzC,QACI,MAAO,CAAED,QAAS,GACzB,IAGCI,EAAWV,EAAAA,OAAOW,EAAPX,CAAmB,CAChCY,MAAO,IACPC,OAAQ,GACRC,SAAU,GACVC,WAAY,SACZC,WAAY,KACZC,cAAe,GACfC,MAAO,uCAGe,EAAGC,eAAe,GAAIC,WAAUC,QAAOC,WAAUjB,eAAe,YAElFkB,EAACC,KAAAzB,EAAgB,CAAA0B,aAAUpB,aAAcA,EAAYiB,SAAA,CACjDC,EAAAA,KAACtB,GAAKyB,MAAI,EAACC,GAAIR,EAAcS,GAAIT,EAAYG,SAAA,CACxCD,GAASQ,EAACC,IAAAnB,GAAWoB,QAAQ,KAAIT,SAAED,IACnCD,GACGS,EACIC,IAAA,MAAA,CAAAR,SAAAO,EAAAA,IAACnB,EAAQ,CAACqB,QAAQ,UAAWT,SAAAF,SAKxCE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material/CircularProgress");const s=require("@mui/material/styles").styled("div")({display:"flex",justifyContent:"center",alignItems:"center"});module.exports=({children:t})=>e.jsx(r.Suspense,{fallback:e.jsx(s,{children:e.jsx(i,{size:56})}),children:t});
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/LazyComponent/index.tsx"],"sourcesContent":["import { Suspense, type ReactNode } from 'react';\n\nimport CircularProgress from '@mui/material/CircularProgress';\nimport { styled } from '@mui/material/styles';\n\ntype LazyComponentProps = {\n children: ReactNode;\n};\n\nconst StyledLoadingContainer = styled('div')({\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n});\n\nconst LazyComponent = ({ children }: LazyComponentProps) => (\n <Suspense\n fallback={\n <StyledLoadingContainer>\n <CircularProgress size={56} />\n </StyledLoadingContainer>\n }\n >\n {children}\n </Suspense>\n);\n\nexport default LazyComponent;\n"],"names":["StyledLoadingContainer","styled","display","justifyContent","alignItems","children","_jsx","Suspense","fallback","jsx","CircularProgress","size"],"mappings":"+GASA,MAAMA,kCAAyBC,OAAO,MAAPA,CAAc,CACzCC,QAAS,OACTC,eAAgB,SAChBC,WAAY,0BAGM,EAAGC,cACrBC,EAAAA,IAACC,EAAAA,UACGC,SACIF,EAACG,IAAAT,EACG,CAAAK,SAAAC,MAACI,EAAgB,CAACC,KAAM,OACHN,SAG5BA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/ListItemLink/index.tsx"],"sourcesContent":["import MuiListItem, { type ListItemProps } from '@mui/material/ListItem';\nimport { type LinkProps, Link } from 'react-router-dom';\n\ntype ListItemLinkProps = ListItemProps & LinkProps & { fdKey: string } & { button?: boolean } & { children?: React.ReactNode };\n\nconst ListItem = MuiListItem as React.ComponentType<ListItemProps & LinkProps>;\n\nconst ListItemLink = ({ fdKey, ...rest }: ListItemLinkProps) => {\n // no Link for external URL\n return <ListItem {...rest} data-fd={fdKey} {...(rest.to ? { component: Link } : {})} />;\n};\n\nexport default ListItemLink;\n"],"names":["ListItem","MuiListItem","fdKey","rest","_jsx","to","component","Link"],"mappings":"kHAKA,MAAMA,EAAWC,iBAEI,EAAGC,WAAUC,KAEvBC,EAAAA,IAACJ,EAAQ,IAAKG,EAAI,UAAWD,KAAYC,EAAKE,GAAK,CAAEC,UAAWC,EAAAA,MAAS,CAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/icons-material"),i=require("@mui/material/IconButton"),r=require("@mui/material/ListItemIcon"),o=require("@mui/material/ListItemText"),n=require("@mui/material/styles/useTheme"),a=require("@mui/material/useMediaQuery"),s=require("@mui/material/styles/styled");const d=s(require("../ListItemLink/index.cjs.js"),{shouldForwardProp:e=>!["borderBottom"].includes(e)&&!["disabled"].includes(e)&&!["selected"].includes(e)})((({theme:e,borderBottom:t,selected:i})=>({borderBottom:t??"1px solid #cecece",paddingLeft:e.spacing(4),paddingRight:e.spacing(4),"&:hover":{backgroundColor:"#eaf2ff"},"&:focus":{backgroundColor:"#eaf2ff"},color:e.palette.text.primary,textDecoration:"none",backgroundColor:i?"#eaf2ff":"inherit"}))),c=s(r,{shouldForwardProp:e=>!["iconMargin"].includes(e)})((({iconMargin:e})=>({margin:e||"16px",marginLeft:"0",padding:"0px",minWidth:"0"}))),l=s(o)((({theme:e})=>({"& .MuiListItemText-primary":{color:e.palette.text.primary},"& .MuiListItemText-secondary":{color:e.palette.text.secondary}}))),u=({borderBottom:r,customTitle:o,customSubtitle:s,disabled:u=!1,onClick:m,title:p,subtitle:x,icon:b,iconMargin:g,hideIcon:f=!1,link:h,isLast:y,customButton:j,iconComponent:k,dataFd:L="",isSelected:q=!1})=>{const I=n(),M=a(I.breakpoints.down("md")),B=!y||M,C=o||p,v=s||x;return e.jsxs(d,{borderBottom:B?r:"none",divider:B,button:!0,fdKey:L||`link-button-${p}`,to:h,onClick:m,disabled:u,selected:q,children:[b&&e.jsx(c,{iconMargin:g,children:e.jsx("img",{src:b,alt:""})}),k&&e.jsx(c,{iconMargin:g,children:k}),e.jsx(l,{primary:C,secondary:v,sx:{pr:"60px"}}),!f&&(j||e.jsx(i,{"aria-label":`link-button-${p}`,children:e.jsx(t.KeyboardArrowRight,{})}))]})};exports.ListItemLinkButton=u,exports.default=u;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/ListItemLinkButton/index.tsx"],"sourcesContent":["import React from 'react';\nimport { KeyboardArrowRight } from '@mui/icons-material';\nimport IconButton from '@mui/material/IconButton';\nimport ListItemIcon from '@mui/material/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport useTheme from '@mui/material/styles/useTheme';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport styled from '@mui/material/styles/styled';\nimport ListItemLink from '../ListItemLink';\n\ntype MarginType = string | number;\n\n// Styled components\nconst StyledListItemLink = styled(ListItemLink, {\n shouldForwardProp: (prop) =>\n !['borderBottom'].includes(prop as string) && !['disabled'].includes(prop as string) && !['selected'].includes(prop as string),\n})<{ borderBottom?: string; disabled?: boolean; selected: boolean }>(({ theme, borderBottom, selected }) => ({\n borderBottom: borderBottom ?? '1px solid #cecece',\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n '&:hover': {\n backgroundColor: '#eaf2ff',\n },\n '&:focus': {\n backgroundColor: '#eaf2ff',\n },\n // Override link color inheritance\n color: theme.palette.text.primary,\n textDecoration: 'none',\n backgroundColor: selected ? '#eaf2ff' : 'inherit',\n}));\n\nconst StyledListItemIcon = styled(ListItemIcon, {\n shouldForwardProp: (prop) => !['iconMargin'].includes(prop as string),\n})<{ iconMargin?: MarginType }>(({ iconMargin }) => ({\n margin: iconMargin || '16px',\n marginLeft: '0',\n padding: '0px',\n minWidth: '0',\n}));\n\nconst StyledListItemText = styled(ListItemText)(({ theme }) => ({\n '& .MuiListItemText-primary': {\n color: theme.palette.text.primary,\n },\n '& .MuiListItemText-secondary': {\n color: theme.palette.text.secondary,\n },\n}));\n\ninterface ListItemLinkButtonProps {\n customTitle?: string;\n customSubtitle?: React.ReactNode;\n disabled?: boolean;\n title?: string;\n subtitle?: string;\n icon?: string;\n hideIcon?: boolean;\n link?: string;\n isLast?: boolean;\n onClick?: () => void;\n borderBottom?: string;\n customButton?: JSX.Element;\n iconComponent?: JSX.Element;\n iconMargin?: MarginType;\n dataFd?: string;\n isSelected?: boolean;\n}\n\nexport const ListItemLinkButton = ({\n borderBottom,\n customTitle,\n customSubtitle,\n disabled = false,\n onClick,\n title,\n subtitle,\n icon,\n iconMargin,\n hideIcon = false,\n link,\n isLast,\n customButton,\n iconComponent,\n dataFd = '',\n isSelected = false,\n}: ListItemLinkButtonProps) => {\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n const hasDivider = !isLast || isMobile;\n\n const titleText = customTitle || title;\n const subtitleText = customSubtitle || subtitle;\n\n return (\n <StyledListItemLink\n borderBottom={hasDivider ? borderBottom : 'none'}\n divider={hasDivider}\n button\n fdKey={dataFd || `link-button-${title}`}\n to={link}\n onClick={onClick}\n disabled={disabled}\n selected={isSelected}\n >\n {icon && (\n <StyledListItemIcon iconMargin={iconMargin}>\n <img src={icon} alt=\"\" />\n </StyledListItemIcon>\n )}\n\n {iconComponent && <StyledListItemIcon iconMargin={iconMargin}>{iconComponent}</StyledListItemIcon>}\n\n <StyledListItemText primary={titleText} secondary={subtitleText} sx={{ pr: '60px' }} />\n\n {!hideIcon &&\n (customButton || (\n <IconButton aria-label={`link-button-${title}`}>\n <KeyboardArrowRight />\n </IconButton>\n ))}\n </StyledListItemLink>\n );\n};\n\nexport default ListItemLinkButton;\n"],"names":["StyledListItemLink","styled","shouldForwardProp","prop","includes","theme","borderBottom","selected","paddingLeft","spacing","paddingRight","backgroundColor","color","palette","text","primary","textDecoration","StyledListItemIcon","ListItemIcon","iconMargin","margin","marginLeft","padding","minWidth","StyledListItemText","ListItemText","secondary","ListItemLinkButton","customTitle","customSubtitle","disabled","onClick","title","subtitle","icon","hideIcon","link","isLast","customButton","iconComponent","dataFd","isSelected","useTheme","isMobile","useMediaQuery","breakpoints","down","hasDivider","titleText","subtitleText","_jsxs","divider","button","fdKey","to","children","_jsx","jsx","src","alt","sx","pr","IconButton","KeyboardArrowRight"],"mappings":"gZAaA,MAAMA,EAAqBC,0CAAqB,CAC5CC,kBAAoBC,IACf,CAAC,gBAAgBC,SAASD,KAAoB,CAAC,YAAYC,SAASD,KAAoB,CAAC,YAAYC,SAASD,IAF5FF,EAG0C,EAAGI,QAAOC,eAAcC,eAAgB,CACzGD,aAAcA,GAAgB,oBAC9BE,YAAaH,EAAMI,QAAQ,GAC3BC,aAAcL,EAAMI,QAAQ,GAC5B,UAAW,CACPE,gBAAiB,WAErB,UAAW,CACPA,gBAAiB,WAGrBC,MAAOP,EAAMQ,QAAQC,KAAKC,QAC1BC,eAAgB,OAChBL,gBAAiBJ,EAAW,UAAY,cAGtCU,EAAqBhB,EAAOiB,EAAc,CAC5ChB,kBAAoBC,IAAU,CAAC,cAAcC,SAASD,IAD/BF,EAEK,EAAGkB,iBAAkB,CACjDC,OAAQD,GAAc,OACtBE,WAAY,IACZC,QAAS,MACTC,SAAU,QAGRC,EAAqBvB,EAAOwB,EAAPxB,EAAqB,EAAGI,YAAa,CAC5D,6BAA8B,CAC1BO,MAAOP,EAAMQ,QAAQC,KAAKC,SAE9B,+BAAgC,CAC5BH,MAAOP,EAAMQ,QAAQC,KAAKY,eAuBrBC,EAAqB,EAC9BrB,eACAsB,cACAC,iBACAC,YAAW,EACXC,UACAC,QACAC,WACAC,OACAf,aACAgB,YAAW,EACXC,OACAC,SACAC,eACAC,gBACAC,SAAS,GACTC,cAAa,MAEb,MAAMpC,EAAQqC,IACRC,EAAWC,EAAcvC,EAAMwC,YAAYC,KAAK,OAChDC,GAAcV,GAAUM,EAExBK,EAAYpB,GAAeI,EAC3BiB,EAAepB,GAAkBI,EAEvC,OACIiB,EAAAA,KAAClD,EAAkB,CACfM,aAAcyC,EAAazC,EAAe,OAC1C6C,QAASJ,EACTK,QAAM,EACNC,MAAOb,GAAU,eAAeR,IAChCsB,GAAIlB,EACJL,QAASA,EACTD,SAAUA,EACVvB,SAAUkC,EAAUc,SAAA,CAEnBrB,GACGsB,EAAAC,IAACxC,EAAmB,CAAAE,WAAYA,EAAUoC,SACtCC,EAAAA,WAAKE,IAAKxB,EAAMyB,IAAI,OAI3BpB,GAAiBiB,EAAAA,IAACvC,EAAmB,CAAAE,WAAYA,WAAaoB,IAE/DiB,EAACC,IAAAjC,GAAmBT,QAASiC,EAAWtB,UAAWuB,EAAcW,GAAI,CAAEC,GAAI,WAEzE1B,IACGG,GACGkB,MAACM,EAAU,CAAA,aAAa,eAAe9B,IACnCuB,SAAAC,EAAAA,IAACO,EAAAA,mBAAqB,CAAA,QAIxC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@mui/material/Card"),r=require("@mui/material/styles"),i=require("@mui/material/Typography");const a=r.styled("div")((({theme:e})=>({margin:e.spacing(8,"auto"),display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"}))),n=r.styled(t)((({theme:e})=>({padding:e.spacing(2,8)})));module.exports=({title:t,caption:r,hasCardBackground:s=!1})=>{const l=()=>e.jsxs(a,{children:[e.jsx(i,{variant:"h6",gutterBottom:!0,children:t}),r&&e.jsx(i,{variant:"body2",children:r})]});return s?e.jsx(n,{children:l()}):l()};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/NoResults/index.tsx"],"sourcesContent":["import Card from '@mui/material/Card';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nconst StyledTextContainer = styled('div')(({ theme }) => ({\n margin: theme.spacing(8, 'auto'),\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n textAlign: 'center',\n}));\n\nconst StyledCard = styled(Card)(({ theme }) => ({\n padding: theme.spacing(2, 8),\n}));\n\ntype Props = {\n title: string;\n caption?: string;\n hasCardBackground?: boolean;\n};\n\nconst NoResults = ({ title, caption, hasCardBackground = false }: Props) => {\n const renderContent = () => {\n return (\n <StyledTextContainer>\n <Typography variant=\"h6\" gutterBottom>\n {title}\n </Typography>\n {caption && <Typography variant=\"body2\">{caption}</Typography>}\n </StyledTextContainer>\n );\n };\n\n if (!hasCardBackground) {\n return renderContent();\n }\n\n return <StyledCard>{renderContent()}</StyledCard>;\n};\n\nexport default NoResults;\n"],"names":["StyledTextContainer","styled","theme","margin","spacing","display","flexDirection","justifyContent","alignItems","textAlign","StyledCard","Card","padding","title","caption","hasCardBackground","renderContent","_jsxs","children","_jsx","Typography","variant","gutterBottom","jsx"],"mappings":"wJAIA,MAAMA,EAAsBC,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACtDC,OAAQD,EAAME,QAAQ,EAAG,QACzBC,QAAS,OACTC,cAAe,SACfC,eAAgB,SAChBC,WAAY,SACZC,UAAW,aAGTC,EAAaT,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CAC5CU,QAASV,EAAME,QAAQ,EAAG,sBASZ,EAAGS,QAAOC,UAASC,qBAAoB,MACrD,MAAMC,EAAgB,IAEdC,OAACjB,EAAmB,CAAAkB,SAAA,CAChBC,EAAAA,IAACC,EAAW,CAAAC,QAAQ,KAAKC,cACpB,EAAAJ,SAAAL,IAEJC,GAAWK,EAACI,IAAAH,EAAW,CAAAC,QAAQ,QAASH,SAAAJ,OAKrD,OAAKC,EAIEI,EAAAA,IAACT,EAAU,CAAAQ,SAAEF,MAHTA,GAGsC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@mui/material/styles"),t=require("@mui/material/Typography"),i=require("@mui/material/Box"),s=require("../../providers/TranslationProvider.cjs.js");const a=r.styled(i)((({theme:e})=>({marginTop:e.spacing(2),display:"flex",justifyContent:"center",alignItems:"center"})));module.exports=()=>{const{translate:r}=s.useTranslation();return e.jsx(a,{children:e.jsx(t,{children:r("Page_Not_Found")})})};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/NotFoundPage/index.tsx"],"sourcesContent":["import { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\nimport { useTranslation } from '../../providers/TranslationProvider';\n\nconst StyledTextContainer = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n}));\n\nconst NotFoundPage = () => {\n const { translate } = useTranslation();\n return (\n <StyledTextContainer>\n <Typography>{translate('Page_Not_Found')}</Typography>\n </StyledTextContainer>\n );\n};\n\nexport default NotFoundPage;\n"],"names":["StyledTextContainer","styled","Box","theme","marginTop","spacing","display","justifyContent","alignItems","translate","useTranslation","_jsx","children","Typography"],"mappings":"+MAKA,MAAMA,EAAsBC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAa,CACpDC,UAAWD,EAAME,QAAQ,GACzBC,QAAS,OACTC,eAAgB,SAChBC,WAAY,4BAGK,KACjB,MAAMC,UAAEA,GAAcC,EAAAA,iBACtB,OACIC,MAACX,EAAmB,CAAAY,SAChBD,EAAAA,IAACE,EAAU,CAAAD,SAAEH,EAAU,qBAE7B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react"),r=require("../../providers/TranslationProvider.cjs.js");module.exports=({children:t})=>{const{translate:i}=r.useTranslation();return e.useEffect((()=>(document.title=`${i(t)} | Flipdish`,()=>{document.title="Flipdish Portal"})),[t]),null};
|
|
2
|
+
//# sourceMappingURL=DocumentTitle.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentTitle.cjs.js","sources":["../../../src/components/PageLayout/DocumentTitle.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useTranslation, type TranslationId } from '../../providers/TranslationProvider';\n\ntype Props = {\n children: string;\n};\n\nconst DEFAULT_TITLE = 'Flipdish Portal';\n\nconst DocumentTitle = ({ children }: Props) => {\n const { translate } = useTranslation();\n\n useEffect(() => {\n document.title = `${translate(children as TranslationId)} | Flipdish`;\n return () => {\n document.title = DEFAULT_TITLE;\n };\n }, [children]);\n\n return null;\n};\n\nexport default DocumentTitle;\n"],"names":["children","translate","useTranslation","useEffect","document","title"],"mappings":"2GASsB,EAAGA,eACrB,MAAMC,UAAEA,GAAcC,EAAAA,iBAStB,OAPAC,EAAAA,WAAU,KACNC,SAASC,MAAQ,GAAGJ,EAAUD,gBACvB,KACHI,SAASC,MARC,iBAQoB,IAEnC,CAACL,IAEG,IAAI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=require("react/jsx-runtime");require("react");var a=require("@mui/material/styles");module.exports=({children:r,className:e="",fullWidth:n,fullSize:s,noTopSpace:t})=>{const g=a.useTheme(),m=a.styled("div")((()=>({...n&&{marginLeft:-20,marginRight:-20},...s&&{[g.breakpoints.up("sm")]:{marginLeft:g.spacing(-3),marginRight:g.spacing(-3)}},...t&&{marginTop:`${g.spacing(-3)} !important`,[g.breakpoints.only("xs")]:{marginTop:`${g.spacing(-2)} !important`}},[g.breakpoints.only("sm")]:{marginLeft:g.spacing(-3),marginRight:g.spacing(-3)},[g.breakpoints.only("xs")]:{marginLeft:g.spacing(-2),marginRight:g.spacing(-2)}})));return i.jsx(m,{className:e,children:r})};
|
|
2
|
+
//# sourceMappingURL=FullWidthContainer.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FullWidthContainer.cjs.js","sources":["../../../src/components/PageLayout/FullWidthContainer.tsx"],"sourcesContent":["import { type ReactNode } from 'react';\nimport { styled, useTheme, type Theme } from '@mui/material/styles';\n\ntype Props = {\n className?: string;\n children: ReactNode;\n fullWidth?: boolean;\n fullSize?: boolean;\n noTopSpace?: boolean;\n};\n\nconst FullWidthContainer = ({ children, className = '', fullWidth, fullSize, noTopSpace }: Props) => {\n const theme = useTheme<Theme>();\n\n const FullWidthDiv = styled('div')(() => ({\n // Base styles\n ...(fullWidth && {\n marginLeft: -20,\n marginRight: -20,\n }),\n ...(fullSize && {\n [theme.breakpoints.up('sm')]: {\n marginLeft: theme.spacing(-3),\n marginRight: theme.spacing(-3),\n },\n }),\n ...(noTopSpace && {\n marginTop: `${theme.spacing(-3)} !important`,\n [theme.breakpoints.only('xs')]: {\n marginTop: `${theme.spacing(-2)} !important`,\n },\n }),\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-3),\n marginRight: theme.spacing(-3),\n },\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n marginRight: theme.spacing(-2),\n },\n }));\n\n return <FullWidthDiv className={className}>{children}</FullWidthDiv>;\n};\n\nexport default FullWidthContainer;\n"],"names":["children","className","fullWidth","fullSize","noTopSpace","theme","useTheme","FullWidthDiv","styled","marginLeft","marginRight","breakpoints","up","spacing","marginTop","only","_jsx"],"mappings":"sHAW2B,EAAGA,WAAUC,YAAY,GAAIC,YAAWC,WAAUC,iBACzE,MAAMC,EAAQC,EAAAA,WAERC,EAAeC,EAAAA,OAAO,MAAPA,EAAc,KAAO,IAElCN,GAAa,CACbO,YAAa,GACbC,aAAc,OAEdP,GAAY,CACZ,CAACE,EAAMM,YAAYC,GAAG,OAAQ,CAC1BH,WAAYJ,EAAMQ,SAAS,GAC3BH,YAAaL,EAAMQ,SAAS,QAGhCT,GAAc,CACdU,UAAW,GAAGT,EAAMQ,SAAS,gBAC7B,CAACR,EAAMM,YAAYI,KAAK,OAAQ,CAC5BD,UAAW,GAAGT,EAAMQ,SAAS,kBAGrC,CAACR,EAAMM,YAAYI,KAAK,OAAQ,CAC5BN,WAAYJ,EAAMQ,SAAS,GAC3BH,YAAaL,EAAMQ,SAAS,IAEhC,CAACR,EAAMM,YAAYI,KAAK,OAAQ,CAC5BN,WAAYJ,EAAMQ,SAAS,GAC3BH,YAAaL,EAAMQ,SAAS,QAIpC,OAAOG,EAAAA,IAACT,EAAa,CAAAN,UAAWA,EAASD,SAAGA,GAAwB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=require("react/jsx-runtime"),t=require("@mui/material/GlobalStyles"),n=require("@mui/material/styles/useTheme"),a=require("./index.cjs.js");module.exports=()=>{const p=n();return i.jsx(t,{styles:{[`.${a.HORIZONTAL_SPACE_CLASSNAME}`]:{paddingLeft:`${p.spacing(3)} !important`,paddingRight:`${p.spacing(3)} !important`,[p.breakpoints.only("xs")]:{paddingLeft:`${p.spacing(2)} !important`,paddingRight:`${p.spacing(2)} !important`}},[`.${a.LEFT_HORIZONTAL_SPACE_CLASSNAME}`]:{paddingLeft:`${p.spacing(3)} !important`,[p.breakpoints.only("xs")]:{paddingLeft:`${p.spacing(2)} !important`}},[`.${a.RIGHT_HORIZONTAL_SPACE_CLASSNAME}`]:{paddingRight:`${p.spacing(3)} !important`,[p.breakpoints.only("xs")]:{paddingRight:`${p.spacing(2)} !important`}},[`.${a.VERTICAL_SPACE_CLASSNAME}`]:{paddingTop:`${p.spacing(3)} !important`,paddingBottom:`${p.spacing(3)} !important`,[p.breakpoints.only("xs")]:{paddingTop:`${p.spacing(2)} !important`,paddingBottom:`${p.spacing(2)} !important`}}}})};
|
|
2
|
+
//# sourceMappingURL=GlobalSpacingStyles.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalSpacingStyles.cjs.js","sources":["../../../src/components/PageLayout/GlobalSpacingStyles.tsx"],"sourcesContent":["import GlobalStyles from '@mui/material/GlobalStyles';\nimport useTheme from '@mui/material/styles/useTheme';\nimport { HORIZONTAL_SPACE_CLASSNAME, LEFT_HORIZONTAL_SPACE_CLASSNAME, RIGHT_HORIZONTAL_SPACE_CLASSNAME, VERTICAL_SPACE_CLASSNAME } from '.';\n\nconst GlobalSpacingStyles = () => {\n const theme = useTheme();\n\n return (\n <GlobalStyles\n styles={{\n [`.${HORIZONTAL_SPACE_CLASSNAME}`]: {\n paddingLeft: `${theme.spacing(3)} !important`,\n paddingRight: `${theme.spacing(3)} !important`,\n [theme.breakpoints.only('xs')]: {\n paddingLeft: `${theme.spacing(2)} !important`,\n paddingRight: `${theme.spacing(2)} !important`,\n },\n },\n [`.${LEFT_HORIZONTAL_SPACE_CLASSNAME}`]: {\n paddingLeft: `${theme.spacing(3)} !important`,\n [theme.breakpoints.only('xs')]: {\n paddingLeft: `${theme.spacing(2)} !important`,\n },\n },\n [`.${RIGHT_HORIZONTAL_SPACE_CLASSNAME}`]: {\n paddingRight: `${theme.spacing(3)} !important`,\n [theme.breakpoints.only('xs')]: {\n paddingRight: `${theme.spacing(2)} !important`,\n },\n },\n [`.${VERTICAL_SPACE_CLASSNAME}`]: {\n paddingTop: `${theme.spacing(3)} !important`,\n paddingBottom: `${theme.spacing(3)} !important`,\n [theme.breakpoints.only('xs')]: {\n paddingTop: `${theme.spacing(2)} !important`,\n paddingBottom: `${theme.spacing(2)} !important`,\n },\n },\n }}\n />\n );\n};\n\nexport default GlobalSpacingStyles;\n"],"names":["theme","useTheme","_jsx","jsx","GlobalStyles","styles","HORIZONTAL_SPACE_CLASSNAME","paddingLeft","spacing","paddingRight","breakpoints","only","LEFT_HORIZONTAL_SPACE_CLASSNAME","RIGHT_HORIZONTAL_SPACE_CLASSNAME","VERTICAL_SPACE_CLASSNAME","paddingTop","paddingBottom"],"mappings":"8KAI4B,KACxB,MAAMA,EAAQC,IAEd,OACIC,EAAAC,IAACC,EAAY,CACTC,OAAQ,CACJ,CAAC,IAAIC,EAA0BA,8BAAK,CAChCC,YAAa,GAAGP,EAAMQ,QAAQ,gBAC9BC,aAAc,GAAGT,EAAMQ,QAAQ,gBAC/B,CAACR,EAAMU,YAAYC,KAAK,OAAQ,CAC5BJ,YAAa,GAAGP,EAAMQ,QAAQ,gBAC9BC,aAAc,GAAGT,EAAMQ,QAAQ,kBAGvC,CAAC,IAAII,EAA+BA,mCAAK,CACrCL,YAAa,GAAGP,EAAMQ,QAAQ,gBAC9B,CAACR,EAAMU,YAAYC,KAAK,OAAQ,CAC5BJ,YAAa,GAAGP,EAAMQ,QAAQ,kBAGtC,CAAC,IAAIK,EAAgCA,oCAAK,CACtCJ,aAAc,GAAGT,EAAMQ,QAAQ,gBAC/B,CAACR,EAAMU,YAAYC,KAAK,OAAQ,CAC5BF,aAAc,GAAGT,EAAMQ,QAAQ,kBAGvC,CAAC,IAAIM,EAAwBA,4BAAK,CAC9BC,WAAY,GAAGf,EAAMQ,QAAQ,gBAC7BQ,cAAe,GAAGhB,EAAMQ,QAAQ,gBAChC,CAACR,EAAMU,YAAYC,KAAK,OAAQ,CAC5BI,WAAY,GAAGf,EAAMQ,QAAQ,gBAC7BQ,cAAe,GAAGhB,EAAMQ,QAAQ,oBAKlD"}
|