Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m

const antUploadDragIcon = `${prefixCls}-upload-drag-icon`;
const shaStoredFilesRenderer = cx("sha-stored-files-renderer", css`
--thumbnail-width: ${layout ? (width ?? height ?? '54px') : '100%'};
--thumbnail-height: ${layout ? (height ?? width ?? '54px') : '100%'};
--thumbnail-width: ${layout ? (width ?? '54px') : '100%'};
--thumbnail-height: ${layout ? (height ?? '54px') : '100%'};
--ant-margin-xs: ${gap ?? '8px'} !important;
--ant-border-radius-xs: ${borderRadius ?? '8px'} !important;
--ant-border-radius-sm: ${borderRadius ?? '8px'} !important;
Expand Down Expand Up @@ -52,6 +52,8 @@ export const useStyles = createStyles(({ token, css, cx, prefixCls }, { style, m
--ant-font-size: ${fontSize ?? '14px'} !important;
border-radius: ${borderRadius ?? '8px'} !important;
display: flex;
width: ${layout ? (width ?? '54px') : ''};
height: ${layout ? (height ?? '54px') : ''};

:before {
top: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ export const getBackgroundStyle = (input: IBackgroundValue, jsStyle: React.CSSPr
};

export const gradientDirectionOptions: IDropdownOption[] = [
{ value: 'to right', label: 'To Right' },
{ value: 'to left', label: 'To Left' },
{ value: 'to top', label: 'To Top' },
{ value: 'to bottom', label: 'To Bottom' },
{ value: 'to top right', label: 'To Top Right' },
{ value: 'to top left', label: 'To Top Left' },
{ value: 'to bottom right', label: 'To Bottom Right' },
{ value: 'to bottom left', label: 'To Bottom Left' },
{ value: 'to right', label: 'To right' },
{ value: 'to left', label: 'To left' },
{ value: 'to top', label: 'To top' },
{ value: 'to bottom', label: 'To bottom' },
{ value: 'to top right', label: 'To top right' },
{ value: 'to top left', label: 'To top left' },
{ value: 'to bottom right', label: 'To bottom right' },
{ value: 'to bottom left', label: 'To bottom left' },
];

export const backgroundTypeOptions: IRadioOption[] = [
Expand Down Expand Up @@ -114,8 +114,8 @@ export const positionOptions: IDropdownOption[] = [
{ value: 'left', label: 'Left' },
{ value: 'right', label: 'Right' },
{ value: 'bottom', label: 'Bottom' },
{ value: 'top left', label: 'Top Left' },
{ value: 'top right', label: 'Top Right' },
{ value: 'bottom left', label: 'Bottom Left' },
{ value: 'bottom right', label: 'Bottom Right' }];
{ value: 'top left', label: 'Top left' },
{ value: 'top right', label: 'Top right' },
{ value: 'bottom left', label: 'Bottom left' },
{ value: 'bottom right', label: 'Bottom right' }];

Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const ContainerComponent: IToolboxComponent<IContainerComponentProps> = {
style={{
...getStyle(model?.style, formData),
}}
noDefaultStyling={model.noDefaultStyling}
className={model.className}
dynamicComponents={model?.isDynamic ? model?.components : []}
{...flexAndGridStyles}
Expand Down
4 changes: 2 additions & 2 deletions shesha-reactjs/src/designer-components/container/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export const defaultStyles = (prev?: IContainerComponentProps): IStyleType & ICo
minWidth = '0px',
borderColor = '#d9d9d9',
borderRadius = '8',
borderStyle = 'solid',
borderWidth = '0px',
borderStyle = 'none',
borderWidth = '1px',
shadowStyle,
} = prev || {};

Expand Down
94 changes: 51 additions & 43 deletions shesha-reactjs/src/designer-components/container/settingsForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {

import { FormLayout } from 'antd/lib/form/Form';
import { getBorderInputs, getCornerInputs } from '../_settings/utils/border/utils';
import { getPositionInputs } from '../_settings/utils/position/utils';
import { backgroundTypeOptions, positionOptions, repeatOptions, sizeOptions } from '../_settings/utils/background/utils';

export const getSettings = (data) => {
Expand Down Expand Up @@ -70,6 +69,15 @@ export const getSettings = (data) => {
},
],
})
.addSettingsInput({
id: 'noDefaultStyling-s4gmBg31azZC0UjZjpfTm',
inputType: 'switch',
propertyName: 'noDefaultStyling',
label: 'No Default Styling',
parentId: 's4gmBg31azZC0UjZjpfTm',
size: 'small',
jsSetting: true,
})
.toJson()
]
},
Expand All @@ -93,48 +101,48 @@ export const getSettings = (data) => {
},
components: [
...new DesignerToolbarSettings()
.addCollapsiblePanel({
id: 'positionCollapsiblePanel',
propertyName: 'pnlPosition',
label: 'Position',
labelAlign: 'right',
parentId: 'styleRouter',
ghost: true,
collapsible: 'header',
content: {
id: 'positionStylePnl',
components: [...new DesignerToolbarSettings()
.addSettingsInput({
id: 'position-s4gmBg31azZC0UjZjpfTm',
propertyName: 'position.value',
label: 'Position',
parentId: 'positionCollapsiblePanel',
inputType: 'dropdown',
description: 'The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.',
validate: {
required: true,
},
dropdownOptions: [
{ value: 'relative', label: 'Relative' },
{ value: 'Fixed', label: 'Fixed' },
]
})
.addSettingsInputRow(
getPositionInputs()[0] as any
)
.addSettingsInputRow(
getPositionInputs()[1] as any
)
.addSettingsInputRow(
getPositionInputs()[2] as any
)
.addSettingsInputRow(
getPositionInputs()[3] as any
)
.toJson()
]
}
})
// .addCollapsiblePanel({
// id: 'positionCollapsiblePanel',
// propertyName: 'pnlPosition',
// label: 'Position',
// labelAlign: 'right',
// parentId: 'styleRouter',
// ghost: true,
// collapsible: 'header',
// content: {
// id: 'positionStylePnl',
// components: [...new DesignerToolbarSettings()
// .addSettingsInput({
// id: 'position-s4gmBg31azZC0UjZjpfTm',
// propertyName: 'position.value',
// label: 'Position',
// parentId: 'positionCollapsiblePanel',
// inputType: 'dropdown',
// description: 'The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.',
// validate: {
// required: true,
// },
// dropdownOptions: [
// { value: 'relative', label: 'Relative' },
// { value: 'absolute', label: 'Absolute' }
// ]
// })
// .addSettingsInputRow(
// getPositionInputs()[0] as any
// )
// .addSettingsInputRow(
// getPositionInputs()[1] as any
// )
// .addSettingsInputRow(
// getPositionInputs()[2] as any
// )
// .addSettingsInputRow(
// getPositionInputs()[3] as any
// )
// .toJson()
// ]
// }
// })
.addCollapsiblePanel({
id: 'displayCollapsiblePanel',
propertyName: 'pnlDisplayStyle',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const InputComponent: FC<Omit<ISettingsInputProps, 'hidden'>> = (props) =
value={value || defaultValue}
style={{ width: "100%" }}
onChange={onChange}
addonAfter={iconElement(icon, null, tooltip, {}, styles)}
addonAfter={iconElement(icon, null, tooltip || label, {}, styles)}
/>;
case 'customDropdown': {
const options = dropdownOptions as IDropdownOption[];
Expand Down
Loading