Skip to content
Draft
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
5a2086a
fix: components space
czwe-01 Aug 8, 2025
891b925
drag-wrapper min-height adjusted
czwe-01 Aug 8, 2025
b7e5cb7
button group
czwe-01 Aug 11, 2025
adbc29e
ignoring inputs height %
czwe-01 Aug 13, 2025
3ad5778
refactor
czwe-01 Aug 18, 2025
3873eb5
checkbox styling in progress
czwe-01 Aug 18, 2025
9bb8876
clean up
czwe-01 Aug 18, 2025
91ab91f
checkbox restore
czwe-01 Aug 18, 2025
6eec4fd
fix: panel height
czwe-01 Aug 18, 2025
0918b55
update for handling file and
czwe-01 Aug 28, 2025
fde6d82
en: inputs height
czwe-01 Aug 29, 2025
e0d53bd
checkbox cleanup
czwe-01 Aug 29, 2025
f726afe
rm unused variable
czwe-01 Aug 29, 2025
8d4d95c
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Aug 29, 2025
b79190e
collapse and tabs height
czwe-01 Aug 29, 2025
4a4a1ec
Merge branch 'thulasizwe/en/canvas' into thulasizwe/en/form-component…
czwe-01 Aug 29, 2025
23e0fc3
with zoom hotkeys
czwe-01 Aug 29, 2025
ee63a2b
rm z-index on zoom button
czwe-01 Aug 29, 2025
6cb1a9d
style adjustments
czwe-01 Sep 1, 2025
d4faaf0
ui cleanup - smaller toolbar buttons, fileList styles fix
czwe-01 Sep 1, 2025
9052ae8
smaller font-size
czwe-01 Sep 2, 2025
4507c0d
need margin clean up
czwe-01 Sep 4, 2025
c4e46a0
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Sep 4, 2025
fe73db8
fine margin
czwe-01 Sep 4, 2025
885135d
some fixes on panels and canvas
czwe-01 Sep 8, 2025
fa9d8f8
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Sep 8, 2025
bd51999
empty canvas indicator
czwe-01 Sep 8, 2025
05281eb
button fix
czwe-01 Sep 8, 2025
8c77ba5
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Sep 22, 2025
3bf3c0e
Merge branch 'thulasizwe/en/canvas' into thulasizwe/en/form-component…
czwe-01 Oct 15, 2025
b86b776
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Oct 16, 2025
fde0b5b
Merge branch 'thulasizwe/en/form-components-width' of https://github.…
czwe-01 Oct 16, 2025
56c3e74
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Oct 16, 2025
e77fbbe
refactor: update file upload component styles and settings
czwe-01 Oct 17, 2025
bc49dcb
refactor: clean up code style and improve consistency across components
czwe-01 Oct 21, 2025
e88a069
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Oct 21, 2025
065c7bb
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Oct 21, 2025
ef8e5b8
refactor: update type definitions for component utilities
czwe-01 Oct 21, 2025
0012f3d
fix: handle potential null model in formComponentHooks
czwe-01 Oct 21, 2025
1879cc5
fix: form-item-label margin
czwe-01 Oct 21, 2025
7ac4c4d
fix: adjust tooltip alignment in form item styles
czwe-01 Oct 21, 2025
dca3479
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Oct 27, 2025
d7e0a9e
refactor: improve styling and layout handling in form components
czwe-01 Oct 27, 2025
0bd30d0
refactor: update file upload styles and improve form item layout hand…
czwe-01 Oct 27, 2025
d30fd40
Merge branch 'thulasizwe/en/form-components-width' of https://github.…
czwe-01 Oct 27, 2025
e313804
refactor: enhance dimension handling and styling in form components
czwe-01 Oct 28, 2025
5e077b8
refactor: enhance form component styling and layout management
czwe-01 Oct 29, 2025
388420e
refactor: streamline component dimension handling and skip logic
czwe-01 Jan 22, 2026
18ed5a1
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Jan 22, 2026
90c9922
refactor: improve background utility functions and clean up code
czwe-01 Jan 22, 2026
5a48159
Merge branch 'thulasizwe/b/4098' into thulasizwe/en/form-components-w…
czwe-01 Jan 22, 2026
1314e33
refactor: enhance dimension handling and styling consistency across c…
czwe-01 Jan 26, 2026
6df75ae
clean up
czwe-01 Jan 26, 2026
5b65e80
Merge branch 'main' into thulasizwe/en/form-components-width
czwe-01 Jan 26, 2026
4deeb3a
lint-fix
czwe-01 Jan 26, 2026
58ff70b
lint-fix
czwe-01 Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion shesha-reactjs/src/components/configurableForm/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ColProps } from 'antd/lib/col';
import { FormInstance, FormProps } from 'antd/lib/form';
import { FormLayout } from 'antd/lib/form/Form';
import { ConfigurableFormInstance } from '@/providers/form/contexts';
import { FormMode, Store, HasFormIdOrMarkup, IFormActions, IFormSections, FormIdentifier } from '@/providers/form/models';
import { FormMode, Store, HasFormIdOrMarkup, IFormActions, IFormSections, FormIdentifier, IFormItemMargin } from '@/providers/form/models';
import { IConfigurableFormComponent, ValidateErrorEntity } from '@/interfaces';
import { IShaFormInstance, ProcessingState } from '@/providers/form/store/interfaces';

