Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit f759628

Browse files
committed
config to do not break compact mode
1 parent 0ef9b24 commit f759628

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

src/components/cellTypes/FormulaCell.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ const FormulaCell = (mdProps: CellComponentProps) => {
4646
return (
4747
<span
4848
ref={formulaRef}
49-
className={`${c("md_cell " + getAlignmentClassname(tableColumn.config))}`}
49+
className={`${c(
50+
"md_cell " +
51+
getAlignmentClassname(
52+
tableColumn.config,
53+
configInfo.getLocalSettings()
54+
)
55+
)}`}
5056
key={`formula_${cell.id}`}
5157
/>
5258
);

src/components/cellTypes/NumberCell.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,15 @@ const NumberCell = (props: CellComponentProps) => {
7070
onChange={handleOnChange}
7171
onKeyDown={handleKeyDown}
7272
onBlur={handleOnBlur}
73-
className={c(getAlignmentClassname(tableColumn.config))}
73+
className={c(
74+
getAlignmentClassname(tableColumn.config, configInfo.getLocalSettings())
75+
)}
7476
/>
7577
) : (
7678
<span
77-
className={c(getAlignmentClassname(tableColumn.config))}
79+
className={c(
80+
getAlignmentClassname(tableColumn.config, configInfo.getLocalSettings())
81+
)}
7882
onClick={handleEditableOnclick}
7983
style={{ width: column.getSize() }}
8084
>

src/components/cellTypes/TextCell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ const TextCell = (props: CellComponentProps) => {
7373
ref={containerCellRef}
7474
onClick={handleEditableOnclick}
7575
style={{ width: column.getSize() }}
76-
className={c(getAlignmentClassname(tableColumn.config))}
76+
className={c(
77+
getAlignmentClassname(tableColumn.config, configInfo.getLocalSettings())
78+
)}
7779
/>
7880
);
7981
};

src/helpers/StylesHelper.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ConfigColumn } from "cdm/FolderModel";
2-
import { COLUMN_ALIGNMENT_OPTIONS, DatabaseCore, MetadataLabels } from "helpers/Constants";
2+
import { LocalSettings } from "cdm/SettingsModel";
3+
import { CellSizeOptions, COLUMN_ALIGNMENT_OPTIONS, DatabaseCore, MetadataLabels } from "helpers/Constants";
34

45
/**
56
* Wrap the classname of css elements
@@ -42,15 +43,16 @@ export function getLabelHeader(input: string) {
4243
return labelCandidate === undefined ? input : labelCandidate[1];
4344
}
4445

45-
export function getAlignmentClassname(configColumn: ConfigColumn) {
46+
export function getAlignmentClassname(configColumn: ConfigColumn, localSettings: LocalSettings) {
4647
const classes: string[] = [];
4748
classes.push(
4849
configColumn.content_alignment === undefined ?
4950
COLUMN_ALIGNMENT_OPTIONS.LEFT :
5051
configColumn.content_alignment
5152
);
53+
console.log(localSettings.cell_size);
5254
classes.push(
53-
configColumn.wrap_content ?
55+
(configColumn.wrap_content && localSettings.cell_size !== CellSizeOptions.COMPACT) ?
5456
COLUMN_ALIGNMENT_OPTIONS.WRAP :
5557
COLUMN_ALIGNMENT_OPTIONS.NOWRAP
5658
);

0 commit comments

Comments
 (0)