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

Commit 67391e6

Browse files
committed
Merge branch 'wrap-compact-collapse'
2 parents 0ef9b24 + c2ca98e commit 67391e6

File tree

5 files changed

+28
-9
lines changed

5 files changed

+28
-9
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: 4 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,15 @@ 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
);
5253
classes.push(
53-
configColumn.wrap_content ?
54+
(configColumn.wrap_content && localSettings.cell_size !== CellSizeOptions.COMPACT) ?
5455
COLUMN_ALIGNMENT_OPTIONS.WRAP :
5556
COLUMN_ALIGNMENT_OPTIONS.NOWRAP
5657
);

styles.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,21 @@ div.database-plugin__checkbox {
376376
padding: 0.6rem;
377377
}
378378

379-
.database-plugin__sticky_first_column .database-plugin__td:nth-child(2),
380-
.database-plugin__sticky_first_column .database-plugin__th:nth-child(2),
381379
.database-plugin__table .database-plugin__td:first-child,
382380
.database-plugin__table .database-plugin__th:first-child {
383381
position: sticky;
384382
left: 0;
385383
z-index: 1;
386384
}
387385

386+
.database-plugin__sticky_first_column .database-plugin__td:nth-child(2),
387+
.database-plugin__sticky_first_column .database-plugin__th:nth-child(2) {
388+
position: sticky;
389+
z-index: 2;
390+
left: 30px;
391+
background-color: var(--background-secondary);
392+
}
393+
388394
.database-plugin__table {
389395
position: relative;
390396
top: 2.65rem;

0 commit comments

Comments
 (0)