Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
5 changes: 1 addition & 4 deletions shesha-reactjs/src/components/panel/styles/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export const useStyles = createStyles(({ css, cx, token, prefixCls }, {
paddingTop,
paddingBottom,
paddingLeft,
paddingRight,
border,
...rest
paddingRight
} = bodyStyle;

const {
Expand Down Expand Up @@ -115,7 +113,6 @@ export const useStyles = createStyles(({ css, cx, token, prefixCls }, {
}

> .ant-collapse-item > .ant-collapse-content {
${rest}
width: ${width};
min-width: ${minWidth};
max-width: ${maxWidth};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ interface CustomDropdownProps {
customTooltip?: string;
onAddCustomOption?: (newOption: string) => void;
onChange?: (value: string) => void;
variant?: 'borderless' | 'outlined' | 'filled';
placeholder?: string;
}

const CustomDropdown: FC<CustomDropdownProps> = ({
value,
options,
readOnly,
label,
placeholder,
defaultValue,
customTooltip,
onChange,
Expand Down Expand Up @@ -83,6 +84,7 @@ const CustomDropdown: FC<CustomDropdownProps> = ({
size={size}
onChange={onChange}
defaultValue={defaultValue}
placeholder={placeholder}
dropdownRender={(menu) => (
<>
{menu}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const getBorderInputs = (path = '', isResponsive: boolean = true, hasMidd
type: 'textField',
label: "Width",
hideLabel: true,
placeholder: '0',
propertyName: `${borderProp}.all.width`,
},
{
Expand All @@ -174,6 +175,7 @@ export const getBorderInputs = (path = '', isResponsive: boolean = true, hasMidd
propertyName: `${borderProp}.all.style`,
type: "dropdown",
hideLabel: true,
placeholder: 'Solid',
width: 60,
dropdownOptions: borderStyles,
},
Expand Down Expand Up @@ -214,6 +216,7 @@ export const getBorderInputs = (path = '', isResponsive: boolean = true, hasMidd
type: 'textField',
label: "Width",
hideLabel: true,
placeholder: '0',
propertyName: `${borderProp}.${side}.width`,
},
{
Expand All @@ -222,6 +225,7 @@ export const getBorderInputs = (path = '', isResponsive: boolean = true, hasMidd
propertyName: `${borderProp}.${side}.style`,
type: "dropdown",
hideLabel: true,
placeholder: 'Solid',
width: 60,
dropdownOptions: borderStyles,
},
Expand Down Expand Up @@ -271,6 +275,7 @@ export const getCornerInputs = (path = '', isResponsive: boolean = true, hideCor
type: 'numberField',
icon: 'ExpandOutlined',
tooltip: 'Styles will apply to all corners',
placeholder: '0',
propertyName: path ? `${path}.border.radius.all` : 'border.radius.all',
}
]
Expand All @@ -290,6 +295,7 @@ export const getCornerInputs = (path = '', isResponsive: boolean = true, hideCor
defaultValue: 0,
type: 'numberField',
icon: cornerValue.icon,
placeholder: '0',
hidden: { _code: hideCornerConditions[corner], _mode: 'code', _value: false } as any,
tooltip: `${humanizeString(corner)} corner`,
propertyName: path ? `${path}.border.radius.${corner}` : `border.radius.${corner}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { CSSProperties } from "react";

export const getOverflowStyle = (overflow: CSSProperties['overflow'], hideScrollBar: boolean): React.CSSProperties => {
export const getOverflowStyle = (overflow, hideScrollBar: boolean): React.CSSProperties => {
if (!overflow) return {};
return {
overflow: overflow,
overflow: 'auto',
scrollbarWidth: 'thin',
'::-webkit-scrollbar': {
width: '8px',
Expand All @@ -12,7 +10,7 @@ export const getOverflowStyle = (overflow: CSSProperties['overflow'], hideScroll
...(hideScrollBar && {
'::-webkit-scrollbar': { display: 'none' },
'msOverflowStyle': 'none',
'scrollbarWidth': 'none'
'scrollbarWidth': 'none',
})
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const CollapsiblePanelComponent: IToolboxComponent<ICollapsiblePanelComponentPro
header,
content,
collapsible: 'icon',
overflow: 'auto',
overflow: true,
};
})
.add<ICollapsiblePanelComponentProps>(2, (prev) => migratePropertyName(migrateCustomFunctions(prev)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getBorderInputs, getCornerInputs } from '../_settings/utils/border/util
import { backgroundTypeOptions, positionOptions, repeatOptions, sizeOptions } from '../_settings/utils/background/utils';
import { fontTypes, fontWeights, textAlign } from '../_settings/utils/font/utils';
import { nanoid } from '@/utils/uuid';
import { overflowOptions } from '../_settings/utils/dimensions/utils';

export const getSettings = () => {
// Generate unique IDs for main sections
Expand Down Expand Up @@ -314,16 +313,6 @@ export const getSettings = () => {
}
]
})
.addSettingsInput({
id: nanoid(),
parentId: styleRouterId,
inline: true,
inputType: 'dropdown',
label: 'Overflow',
defaultValue: 'auto',
propertyName: 'overflow',
dropdownOptions: overflowOptions
})
.toJson()
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ const ContainerComponent: IToolboxComponent<IContainerComponentProps> = {
noDefaultStyling: prev?.noDefaultStyling,
gridColumnsCount: prev?.gridColumnsCount,
flexWrap: prev?.flexWrap,
gap: prev?.gap || 8
gap: prev?.gap || 8,
overflow: prev?.overflow || true,
};

return {
Expand Down
3 changes: 1 addition & 2 deletions shesha-reactjs/src/designer-components/container/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export const defaultStyles = (prev?: IContainerComponentProps): IStyleType & ICo
justifySelf: prev?.justifySelf ?? "normal",
noDefaultStyling: prev?.noDefaultStyling ?? false,
gridColumnsCount: prev?.gridColumnsCount ?? null,
gap: prev?.gap ?? '8px',
overflow: prev?.overflow ?? 'auto'
gap: prev?.gap ?? '8px'
};
};
22 changes: 0 additions & 22 deletions shesha-reactjs/src/designer-components/container/settingsForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { FormLayout } from 'antd/lib/form/Form';
import { getBorderInputs, getCornerInputs } from '../_settings/utils/border/utils';
import { backgroundTypeOptions, positionOptions, repeatOptions, sizeOptions } from '../_settings/utils/background/utils';
import { overflowOptions } from '../_settings/utils/dimensions/utils';

export const getSettings = (data) => {
// Generate unique IDs for major components
Expand Down Expand Up @@ -541,27 +540,6 @@ export const getSettings = (data) => {
dropdownOptions: TEXT_JUSTIFY
}
)
.addSettingsInputRow({
id: nanoid(),
parentId: displayCollapsiblePanelId,
inline: false,
readOnly: { _code: 'return getSettingValue(data?.readOnly);', _mode: 'code', _value: false } as any,
inputs: [
{
type: 'dropdown',
id: nanoid(),
label: 'Overflow',
propertyName: 'overflow',
dropdownOptions: overflowOptions
},
{
id: nanoid(),
type: 'switch',
label: "Hide Scroll Bar",
propertyName: 'hideScrollBar'
}
],
})
.toJson()
]
}
Expand Down
2 changes: 1 addition & 1 deletion shesha-reactjs/src/designer-components/dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const DropdownComponent: IToolboxComponent<IDropdownComponentProps, ITextFieldCo

return <Dropdown
{...model}
style={{ ...model.allStyles.fullStyle, overflow: 'auto' }}
style={{ ...model.allStyles.fullStyle }}
{...customEvent}
defaultValue={calculatedModel.defaultValue}
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export const InputComponent: FC<Omit<ISettingsInputProps, 'hidden'>> = (props) =
style={{ width: "100%" }}
defaultValue={defaultValue}
onChange={onChange}
placeholder={placeholder}
options={[...(options || [])].map(option => ({ ...option, label: iconElement(option.label, option.value, tooltip, {}, styles) }))}
/>;
}
Expand Down Expand Up @@ -145,8 +146,7 @@ export const InputComponent: FC<Omit<ISettingsInputProps, 'hidden'>> = (props) =
case 'customDropdown': {
const options = dropdownOptions as IDropdownOption[];

return <CustomDropdown
variant={variant} value={value || defaultValue}
return <CustomDropdown value={value || defaultValue} placeholder={placeholder}
defaultValue={defaultValue} options={options.map(option => ({ ...option, label: iconElement(option.label, option.value, tooltip, {}, styles) }))} readOnly={readOnly} onChange={onChange} size={size} customTooltip={props.customTooltip} />;
}
case 'textArea':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DesignerToolbarSettings } from '@/interfaces/toolbarSettings';
import { nanoid } from '@/utils/uuid';
import { FormLayout } from 'antd/lib/form/Form';
import { fontTypes, fontWeights, textAlign } from '../_settings/utils/font/utils';
import { FormLayout } from 'antd/es/form/Form';

export const getSettings = (data: any) => {
const searchableTabsId = nanoid();
Expand Down
1 change: 1 addition & 0 deletions shesha-reactjs/src/designer-components/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const TabsComponent: IToolboxComponent<ITabsComponentProps> = {
const initialCardStyle = { ...defaultCardStyles, font: { ...defaultCardStyles.font, color: '#000000' } };
return {
...newModel,
overflow: true,
card: { ...initialCardStyle },
desktop: { ...newModel.desktop, card: { ...initialCardStyle } },
tablet: { ...newModel.tablet, card: { ...initialCardStyle } },
Expand Down
19 changes: 0 additions & 19 deletions shesha-reactjs/src/designer-components/tabs/settingsForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { getBorderInputs, getCornerInputs } from '../_settings/utils/border/util
import { backgroundTypeOptions, positionOptions, repeatOptions, sizeOptions } from '../_settings/utils/background/utils';
import { onAddNewItem } from './utils';
import { getItemSettings } from './itemSettings';
import { overflowOptions } from '../_settings/utils/dimensions/utils';
import { nanoid } from '@/utils/uuid';

export const getSettings = () => {
Expand Down Expand Up @@ -300,24 +299,6 @@ export const getSettings = () => {
}
]
})
.addSettingsInputRow({
id: nanoid(),
inputs: [{
id: nanoid(),
type: 'dropdown',
label: 'Overflow',
defaultValue: 'auto',
propertyName: 'overflow',
dropdownOptions: overflowOptions
},
{
id: nanoid(),
type: 'switch',
label: "Hide Scroll Bar",
propertyName: 'hideScrollBar'
}
]
})
.toJson()
]
}
Expand Down
2 changes: 1 addition & 1 deletion shesha-reactjs/src/designer-components/wizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const TabsComponent: IToolboxComponent<Omit<IWizardComponentProps, 'size'>> = {
.add<IWizardComponentProps>(4, (prev) => migrateWizardActions(prev))
.add<IWizardComponentProps>(5, (prev) => ({ ...migrateFormApi.properties(prev) }))
.add<IWizardComponentProps>(6, (prev) => removeComponents(prev))
.add<IWizardComponentProps>(7, (prev) => ({ ...migratePrevStyles({ ...prev, primaryTextColor: '#fff' }, defaultStyles()) })),
.add<IWizardComponentProps>(7, (prev) => ({ ...migratePrevStyles({ ...prev, primaryTextColor: '#fff' }, defaultStyles()), overflow: true })),
settingsFormMarkup: () => getSettings(),
validateSettings: (model) => validateConfigurableComponentSettings(getSettings(), model),

Expand Down
Loading
Loading