Expand All @@ -14,6 +14,7 @@ export interface IConfigurableFormRendererProps<Values = any, _FieldData = any>
showDataSubmitIndicator?: boolean;
labelCol?: ColProps;
wrapperCol?: ColProps;
formItemMargin?: IFormItemMargin;
layout?: FormLayout;
initialValues?: Store;
parentFormValues?: Store;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const useStyles = createStyles(({ css, cx, prefixCls, token }, { style }:
const entitySelect = cx("entity-select", css`
--ant-color-text: ${style?.color || '#000'} !important;
width: calc(100% - 32px) !important;
flex-basis: unset !important;
&:hover {
border-color: ${token.colorPrimary} !important;
}
Expand Down
10 changes: 5 additions & 5 deletions shesha-reactjs/src/components/fileUpload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Image } from 'antd/lib';
import { UploadProps } from 'antd/lib/upload/Upload';
import filesize from 'filesize';
import { UploadRequestOption as RcCustomRequestOptions } from 'rc-upload/lib/interface';
import React, { FC, useEffect, useRef, useState } from 'react';
import React, { CSSProperties, FC, useEffect, useRef, useState } from 'react';
import { listType } from '@/designer-components/attachmentsEditor/attachmentsEditor';
import { getFileIcon, isImageType } from '@/icons/fileIcons';
import { useSheshaApplication, useStoredFile, useTheme } from '@/providers';
Expand All @@ -36,7 +36,7 @@ export interface IFileUploadProps {
thumbnailHeight?: string;
borderRadius?: number;
hideFileName?: boolean;
styles?: any;
style?: CSSProperties;
type?: string;
}

Expand All @@ -51,7 +51,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
isDragger = false,
listType = 'text',
hideFileName = false,
styles: stylesProp,
style,
}) => {
const {
fileInfo,
Expand All @@ -62,7 +62,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
} = useStoredFile();
const { backendUrl, httpHeaders } = useSheshaApplication();
const props = {
style: stylesProp,
style,
model: {
layout: listType === 'thumbnail' && !isDragger,
isDragger,
Expand Down Expand Up @@ -221,7 +221,7 @@ export const FileUpload: FC<IFileUploadProps> = ({
accept: allowedFileTypes?.join(','),
multiple: false,
fileList: fileInfo ? [fileInfo] : [],
style: !isDragger && stylesProp,
style: isDragger ? undefined : style,
customRequest: onCustomRequest,
beforeUpload: (file) => {
if (!isFileTypeAllowed(file.name, allowedFileTypes)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import { IConfigurableFormItemProps } from './model';
import { ConfigurableFormItemContext } from './configurableFormItemContext';
import { ConfigurableFormItemForm } from './configurableFormItemForm';
import { useStyles } from './styles';
import { addPx } from '@/utils/style';

Check failure on line 10 in shesha-reactjs/src/components/formDesigner/components/configurableFormItemLive.tsx

View workflow job for this annotation

GitHub Actions / build-attempt

'addPx' is defined but never used. Allowed unused vars must match /^_/u

export const ConfigurableFormItemLive: FC<IConfigurableFormItemProps> = ({
children,
Expand All @@ -19,12 +21,30 @@
const { getPublicFormApi } = useShaFormInstance();
const getFormData = getPublicFormApi().getFormData;
const formItem = useFormItem();
const shaForm = useShaFormInstance();
const { namePrefix, wrapperCol: formItemWrapperCol, labelCol: formItemlabelCol } = formItem;

const layout = useMemo(() => {
// Make sure the `wrapperCol` and `labelCol` from `FormItemProver` override the ones from the main form
return { labelCol: formItemlabelCol || labelCol, wrapperCol: formItemWrapperCol || wrapperCol };
}, [formItemlabelCol, formItemWrapperCol]);
const settings = shaForm.settings;
const { styles } = useStyles(settings.layout);

const defaultMargins = settings?.formItemMargin || {};
const { top, left, right, bottom } = defaultMargins;
const {
marginTop = top ?? 5,
marginBottom = bottom ?? 5,
marginRight = right ?? 3,
marginLeft = left ?? 3,
width,
height,
minWidth,
minHeight,
maxWidth,
maxHeight,
} = model?.allStyles?.fullStyle || {};

const { hideLabel, hidden } = model;
if (hidden) return null;
Expand All @@ -34,7 +54,7 @@
: model.propertyName;

const formItemProps: FormItemProps = {
className: classNames(className),
className: classNames(className, styles.formItem, settings.layout),
label: hideLabel ? null : model.label,
labelAlign: model.labelAlign,
hidden: model.hidden,
Expand All @@ -46,6 +66,7 @@
wrapperCol: hideLabel ? { span: 24 } : layout?.wrapperCol,
// layout: model.layout, this property appears to have been removed from the Ant component
name: model.context ? undefined : getFieldNameFromExpression(propName),
style: { marginBottom, marginRight, marginLeft, marginTop, width, height, minHeight, minWidth, maxHeight, maxWidth },
};

if (typeof children === 'function') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { getPropertySettingsFromData } from '@/designer-components/_settings/uti
import { SettingsControl, useShaFormInstance } from '@/index';
import { IConfigurableFormItemChildFunc, IConfigurableFormItemProps } from './model';
import { ConfigurableFormItemLive } from './configurableFormItemLive';
import { useStyles } from './styles';

export const ConfigurableFormItemSetting: FC<IConfigurableFormItemProps> = ({
children,
model,
valuePropName,
}) => {
const { formData } = useShaFormInstance();

const { styles } = useStyles();
if (model.hidden) return null;

const { _mode: mode } = getPropertySettingsFromData(formData, model.propertyName);
Expand All @@ -24,12 +25,13 @@ export const ConfigurableFormItemSetting: FC<IConfigurableFormItemProps> = ({
required: model.validate?.required,
tooltip: model.description || undefined,
hidden: model.hidden,
className: styles.formItem,
};

if (typeof children === 'function') {
const childrenFunc = children as IConfigurableFormItemChildFunc;
return (
<Form.Item {...formProps}>
<Form.Item {...formProps} className={styles.formItem}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Duplicate className prop assignment.

The className: styles.formItem is already included in formProps (line 29), so specifying it again in the JSX spread is redundant. The prop in {...formProps} will be applied, and then overwritten by the explicit className={styles.formItem}.

Remove the duplicate:

-      <Form.Item {...formProps} className={styles.formItem}>
+      <Form.Item {...formProps}>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Form.Item {...formProps} className={styles.formItem}>
<Form.Item {...formProps}>
🤖 Prompt for AI Agents
In
shesha-reactjs/src/components/formDesigner/components/configurableFormItemSetting.tsx
around line 35, the Form.Item JSX spreads formProps which already contains
className: styles.formItem (set on line 29) and then redundantly sets
className={styles.formItem} again; remove the explicit
className={styles.formItem} from the JSX so the single className from
{...formProps} is used and there is no duplicate/overwritten prop.

<SettingsControl propertyName={model.propertyName} mode={mode}>
{(value, onChange, propertyName) => childrenFunc(value, onChange, propertyName)}
</SettingsControl>
Expand Down
37 changes: 37 additions & 0 deletions shesha-reactjs/src/components/formDesigner/components/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { createStyles } from '@/styles';

export const useStyles = createStyles(({ css, cx }, layout: 'vertical' | 'horizontal' | 'inline' | undefined) => {

Check failure on line 3 in shesha-reactjs/src/components/formDesigner/components/styles.ts

View workflow job for this annotation

GitHub Actions / build-attempt

Trailing spaces not allowed
const formItem = cx(css`
--ant-form-item-margin-bottom: 0px !important;
.ant-form-item-row {
height: 100%;
width: 100%;
}

.ant-row .ant-form-item-control {
width: 100% !important;
height: 100% !important;
max-height: ${layout === 'vertical' ? 'calc(100% - 32px)' : '100%'};
margin: auto;

.ant-form-item-control-input {
min-height : 0px !important;
height: 100%;
width: 100%;

.ant-form-item-control-input-content {
height: 100%;
width: 100%;
> div {
vertical-align: middle;
}
}
}
}


`);
Comment on lines +36 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove extra blank line.

Minor formatting cleanup - there's an unnecessary blank line before the closing backtick.

         }
     }
-
-
   `);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`);
`);
🤖 Prompt for AI Agents
In shesha-reactjs/src/components/formDesigner/components/styles.ts around lines
36 to 38 there is an extra blank line before the closing template backtick;
remove that blank line so the template literal closes immediately after the last
style content (ensure no unintended whitespace/newline remains), then run
formatting/linting (prettier/ESLint) to confirm consistent styling.

return {
formItem,
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, {
} from 'react';
import { createPortal } from 'react-dom';
import ValidationIcon from './validationIcon';
import { DataContextTopLevels, EditMode, IConfigurableFormComponent } from '@/providers';
import { DataContextTopLevels, EditMode, IConfigurableFormComponent, useCanvas, useShaFormInstance } from '@/providers';
import {
EditOutlined,
EyeInvisibleOutlined,
Expand All @@ -21,10 +21,14 @@ import { isPropertySettings } from '@/designer-components/_settings/utils';
import { Show } from '@/components/show';
import { Tooltip } from 'antd';
import { ShaForm, useIsDrawingForm } from '@/providers/form';
import { useFormDesignerState } from '@/providers/formDesigner';
import { useFormDesignerState, useFormDesignerStateSelector } from '@/providers/formDesigner';
import { useStyles } from '../styles/styles';
import { ComponentProperties } from '../componentPropertiesPanel/componentProperties';
import { useFormDesignerComponentGetter } from '@/providers/form/hooks';
import { useFormComponentStyles } from '@/hooks/formComponentHooks';
import { getComponentTypeInfo } from '../utils/componentTypeUtils';
import { getComponentDimensions, getDeviceDimensions, getDeviceFlexBasis } from '../utils/dimensionUtils';
import { createRootContainerStyle } from '../utils/stylingUtils';

export interface IConfigurableFormComponentDesignerProps {
componentModel: IConfigurableFormComponent;
Expand All @@ -43,11 +47,21 @@ const ConfigurableFormComponentDesignerInner: FC<IConfigurableFormComponentDesig
componentEditMode,
}) => {
const { styles } = useStyles();

const getToolboxComponent = useFormDesignerComponentGetter();

const formSettings = useFormDesignerStateSelector((x) => x.formSettings);
const { formMode } = useShaFormInstance();
const { activeDevice } = useCanvas();

const component = getToolboxComponent(componentModel?.type);
const typeInfo = getComponentTypeInfo(component);
const { dimensionsStyles, stylingBoxAsCSS } = useFormComponentStyles({ ...componentModel, ...componentModel?.[activeDevice] });
const { top, left, bottom, right } = formSettings?.formItemMargin || {};
const desktopConfig = componentModel?.[activeDevice] || {};
const originalDimensions = dimensionsStyles;
const originalStylingBox = stylingBoxAsCSS;

const hasLabel = componentModel.label && componentModel.label.toString().length > 0;
const isSelected = componentModel.id && selectedComponentId === componentModel.id;

const invalidConfiguration = componentModel.settingsValidationErrors && componentModel.settingsValidationErrors.length > 0;

const hiddenFx = isPropertySettings(componentModel.hidden);
Expand All @@ -57,9 +71,9 @@ const ConfigurableFormComponentDesignerInner: FC<IConfigurableFormComponentDesig
const actionText2 = (hiddenFx ? 'showing' : '') + (hiddenFx && componentEditModeFx ? '/' : '') + (componentEditModeFx ? 'enabled' : '');

const settingsEditor = useMemo(() => {
const renderRerquired = isSelected && settingsPanelRef.current;
const renderRequired = isSelected && settingsPanelRef.current;

if (!renderRerquired)
if (!renderRequired)
return null;

const createPortalInner = true
Expand All @@ -82,8 +96,57 @@ const ConfigurableFormComponentDesignerInner: FC<IConfigurableFormComponentDesig
return result;
}, [isSelected]);

const { marginLeft = left, marginRight = right, marginBottom = bottom, marginTop = top } = stylingBoxAsCSS;

const stylingBoxPadding = useMemo(() => {
return {
paddingBottom: originalStylingBox.paddingBottom,
paddingLeft: originalStylingBox.paddingLeft,
paddingRight: originalStylingBox.paddingRight,
paddingTop: originalStylingBox.paddingTop,
};
}, [formMode, originalStylingBox, desktopConfig.stylingBox]);

const stylingBoxMargin = useMemo(() => {
return {
marginTop: marginTop ? top : marginTop,
marginBottom: marginBottom ? bottom : marginBottom,
marginLeft: marginLeft ? left : marginLeft,
marginRight: marginRight ? right : marginRight,
};
}, [formMode, originalStylingBox, desktopConfig.stylingBox]);

const paddingStyles = JSON.stringify(stylingBoxPadding);
const marginStyles = JSON.stringify(stylingBoxMargin);

const componentDimensions = getComponentDimensions(typeInfo, dimensionsStyles);

const renderComponentModel = useMemo(() => {
const deviceDimensions = getDeviceDimensions(typeInfo, dimensionsStyles);

return {
...componentModel,
[activeDevice]: {
...desktopConfig,
dimensions: deviceDimensions,
},
// ...(formMode === 'designer' ? {stylingBox: paddingStyles} : {stylingBox: JSON.stringify({...stylingBoxPadding, ...stylingBoxMargin})}),
flexBasis: getDeviceFlexBasis(dimensionsStyles),
};
}, [componentModel, desktopConfig, paddingStyles, originalDimensions, formMode, typeInfo, activeDevice, dimensionsStyles]);

const rootContainerStyle = useMemo(() => {
return createRootContainerStyle(
componentDimensions,
{ ...JSON.parse(marginStyles) },
originalDimensions,
typeInfo.isInput,
);
}, [componentDimensions, marginTop, marginBottom, marginLeft, marginRight, originalDimensions, hasLabel]);

return (
<div
style={rootContainerStyle}
className={classNames(styles.shaComponent, {
"selected": isSelected,
'has-config-errors': invalidConfiguration,
Expand All @@ -107,6 +170,7 @@ const ConfigurableFormComponentDesignerInner: FC<IConfigurableFormComponentDesig
<StopOutlined />
</Tooltip>
</Show>

<Show when={!componentEditModeFx && componentEditMode === 'editable'}>
<Tooltip title="This component is always in Edit/Action mode">
<EditOutlined />
Expand All @@ -115,10 +179,23 @@ const ConfigurableFormComponentDesignerInner: FC<IConfigurableFormComponentDesig
</span>

{invalidConfiguration && <ValidationIcon validationErrors={componentModel.settingsValidationErrors} />}
<div>

<div style={{
width: '100%',
height: '100%',
boxSizing: 'border-box',
}}
>
<DragWrapper componentId={componentModel.id} readOnly={readOnly}>
<div style={{ padding: '5px 3px' }}>
<FormComponent componentModel={componentModel} />
<div style={{
width: '100%',
height: '100%',
boxSizing: 'border-box',
}}
>
<FormComponent
componentModel={renderComponentModel}
/>
</div>
</DragWrapper>
</div>
Comment on lines +160 to 178
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider consolidating nested wrapper divs with identical styles.

Two wrapper divs (lines 170-175 and 177-182) have identical inline styles (width: 100%, height: 100%, boxSizing: 'border-box'). If the outer wrapper's only purpose is sizing, consider combining them or extracting the repeated style to a constant.

const innerWrapperStyle: React.CSSProperties = {
  width: '100%',
  height: '100%',
  boxSizing: 'border-box',
};

// Then use:
<div style={innerWrapperStyle}>
  <DragWrapper componentId={componentModel.id} readOnly={readOnly}>
    <FormComponent componentModel={renderComponentModel} />
  </DragWrapper>
</div>
🤖 Prompt for AI Agents
In
shesha-reactjs/src/components/formDesigner/configurableFormComponent/index.tsx
around lines 170 to 188, two nested divs use identical inline styles (width:
'100%', height: '100%', boxSizing: 'border-box'); remove the redundant wrapper
by keeping a single wrapper around DragWrapper or extract the repeated style
into a shared constant (e.g., innerWrapperStyle) and apply it to the remaining
div to avoid duplication and improve clarity.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,4 +537,4 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
formDesigner,
quickEditModal,
};
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const DebugButton: FC = () => {
icon={<BugOutlined />}
title="Debug"
type="primary"
ghost={!isDebug}
size="small"
ghost={!isDebug}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const SaveMenu: FC<ISaveMenuProps> = ({ onSaved }) => {
icon={<SaveOutlined />}
onClick={onSaveClick}
type="primary"
size="small"
>
Save
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { IConfigurableFormComponent, IToolboxComponent } from "@/interfaces";

export interface ComponentTypeInfo {
isDataTableContext: boolean;
isInput: boolean;
}

export const getComponentTypeInfo = (component: IToolboxComponent<IConfigurableFormComponent>): ComponentTypeInfo => {
const isDataTableContext = component?.type === 'datatableContext';
const isInput = component?.isInput || component?.type === 'button';

return {
isDataTableContext,
isInput,
};
};
Loading
Loading