Skip to content

Commit cb6aad1

Browse files
authored
Merge pull request #4611 from czwe-01/thulasizwe/bug/3557
Thulasizwe/bug/3557
2 parents a87d6ae + fb56f74 commit cb6aad1

File tree

15 files changed

+33
-24
lines changed

15 files changed

+33
-24
lines changed

shesha-reactjs/src/components/dataTable/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { getCellStyleAccessor } from './utils';
5454
import { isPropertiesArray } from '@/interfaces/metadata';
5555
import { IBeforeRowReorderArguments, IAfterRowReorderArguments } from '@/designer-components/dataTable/tableContext/models';
5656
import { StandaloneTable } from '@/designer-components/dataTable/table/standaloneTable';
57+
import { IDimensionsValue } from '@/designer-components/_settings/utils/index';
5758

5859
export interface IIndexTableOptions {
5960
omitClick?: boolean;
@@ -137,6 +138,7 @@ export interface IIndexTableProps extends IShaDataTableProps, TableProps {
137138

138139
// Overall table styling
139140
boxShadow?: string;
141+
dimensions?: IDimensionsValue;
140142
sortableIndicatorColor?: string;
141143
}
142144

@@ -200,6 +202,7 @@ export const DataTable: FC<Partial<IIndexTableProps>> = ({
200202
rowBorder,
201203
rowBorderStyle,
202204
boxShadow,
205+
dimensions,
203206
sortableIndicatorColor,
204207
bodyFontFamily,
205208
bodyFontSize,
@@ -1007,6 +1010,7 @@ export const DataTable: FC<Partial<IIndexTableProps>> = ({
10071010
rowBorder,
10081011
rowBorderStyle,
10091012
boxShadow,
1013+
dimensions,
10101014
sortableIndicatorColor,
10111015

10121016
onRowClickAction: onRowClick,

shesha-reactjs/src/components/reactTable/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ export const ReactTable: FC<IReactTableProps> = ({
115115
rowBorder,
116116
rowBorderStyle,
117117
boxShadow,
118+
dimensions,
118119
sortableIndicatorColor,
119120
striped,
120121
cellBorderColor,
@@ -156,6 +157,7 @@ export const ReactTable: FC<IReactTableProps> = ({
156157
rowHoverBackgroundColor,
157158
rowSelectedBackgroundColor,
158159
border,
160+
dimensions,
159161
backgroundColor,
160162
headerFontFamily,
161163
headerFontSize,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, { ReactNode, CSSProperties } from 'react';
55
import { Column, ColumnInstance, Row, SortingRule, TableState } from 'react-table';
66
import { IBorderValue } from '@/designer-components/_settings/utils/border/interfaces';
77
import { TableSelectionMode } from '../dataTable/interfaces';
8-
import { IShadowValue } from '@/designer-components/_settings/utils/index';
8+
import { IDimensionsValue, IShadowValue } from '@/designer-components/_settings/utils/index';
99

1010
export interface IColumnWidth {
1111
id: React.Key;
@@ -326,6 +326,7 @@ export interface IReactTableProps extends ITableRowDragProps {
326326
border?: IBorderValue;
327327
backgroundColor?: string;
328328
boxShadow?: string;
329+
dimensions?: IDimensionsValue;
329330
sortableIndicatorColor?: string;
330331
striped?: boolean;
331332

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { IBorderValue } from '@/designer-components/_settings/utils/border/inter
33
import { IShadowValue } from '@/designer-components/_settings/utils/shadow/interfaces';
44
import { getBorderStyle } from '@/designer-components/_settings/utils/border/utils';
55
import { getShadowStyle } from '@/designer-components/_settings/utils/shadow/utils';
6+
import { IDimensionsValue } from '@/designer-components/_settings/utils/index';
67

78
const tableClassNames = {
89
shaTable: 'sha-table',
@@ -46,6 +47,7 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
4647
rowHoverBackgroundColor,
4748
rowSelectedBackgroundColor,
4849
border,
50+
dimensions,
4951
backgroundColor,
5052
headerFontFamily,
5153
headerFontSize,
@@ -94,6 +96,7 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
9496
rowBorder?: string;
9597
rowBorderStyle?: IBorderValue;
9698
boxShadow?: string;
99+
dimensions?: IDimensionsValue;
97100
sortableIndicatorColor?: string;
98101
striped?: boolean;
99102
cellBorderColor?: string;
@@ -215,6 +218,11 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
215218
position: relative;
216219
` : ''}
217220
221+
222+
${dimensions?.height ? `height: ${dimensions.height};` : ''}
223+
${dimensions?.minHeight ? `min-height: ${dimensions.minHeight};` : ''}
224+
${dimensions?.maxHeight ? `max-height: ${dimensions.maxHeight};` : ''}
225+
218226
.${shaSpanCenterVertically} {
219227
display: flex;
220228
align-items: center;
@@ -229,7 +237,6 @@ export const useMainStyles = createStyles(({ css, cx, token, prefixCls, iconPref
229237
border-spacing: 0;
230238
display: inline-block;
231239
min-width: 100%;
232-
overflow-x: auto;
233240
234241
/* Background applied to table ensures it covers all rows when scrolling with freezeHeaders */
235242
${backgroundColor ? `background: ${backgroundColor};` : 'background: white;'}

shesha-reactjs/src/components/sectionSeparator/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export const SectionSeparator: FC<ISectionSeparatorProps> = ({
116116
...containerStyle,
117117
height: 'max-content',
118118
width: addPx(lineWidth, allData) ?? '100%',
119-
marginRight: 1,
120119
}}
121120
key={id}
122121
>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const useStyles = createStyles(({ css, cx, token, prefixCls, iconPrefixCl
2020
const csDocEditor = 'sha-cs-doc-editor';
2121

2222
const headerHeight = 60;
23-
const tabCardHeight = 40;
2423

2524
const configStudio = cx("sha-config-studio", css`
2625
@@ -102,8 +101,6 @@ export const useStyles = createStyles(({ css, cx, token, prefixCls, iconPrefixCl
102101
}
103102
.${csDocEditor}{
104103
padding: 0;
105-
overflow: auto;
106-
height: calc(100vh - ${headerHeight}px - ${tabCardHeight}px);
107104
}
108105
`);
109106

shesha-reactjs/src/designer-components/attachmentsEditor/attachmentsEditor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const AttachmentsEditor: IToolboxComponent<IAttachmentsEditorProps> = {
164164
type: 'attachmentsEditor',
165165
isInput: true,
166166
name: 'File list',
167+
preserveDimensionsInDesigner: true,
167168
dataTypeSupported: ({ dataType, dataFormat }) => dataType === DataTypes.advanced && dataFormat === AdvancedFormats.fileList,
168169
icon: <FolderAddOutlined />,
169170
Factory: ({ model }) => {

shesha-reactjs/src/designer-components/container/settingsForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ export const getSettings: SettingsFormMarkupFactory = ({ fbf }) => {
465465
propertyName: 'flexWrap',
466466
dropdownOptions: FLEX_WRAP,
467467
hidden: {
468-
_code: 'return getSettingValue(data[`${contexts.canvasContext?.designerDevice || "desktop"}`]?.flexDirection) !== "row";',
468+
_code: 'return getSettingValue(data[`${contexts.canvasContext?.designerDevice || "desktop"}`]?.display) !== "flex";',
469469
_mode: 'code',
470470
_value: false,
471471
} as any,

shesha-reactjs/src/designer-components/dataTable/table/styles/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export const GlobalTableStyles = createGlobalStyle`
5959
}
6060
6161
.sha-react-table {
62+
overflow: auto;
6263
.td {
6364
.${(p) => p.theme.prefixCls}-form-item {
6465
width: 100%;

shesha-reactjs/src/designer-components/dataTable/table/tableComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ const TableComponent: TableComponentDefinition = {
148148
isInput: true,
149149
isOutput: true,
150150
name: 'Data Table',
151+
preserveDimensionsInDesigner: true,
151152
icon: <TableOutlined />,
152153
Factory: ({ model }) => {
153154
return <TableComponentFactory model={model} />;

0 commit comments

Comments
 (0)