@flipdish/portal-library 1.0.74 → 1.0.76

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.
Files changed (83) hide show
  1. package/dist/7cb5b036a5bc98d2.gif +0 -0
  2. package/dist/assets/images/fd-loader.gif.cjs.js +2 -0
  3. package/dist/assets/images/fd-loader.gif.cjs.js.map +1 -0
  4. package/dist/assets/images/fd-loader.gif.js +2 -0
  5. package/dist/assets/images/fd-loader.gif.js.map +1 -0
  6. package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js +1 -1
  7. package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js.map +1 -1
  8. package/dist/components/custom-hooks/useMicroFrontendAttributes.d.ts +2 -1
  9. package/dist/components/custom-hooks/useMicroFrontendAttributes.js +1 -1
  10. package/dist/components/custom-hooks/useMicroFrontendAttributes.js.map +1 -1
  11. package/dist/components/custom-hooks/useRenderValidText.cjs.js +1 -1
  12. package/dist/components/custom-hooks/useRenderValidText.cjs.js.map +1 -1
  13. package/dist/components/custom-hooks/useRenderValidText.d.ts +5 -4
  14. package/dist/components/custom-hooks/useRenderValidText.js +1 -1
  15. package/dist/components/custom-hooks/useRenderValidText.js.map +1 -1
  16. package/dist/components/index.cjs.js +1 -1
  17. package/dist/components/index.d.ts +1 -0
  18. package/dist/components/index.js +1 -1
  19. package/dist/components/renderUtilities/renderUtilities.cjs.js +1 -1
  20. package/dist/components/renderUtilities/renderUtilities.cjs.js.map +1 -1
  21. package/dist/components/renderUtilities/renderUtilities.js +1 -1
  22. package/dist/components/renderUtilities/renderUtilities.js.map +1 -1
  23. package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js +1 -1
  24. package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js.map +1 -1
  25. package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js +1 -1
  26. package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js.map +1 -1
  27. package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js +2 -0
  28. package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js.map +1 -0
  29. package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.d.ts +10 -0
  30. package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js +2 -0
  31. package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js.map +1 -0
  32. package/dist/components/ui/Form/FormItemLayout.cjs.js.map +1 -1
  33. package/dist/components/ui/Form/FormItemLayout.js.map +1 -1
  34. package/dist/components/ui/Form/GenericAutocompleteField.cjs.js +1 -1
  35. package/dist/components/ui/Form/GenericAutocompleteField.cjs.js.map +1 -1
  36. package/dist/components/ui/Form/GenericAutocompleteField.js +1 -1
  37. package/dist/components/ui/Form/GenericAutocompleteField.js.map +1 -1
  38. package/dist/components/ui/Form/GenericFormContainer.cjs.js +1 -1
  39. package/dist/components/ui/Form/GenericFormContainer.cjs.js.map +1 -1
  40. package/dist/components/ui/Form/GenericFormContainer.js +1 -1
  41. package/dist/components/ui/Form/GenericFormContainer.js.map +1 -1
  42. package/dist/components/ui/Form/GenericTextField.cjs.js +1 -1
  43. package/dist/components/ui/Form/GenericTextField.cjs.js.map +1 -1
  44. package/dist/components/ui/Form/GenericTextField.js +1 -1
  45. package/dist/components/ui/Form/GenericTextField.js.map +1 -1
  46. package/dist/components/ui/Form/utilities/formValidation.cjs.js.map +1 -1
  47. package/dist/components/ui/Form/utilities/formValidation.js.map +1 -1
  48. package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js +2 -0
  49. package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js.map +1 -0
  50. package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.d.ts +22 -0
  51. package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js +2 -0
  52. package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js.map +1 -0
  53. package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js +1 -1
  54. package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js.map +1 -1
  55. package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.d.ts +3 -17
  56. package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.js +1 -1
  57. package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.js.map +1 -1
  58. package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js +1 -1
  59. package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js.map +1 -1
  60. package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.d.ts +3 -17
  61. package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.js +1 -1
  62. package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.js.map +1 -1
  63. package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js +1 -1
  64. package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js.map +1 -1
  65. package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js +1 -1
  66. package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js.map +1 -1
  67. package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js +1 -1
  68. package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js.map +1 -1
  69. package/dist/components/ui/GenericTableBody/GenericTableBody.js +1 -1
  70. package/dist/components/ui/GenericTableBody/GenericTableBody.js.map +1 -1
  71. package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js +1 -1
  72. package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js.map +1 -1
  73. package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.js +1 -1
  74. package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.js.map +1 -1
  75. package/dist/components/ui/PageLayout/PageLayout.cjs.js +1 -1
  76. package/dist/components/ui/PageLayout/PageLayout.cjs.js.map +1 -1
  77. package/dist/components/ui/PageLayout/PageLayout.js +1 -1
  78. package/dist/components/ui/PageLayout/PageLayout.js.map +1 -1
  79. package/dist/components/ui/Spacer/Spacer.cjs.js.map +1 -1
  80. package/dist/components/ui/Spacer/Spacer.js.map +1 -1
  81. package/dist/providers/TranslationProvider.cjs.js.map +1 -1
  82. package/dist/providers/TranslationProvider.js.map +1 -1
  83. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GenericDateTimePickerField.cjs.js","sources":["../../../../src/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.tsx"],"sourcesContent":["import { type FieldProps, Field } from 'formik';\nimport FormItemLayout from '../Form/FormItemLayout';\nimport { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';\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';\n\nconst StyledDateTimePicker = styled(DateTimePicker)(({ theme }) => ({\n marginTop: theme.spacing(2),\n width: '100%',\n}));\n\ntype Props = {\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};\nconst GenericDateTimePickerField = ({\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}: Props) => {\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 <StyledDateTimePicker\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 const momentValue = moment.isMoment(value) ? value : moment(value);\n void 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: showError ? helperText : showHelperTextWhenValid ? helperText : undefined,\n FormHelperTextProps: {\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n },\n },\n }}\n disabled={isSubmitting || disabled}\n disablePast={disablePast}\n disableFuture={disablefuture}\n />\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 GenericDateTimePickerField;\n"],"names":["StyledDateTimePicker","styled","DateTimePicker","theme","marginTop","spacing","width","label","fieldName","description","validation","variant","layout","onChange","disabled","disablePast","disablefuture","placeholder","showHelperTextWhenValid","useTheme","renderField","_jsx","Field","name","validate","children","field","form","errors","touched","isSubmitting","fieldError","showError","helperText","useRenderValidText","value","_jsxs","jsxs","Box","sx","paddingRight","jsx","undefined","moment","isMoment","momentValue","setFieldValue","slotProps","textField","error","FormHelperTextProps","style","textAlign","disableFuture","Typography","color","palette","text","secondary","_Fragment","component","FormItemLayout"],"mappings":"2XAUA,MAAMA,EAAuBC,EAAAA,OAAOC,EAAAA,eAAPD,EAAuB,EAAGE,YAAa,CAChEC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,EAEIwB,EAAAC,KAAAsB,WAAA,CAAAlC,SAAA,CACiB,aAAZd,GACGU,EAAAoB,IAACa,EAAU,CAAC3C,QAAQ,YAAYiD,UAAU,KAAKL,MAAM,cAChD9B,SAAAlB,IAGRa,OAKNC,EAAAoB,IAACoB,EAAc,CAACtD,MAAOA,EAAQkB,SAAAL,KAA+B"}
