@evoke-platform/ui-components 1.10.0-dev.22 → 1.10.0-dev.23

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.
@@ -155,7 +155,6 @@ const FormRendererInternal = (props) => {
155
155
  errors,
156
156
  hasAccordions: hasSections && isSmallerThanMd,
157
157
  shouldShowValidationErrors: isSubmitted,
158
- isDeleteForm: form.id === '',
159
158
  action,
160
159
  validationContainerRef: validationContainerRef,
161
160
  autosaveEnabled: !!form.autosaveActionId,
@@ -213,7 +212,7 @@ const FormRendererInternal = (props) => {
213
212
  expandedSections,
214
213
  hasAccordions: hasSections && isSmallerThanMd,
215
214
  } })),
216
- (actionId || form.id === 'documentForm') &&
215
+ (action || form.id === 'documentForm') &&
217
216
  onSubmit &&
218
217
  (renderFooter ? renderFooter(footerProps) : React.createElement(Footer, { ...footerProps }))))));
219
218
  };
@@ -135,7 +135,7 @@ function FormRendererContainer(props) {
135
135
  entries: [
136
136
  {
137
137
  type: 'content',
138
- html: `<p>You are about to delete <strong>${instance?.name}</strong>. Deleted records can't be restored. Are you sure you want to continue?</p>`,
138
+ html: `<p style="padding-top: 24px; padding-bottom: 24px;">You are about to delete <strong>${instance?.name}</strong>. Deleted records can't be restored. Are you sure you want to continue?</p>`,
139
139
  },
140
140
  ],
141
141
  objectId: objectId,
@@ -6,7 +6,7 @@ import { Box } from '../../../layout';
6
6
  import { FormContext } from './FormContext';
7
7
  /* Default FormRenderer Footer. Displays a submit button and cancel changes button. */
8
8
  export const Footer = (props) => {
9
- const { action, sx } = props;
9
+ const { sx } = props;
10
10
  const { width } = useContext(FormContext);
11
11
  const { isBelow, breakpoints } = useWidgetSize({
12
12
  scroll: false,
@@ -20,9 +20,12 @@ export const Footer = (props) => {
20
20
  padding: isSmallerThanMd ? '16px' : '20px',
21
21
  justifyContent: isXs ? 'center' : 'flex-end',
22
22
  alignItems: 'center',
23
- borderTop: action?.type !== 'delete' ? '1px solid #f4f6f8' : 'none',
23
+ borderTop: '1px solid #f4f6f8',
24
24
  borderRadius: '0px 0px 6px 6px',
25
25
  zIndex: 3,
26
+ width: '100%',
27
+ // this will ensure footer does not exceed form width when form has padding
28
+ maxWidth: width - (isSmallerThanMd ? 32 : 40),
26
29
  ...sx,
27
30
  } },
28
31
  React.createElement(FooterActions, { ...props })));
@@ -84,7 +84,7 @@ export const ActionDialog = (props) => {
84
84
  objectId: relatedParameter.objectId, onSubmit: handleFormSave, onDiscardChanges: onClose, onSubmitError: handleSaveError, richTextEditor: richTextEditor, associatedObject: associatedObject, renderHeader: (formHeaderProps) => {
85
85
  return (React.createElement(DialogTitle, { sx: {
86
86
  ...styles.dialogTitle,
87
- borderBottom: action.type === 'delete' ? undefined : '1px solid #e9ecef',
87
+ borderBottom: '1px solid #e9ecef',
88
88
  } },
89
89
  action && hasAccess && !loading ? action?.name : '',
90
90
  React.createElement(IconButton, { sx: styles.closeIcon, onClick: onClose, "aria-label": "Close" },
@@ -99,7 +99,7 @@ export const ActionDialog = (props) => {
99
99
  React.createElement("div", { ref: validationErrorsRef }, !isEmpty(bodyProps.errors) && bodyProps.shouldShowValidationErrors ? (React.createElement(ValidationErrors, { errors: bodyProps.errors, sx: {
100
100
  my: isSm || isXs ? 2 : 3,
101
101
  } })) : null),
102
- React.createElement(Body, { ...bodyProps, sx: { padding: 0 } }))), renderFooter: (footerProps) => (React.createElement(DialogActions, { sx: { padding: 0 } },
102
+ React.createElement(Body, { ...bodyProps, sx: { padding: 0 } }))), renderFooter: (footerProps) => (React.createElement(DialogActions, { sx: { padding: 0, margin: 0 } },
103
103
  React.createElement(Footer, { ...footerProps, discardChangesButtonLabel: "Cancel" }))), renderContainer: ({ status, error, defaultContainer }) => (React.createElement(React.Fragment, null,
104
104
  status === 'ready' && defaultContainer,
105
105
  status === 'loading' && (React.createElement(DialogContent, null,
@@ -11,14 +11,6 @@ export type HeaderProps = {
11
11
  expandedSections?: ExpandedSection[];
12
12
  onExpandAll?: () => void;
13
13
  onCollapseAll?: () => void;
14
- /**
15
- * Indicates whether this is a "delete form".
16
- * This flag adjusts header styling specifically for delete forms.
17
- *
18
- * @warning This prop is temporary and will be removed
19
- * when delete form styling is finalized.
20
- */
21
- isDeleteForm?: boolean;
22
14
  errors?: FieldErrors;
23
15
  action?: Action;
24
16
  autosaving?: boolean;
@@ -7,7 +7,7 @@ import { Typography } from '../../../core/Typography';
7
7
  import Box from '../../../layout/Box/Box';
8
8
  import ValidationErrors from './ValidationFiles/ValidationErrors';
9
9
  const Header = (props) => {
10
- const { title, errors, hasAccordions, shouldShowValidationErrors, validationContainerRef, sx, isDeleteForm, autosaveEnabled, } = props;
10
+ const { title, errors, hasAccordions, shouldShowValidationErrors, validationContainerRef, sx, autosaveEnabled } = props;
11
11
  const { width } = useFormContext();
12
12
  const { breakpoints, isBelow } = useWidgetSize({
13
13
  scroll: false,
@@ -24,8 +24,7 @@ const Header = (props) => {
24
24
  alignItems: 'center',
25
25
  flexWrap: 'wrap',
26
26
  paddingY: isSm || isXs ? 2 : 3,
27
- // when rendering the default delete action, we don't want a border
28
- borderBottom: isDeleteForm ? undefined : '1px solid #e9ecef',
27
+ borderBottom: '1px solid #e9ecef',
29
28
  gap: isSm || isXs ? 2 : 3,
30
29
  ...sx,
31
30
  }, ref: validationContainerRef },
@@ -563,6 +563,8 @@ export const mockEvokeForm = {
563
563
  display: {
564
564
  label: 'Collection',
565
565
  createActionId: '_create',
566
+ deleteActionId: '_delete',
567
+ deleteFormId: '_auto_',
566
568
  createFormId: 'customerCreateForm',
567
569
  },
568
570
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.10.0-dev.22",
3
+ "version": "1.10.0-dev.23",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",