CE-752 Final style updates for helpContent

This commit is contained in:
2023-12-13 15:19:46 -06:00
parent fc5637b133
commit be393884cc
4 changed files with 33 additions and 22 deletions

View File

@ -48,7 +48,7 @@ const tooltip: Types = {
borderRadius: borderRadius.md, borderRadius: borderRadius.md,
opacity: 0.7, opacity: 0.7,
padding: "1rem", padding: "1rem",
boxShadow: "rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px" boxShadow: "0px 0px 12px rgba(128, 128, 128, 0.40)"
}, },
arrow: { arrow: {

View File

@ -108,10 +108,10 @@ function QDynamicForm({formData, formLabel, bulkEditMode, bulkEditSwitchChangeHa
let formattedHelpContent = <HelpContent helpContents={field.fieldMetaData.helpContents} roles={helpRoles} helpContentKey={`${helpContentKeyPrefix ?? ""}field:${fieldName}`} />; let formattedHelpContent = <HelpContent helpContents={field.fieldMetaData.helpContents} roles={helpRoles} helpContentKey={`${helpContentKeyPrefix ?? ""}field:${fieldName}`} />;
if(formattedHelpContent) if(formattedHelpContent)
{ {
formattedHelpContent = <Box color="#757575" fontSize="0.875rem" mt="-0.5rem">{formattedHelpContent}</Box> formattedHelpContent = <Box color="#757575" fontSize="0.875rem" mt="-0.25rem">{formattedHelpContent}</Box>
} }
const labelElement = <Box fontSize="1rem" fontWeight="500"> const labelElement = <Box fontSize="1rem" fontWeight="500" marginBottom="0.25rem">
<label htmlFor={field.name}>{field.label}</label> <label htmlFor={field.name}>{field.label}</label>
</Box> </Box>

View File

@ -50,6 +50,7 @@ interface Props
bulkEditMode?: boolean; bulkEditMode?: boolean;
bulkEditSwitchChangeHandler?: any; bulkEditSwitchChangeHandler?: any;
otherValues?: Map<string, any>; otherValues?: Map<string, any>;
variant: "standard" | "outlined";
} }
DynamicSelect.defaultProps = { DynamicSelect.defaultProps = {
@ -64,6 +65,7 @@ DynamicSelect.defaultProps = {
isMultiple: false, isMultiple: false,
bulkEditMode: false, bulkEditMode: false,
otherValues: new Map<string, any>(), otherValues: new Map<string, any>(),
variant: "outlined",
bulkEditSwitchChangeHandler: () => bulkEditSwitchChangeHandler: () =>
{ {
}, },
@ -71,7 +73,7 @@ DynamicSelect.defaultProps = {
const qController = Client.getInstance(); const qController = Client.getInstance();
function DynamicSelect({tableName, processName, fieldName, overrideId, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler, otherValues}: Props) function DynamicSelect({tableName, processName, fieldName, overrideId, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler, otherValues, variant}: Props)
{ {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const [options, setOptions] = useState<readonly QPossibleValue[]>([]); const [options, setOptions] = useState<readonly QPossibleValue[]>([]);
@ -246,28 +248,35 @@ function DynamicSelect({tableName, processName, fieldName, overrideId, fieldLabe
bulkEditSwitchChangeHandler(fieldName, newSwitchValue); bulkEditSwitchChangeHandler(fieldName, newSwitchValue);
}; };
// console.log(`default value: ${JSON.stringify(defaultValue)}`); ////////////////////////////////////////////
// for outlined style, adjust some styles //
////////////////////////////////////////////
let autocompleteSX = {};
if (variant == "outlined")
{
autocompleteSX = {
"& .MuiOutlinedInput-root": {
borderRadius: "0.75rem",
},
"& .MuiInputBase-root": {
padding: "0.5rem",
background: isDisabled ? "#f0f2f5!important" : "initial",
},
"& .MuiOutlinedInput-root .MuiAutocomplete-input": {
padding: "0",
fontSize: "1rem"
},
"& .Mui-disabled .MuiOutlinedInput-notchedOutline": {
borderColor: inputBorderColor
}
}
}
const autocomplete = ( const autocomplete = (
<Box> <Box>
<Autocomplete <Autocomplete
id={overrideId ?? fieldName} id={overrideId ?? fieldName}
sx={{ sx={autocompleteSX}
"& .MuiOutlinedInput-root": {
borderRadius: "0.75rem",
},
"& .MuiInputBase-root": {
padding: "0.5rem",
background: isDisabled ? "#f0f2f5!important" : "initial",
},
"& .MuiOutlinedInput-root .MuiAutocomplete-input": {
padding: "0",
fontSize: "1rem"
},
"& .Mui-disabled .MuiOutlinedInput-notchedOutline": {
borderColor: inputBorderColor
}
}}
open={open} open={open}
fullWidth fullWidth
onOpen={() => onOpen={() =>
@ -322,7 +331,7 @@ function DynamicSelect({tableName, processName, fieldName, overrideId, fieldLabe
<TextField <TextField
{...params} {...params}
label={fieldLabel} label={fieldLabel}
variant="outlined" variant={variant}
autoComplete="off" autoComplete="off"
type="search" type="search"
InputProps={{ InputProps={{

View File

@ -215,6 +215,7 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
initialDisplayValue={selectedPossibleValue?.label} initialDisplayValue={selectedPossibleValue?.label}
inForm={false} inForm={false}
onChange={(value: any) => valueChangeHandler(null, 0, value)} onChange={(value: any) => valueChangeHandler(null, 0, value)}
variant="standard"
/> />
</Box>; </Box>;
case ValueMode.PVS_MULTI: case ValueMode.PVS_MULTI:
@ -242,6 +243,7 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
initialValues={initialValues} initialValues={initialValues}
inForm={false} inForm={false}
onChange={(value: any) => valueChangeHandler(null, "all", value)} onChange={(value: any) => valueChangeHandler(null, "all", value)}
variant="standard"
/> />
</Box>; </Box>;
} }