1
+ {"version":3,"file":"GenericDateTimePickerField.cjs.js","sources":["../../../../src/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.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"}
@@ -1,21 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { TextFieldVariants } from '@mui/material/TextField';
3
- import moment from 'moment';
2
+ import { GenericDateFieldBaseProps } from '../GenericDatePickerField/GenericDateFieldBase.js';
4
3
 
5
- type Props = {
6
- label: string;
7
- placeholder?: string;
8
- fieldName: string;
9
- description?: string;
10
- validation?: (value: string) => string | undefined;
11
- layout?: 'horizontal' | 'vertical';
12
- variant?: TextFieldVariants;
13
- disabled?: boolean;
14
- disablePast?: boolean;
15
- disablefuture?: boolean;
16
- onChange?: (dateTime: moment.Moment) => void;
17
- showHelperTextWhenValid?: boolean;
18
- };
19
- declare const GenericDateTimePickerField: ({ label, fieldName, description, validation, variant, layout, onChange, disabled, disablePast, disablefuture, placeholder, showHelperTextWhenValid, }: Props) => react_jsx_runtime.JSX.Element;
4
+ type Props = Omit<GenericDateFieldBaseProps, 'pickerComponent'>;
5
+ declare const GenericDateTimePickerField: (props: Props) => react_jsx_runtime.JSX.Element;
20
6
 
21
7
  export { GenericDateTimePickerField as default };
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{Field as a}from"formik";import i from"../Form/FormItemLayout.js";import{DateTimePicker as o}from"@mui/x-date-pickers/DateTimePicker";import{styled as l,useTheme as m}from"@mui/material/styles";import"@mui/material/TextField";import n from"@mui/material/Box";import d from"@mui/material/Typography";import s from"../../custom-hooks/useRenderValidText.js";import p from"moment";const u=l(o)((({theme:e})=>({marginTop:e.spacing(2),width:"100%"}))),c=({label:o,fieldName:l,description:c,validation:h,variant:f="standard",layout:x,onChange:v,disabled:b=!1,disablePast:g=!1,disablefuture:y=!1,placeholder:T,showHelperTextWhenValid:F=!1})=>{const P=m(),k=()=>t(a,{name:l,validate:h,children:({field:r,form:a})=>{const{errors:i,touched:m,isSubmitting:h}=a,k=i[r.name],j=!!k&&m[r.name],w=s({fieldError:k,showError:j,touched:!!m[r.name],value:r.value});return e(n,{sx:{paddingRight:"horizontal"===x?"16px":0},children:[t(u,{label:"standard"===f?void 0:o,value:p.isMoment(r.value)?r.value:p(r.value),onChange:e=>{const t=p.isMoment(e)?e:p(e);a.setFieldValue(r.name,t),v&&v(t)},name:l,slotProps:{textField:{variant:f,placeholder:T,error:j,helperText:j||F?w:void 0,FormHelperTextProps:{children:" ",style:{textAlign:"right"}}}},disabled:h||b,disablePast:g,disableFuture:y}),c&&t(d,{variant:"caption",sx:{color:P.palette.text.secondary},children:c})]})}});return"vertical"===x?e(r,{children:["standard"===f&&t(d,{variant:"subtitle1",component:"h3",color:"textPrimary",children:o}),k()]}):t(i,{label:o,children:k()})};export{c as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{DateTimePicker as r}from"@mui/x-date-pickers/DateTimePicker";import i from"../GenericDatePickerField/GenericDateFieldBase.js";const t=t=>e(i,{...t,pickerComponent:r});export{t as default};
2
2
  //# sourceMappingURL=GenericDateTimePickerField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericDateTimePickerField.js","sources":["../../../../src/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.tsx"],"sourcesContent":["import { type FieldProps, Field } from 'formik';\nimport FormItemLayout from '../Form/FormItemLayout';\nimport { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';\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';\n\nconst StyledDateTimePicker = styled(DateTimePicker)(({ theme }) => ({\n marginTop: theme.spacing(2),\n width: '100%',\n}));\n\ntype Props = {\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};\nconst GenericDateTimePickerField = ({\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}: Props) => {\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 <StyledDateTimePicker\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 const momentValue = moment.isMoment(value) ? value : moment(value);\n void 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: showError ? helperText : showHelperTextWhenValid ? helperText : undefined,\n FormHelperTextProps: {\n children: ' ', // reserves line height for error message\n style: { textAlign: 'right' },\n },\n },\n }}\n disabled={isSubmitting || disabled}\n disablePast={disablePast}\n disableFuture={disablefuture}\n />\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 GenericDateTimePickerField;\n"],"names":["StyledDateTimePicker","styled","DateTimePicker","theme","marginTop","spacing","width","GenericDateTimePickerField","label","fieldName","description","validation","variant","layout","onChange","disabled","disablePast","disablefuture","placeholder","showHelperTextWhenValid","useTheme","renderField","_jsx","Field","name","validate","children","field","form","errors","touched","isSubmitting","fieldError","showError","helperText","useRenderValidText","value","_jsxs","Box","sx","paddingRight","undefined","moment","isMoment","momentValue","setFieldValue","slotProps","textField","error","FormHelperTextProps","style","textAlign","disableFuture","Typography","color","palette","text","secondary","_Fragment","component","FormItemLayout"],"mappings":"+bAUA,MAAMA,EAAuBC,EAAOC,EAAPD,EAAuB,EAAGE,YAAa,CAChEC,UAAWD,EAAME,QAAQ,GACzBC,MAAO,WAiBLC,EAA6B,EAC/BC,QACAC,YACAC,cACAC,aACAC,UAAU,WACVC,SACAC,WACAC,YAAW,EACXC,eAAc,EACdC,iBAAgB,EAChBC,cACAC,2BAA0B,MAE1B,MAAMhB,EAAQiB,I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TimePickerField.js","sources":["../../../../src/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.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":["GenericDateTimePickerField","props","_jsx","GenericDateFieldBase","pickerComponent","DateTimePicker"],"mappings":"6KAKA,MAAMA,EAA8BC,GACzBC,EAACC,EAAyB,IAAAF,EAAOG,gBAAiBC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("formik"),i=require("../Form/FormItemLayout.cjs.js"),a=require("@mui/material/Box"),t=require("@mui/material/Typography"),l=require("../../custom-hooks/useRenderValidText.cjs.js"),o=require("@mui/material/Radio"),s=require("@mui/material/FormControlLabel"),n=require("@mui/material/RadioGroup");require("react");var u=require("../Spacer/Spacer.cjs.js"),d=require("@mui/material/styles");const m=d.styled(a)((({theme:e})=>({marginLeft:e.spacing(4)}))),c=d.styled(t,{shouldForwardProp:e=>"showError"!==e})((({theme:e,showError:r})=>({color:r?e.palette.error.main:"inherit",textAlign:"right"})));module.exports=({label:d,fieldName:h,layout:x,onChange:j,options:v,showHelperTextWhenValid:p=!1})=>{const g=()=>e.jsx(r.Field,{name:h,children:({field:r,form:i})=>{const{errors:t,touched:d,isSubmitting:h}=i,g=t[r.name],q=!!g&&d[r.name],b=l({fieldError:g,showError:q,touched:!!d[r.name],value:r.value});return e.jsxs(a,{sx:{paddingRight:"horizontal"===x?"16px":0},children:[e.jsx(n,{name:"radio-buttons-group",value:r.value,onChange:e=>{i.setFieldValue(r.name,e.target.value),j&&j(e)},children:v.map((i=>e.jsxs("div",{children:[e.jsx(s,{value:i.value,control:e.jsx(o,{}),label:i.label,disabled:h||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(c,{showError:q,children:q||p?b:void 0})]})}});return"vertical"===x?e.jsxs(e.Fragment,{children:[d&&e.jsx(t,{variant:"subtitle1",component:"h3",color:"textPrimary",children:d}),g()]}):e.jsx(i,{label:d,children:g()})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("formik"),a=require("../Form/FormItemLayout.cjs.js"),i=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/Spacer.cjs.js"),d=require("@mui/material/styles");const m=d.styled(i)((({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:a,onChange:o,options:d,layout:c,showHelperTextWhenValid:x=!1})=>{const{errors:j,touched:p,isSubmitting:v}=a,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(i,{sx:{paddingRight:"horizontal"===c?"16px":0},children:[e.jsx(n,{name:"radio-buttons-group",value:r.value,onChange:e=>{a.setFieldValue(r.name,e.target.value),o&&o(e)},children:d.map((a=>e.jsxs("div",{children:[e.jsx(s,{value:a.value,control:e.jsx(l,{}),label:a.label,disabled:v||a.disabled}),a.selectedContent&&r.value===a.value&&e.jsxs(m,{children:[a.selectedContent,e.jsx(u,{size:8,variant:"horizontal"})]})]},a.value)))}),e.jsx(h,{showError:q,children:q||x?b:void 0})]})};module.exports=({label:i,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:[i&&e.jsx(o,{variant:"subtitle1",component:"h3",color:"textPrimary",children:i}),d()]}):e.jsx(a,{label:i,children:d()})};
2
2
  //# sourceMappingURL=GenericRadioButtons.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericRadioButtons.cjs.js","sources":["../../../../src/components/ui/GenericRadioButtons/GenericRadioButtons.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\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 GenericRadioButtons = ({ label, fieldName, layout, onChange, options, showHelperTextWhenValid = false }: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName}>\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 <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\n value={option.value}\n control={<Radio />}\n label={option.label}\n disabled={isSubmitting || option.disabled}\n />\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 {showError ? helperText : showHelperTextWhenValid ? helperText : undefined}\n </StyledHelperText>\n </Box>\n );\n }}\n </Field>\n );\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","label","fieldName","layout","onChange","options","showHelperTextWhenValid","renderField","_jsx","jsx","Field","name","children","field","form","errors","touched","isSubmitting","fieldError","helperText","useRenderValidText","value","_jsxs","jsxs","sx","paddingRight","RadioGroup","e","setFieldValue","target","map","option","FormControlLabel","control","Radio","disabled","selectedContent","Spacer","size","variant","undefined","_Fragment","component","FormItemLayout"],"mappings":"6bA0BA,MAAMA,EAAwBC,EAAAA,OAAOC,EAAPD,EAAY,EAAGE,YAAa,CACtDC,WAAYD,EAAME,QAAQ,OAGxBC,EAAmBL,EAAMA,OAACM,EAAY,CACxCC,kBAAoBC,GAAkB,cAATA,GADRR,EAEE,E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AAChB,EAAU,CAAC+C,QAAQ,YAAYG,UAAU,KAAK9C,MAAM,cAAagB,SAC7DX,IAGRM,OAKNC,EAAAC,IAACkC,EAAc,CAAC1C,MAAOA,EAAQW,SAAAL,KAA+B"}
1
+ {"version":3,"file":"GenericRadioButtons.cjs.js","sources":["../../../../src/components/ui/GenericRadioButtons/GenericRadioButtons.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":"6bAmCA,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"}
@@ -1,2 +1,2 @@
1
- import{jsxs as r,Fragment as e,jsx as o}from"react/jsx-runtime";import{Field as t}from"formik";import a from"../Form/FormItemLayout.js";import i from"@mui/material/Box";import l from"@mui/material/Typography";import m from"../../custom-hooks/useRenderValidText.js";import n from"@mui/material/Radio";import d from"@mui/material/FormControlLabel";import u from"@mui/material/RadioGroup";import"react";import s from"../Spacer/Spacer.js";import{styled as h}from"@mui/material/styles";const p=h(i)((({theme:r})=>({marginLeft:r.spacing(4)}))),c=h(l,{shouldForwardProp:r=>"showError"!==r})((({theme:r,showError:e})=>({color:e?r.palette.error.main:"inherit",textAlign:"right"}))),f=({label:h,fieldName:f,layout:v,onChange:g,options:b,showHelperTextWhenValid:x=!1})=>{const w=()=>o(t,{name:f,children:({field:e,form:t})=>{const{errors:a,touched:l,isSubmitting:h}=t,f=a[e.name],w=!!f&&l[e.name],y=m({fieldError:f,showError:w,touched:!!l[e.name],value:e.value});return r(i,{sx:{paddingRight:"horizontal"===v?"16px":0},children:[o(u,{name:"radio-buttons-group",value:e.value,onChange:r=>{t.setFieldValue(e.name,r.target.value),g&&g(r)},children:b.map((t=>r("div",{children:[o(d,{value:t.value,control:o(n,{}),label:t.label,disabled:h||t.disabled}),t.selectedContent&&e.value===t.value&&r(p,{children:[t.selectedContent,o(s,{size:8,variant:"horizontal"})]})]},t.value)))}),o(c,{showError:w,children:w||x?y:void 0})]})}});return"vertical"===v?r(e,{children:[h&&o(l,{variant:"subtitle1",component:"h3",color:"textPrimary",children:h}),w()]}):o(a,{label:h,children:w()})};export{f as default};
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{Field as t}from"formik";import a from"../Form/FormItemLayout.js";import i from"@mui/material/Box";import l from"@mui/material/Typography";import m from"../../custom-hooks/useRenderValidText.js";import n from"@mui/material/Radio";import d from"@mui/material/FormControlLabel";import h from"@mui/material/RadioGroup";import"react";import s from"../Spacer/Spacer.js";import{styled as u}from"@mui/material/styles";const p=u(i)((({theme:e})=>({marginLeft:e.spacing(4)}))),c=u(l,{shouldForwardProp:e=>"showError"!==e})((({theme:e,showError:r})=>({color:r?e.palette.error.main:"inherit",textAlign:"right"}))),f=({field:r,form:t,onChange:a,options:l,layout:u,showHelperTextWhenValid:f=!1})=>{const{errors:v,touched:g,isSubmitting:x}=t,b=v[r.name],w=!!b&&g[r.name],y=m({fieldError:b,showError:w,touched:!!g[r.name],value:r.value});return e(i,{sx:{paddingRight:"horizontal"===u?"16px":0},children:[o(h,{name:"radio-buttons-group",value:r.value,onChange:e=>{t.setFieldValue(r.name,e.target.value),a&&a(e)},children:l.map((t=>e("div",{children:[o(d,{value:t.value,control:o(n,{}),label:t.label,disabled:x||t.disabled}),t.selectedContent&&r.value===t.value&&e(p,{children:[t.selectedContent,o(s,{size:8,variant:"horizontal"})]})]},t.value)))}),o(c,{showError:w,children:w||f?y:void 0})]})},v=({label:i,fieldName:m,layout:n,onChange:d,options:h,showHelperTextWhenValid:s=!1})=>{const u=()=>o(t,{name:m,children:e=>o(f,{...e,onChange:d,options:h,layout:n,showHelperTextWhenValid:s})});return"vertical"===n?e(r,{children:[i&&o(l,{variant:"subtitle1",component:"h3",color:"textPrimary",children:i}),u()]}):o(a,{label:i,children:u()})};export{v as default};
2
2
  //# sourceMappingURL=GenericRadioButtons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericRadioButtons.js","sources":["../../../../src/components/ui/GenericRadioButtons/GenericRadioButtons.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\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 GenericRadioButtons = ({ label, fieldName, layout, onChange, options, showHelperTextWhenValid = false }: Props) => {\n const renderField = () => {\n return (\n <Field name={fieldName}>\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 <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\n value={option.value}\n control={<Radio />}\n label={option.label}\n disabled={isSubmitting || option.disabled}\n />\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 {showError ? helperText : showHelperTextWhenValid ? helperText : undefined}\n </StyledHelperText>\n </Box>\n );\n }}\n </Field>\n );\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","GenericRadioButtons","label","fieldName","layout","onChange","options","showHelperTextWhenValid","renderField","_jsx","Field","name","children","field","form","errors","touched","isSubmitting","fieldError","helperText","useRenderValidText","value","_jsxs","sx","paddingRight","RadioGroup","e","setFieldValue","target","map","option","FormControlLabel","control","Radio","disabled","selectedContent","Spacer","size","variant","undefined","_Fragment","component","FormItemLayout"],"mappings":"ieA0BA,MAAMA,EAAwBC,EAAOC,EAAPD,EAAY,EAAGE,YAAa,CACtDC,WAAYD,EAAME,QAAQ,OAGxBC,EAAmBL,EAAOM,EAAY,CACxCC,kBAAoBC,GAAkB,cAATA,GADRR,EAEE,EAAGE,QAAOO,gBAAiB,CAClDC,MAAOD,EAAYP,EAAMS,QAAQC,MAAMC,KAAO,UAC9CC,U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AQU,SAAAJ,KAA+B"}
1
+ {"version":3,"file":"GenericRadioButtons.js","sources":["../../../../src/components/ui/GenericRadioButtons/GenericRadioButtons.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","sx","paddingRight","children","_jsx","RadioGroup","e","setFieldValue","target","map","option","FormControlLabel","control","Radio","label","disabled","selectedContent","Spacer","size","variant","GenericRadioButtons","fieldName","renderField","Field","fieldProps","_Fragment","component","FormItemLayout"],"mappings":"ieAmCA,MAAMA,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MAAM+B,EAAc,IAChBlB,EAACmB,EAAK,CAAC3B,KAAMyB,WACPG,GACEpB,EAACnB,MACOuC,EACJpC,SAAUA,EACVC,QAASA,EACTC,OAAQA,EACRC,wBAAyBA,MAMzC,MAAe,aAAXD,EAEIU,EAAAyB,EAAA,CAAAtB,SAAA,CACKW,GACGV,EAAC5B,EAAU,CAAC2C,QAAQ,YAAYO,UAAU,KAAK9C,MAAM,cAAauB,SAC7DW,IAGRQ,OAKNlB,EAACuB,EAAc,CAACb,MAAOA,EAAQX,SAAAmB,KAA+B"}
@@ -1,2 +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");require("../GenericTable/GenericTable.cjs.js");var o=require("@mui/material/Skeleton"),n=require("../GenericTableBodyRow/GenericTableBodyRow.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 m=n[r],d=o[r].align??"left",u=o[r].hideWhenEmpty??!1?"":"-",w={align:d,warning:l,titleCell:a,sticky:"sticky"===c&&0===t,"data-testid":`col-${r}`,isTitleRow:n.isTitleRow??!1};if(i.isValidElement(m))return e.jsx(s,{...w,children:m});switch(o[r].columnType){case"String":default:return e.jsx(s,{...w,children:m??u});case"Custom":return e.jsx(s,{...w,children:m?o[r].customComponent(m,n):u})}};module.exports=({columns:i,data:t,loading:l,type:m,onRowClick:d,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})},t)))},r))):t?.map(((t,r)=>e.jsx(n,{onRowClick:d,row:t,tableRowTestKey:r.toString(),children:Array.from(i).map(((i,r)=>e.jsx(c,{colIdx:r,colName:i,row:t,type:m,meta:u},r)))},r)))});
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("@mui/material/styles"),t=require("@mui/material/TableBody"),l=require("@mui/material/TableCell"),a=require("@mui/material/TableRow");require("../GenericTable/GenericTable.cjs.js");var o=require("@mui/material/Skeleton"),n=require("../GenericTableBodyRow/GenericTableBodyRow.cjs.js");const s=r.styled(l,{shouldForwardProp:e=>"align"!==e&&"titleCell"!==e&&"warning"!==e&&"sticky"!==e&&"isTitleRow"!==e})((({align:e,titleCell:i,warning:r,sticky:t,isTitleRow:l})=>({textAlign:e,fontWeight:i||l?"bold":"normal",backgroundColor:r?"#ffcccb":"inherit",position:t?"sticky":"static"}))),c=({colIdx:r,colName:t,hasWarning:l,hasTitle:a,meta:o,row:n,type:c})=>{const d=n[t],m=o[t].align??"left",u=o[t].hideWhenEmpty??!1?"":"-",w={align:m,warning:l,titleCell:a,sticky:"sticky"===c&&0===r,"data-testid":`col-${t}`,isTitleRow:n.isTitleRow??!1};if(i.isValidElement(d))return e.jsx(s,{...w,children:d});switch(o[t].columnType){case"String":default:return e.jsx(s,{...w,children:d??u});case"Custom":return e.jsx(s,{...w,children:d?o[t].customComponent(d,n):u})}};module.exports=({columns:i,data:r,loading:l,type:d,onRowClick:m,meta:u})=>e.jsx(t,{children:l?Array.from(Array(5)).map(((r,t)=>e.jsx(a,{"data-testid":"row-loader",children:Array.from(i).map(((i,r)=>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-${r}`)))},`row-loader-${t}`))):r?.map(((r,t)=>e.jsx(n,{onRowClick:m,row:r,tableRowTestKey:t.toString(),children:Array.from(i).map(((i,t)=>e.jsx(c,{colIdx:t,colName:i,row:r,type:d,meta:u},`cell-${i}-${t}`)))},`row-${t}`)))});
2
2
  //# sourceMappingURL=GenericTableBody.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericTableBody.cjs.js","sources":["../../../../src/components/ui/GenericTableBody/GenericTableBody.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 { type GenericTableColumns } from '../GenericTable';\nimport Skeleton from '@mui/material/Skeleton';\nimport { GenericTableBodyRow } from '../GenericTableBodyRow';\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={idx} data-testid=\"row-loader\">\n {Array.from(columns).map((columnName, colIdx) => (\n <StyledTableCell\n key={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={rowIdx} onRowClick={onRowClick} row={row} tableRowTestKey={rowIdx.toString()}>\n {Array.from(columns).map((colName, colIdx) => (\n <RenderTableCell key={colIdx} colIdx={colIdx} colName={colName} row={row} type={type} meta={meta} />\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":"yWAUA,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,MAACe,EAAQ,CAAA,cAAuB,aAC3Bd,SAAAS,MAAMC,KAAKN,GAASO,KAAI,CAACI,EAAY5B,IAClCY,EAACG,IAAA9B,EAEG,CAAAK,MAAO,OACPC,WAAW,EACXC,SAAS,EACTC,QAAQ,EAAK,cACA,OAAOmC,IACpBlC,YAAY,EAEZmB,SAAAD,MAACiB,EAAS,CAAAC,MAAM,MAAMC,OAAQ,MARzB/B,MAHF0B,KAgBnBR,GAAMM,KAAI,CAACnB,EAAK2B,IACZpB,EAAAA,IAACqB,EAAmB,CAAcb,WAAYA,EAAYf,IAAKA,EAAK6B,gBAAiBF,EAAOG,WACvFtB,SAAAS,MAAMC,KAAKN,GAASO,KAAI,CAACvB,EAASD,IAC/BY,EAAAA,IAACb,EAAe,CAAcC,OAAQA,EAAQC,QAASA,EAASI,IAAKA,EAAKC,KAAMA,EAAMF,KAAMA,GAAtEJ,MAFJgC"}
1
+ {"version":3,"file":"GenericTableBody.cjs.js","sources":["../../../../src/components/ui/GenericTableBody/GenericTableBody.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 { type GenericTableColumns } from '../GenericTable';\nimport Skeleton from '@mui/material/Skeleton';\nimport { GenericTableBodyRow } from '../GenericTableBodyRow';\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":"yWAUA,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,GA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react/jsx-runtime";import i from"react";import{styled as e}from"@mui/material/styles";import r from"@mui/material/TableBody";import l from"@mui/material/TableCell";import o from"@mui/material/TableRow";import"../GenericTable/GenericTable.js";import a from"@mui/material/Skeleton";import n from"../GenericTableBodyRow/GenericTableBodyRow.js";const m=e(l,{shouldForwardProp:t=>"align"!==t&&"titleCell"!==t&&"warning"!==t&&"sticky"!==t&&"isTitleRow"!==t})((({align:t,titleCell:i,warning:e,sticky:r,isTitleRow:l})=>({textAlign:t,fontWeight:i||l?"bold":"normal",backgroundColor:e?"#ffcccb":"inherit",position:r?"sticky":"static"}))),c=({colIdx:e,colName:r,hasWarning:l,hasTitle:o,meta:a,row:n,type:c})=>{const s=n[r],d=a[r].align??"left",p=a[r].hideWhenEmpty??!1?"":"-",w={align:d,warning:l,titleCell:o,sticky:"sticky"===c&&0===e,"data-testid":`col-${r}`,isTitleRow:n.isTitleRow??!1};if(i.isValidElement(s))return t(m,{...w,children:s});switch(a[r].columnType){case"String":default:return t(m,{...w,children:s??p});case"Custom":return t(m,{...w,children:s?a[r].customComponent(s,n):p})}},s=({columns:i,data:e,loading:l,type:s,onRowClick:d,meta:p})=>t(r,{children:l?Array.from(Array(5)).map(((e,r)=>t(o,{"data-testid":"row-loader",children:Array.from(i).map(((i,e)=>t(m,{align:"left",titleCell:!1,warning:!1,sticky:!1,"data-testid":`col-${i}`,isTitleRow:!1,children:t(a,{width:"90%",height:22})},e)))},r))):e?.map(((e,r)=>t(n,{onRowClick:d,row:e,tableRowTestKey:r.toString(),children:Array.from(i).map(((i,r)=>t(c,{colIdx:r,colName:i,row:e,type:s,meta:p},r)))},r)))});export{s as default};
1
+ import{jsx as e}from"react/jsx-runtime";import t from"react";import{styled as i}from"@mui/material/styles";import r from"@mui/material/TableBody";import l from"@mui/material/TableCell";import o from"@mui/material/TableRow";import"../GenericTable/GenericTable.js";import a from"@mui/material/Skeleton";import n from"../GenericTableBodyRow/GenericTableBodyRow.js";const m=i(l,{shouldForwardProp:e=>"align"!==e&&"titleCell"!==e&&"warning"!==e&&"sticky"!==e&&"isTitleRow"!==e})((({align:e,titleCell:t,warning:i,sticky:r,isTitleRow:l})=>({textAlign:e,fontWeight:t||l?"bold":"normal",backgroundColor:i?"#ffcccb":"inherit",position:r?"sticky":"static"}))),c=({colIdx:i,colName:r,hasWarning:l,hasTitle:o,meta:a,row:n,type:c})=>{const s=n[r],d=a[r].align??"left",w=a[r].hideWhenEmpty??!1?"":"-",p={align:d,warning:l,titleCell:o,sticky:"sticky"===c&&0===i,"data-testid":`col-${r}`,isTitleRow:n.isTitleRow??!1};if(t.isValidElement(s))return e(m,{...p,children:s});switch(a[r].columnType){case"String":default:return e(m,{...p,children:s??w});case"Custom":return e(m,{...p,children:s?a[r].customComponent(s,n):w})}},s=({columns:t,data:i,loading:l,type:s,onRowClick:d,meta:w})=>e(r,{children:l?Array.from(Array(5)).map(((i,r)=>e(o,{"data-testid":"row-loader",children:Array.from(t).map(((t,i)=>e(m,{align:"left",titleCell:!1,warning:!1,sticky:!1,"data-testid":`col-${t}`,isTitleRow:!1,children:e(a,{width:"90%",height:22})},`col-${t}-loader-${i}`)))},`row-loader-${r}`))):i?.map(((i,r)=>e(n,{onRowClick:d,row:i,tableRowTestKey:r.toString(),children:Array.from(t).map(((t,r)=>e(c,{colIdx:r,colName:t,row:i,type:s,meta:w},`cell-${t}-${r}`)))},`row-${r}`)))});export{s as default};
2
2
  //# sourceMappingURL=GenericTableBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericTableBody.js","sources":["../../../../src/components/ui/GenericTableBody/GenericTableBody.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 { type GenericTableColumns } from '../GenericTable';\nimport Skeleton from '@mui/material/Skeleton';\nimport { GenericTableBodyRow } from '../GenericTableBodyRow';\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={idx} data-testid=\"row-loader\">\n {Array.from(columns).map((columnName, colIdx) => (\n <StyledTableCell\n key={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={rowIdx} onRowClick={onRowClick} row={row} tableRowTestKey={rowIdx.toString()}>\n {Array.from(columns).map((colName, colIdx) => (\n <RenderTableCell key={colIdx} colIdx={colIdx} colName={colName} row={row} type={type} meta={meta} />\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","customComponent","GenericTableBody","columns","data","loading","onRowClick","MuiTableBody","Array","from","map","_","idx","TableRow","columnName","Skeleton","width","height","rowIdx","GenericTableBodyRow","tableRowTestKey","toString"],"mappings":"0WAUA,MAAMA,EAAkBC,EAAOC,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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AACb,EAAe,CAAcC,OAAQA,EAAQC,QAASA,EAASI,IAAKA,EAAKC,KAAMA,EAAMF,KAAMA,GAAtEJ,MAFJgC"}
1
+ {"version":3,"file":"GenericTableBody.js","sources":["../../../../src/components/ui/GenericTableBody/GenericTableBody.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 { type GenericTableColumns } from '../GenericTable';\nimport Skeleton from '@mui/material/Skeleton';\nimport { GenericTableBodyRow } from '../GenericTableBodyRow';\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","customComponent","GenericTableBody","columns","data","loading","onRowClick","MuiTableBody","Array","from","map","_","idx","TableRow","columnName","Skeleton","width","height","rowIdx","GenericTableBodyRow","tableRowTestKey","toString"],"mappings":"0WAUA,MAAMA,EAAkBC,EAAOC,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,EAAC3B,EAAe,IAAKwB,EAAiBI,SAAAxB,IAGjD,OAAQe,EAAKH,GAASa,YAClB,IAAK,SAIL,QACI,OAAOF,EAAC3B,EAAoB,IAAAwB,WAAiBpB,GAAQkB,IAHzD,IAAK,SACD,OAAOK,EAAC3B,EAAe,IAAKwB,EAAcI,SAAGxB,EAAOe,EAAKH,GAASc,gBAAgB1B,EAAMgB,GAAOE,IAGtG,EAcCS,EAA6C,EAAGC,UAASC,OAAMC,UAASb,OAAMc,aAAYhB,UAGxFQ,EAACS,EAAY,CAAAR,SACRM,EACKG,MAAMC,KAAKD,MAJL,IAIyBE,KAAI,CAACC,EAAGC,IACnCd,EAACe,iBAA+C,aAAYd,SACvDS,MAAMC,KAAKN,GAASO,KAAI,CAACI,EAAY5B,IAClCY,EAAC3B,EAAe,CAEZK,MAAO,OACPC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACK,cAAA,OAAOmC,IACpBlC,YAAY,EAEZmB,SAAAD,EAACiB,EAAQ,CAACC,MAAM,MAAMC,OAAQ,MARzB,OAAOH,YAAqB5B,QAH9B,cAAc0B,OAgBjCR,GAAMM,KAAI,CAACnB,EAAK2B,IACZpB,EAACqB,GAA0Cb,WAAYA,EAAYf,IAAKA,EAAK6B,gBAAiBF,EAAOG,WAChGtB,SAAAS,MAAMC,KAAKN,GAASO,KAAI,CAACvB,EAASD,IAC/BY,EAACb,EAEG,CAAAC,OAAQA,EACRC,QAASA,EACTI,IAAKA,EACLC,KAAMA,EACNF,KAAMA,GALD,QAAQH,KAAWD,QAHV,OAAOgC"}
@@ -1,2 +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:s,tableRowTestKey:a}=i,u=e=>{e.preventDefault(),o&&o(l)};return o?e.jsx(t,{role:"button",onClick:u,hover:void 0!==u,"data-testid":`row-${a}`,isTitleRow:l.isTitleRow??!1,children:s}):e.jsx(r,{"data-testid":`row-${a}`,children:s})};
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
2
  //# sourceMappingURL=GenericTableBodyRow.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericTableBodyRow.cjs.js","sources":["../../../../src/components/ui/GenericTableBodyRow/GenericTableBodyRow.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 && onRowClick(row);\n };\n\n if (onRowClick) {\n return (\n <StyledTableRow\n role=\"button\"\n onClick={onClick}\n hover={onClick !== undefined}\n data-testid={`row-${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","role","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,GAAcA,EAAWC,EAAI,EAGjC,OAAID,EAEIO,EAAAC,IAACnB,EAAc,CACXoB,KAAK,SACLL,QAASA,EACTM,WAAmBC,IAAZP,EAAqB,cACf,OAAOD,IACpBR,WAAYM,EAAIN,aAAc,EAAKO,SAElCA,IAKNK,MAAChB,EAAsB,CAAA,cAAA,OAAOY,IAAiBD,SAAGA,GAAoB"}
1
+ {"version":3,"file":"GenericTableBodyRow.cjs.js","sources":["../../../../src/components/ui/GenericTableBodyRow/GenericTableBodyRow.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"}
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import"react";import e from"@mui/material/TableRow";import{styled as o}from"@mui/material/styles";const r=o(e,{shouldForwardProp:t=>"isTitleRow"!==t})((({theme:t,isTitleRow:e})=>e?{backgroundColor:t.palette.grey[100]}:{})),i=o=>{const{onRowClick:i,row:l,children:a,tableRowTestKey:s}=o,m=t=>{t.preventDefault(),i&&i(l)};return i?t(r,{role:"button",onClick:m,hover:void 0!==m,"data-testid":`row-${s}`,isTitleRow:l.isTitleRow??!1,children:a}):t(e,{"data-testid":`row-${s}`,children:a})};export{i as default};
1
+ import{jsx as e}from"react/jsx-runtime";import"react";import t from"@mui/material/TableRow";import{styled as o}from"@mui/material/styles";const r=o(t,{shouldForwardProp:e=>"isTitleRow"!==e})((({theme:e,isTitleRow:t})=>t?{backgroundColor:e.palette.grey[100]}:{})),i=o=>{const{onRowClick:i,row:l,children:a,tableRowTestKey:s}=o,m=e=>{e.preventDefault(),i?.(l)};return i?e(r,{onClick:m,hover:void 0!==m,"data-testid":`row-clickable-${s}`,isTitleRow:l.isTitleRow??!1,children:a}):e(t,{"data-testid":`row-${s}`,children:a})};export{i as default};
2
2
  //# sourceMappingURL=GenericTableBodyRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenericTableBodyRow.js","sources":["../../../../src/components/ui/GenericTableBodyRow/GenericTableBodyRow.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 && onRowClick(row);\n };\n\n if (onRowClick) {\n return (\n <StyledTableRow\n role=\"button\"\n onClick={onClick}\n hover={onClick !== undefined}\n data-testid={`row-${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","GenericTableBodyRow","props","onRowClick","row","children","tableRowTestKey","onClick","e","preventDefault","_jsx","role","hover","undefined"],"mappings":"0IAaA,MAAMA,EAAiBC,EAAOC,EAAU,CACpCC,kBAAoBC,GAAkB,eAATA,GADVH,EAEK,EAAGI,QAAOC,gBAC7BA,EAIE,CACHC,gBAAiBF,EAAMG,QAAQC,KAAK,MAJ7B,KAUTC,EAA4EC,IAC9E,MAAMC,WAAEA,EAAUC,IAAEA,EAAGC,SAAEA,EAAQC,gBAAEA,GAAoBJ,EAEjDK,EAAWC,IACbA,EAAEC,iBACFN,GAAcA,EAAWC,EAAI,EAGjC,OAAID,EAEIO,EAACnB,EAAc,CACXoB,KAAK,SACLJ,QAASA,EACTK,WAAmBC,IAAZN,EAAqB,cACf,OAAOD,IACpBT,WAAYO,EAAIP,aAAc,EAAKQ,SAElCA,IAKNK,EAACjB,EAAsB,CAAA,cAAA,OAAOa,IAAiBD,SAAGA,GAAoB"}
1
+ {"version":3,"file":"GenericTableBodyRow.js","sources":["../../../../src/components/ui/GenericTableBodyRow/GenericTableBodyRow.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","GenericTableBodyRow","props","onRowClick","row","children","tableRowTestKey","onClick","e","preventDefault","_jsx","hover","undefined"],"mappings":"0IAaA,MAAMA,EAAiBC,EAAOC,EAAU,CACpCC,kBAAoBC,GAAkB,eAATA,GADVH,EAEK,EAAGI,QAAOC,gBAC7BA,EAIE,CACHC,gBAAiBF,EAAMG,QAAQC,KAAK,MAJ7B,KAUTC,EAA4EC,IAC9E,MAAMC,WAAEA,EAAUC,IAAEA,EAAGC,SAAEA,EAAQC,gBAAEA,GAAoBJ,EAEjDK,EAAWC,IACbA,EAAEC,iBACFN,IAAaC,EAAI,EAGrB,OAAID,EAEIO,EAACnB,EAAc,CACXgB,QAASA,EACTI,WAAmBC,IAAZL,EAAqB,cACf,iBAAiBD,IAC9BT,WAAYO,EAAIP,aAAc,EAAKQ,SAElCA,IAKNK,EAACjB,EAAsB,CAAA,cAAA,OAAOa,IAAiBD,SAAGA,GAAoB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var i=require("@mui/icons-material/Add"),t=require("@mui/icons-material/ArrowBack"),n=require("@mui/material/Grid"),r=require("@mui/material/IconButton"),a=require("@mui/material/styles"),s=require("@mui/material/Typography"),o=require("@mui/material/useMediaQuery"),d=require("./DocumentTitle.cjs.js"),l=require("./FullWidthContainer.cjs.js"),c=require("../FDErrorBoundary/FDErrorBoundary.cjs.js"),m=require("@mui/material/Button"),p=require("../../renderUtilities/renderUtilities.cjs.js"),h=require("../../../utilities/validation.cjs.js"),g=require("../Spacer/Spacer.cjs.js"),u=require("@mui/material/Box"),x=require("@mui/material/Divider");const j=1112,v=a.styled("div")((({theme:e,fluid:i})=>({maxWidth:i?"none":j,[e.breakpoints.down("md")]:{maxWidth:"none"},padding:e.spacing(2,4),position:"relative",minHeight:"100vh"}))),y=a.styled(n)((({theme:e})=>({[e.breakpoints.down("sm")]:{width:"100%",paddingTop:e.spacing(2)}}))),f=a.styled(n)((({theme:e})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:e.spacing(3),paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingTop:e.spacing(2),paddingBottom:e.spacing(3)}}))),b=a.styled(n)((({theme:e})=>({paddingTop:e.spacing(2)}))),k=a.styled(n)((()=>({flexGrow:1}))),B=a.styled("div")((({theme:e})=>({maxWidth:j,paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingBottom:e.spacing(2),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}))),q=a.styled(r,{shouldForwardProp:e=>"hasTitleComponent"!==e})((({theme:e,hasTitleComponent:i})=>({margin:i?e.spacing(-.75,2,-1.5,-1.5):e.spacing(-1.5,2,-1.5,-1.5),[e.breakpoints.only("sm")]:{marginLeft:e.spacing(-2)},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(-2)}}))),w=a.styled("div")((({theme:e})=>({maxWidth:j,marginLeft:e.spacing(6),marginRight:e.spacing(4),paddingBottom:e.spacing(2),[e.breakpoints.only("md")]:{marginLeft:12,marginRight:e.spacing(3)},[e.breakpoints.only("sm")]:{marginLeft:e.spacing(3),marginRight:e.spacing(3),maxWidth:"none"},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(2),marginRight:e.spacing(2),maxWidth:"none"}}))),T=a.styled(n)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),W=a.styled(s)((()=>({lineHeight:"26px"}))),A=a.styled(s)((()=>({fontWeight:"bold"}))),C=a.styled(x)((({theme:e})=>({marginBottom:e.spacing(4)}))),F=({title:i})=>e.jsx(A,{variant:"h5",component:"h2",children:i}),L=a.styled("div")((({useAlternateBackground:e,theme:i})=>({backgroundColor:e?i.palette.alternateBackground.main:i.palette.white.main,width:"100%",height:"100%"})));exports.PageTitle=F,exports.default=r=>{const{actionBtnTitle:s,caption:x,children:j,contextButtons:A,documentTitle:P,fluid:I=!1,fullWidth:D,header:R,hideHeader:z,actionButtonLink:H,openLinkInNewTab:_=!1,pageHeader:G,showActionButton:M,showAddIcon:U,title:E,titleComponent:S,toPrevious:N,toParent:O,strictToParent:Q,navigate:$,hideDivider:J=!1,customActionButtons:K,useAlternateBackground:V=!1,titleComponentAfter:X}=r,Y=a.useTheme(),Z=o(Y.breakpoints.down("md")),ee=p.getMicroFrontendAttribute("data-portal-base-url")||"/",ie=H?.startsWith("https://"),te=ie?H:void 0!==H?h.joinUrlPaths(ee,H):"";return e.jsx(L,{useAlternateBackground:V,children:e.jsxs(v,{fluid:I,children:[P&&e.jsx(d,{children:P}),G||null,e.jsxs(w,{children:[G&&e.jsx(g,{size:16,variant:"vertical"}),!z&&e.jsxs(e.Fragment,{children:[e.jsxs(f,{container:!0,alignItems:"center",direction:"column",children:[e.jsx(n,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:e.jsx(T,{item:!0,children:A&&A.map(((i,t)=>e.jsx("div",{children:i},t)))})}),e.jsxs(b,{item:!0,container:!0,children:[(O||N)&&e.jsx(u,{children:e.jsx(q,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!S,component:"button",onClick:()=>{N?$(-1):O&&Q||O&&history.length<3?$(O):$(-1)},children:e.jsx(t,{})})}),e.jsxs(k,{item:!0,children:[S?e.jsx(S,{}):e.jsx(e.Fragment,{children:e.jsxs(u,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(F,{title:E}),X]})}),x&&e.jsx(W,{variant:"caption",component:"h3",children:x})]}),M&&e.jsxs(e.Fragment,{children:[Z&&e.jsx(g,{size:56,variant:"vertical"}),e.jsx(y,{item:!0,children:e.jsxs(m,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${s}`,href:_||ie?te:"",target:_?"_blank":void 0,rel:_?"noopener noreferrer":void 0,onClick:_||ie?()=>{}:()=>$(H),children:[U&&e.jsx(i,{}),s]})})]}),K&&K.map(((i,t)=>e.jsxs("div",{children:[Z&&e.jsx(g,{size:56,variant:"vertical"}),!Z&&e.jsx(g,{size:16,variant:"vertical"}),e.jsx(y,{item:!0,children:i})]},t)))]})]}),!J&&e.jsx(C,{})]}),e.jsxs(l,{fullWidth:D,children:[R?e.jsx(B,{children:R}):null,e.jsx(c,{identifier:P,children:e.jsx(e.Fragment,{children:j})})]})]})]})})},exports.maxWidth=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),t=require("@mui/icons-material/Add"),n=require("@mui/icons-material/ArrowBack"),r=require("@mui/material/Grid"),a=require("@mui/material/IconButton"),s=require("@mui/material/styles"),o=require("@mui/material/Typography"),d=require("@mui/material/useMediaQuery"),l=require("./DocumentTitle.cjs.js"),c=require("./FullWidthContainer.cjs.js"),m=require("../FDErrorBoundary/FDErrorBoundary.cjs.js"),p=require("@mui/material/Button"),h=require("../../renderUtilities/renderUtilities.cjs.js"),u=require("../../../utilities/validation.cjs.js"),g=require("../Spacer/Spacer.cjs.js"),x=require("@mui/material/Box"),j=require("@mui/material/Divider");const f=1112,v=s.styled("div")((({theme:e,fluid:i})=>({maxWidth:i?"none":f,[e.breakpoints.down("md")]:{maxWidth:"none"},padding:e.spacing(2,4),position:"relative",minHeight:"100vh"}))),y=s.styled(r)((({theme:e})=>({[e.breakpoints.down("sm")]:{width:"100%",paddingTop:e.spacing(2)}}))),b=s.styled(r)((({theme:e})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:e.spacing(3),paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingTop:e.spacing(2),paddingBottom:e.spacing(3)}}))),k=s.styled(r)((({theme:e})=>({paddingTop:e.spacing(2)}))),B=s.styled(r)((()=>({flexGrow:1}))),q=s.styled("div")((({theme:e})=>({maxWidth:f,paddingBottom:e.spacing(3),[e.breakpoints.down("md")]:{paddingBottom:e.spacing(2),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}))),w=s.styled(a,{shouldForwardProp:e=>"hasTitleComponent"!==e})((({theme:e,hasTitleComponent:i})=>({margin:i?e.spacing(-.75,2,-1.5,-1.5):e.spacing(-1.5,2,-1.5,-1.5),[e.breakpoints.only("sm")]:{marginLeft:e.spacing(-2)},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(-2)}}))),T=s.styled("div")((({theme:e})=>({maxWidth:f,marginLeft:e.spacing(6),marginRight:e.spacing(4),paddingBottom:e.spacing(2),[e.breakpoints.only("md")]:{marginLeft:12,marginRight:e.spacing(3)},[e.breakpoints.only("sm")]:{marginLeft:e.spacing(3),marginRight:e.spacing(3),maxWidth:"none"},[e.breakpoints.only("xs")]:{marginLeft:e.spacing(2),marginRight:e.spacing(2),maxWidth:"none"}}))),W=s.styled(r)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),A=s.styled(o)((()=>({lineHeight:"26px"}))),C=s.styled(o)((()=>({fontWeight:"bold"}))),L=s.styled(j)((({theme:e})=>({marginBottom:e.spacing(4)}))),F=({title:i})=>e.jsx(C,{variant:"h5",component:"h2",children:i}),P=s.styled("div")((({useAlternateBackground:e,theme:i})=>({backgroundColor:e?i.palette.alternateBackground.main:i.palette.white.main,width:"100%",height:"100%"})));exports.PageTitle=F,exports.default=a=>{const{actionBtnTitle:o,caption:j,children:f,contextButtons:C,documentTitle:I,fluid:D=!1,fullWidth:R,header:z,hideHeader:E,actionButtonLink:H,openLinkInNewTab:_=!1,pageHeader:G,showActionButton:M,showAddIcon:U,title:$,titleComponent:S,toPrevious:V,toParent:N,strictToParent:O,navigate:Q,hideDivider:J=!1,customActionButtons:K,useAlternateBackground:X=!1,titleComponentAfter:Y}=a,Z=s.useTheme(),ee=d(Z.breakpoints.down("md")),ie=h.getMicroFrontendAttribute("data-portal-base-url")||"/",te=H?.startsWith("https://"),ne=te?H:void 0!==H?u.joinUrlPaths(ie,H):"";return e.jsx(P,{useAlternateBackground:X,children:e.jsxs(v,{fluid:D,children:[I&&e.jsx(l,{children:I}),G||null,e.jsxs(T,{children:[G&&e.jsx(g,{size:16,variant:"vertical"}),!E&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{container:!0,alignItems:"center",direction:"column",children:[e.jsx(r,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:e.jsx(W,{item:!0,children:C?.map((t=>e.jsx("div",{children:t},`context-button-${i.isValidElement(t)?t.props?.["data-testid"]||t.props?.children:"fallback"}`)))})}),e.jsxs(k,{item:!0,container:!0,children:[(N||V)&&e.jsx(x,{children:e.jsx(w,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!S,component:"button",onClick:()=>{V?Q(-1):N&&O||N&&history.length<3?Q(N):Q(-1)},children:e.jsx(n,{})})}),e.jsxs(B,{item:!0,children:[S?e.jsx(S,{}):e.jsxs(x,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(F,{title:$}),Y]}),j&&e.jsx(A,{variant:"caption",component:"h3",children:j})]}),M&&e.jsxs(e.Fragment,{children:[ee&&e.jsx(g,{size:56,variant:"vertical"}),e.jsx(y,{item:!0,children:e.jsxs(p,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${o}`,href:_||te?ne:"",target:_?"_blank":void 0,rel:_?"noopener noreferrer":void 0,onClick:_||te?()=>{}:()=>Q(H),children:[U&&e.jsx(t,{}),o]})})]}),K?.map((t=>e.jsxs("div",{children:[ee&&e.jsx(g,{size:56,variant:"vertical"}),!ee&&e.jsx(g,{size:16,variant:"vertical"}),e.jsx(y,{item:!0,children:t})]},`custom-action-button-${i.isValidElement(t)?t.props?.["data-testid"]||t.props?.children:"fallback"}`)))]})]}),!J&&e.jsx(L,{})]}),e.jsxs(c,{fullWidth:R,children:[z?e.jsx(q,{children:z}):null,e.jsx(m,{identifier:I,children:e.jsx(e.Fragment,{children:f})})]})]})]})})},exports.maxWidth=f;
2
2
  //# sourceMappingURL=PageLayout.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground ? theme.palette.alternateBackground.main : theme.palette.white.main,\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const actionButtonLinkFinal = actionButtonWithHttps\n ? actionButtonLink\n : actionButtonLink !== undefined\n ? joinUrlPaths(baseUrl, actionButtonLink)\n : '';\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader ? pageHeader : null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons && contextButtons.map((button, index) => <div key={index}>{button}</div>)}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <>\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n </>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <Add />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons &&\n customActionButtons.map((button, index) => (\n <div key={index}>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","alternateBackground","main","white","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","_jsxs","jsxs","jsx","DocumentTitle","Spacer","size","_Fragment","Fragment","container","direction","item","alignContent","map","button","index","Box","onClick","history","length","ArrowBackIcon","gap","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"4vBAwBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAMA,OAAC,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BO,MAAO,OACPC,WAAYX,EAAMK,QAAQ,QAI5BO,EAAeb,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CAC9Ca,SAAU,SACVC,WAAY,aACZH,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BQ,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,QAI/BW,EAAuBjB,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CACtDW,WAAYX,EAAMK,QAAQ,OAGxBY,EAAqBlB,EAAAA,OAAOU,EAAPV,EAAa,KAAO,CAC3CmB,SAAU,MAGRC,EAAmBpB,EAAAA,OAAO,MAAPA,EAAc,EAAGC,YAAa,CACnDH,WACAkB,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BY,cAAef,EAAMK,QAAQ,GAC7Be,YAAapB,EAAMK,QAAQ,GAC3BgB,aAAcrB,EAAMK,QAAQ,QAI9BiB,EAAmBvB,EAAMA,OAACwB,EAAY,CACxCC,kBAAoBC,GAAkB,sBAATA,GADR1B,EAG0B,EAAGC,QAAO0B,wBAAyB,CAClFC,OAA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C,IAC7Bd,wBACKT,GAAYnC,MAACgD,EAAM,CAACC,KAAM,GAAIhD,QAAQ,cACrCkC,GAAYnC,EAAA8C,IAACE,EAAO,CAAAC,KAAM,GAAIhD,QAAQ,aACxCD,EAAA8C,IAACnF,EAAsB,CAAC2F,MAAM,EAAAnD,SAAAsD,MAHxBC,YAQxB3B,GAAe/B,EAAAA,IAACL,EAAiB,CAAA,MAG3CiD,OAAC0B,GAAmBrD,UAAWA,EAC1Bd,SAAA,CAAAe,EAASlB,EAAAA,IAAC1B,EAAkB,CAAA6B,SAAAe,IAA6B,KAC1DlB,EAAAA,IAACuE,EAAgB,CAAAC,WAAYxD,EAAab,SACtCH,EAAG8C,IAAAI,WAAA,CAAA/C,SAAAA,gBAMzB"}
1
+ {"version":3,"file":"PageLayout.cjs.js","sources":["../../../../src/components/ui/PageLayout/PageLayout.tsx"],"sourcesContent":["import React, { type ComponentType, type ReactNode } from 'react';\n\nimport Add from '@mui/icons-material/Add';\nimport ArrowBackIcon from '@mui/icons-material/ArrowBack';\nimport Grid from '@mui/material/Grid';\nimport IconButton from '@mui/material/IconButton';\nimport { styled, useTheme } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport useMediaQuery from '@mui/material/useMediaQuery';\n\nimport DocumentTitle from './DocumentTitle';\nimport FullWidthContainer from './FullWidthContainer';\nimport FDErrorBoundary from '../FDErrorBoundary/FDErrorBoundary';\nimport Button from '@mui/material/Button';\nimport { getMicroFrontendAttribute } from '../../renderUtilities';\nimport { joinUrlPaths } from '../../../utilities/validation';\nimport Spacer from '../Spacer/Spacer';\nimport Box from '@mui/material/Box';\nimport Divider from '@mui/material/Divider';\n\nexport const HORIZONTAL_SPACE_CLASSNAME = 'horizontal-content-space';\nexport const LEFT_HORIZONTAL_SPACE_CLASSNAME = 'left-horizontal-content-space';\nexport const RIGHT_HORIZONTAL_SPACE_CLASSNAME = 'right-horizontal-content-space';\nexport const VERTICAL_SPACE_CLASSNAME = 'vertical-content-space';\nexport const maxWidth = 1112;\nconst historyMinLength = 3;\n\nconst StyledWrapper = styled('div')<{ fluid: boolean }>(({ theme, fluid }) => ({\n maxWidth: fluid ? 'none' : maxWidth,\n [theme.breakpoints.down('md')]: {\n maxWidth: 'none',\n },\n padding: theme.spacing(2, 4),\n position: 'relative',\n minHeight: '100vh',\n}));\n\nconst StyledActionButtonGrid = styled(Grid)(({ theme }) => ({\n [theme.breakpoints.down('sm')]: {\n width: '100%',\n paddingTop: theme.spacing(2),\n },\n}));\n\nconst StyledHeader = styled(Grid)(({ theme }) => ({\n flexWrap: 'nowrap',\n alignItems: 'flex-start',\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingTop: theme.spacing(2),\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst StyledTitleContainer = styled(Grid)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst StyledTitleSection = styled(Grid)(() => ({\n flexGrow: 1,\n}));\n\nconst StyledTopSection = styled('div')(({ theme }) => ({\n maxWidth,\n paddingBottom: theme.spacing(3),\n\n [theme.breakpoints.down('md')]: {\n paddingBottom: theme.spacing(2),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n },\n}));\n\nconst StyledBackButton = styled(IconButton, {\n shouldForwardProp: (prop) => prop !== 'hasTitleComponent',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n})<{ hasTitleComponent: boolean; component: any }>(({ theme, hasTitleComponent }) => ({\n margin: hasTitleComponent ? theme.spacing(-0.75, 2, -1.5, -1.5) : theme.spacing(-1.5, 2, -1.5, -1.5),\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(-2),\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(-2),\n },\n}));\n\nconst StyledInnerWrapper = styled('div')(({ theme }) => ({\n maxWidth,\n marginLeft: theme.spacing(6),\n marginRight: theme.spacing(4),\n paddingBottom: theme.spacing(2),\n\n [theme.breakpoints.only('md')]: {\n marginLeft: 12,\n marginRight: theme.spacing(3),\n },\n\n [theme.breakpoints.only('sm')]: {\n marginLeft: theme.spacing(3),\n marginRight: theme.spacing(3),\n maxWidth: 'none',\n },\n\n [theme.breakpoints.only('xs')]: {\n marginLeft: theme.spacing(2),\n marginRight: theme.spacing(2),\n maxWidth: 'none',\n },\n}));\n\nconst StyledHeaderContainer = styled(Grid)(() => ({\n display: 'flex',\n flexGrow: 1,\n justifyContent: 'flex-end',\n}));\nconst StyledCaption = styled(Typography)<{ component: string }>(() => ({\n lineHeight: '26px',\n}));\n\nconst StyledPageTitle = styled(Typography)<{ component: string }>(() => ({\n fontWeight: 'bold',\n}));\n\nconst StyledPageDivider = styled(Divider)(({ theme }) => ({\n marginBottom: theme.spacing(4),\n}));\n\nexport const PageTitle = ({ title }: { title: string | ReactNode }) => (\n <StyledPageTitle variant=\"h5\" component=\"h2\">\n {title}\n </StyledPageTitle>\n);\n\nconst StyledPageContainer = styled('div')<{ useAlternateBackground: boolean }>(({ useAlternateBackground, theme }) => ({\n backgroundColor: useAlternateBackground ? theme.palette.alternateBackground.main : theme.palette.white.main,\n width: '100%',\n height: '100%',\n}));\n\nexport type Props = {\n actionBtnTitle?: string;\n caption?: ReactNode;\n children: ReactNode;\n contextButtons?: ReactNode[];\n documentTitle: string;\n fluid?: boolean;\n fullWidth?: boolean;\n header?: ReactNode;\n hideHeader?: boolean;\n actionButtonLink?: string;\n pageHeader?: ReactNode;\n showActionButton?: boolean;\n showAddIcon?: boolean;\n title: ReactNode;\n titleComponent?: ComponentType<React.PropsWithChildren<unknown>>;\n titleComponentAfter?: ReactNode;\n toPrevious?: boolean;\n toParent?: string;\n strictToParent?: boolean;\n openLinkInNewTab?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n navigate: (to: any) => void;\n hideDivider?: boolean;\n customActionButtons?: ReactNode[];\n useAlternateBackground?: boolean;\n};\n\nconst PageLayout = (props: Props) => {\n const {\n actionBtnTitle,\n caption,\n children,\n contextButtons,\n documentTitle,\n fluid = false,\n fullWidth,\n header,\n hideHeader,\n actionButtonLink,\n openLinkInNewTab = false,\n pageHeader,\n showActionButton,\n showAddIcon,\n title,\n titleComponent: TitleComponent,\n toPrevious,\n toParent,\n strictToParent,\n navigate,\n hideDivider = false,\n customActionButtons,\n useAlternateBackground = false,\n titleComponentAfter,\n } = props;\n const theme = useTheme();\n const isMobile = useMediaQuery(theme.breakpoints.down('md'));\n\n const baseUrl = getMicroFrontendAttribute('data-portal-base-url') || '/';\n const actionButtonWithHttps = actionButtonLink?.startsWith('https://');\n const getActionButtonLink = () => {\n if (actionButtonWithHttps) {\n return actionButtonLink;\n }\n if (actionButtonLink !== undefined) {\n return joinUrlPaths(baseUrl, actionButtonLink);\n }\n return '';\n };\n const actionButtonLinkFinal = getActionButtonLink();\n\n return (\n <StyledPageContainer useAlternateBackground={useAlternateBackground}>\n <StyledWrapper fluid={fluid}>\n {documentTitle && <DocumentTitle>{documentTitle}</DocumentTitle>}\n\n {pageHeader || null}\n <StyledInnerWrapper>\n {pageHeader && <Spacer size={16} variant=\"vertical\" />}\n {!hideHeader && (\n <>\n <StyledHeader container alignItems=\"center\" direction=\"column\">\n <Grid item container direction=\"row\" alignContent=\"space-between\">\n <StyledHeaderContainer item>\n {contextButtons?.map((button) => (\n <div\n key={`context-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {button}\n </div>\n ))}\n </StyledHeaderContainer>\n </Grid>\n <StyledTitleContainer item container>\n {(toParent || toPrevious) && (\n <Box>\n <StyledBackButton\n aria-label=\"Back\"\n data-testid=\"back_button\"\n hasTitleComponent={!!TitleComponent}\n component={'button'}\n onClick={() => {\n if (toPrevious) {\n navigate(-1);\n } else if (toParent && strictToParent) {\n navigate(toParent);\n } else if (toParent && history.length < historyMinLength) {\n navigate(toParent);\n } else {\n navigate(-1);\n }\n }}\n >\n <ArrowBackIcon />\n </StyledBackButton>\n </Box>\n )}\n\n <StyledTitleSection item>\n {TitleComponent ? (\n <TitleComponent />\n ) : (\n <Box display=\"flex\" alignItems=\"center\" gap={2}>\n <PageTitle title={title} />\n {titleComponentAfter}\n </Box>\n )}\n {caption && (\n <StyledCaption variant=\"caption\" component=\"h3\">\n {caption}\n </StyledCaption>\n )}\n </StyledTitleSection>\n\n {showActionButton && (\n <>\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n <StyledActionButtonGrid item>\n <Button\n variant=\"contained\"\n fullWidth={true}\n data-testid={`Action-button-${actionBtnTitle}`}\n href={openLinkInNewTab || actionButtonWithHttps ? actionButtonLinkFinal : ''}\n target={openLinkInNewTab ? '_blank' : undefined}\n rel={openLinkInNewTab ? 'noopener noreferrer' : undefined}\n onClick={\n !openLinkInNewTab && !actionButtonWithHttps ? () => navigate(actionButtonLink) : () => {}\n }\n >\n {showAddIcon && <Add />}\n {actionBtnTitle}\n </Button>\n </StyledActionButtonGrid>\n </>\n )}\n {customActionButtons?.map((button) => (\n <div\n key={`custom-action-button-${React.isValidElement(button) ? button.props?.['data-testid'] || button.props?.children : 'fallback'}`}\n >\n {isMobile && <Spacer size={56} variant=\"vertical\" />}\n {!isMobile && <Spacer size={16} variant=\"vertical\" />}\n <StyledActionButtonGrid item>{button}</StyledActionButtonGrid>\n </div>\n ))}\n </StyledTitleContainer>\n </StyledHeader>\n {!hideDivider && <StyledPageDivider />}\n </>\n )}\n <FullWidthContainer fullWidth={fullWidth}>\n {header ? <StyledTopSection>{header}</StyledTopSection> : null}\n <FDErrorBoundary identifier={documentTitle}>\n <>{children}</>\n </FDErrorBoundary>\n </FullWidthContainer>\n </StyledInnerWrapper>\n </StyledWrapper>\n </StyledPageContainer>\n );\n};\n\nexport default PageLayout;\n"],"names":["maxWidth","StyledWrapper","styled","theme","fluid","breakpoints","down","padding","spacing","position","minHeight","StyledActionButtonGrid","Grid","width","paddingTop","StyledHeader","flexWrap","alignItems","paddingBottom","StyledTitleContainer","StyledTitleSection","flexGrow","StyledTopSection","paddingLeft","paddingRight","StyledBackButton","IconButton","shouldForwardProp","prop","hasTitleComponent","margin","only","marginLeft","StyledInnerWrapper","marginRight","StyledHeaderContainer","display","justifyContent","StyledCaption","Typography","lineHeight","StyledPageTitle","fontWeight","StyledPageDivider","Divider","marginBottom","PageTitle","title","_jsx","variant","component","children","StyledPageContainer","useAlternateBackground","backgroundColor","palette","alternateBackground","main","white","height","props","actionBtnTitle","caption","contextButtons","documentTitle","fullWidth","header","hideHeader","actionButtonLink","openLinkInNewTab","pageHeader","showActionButton","showAddIcon","titleComponent","TitleComponent","toPrevious","toParent","strictToParent","navigate","hideDivider","customActionButtons","titleComponentAfter","useTheme","isMobile","useMediaQuery","baseUrl","getMicroFrontendAttribute","actionButtonWithHttps","startsWith","actionButtonLinkFinal","undefined","joinUrlPaths","jsx","_jsxs","DocumentTitle","Spacer","size","_Fragment","jsxs","container","direction","item","alignContent","map","button","React","isValidElement","Box","onClick","history","length","ArrowBackIcon","gap","Button","href","target","rel","Add","FullWidthContainer","FDErrorBoundary","identifier"],"mappings":"0vBAwBO,MAAMA,EAAW,KAGlBC,EAAgBC,EAAMA,OAAC,MAAPA,EAAkC,EAAGC,QAAOC,YAAa,CAC3EJ,SAAUI,EAAQ,OAASJ,EAC3B,CAACG,EAAME,YAAYC,KAAK,OAAQ,CAC5BN,SAAU,QAEdO,QAASJ,EAAMK,QAAQ,EAAG,GAC1BC,SAAU,WACVC,UAAW,YAGTC,EAAyBT,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CACxD,CAACA,EAAME,YAAYC,KAAK,OAAQ,CAC5BO,MAAO,OACPC,WAAYX,EAAMK,QAAQ,QAI5BO,EAAeb,EAAAA,OAAOU,EAAPV,EAAa,EAAGC,YAAa,CAC9Ca,SAAU,SACVC,WAAY,aACZH,WAAYX,EAAMK,QAAQ,GAC1BU,cAAef,EAAMK,QAAQ,GAE7B,CAACL,EAAME,YAAYC,KAAK,OAAQ,CAC5BQ,WAAYX,EAAMK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C,MAAOA,IACjBkC,KAGRnB,GACGd,EAAAA,IAACV,EAAa,CAACW,QAAQ,UAAUC,UAAU,KAAIC,SAC1CW,OAKZS,GACGsB,EACKK,KAAAD,WAAA,CAAA9C,SAAA,CAAAgC,IAAYnC,EAAAA,IAAC+C,EAAM,CAACC,KAAM,GAAI/C,QAAQ,aACvCD,EAAA4C,IAACjF,EAAsB,CAAC0F,MACpB,EAAAlD,SAAA0C,EAAAA,KAACoB,EAAM,CACHhE,QAAQ,YACRgB,WAAW,EAAI,cACF,iBAAiBJ,IAC9BqD,KAAM7C,GAAoBkB,GAAwBE,GAAwB,GAC1E0B,OAAQ9C,EAAmB,cAAWqB,EACtC0B,IAAK/C,EAAmB,2BAAwBqB,EAChDkB,QACKvC,GAAqBkB,GAA2D,OAAnC,IAAMT,EAASV,aAGhEI,GAAexB,EAAAA,IAACqE,MAChBxD,UAKhBmB,GAAqBuB,KAAKC,GACvBX,EAAAA,KAGK,MAAA,CAAA1C,SAAA,CAAAgC,IAAYnC,MAAC+C,EAAO,CAAAC,KAAM,GAAI/C,QAAQ,cACrCkC,IAAYnC,EAAAA,IAAC+C,EAAO,CAAAC,KAAM,GAAI/C,QAAQ,aACxCD,EAAC4C,IAAAjF,GAAuB0F,MAAI,EAAAlD,SAAEqD,MAJzB,wBAAwBC,EAAMC,eAAeF,GAAUA,EAAO5C,QAAQ,gBAAkB4C,EAAO5C,OAAOT,SAAW,uBASpI4B,GAAe/B,MAACL,SAG1BkD,EAAAK,KAACoB,EAAmB,CAAArD,UAAWA,YAC1BC,EAASlB,EAAAA,IAAC1B,EAAgB,CAAA6B,SAAEe,IAA6B,KAC1DlB,MAACuE,EAAe,CAACC,WAAYxD,EACzBb,SAAAH,EAAA4C,IAAAK,WAAA,CAAA9C,SAAGA,gBAMzB"}
@@ -1,2 +1,2 @@
1
- import{jsx as i,jsxs as t,Fragment as n}from"react/jsx-runtime";import"react";import e from"@mui/icons-material/Add";import r from"@mui/icons-material/ArrowBack";import a from"@mui/material/Grid";import o from"@mui/material/IconButton";import{styled as d,useTheme as m}from"@mui/material/styles";import l from"@mui/material/Typography";import p from"@mui/material/useMediaQuery";import c from"./DocumentTitle.js";import s from"./FullWidthContainer.js";import h from"../FDErrorBoundary/FDErrorBoundary.js";import g from"@mui/material/Button";import{getMicroFrontendAttribute as u}from"../../renderUtilities/renderUtilities.js";import{joinUrlPaths as f}from"../../../utilities/validation.js";import v from"../Spacer/Spacer.js";import k from"@mui/material/Box";import B from"@mui/material/Divider";const b=1112,x=d("div")((({theme:i,fluid:t})=>({maxWidth:t?"none":b,[i.breakpoints.down("md")]:{maxWidth:"none"},padding:i.spacing(2,4),position:"relative",minHeight:"100vh"}))),w=d(a)((({theme:i})=>({[i.breakpoints.down("sm")]:{width:"100%",paddingTop:i.spacing(2)}}))),y=d(a)((({theme:i})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:i.spacing(3),paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingTop:i.spacing(2),paddingBottom:i.spacing(3)}}))),T=d(a)((({theme:i})=>({paddingTop:i.spacing(2)}))),W=d(a)((()=>({flexGrow:1}))),C=d("div")((({theme:i})=>({maxWidth:b,paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingBottom:i.spacing(2),paddingLeft:i.spacing(2),paddingRight:i.spacing(2)}}))),A=d(o,{shouldForwardProp:i=>"hasTitleComponent"!==i})((({theme:i,hasTitleComponent:t})=>({margin:t?i.spacing(-.75,2,-1.5,-1.5):i.spacing(-1.5,2,-1.5,-1.5),[i.breakpoints.only("sm")]:{marginLeft:i.spacing(-2)},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(-2)}}))),L=d("div")((({theme:i})=>({maxWidth:b,marginLeft:i.spacing(6),marginRight:i.spacing(4),paddingBottom:i.spacing(2),[i.breakpoints.only("md")]:{marginLeft:12,marginRight:i.spacing(3)},[i.breakpoints.only("sm")]:{marginLeft:i.spacing(3),marginRight:i.spacing(3),maxWidth:"none"},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(2),marginRight:i.spacing(2),maxWidth:"none"}}))),j=d(a)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),I=d(l)((()=>({lineHeight:"26px"}))),D=d(l)((()=>({fontWeight:"bold"}))),R=d(B)((({theme:i})=>({marginBottom:i.spacing(4)}))),z=({title:t})=>i(D,{variant:"h5",component:"h2",children:t}),F=d("div")((({useAlternateBackground:i,theme:t})=>({backgroundColor:i?t.palette.alternateBackground.main:t.palette.white.main,width:"100%",height:"100%"}))),H=o=>{const{actionBtnTitle:d,caption:l,children:B,contextButtons:b,documentTitle:D,fluid:H=!1,fullWidth:P,header:G,hideHeader:E,actionButtonLink:S,openLinkInNewTab:U=!1,pageHeader:_,showActionButton:M,showAddIcon:N,title:Q,titleComponent:$,toPrevious:q,toParent:J,strictToParent:K,navigate:O,hideDivider:V=!1,customActionButtons:X,useAlternateBackground:Y=!1,titleComponentAfter:Z}=o,ii=m(),ti=p(ii.breakpoints.down("md")),ni=u("data-portal-base-url")||"/",ei=S?.startsWith("https://"),ri=ei?S:void 0!==S?f(ni,S):"";return i(F,{useAlternateBackground:Y,children:t(x,{fluid:H,children:[D&&i(c,{children:D}),_||null,t(L,{children:[_&&i(v,{size:16,variant:"vertical"}),!E&&t(n,{children:[t(y,{container:!0,alignItems:"center",direction:"column",children:[i(a,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:i(j,{item:!0,children:b&&b.map(((t,n)=>i("div",{children:t},n)))})}),t(T,{item:!0,container:!0,children:[(J||q)&&i(k,{children:i(A,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!$,component:"button",onClick:()=>{q?O(-1):J&&K||J&&history.length<3?O(J):O(-1)},children:i(r,{})})}),t(W,{item:!0,children:[$?i($,{}):i(n,{children:t(k,{display:"flex",alignItems:"center",gap:2,children:[i(z,{title:Q}),Z]})}),l&&i(I,{variant:"caption",component:"h3",children:l})]}),M&&t(n,{children:[ti&&i(v,{size:56,variant:"vertical"}),i(w,{item:!0,children:t(g,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${d}`,href:U||ei?ri:"",target:U?"_blank":void 0,rel:U?"noopener noreferrer":void 0,onClick:U||ei?()=>{}:()=>O(S),children:[N&&i(e,{}),d]})})]}),X&&X.map(((n,e)=>t("div",{children:[ti&&i(v,{size:56,variant:"vertical"}),!ti&&i(v,{size:16,variant:"vertical"}),i(w,{item:!0,children:n})]},e)))]})]}),!V&&i(R,{})]}),t(s,{fullWidth:P,children:[G?i(C,{children:G}):null,i(h,{identifier:D,children:i(n,{children:B})})]})]})]})})};export{z as PageTitle,H as default,b as maxWidth};
1
+ import{jsx as i,jsxs as t,Fragment as n}from"react/jsx-runtime";import e from"react";import a from"@mui/icons-material/Add";import r from"@mui/icons-material/ArrowBack";import o from"@mui/material/Grid";import d from"@mui/material/IconButton";import{styled as m,useTheme as l}from"@mui/material/styles";import p from"@mui/material/Typography";import c from"@mui/material/useMediaQuery";import s from"./DocumentTitle.js";import h from"./FullWidthContainer.js";import g from"../FDErrorBoundary/FDErrorBoundary.js";import u from"@mui/material/Button";import{getMicroFrontendAttribute as f}from"../../renderUtilities/renderUtilities.js";import{joinUrlPaths as v}from"../../../utilities/validation.js";import b from"../Spacer/Spacer.js";import k from"@mui/material/Box";import B from"@mui/material/Divider";const x=1112,w=m("div")((({theme:i,fluid:t})=>({maxWidth:t?"none":x,[i.breakpoints.down("md")]:{maxWidth:"none"},padding:i.spacing(2,4),position:"relative",minHeight:"100vh"}))),y=m(o)((({theme:i})=>({[i.breakpoints.down("sm")]:{width:"100%",paddingTop:i.spacing(2)}}))),T=m(o)((({theme:i})=>({flexWrap:"nowrap",alignItems:"flex-start",paddingTop:i.spacing(3),paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingTop:i.spacing(2),paddingBottom:i.spacing(3)}}))),W=m(o)((({theme:i})=>({paddingTop:i.spacing(2)}))),C=m(o)((()=>({flexGrow:1}))),A=m("div")((({theme:i})=>({maxWidth:x,paddingBottom:i.spacing(3),[i.breakpoints.down("md")]:{paddingBottom:i.spacing(2),paddingLeft:i.spacing(2),paddingRight:i.spacing(2)}}))),L=m(d,{shouldForwardProp:i=>"hasTitleComponent"!==i})((({theme:i,hasTitleComponent:t})=>({margin:t?i.spacing(-.75,2,-1.5,-1.5):i.spacing(-1.5,2,-1.5,-1.5),[i.breakpoints.only("sm")]:{marginLeft:i.spacing(-2)},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(-2)}}))),j=m("div")((({theme:i})=>({maxWidth:x,marginLeft:i.spacing(6),marginRight:i.spacing(4),paddingBottom:i.spacing(2),[i.breakpoints.only("md")]:{marginLeft:12,marginRight:i.spacing(3)},[i.breakpoints.only("sm")]:{marginLeft:i.spacing(3),marginRight:i.spacing(3),maxWidth:"none"},[i.breakpoints.only("xs")]:{marginLeft:i.spacing(2),marginRight:i.spacing(2),maxWidth:"none"}}))),I=m(o)((()=>({display:"flex",flexGrow:1,justifyContent:"flex-end"}))),D=m(p)((()=>({lineHeight:"26px"}))),R=m(p)((()=>({fontWeight:"bold"}))),z=m(B)((({theme:i})=>({marginBottom:i.spacing(4)}))),E=({title:t})=>i(R,{variant:"h5",component:"h2",children:t}),F=m("div")((({useAlternateBackground:i,theme:t})=>({backgroundColor:i?t.palette.alternateBackground.main:t.palette.white.main,width:"100%",height:"100%"}))),H=d=>{const{actionBtnTitle:m,caption:p,children:B,contextButtons:x,documentTitle:R,fluid:H=!1,fullWidth:P,header:G,hideHeader:$,actionButtonLink:S,openLinkInNewTab:U=!1,pageHeader:V,showActionButton:_,showAddIcon:M,title:N,titleComponent:Q,toPrevious:q,toParent:J,strictToParent:K,navigate:O,hideDivider:X=!1,customActionButtons:Y,useAlternateBackground:Z=!1,titleComponentAfter:ii}=d,ti=l(),ni=c(ti.breakpoints.down("md")),ei=f("data-portal-base-url")||"/",ai=S?.startsWith("https://"),ri=ai?S:void 0!==S?v(ei,S):"";return i(F,{useAlternateBackground:Z,children:t(w,{fluid:H,children:[R&&i(s,{children:R}),V||null,t(j,{children:[V&&i(b,{size:16,variant:"vertical"}),!$&&t(n,{children:[t(T,{container:!0,alignItems:"center",direction:"column",children:[i(o,{item:!0,container:!0,direction:"row",alignContent:"space-between",children:i(I,{item:!0,children:x?.map((t=>i("div",{children:t},`context-button-${e.isValidElement(t)?t.props?.["data-testid"]||t.props?.children:"fallback"}`)))})}),t(W,{item:!0,container:!0,children:[(J||q)&&i(k,{children:i(L,{"aria-label":"Back","data-testid":"back_button",hasTitleComponent:!!Q,component:"button",onClick:()=>{q?O(-1):J&&K||J&&history.length<3?O(J):O(-1)},children:i(r,{})})}),t(C,{item:!0,children:[Q?i(Q,{}):t(k,{display:"flex",alignItems:"center",gap:2,children:[i(E,{title:N}),ii]}),p&&i(D,{variant:"caption",component:"h3",children:p})]}),_&&t(n,{children:[ni&&i(b,{size:56,variant:"vertical"}),i(y,{item:!0,children:t(u,{variant:"contained",fullWidth:!0,"data-testid":`Action-button-${m}`,href:U||ai?ri:"",target:U?"_blank":void 0,rel:U?"noopener noreferrer":void 0,onClick:U||ai?()=>{}:()=>O(S),children:[M&&i(a,{}),m]})})]}),Y?.map((n=>t("div",{children:[ni&&i(b,{size:56,variant:"vertical"}),!ni&&i(b,{size:16,variant:"vertical"}),i(y,{item:!0,children:n})]},`custom-action-button-${e.isValidElement(n)?n.props?.["data-testid"]||n.props?.children:"fallback"}`)))]})]}),!X&&i(z,{})]}),t(h,{fullWidth:P,children:[G?i(A,{children:G}):null,i(g,{identifier:R,children:i(n,{children:B})})]})]})]})})};export{E as PageTitle,H as default,x as maxWidth};
2
2
  //# sourceMappingURL=PageLayout.js.map