@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.
- package/dist/7cb5b036a5bc98d2.gif +0 -0
- package/dist/assets/images/fd-loader.gif.cjs.js +2 -0
- package/dist/assets/images/fd-loader.gif.cjs.js.map +1 -0
- package/dist/assets/images/fd-loader.gif.js +2 -0
- package/dist/assets/images/fd-loader.gif.js.map +1 -0
- package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js +1 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.cjs.js.map +1 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.d.ts +2 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.js +1 -1
- package/dist/components/custom-hooks/useMicroFrontendAttributes.js.map +1 -1
- package/dist/components/custom-hooks/useRenderValidText.cjs.js +1 -1
- package/dist/components/custom-hooks/useRenderValidText.cjs.js.map +1 -1
- package/dist/components/custom-hooks/useRenderValidText.d.ts +5 -4
- package/dist/components/custom-hooks/useRenderValidText.js +1 -1
- package/dist/components/custom-hooks/useRenderValidText.js.map +1 -1
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/renderUtilities/renderUtilities.cjs.js +1 -1
- package/dist/components/renderUtilities/renderUtilities.cjs.js.map +1 -1
- package/dist/components/renderUtilities/renderUtilities.js +1 -1
- package/dist/components/renderUtilities/renderUtilities.js.map +1 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js +1 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.cjs.js.map +1 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js +1 -1
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js.map +1 -1
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js +2 -0
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.cjs.js.map +1 -0
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.d.ts +10 -0
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js +2 -0
- package/dist/components/ui/FlipdishLogoLoader/FlipdishLogoLoader.js.map +1 -0
- package/dist/components/ui/Form/FormItemLayout.cjs.js.map +1 -1
- package/dist/components/ui/Form/FormItemLayout.js.map +1 -1
- package/dist/components/ui/Form/GenericAutocompleteField.cjs.js +1 -1
- package/dist/components/ui/Form/GenericAutocompleteField.cjs.js.map +1 -1
- package/dist/components/ui/Form/GenericAutocompleteField.js +1 -1
- package/dist/components/ui/Form/GenericAutocompleteField.js.map +1 -1
- package/dist/components/ui/Form/GenericFormContainer.cjs.js +1 -1
- package/dist/components/ui/Form/GenericFormContainer.cjs.js.map +1 -1
- package/dist/components/ui/Form/GenericFormContainer.js +1 -1
- package/dist/components/ui/Form/GenericFormContainer.js.map +1 -1
- package/dist/components/ui/Form/GenericTextField.cjs.js +1 -1
- package/dist/components/ui/Form/GenericTextField.cjs.js.map +1 -1
- package/dist/components/ui/Form/GenericTextField.js +1 -1
- package/dist/components/ui/Form/GenericTextField.js.map +1 -1
- package/dist/components/ui/Form/utilities/formValidation.cjs.js.map +1 -1
- package/dist/components/ui/Form/utilities/formValidation.js.map +1 -1
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js +2 -0
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.cjs.js.map +1 -0
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.d.ts +22 -0
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js +2 -0
- package/dist/components/ui/GenericDatePickerField/GenericDateFieldBase.js.map +1 -0
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js +1 -1
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.cjs.js.map +1 -1
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.d.ts +3 -17
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.js +1 -1
- package/dist/components/ui/GenericDatePickerField/GenericDatePickerField.js.map +1 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js +1 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.cjs.js.map +1 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.d.ts +3 -17
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.js +1 -1
- package/dist/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.js.map +1 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js +1 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.cjs.js.map +1 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js +1 -1
- package/dist/components/ui/GenericRadioButtons/GenericRadioButtons.js.map +1 -1
- package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js +1 -1
- package/dist/components/ui/GenericTableBody/GenericTableBody.cjs.js.map +1 -1
- package/dist/components/ui/GenericTableBody/GenericTableBody.js +1 -1
- package/dist/components/ui/GenericTableBody/GenericTableBody.js.map +1 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js +1 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.cjs.js.map +1 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.js +1 -1
- package/dist/components/ui/GenericTableBodyRow/GenericTableBodyRow.js.map +1 -1
- package/dist/components/ui/PageLayout/PageLayout.cjs.js +1 -1
- package/dist/components/ui/PageLayout/PageLayout.cjs.js.map +1 -1
- package/dist/components/ui/PageLayout/PageLayout.js +1 -1
- package/dist/components/ui/PageLayout/PageLayout.js.map +1 -1
- package/dist/components/ui/Spacer/Spacer.cjs.js.map +1 -1
- package/dist/components/ui/Spacer/Spacer.js.map +1 -1
- package/dist/providers/TranslationProvider.cjs.js.map +1 -1
- package/dist/providers/TranslationProvider.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenericDateTimePickerField.cjs.js","sources":["../../../../src/components/ui/GenericDateTimePickerField/GenericDateTimePickerField.tsx"],"sourcesContent":["import {
|
|
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 {
|
|
3
|
-
import moment from 'moment';
|
|
2
|
+
import { GenericDateFieldBaseProps } from '../GenericDatePickerField/GenericDateFieldBase.js';
|
|
4
3
|
|
|
5
|
-
type Props =
|
|
6
|
-
|
|
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{
|
|
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 {
|
|
1
|
+
{"version":3,"file":"GenericDateTimePickerField.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"),
|
|
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
|
|
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
|
|
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
|
|
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,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,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,EAAC7B,GAAI8B,GAAI,CAAEC,aAAyB,eAAXZ,EAA0B,OAAS,GAAGa,SAAA,CAC3DC,EAACC,EAAU,CACPT,KAAK,sBACLG,MAAOb,EAAMa,MACbX,SAAWkB,IAEPnB,EAAKoB,cAAcrB,EAAMU,KAAMU,EAAEE,OAAOT,OACpCX,GACAA,EAASkB,EACZ,EACJH,SAEAd,EAAQoB,KAAKC,GACVV,EACI,MAAA,CAAAG,SAAA,CAAAC,EAACO,EAAiB,CAAAZ,MAAOW,EAAOX,MAAOa,QAASR,EAACS,MAAUC,MAAOJ,EAAOI,MAAOC,SAAUrB,GAAgBgB,EAAOK,WAChHL,EAAOM,iBAAmB9B,EAAMa,QAAUW,EAAOX,OAC9CC,EAAC/B,EAAqB,CAAAkC,SAAA,CACjBO,EAAOM,gBACRZ,EAACa,GAAOC,KAAM,EAAGC,QAAQ,oBAL3BT,EAAOX,WAWzBK,EAAC7B,EAAiB,CAAAI,UAAWA,EAASwB,SAE1BxB,GACAY,EADkBM,OACtB,MAKd,EAGAuB,EAAsB,EAAGN,QAAOO,YAAW/B,SAAQF,WAAUC,UAASE,2BAA0B,MAClG,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"),
|
|
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
|
|
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,GAAK,IACrCC,EAAiB,CACnBnB,QACAE,QA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"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
|
|
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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AMA,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:
|
|
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
|
|
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
|
|
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
|
|
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")
|
|
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,QAA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9BqD,KAAM7C,GAAoBkB,GAAwBE,GAAwB,GAC1E0B,OAAQ9C,EAAmB,cAAWqB,EACtC0B,IAAK/C,EAAmB,2BAAwBqB,EAChDkB,QACKvC,GAAqBkB,GAA2D,OAAnC,IAAMT,EAASV,aAGhEI,GAAexB,EAAAA,IAACqE,EAAG,CAAA,GACnBxD,UAKhBmB,GACGA,EAAoBwB,KAAI,CAACC,EAAQC,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,YAA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AAA,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
|
|
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
|