Skip to content

Commit f41849b

Browse files
committed
refactor: update styles for consistency and responsiveness
- Enhanced form item styles in formDesigner for better alignment and responsiveness. - Adjusted default margins in designerConstants for a cleaner layout. - Updated ReactTable styles to ensure full width and proper box-sizing. - Removed unnecessary margin from MultiCheckbox component for improved spacing.
1 parent 50e69eb commit f41849b

File tree

6 files changed

+48
-34
lines changed

6 files changed

+48
-34
lines changed

shesha-reactjs/src/components/formDesigner/components/styles.ts

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,52 @@ import { createStyles } from '@/styles';
33
export interface UseStylesProps {
44
autoAlignLabel?: boolean;
55
}
6-
export const useStyles = createStyles(({ css, cx }, { autoAlignLabel = true }) => {
6+
export const useStyles = createStyles(({ css, cx, token }, { autoAlignLabel = true }) => {
77
const settingsFormItem = cx(css`
88
margin: 0px !important;
99
`);
1010

1111
const formItem = cx(css`
12-
--ant-form-item-margin-bottom: 0px !important;
13-
position: relative;
14-
height: auto;
15-
16-
.ant-form-item-row {
17-
height: 100%;
18-
width: 100%;
1912
20-
>.ant-form-item-label {
21-
${autoAlignLabel ? 'margin: auto 0;' : 'margin: unset;'};
22-
}
23-
}
13+
.ant-row {
14+
width: 100% !important;
15+
height: 100% !important;
16+
}
17+
.ant-form-item {
18+
width: 100% !important;
19+
height: 100% !important;
20+
margin-bottom: 0 !important;
21+
22+
.ant-form-item-row {
23+
width: 100% !important;
24+
height: 100% !important;
25+
26+
>.ant-form-item-label {
27+
${autoAlignLabel ? 'margin: auto 0;' : 'margin: unset;'};
28+
}
29+
}
30+
31+
.ant-form-item-control {
32+
width: 100% !important;
33+
height: 100% !important;
34+
}
35+
36+
.ant-form-item-control-input {
37+
width: 100% !important;
38+
height: 100% !important;
39+
}
40+
41+
.ant-form-item-control-input-content {
42+
width: 100% !important;
43+
height: 100% !important;
44+
}
45+
}
2446
25-
.ant-form-item-additional {
26-
position: absolute;
27-
bottom: 0;
28-
left: 0;
29-
right: 0;
30-
transform: translateY(100%);
31-
z-index: 1;
47+
:hover {
48+
border-color: ${token.colorPrimary} !important;
3249
}
33-
}
34-
`);
50+
51+
`);
3552
return {
3653
formItem,
3754
settingsFormItem,

shesha-reactjs/src/components/formDesigner/utils/designerConstants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const designerConstants = {
3636
DEFAULT_FORM_ITEM_MARGINS: {
3737
top: '5px',
3838
bottom: '5px',
39-
left: '3px',
40-
right: '3px',
39+
left: '0px',
40+
right: '0px',
4141
} as const,
4242

4343
/**
@@ -48,7 +48,7 @@ export const designerConstants = {
4848
*/
4949
DEFAULT_MARGINS: {
5050
vertical: '5px',
51-
horizontal: '3px',
51+
horizontal: '0px',
5252
} as const,
5353

5454
/**

shesha-reactjs/src/components/reactTable/styles/styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
236236
.${shaTable} {
237237
border-spacing: 0;
238238
display: inline-block;
239-
min-width: calc(100% - 2px);
239+
min-width: 100%;
240+
box-sizing: border-box;
240241
241242
/* Background applied to table ensures it covers all rows when scrolling with freezeHeaders */
242243
${backgroundColor ? `background: ${backgroundColor};` : 'background: white;'}

shesha-reactjs/src/components/richTextEditor/styles/styles.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ export const useStyles = createStyles(({ css, cx }) => {
2020
display: flex;
2121
flex-direction: column;
2222
23-
.jodit-toolbar__box {
24-
z-index: 2;
25-
}
2623
}
2724
2825
.jodit-workplace {

shesha-reactjs/src/configuration-studio/styles.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ export const useStyles = createStyles(({ css, cx, token, prefixCls, iconPrefixCl
100100
}
101101
}
102102
}
103-
.${csDocEditor}{
104-
padding: 0;
105-
overflow: auto;
106-
height: calc(100vh - ${headerHeight}px - ${tabCardHeight}px);
107-
}
103+
.${csDocEditor}{
104+
padding: 0;
105+
overflow: auto;
106+
height: calc(100vh - ${headerHeight}px - ${tabCardHeight}px);
107+
}
108108
`);
109109

110110
return {

shesha-reactjs/src/designer-components/checkboxGroup/multiCheckbox.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const MultiCheckbox: FC<ICheckboxGroupProps> = (model) => {
7272
flexDirection: direction === 'vertical' ? 'column' : 'row',
7373
flexWrap: direction === 'vertical' ? 'nowrap' : 'wrap',
7474
gap: '8px',
75-
marginTop: '5px',
7675
};
7776

7877
return (

0 commit comments

Comments
 (0)