This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 12 files changed +68
-37
lines changed
Expand file tree Collapse file tree 12 files changed +68
-37
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export interface ConfigColumn {
4040 media_height : number ;
4141 isInline : boolean ;
4242 content_alignment ?: string ;
43+ wrap_content ?: boolean ;
4344 task_hide_completed ?: boolean ;
4445 formula_query ?: string ;
4546 persist_formula ?: boolean ;
Original file line number Diff line number Diff line change @@ -46,9 +46,7 @@ const FormulaCell = (mdProps: CellComponentProps) => {
4646 return (
4747 < span
4848 ref = { formulaRef }
49- className = { `${ c (
50- "md_cell " + getAlignmentClassname ( tableColumn . config . content_alignment )
51- ) } `}
49+ className = { `${ c ( "md_cell " + getAlignmentClassname ( tableColumn . config ) ) } ` }
5250 key = { `formula_${ cell . id } ` }
5351 />
5452 ) ;
Original file line number Diff line number Diff line change @@ -70,11 +70,11 @@ const NumberCell = (props: CellComponentProps) => {
7070 onChange = { handleOnChange }
7171 onKeyDown = { handleKeyDown }
7272 onBlur = { handleOnBlur }
73- className = { c ( getAlignmentClassname ( tableColumn . config . content_alignment ) ) }
73+ className = { c ( getAlignmentClassname ( tableColumn . config ) ) }
7474 />
7575 ) : (
7676 < span
77- className = { c ( getAlignmentClassname ( tableColumn . config . content_alignment ) ) }
77+ className = { c ( getAlignmentClassname ( tableColumn . config ) ) }
7878 onClick = { handleEditableOnclick }
7979 style = { { width : column . getSize ( ) } }
8080 >
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ const TextCell = (props: CellComponentProps) => {
7373 ref = { containerCellRef }
7474 onClick = { handleEditableOnclick }
7575 style = { { width : column . getSize ( ) } }
76- className = { c ( getAlignmentClassname ( tableColumn . config . content_alignment ) ) }
76+ className = { c ( getAlignmentClassname ( tableColumn . config ) ) }
7777 />
7878 ) ;
7979} ;
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import { SelectedColumnOptionsHandler } from "components/modals/columnSettings/h
77import { HideCompletedTaskToggleHandler } from "components/modals/columnSettings/handlers/tasks/HideCompletedTaskToggleHandler" ;
88import { LinkAliasToggleHandler } from "components/modals/columnSettings/handlers/media/LinkAliasToggleHandler" ;
99import { FormulaInputHandler } from "components/modals/columnSettings/handlers/automations/FormulaInputHandler" ;
10- import { AlignmentSelectorHandler } from "components/modals/columnSettings/handlers/AlignmentSelectorHandler" ;
10+ import { AlignmentSelectorHandler } from "components/modals/columnSettings/handlers/styles/AlignmentSelectorHandler" ;
11+ import { ToggleWrapContentHandler } from "components/modals/columnSettings/handlers/styles/ToggleWrapContentHandler" ;
1112import { InputType } from "helpers/Constants" ;
1213import { AbstractChain } from "patterns/AbstractFactoryChain" ;
1314import { AbstractHandler } from "patterns/AbstractHandler" ;
@@ -31,6 +32,7 @@ class StyleSetttingsSection extends AbstractChain<ColumnSettingsHandlerResponse>
3132 case InputType . NUMBER :
3233 case InputType . FORMULA :
3334 particularHandlers . push ( new AlignmentSelectorHandler ( ) ) ;
35+ particularHandlers . push ( new ToggleWrapContentHandler ( ) ) ;
3436 break ;
3537 default :
3638 // do nothing
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import { add_toggle } from "settings/SettingsComponents" ;
2+ import { ColumnSettingsHandlerResponse } from "cdm/ModalsModel" ;
3+ import { AbstractHandlerClass } from "patterns/AbstractHandler" ;
4+ export class ToggleWrapContentHandler extends AbstractHandlerClass < ColumnSettingsHandlerResponse > {
5+ settingTitle : string = "Wrap content" ;
6+ handle (
7+ columnHandlerResponse : ColumnSettingsHandlerResponse
8+ ) : ColumnSettingsHandlerResponse {
9+ const { column, containerEl, columnSettingsManager } =
10+ columnHandlerResponse ;
11+ const { view } = columnSettingsManager . modal ;
12+ const wrap_content_togle_promise = async ( value : boolean ) : Promise < void > => {
13+ // Persist value
14+ await view . diskConfig . updateColumnConfig ( column . key , {
15+ wrap_content : value ,
16+ } ) ;
17+ columnSettingsManager . modal . enableReset = true ;
18+ } ;
19+ add_toggle (
20+ containerEl ,
21+ this . settingTitle ,
22+ "Wrap content of the cells in the column" ,
23+ column . config . wrap_content ,
24+ wrap_content_togle_promise
25+ ) ;
26+ return this . goNext ( columnHandlerResponse ) ;
27+ }
28+ }
Original file line number Diff line number Diff line change @@ -94,7 +94,10 @@ const SelectPortal = (popperProps: CellComponentProps) => {
9494 menuPortalTarget = { activeDocument . body }
9595 menuPlacement = "auto"
9696 menuShouldBlockScroll = { true }
97- className = { c ( "text-align-center" ) }
97+ className = { `react-select-container ${ c (
98+ "tags-container text-align-center"
99+ ) } `}
100+ classNamePrefix = "react-select"
98101 key = { `${ tableColumn . key } -select-open` }
99102 />
100103 </ div >
@@ -108,7 +111,7 @@ const SelectPortal = (popperProps: CellComponentProps) => {
108111 ) : (
109112 /* Current value of the select */
110113 < div
111- className = { `cell-padding d-flex ${ c ( "text-align-center" ) } ` }
114+ className = { `${ c ( "text-align-center" ) } ` }
112115 onClick = { ( ) => setShowSelect ( true ) }
113116 style = { { width : column . getSize ( ) } }
114117 >
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ const TagsPortal = (tagsProps: CellComponentProps) => {
107107 onBlur = { ( ) => setShowSelectTags ( false ) }
108108 onChange = { handleOnChange }
109109 menuPortalTarget = { activeDocument . body }
110- className = { c ( "tags-container text-align-center" ) }
110+ className = { `react-select-container ${ c (
111+ "tags-container text-align-center"
112+ ) } `}
113+ classNamePrefix = "react-select"
111114 menuPlacement = "auto"
112115 menuShouldBlockScroll = { true }
113116 />
Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ export const COLUMN_ALIGNMENT_OPTIONS = Object.freeze({
7575 CENTER : 'text-align-center' ,
7676 RIGHT : 'text-align-right' ,
7777 JUSTIFY : 'text-align-justify' ,
78+ NOWRAP : 'text-nowrap' ,
79+ WRAP : 'text-wrap' ,
7880} ) ;
7981
8082export const DEFAULT_COLUMN_CONFIG : ConfigColumn = Object . freeze ( {
You can’t perform that action at this time.
0 commit comments