added cell wrap text option

This commit is contained in:
Danis
2025-08-19 14:37:47 +04:00
parent 878eab5749
commit 38a7f9ba28
4 changed files with 27 additions and 3 deletions

View File

@ -328,6 +328,7 @@
"txtWidth": "Width",
"txtHeight": "Height",
"textCellSize": "Rows & columns size",
"textCellOptions": "Cell options",
"textLevels": "Levels",
"textLineSpacing": "Line spacing",
"textLink": "Link",

View File

@ -108,6 +108,14 @@ class EditTableController extends Component {
api.tblApply(properties);
}
}
onOptionCellWrap (value) {
const api = Common.EditorApi.get();
if (api) {
const properties = new Asc.CTableProp();
properties.put_CellsNoWrap(value);
api.tblApply(properties);
}
}
onWrapType (value) {
const api = Common.EditorApi.get();
if (api) {
@ -263,6 +271,7 @@ class EditTableController extends Component {
onGetTableStylesPreviews = {this.onGetTableStylesPreviews}
onDistributeTable = {this.onDistributeTable}
onChangeTableDimension = {this.onChangeTableDimension}
onOptionCellWrap = {this.onOptionCellWrap}
/>
)
}

View File

@ -74,10 +74,13 @@ export class storeTableSettings {
return tableObject.get_TablePaddings().get_Top();
}
getRowHeight (tableObject) {
return tableObject.get_RowHeight()
return tableObject.get_RowHeight();
}
getColumnWidth (tableObject) {
return tableObject.get_ColumnWidth()
return tableObject.get_ColumnWidth();
}
getCellWrapOption (tableObject) {
return tableObject.get_CellsNoWrap();
}
// Fill color

View File

@ -42,16 +42,18 @@ const PageTableOptions = props => {
const tableObject = storeFocusObjects.tableObject;
const storeTableSettings = props.storeTableSettings;
let distance, isRepeat, isResize, columnWidth, rowHeight, displayRowHeight, displayColumnWidth;
let distance, isRepeat, isResize, columnWidth, rowHeight, displayRowHeight, displayColumnWidth, isCellNoWrap;
if (tableObject) {
distance = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getCellMargins(tableObject));
isRepeat = storeTableSettings.getRepeatOption(tableObject);
isResize = storeTableSettings.getResizeOption(tableObject);
isCellNoWrap = storeTableSettings.getCellWrapOption(tableObject);
rowHeight = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getRowHeight(tableObject));
columnWidth = Common.Utils.Metric.fnRecalcFromMM(storeTableSettings.getColumnWidth(tableObject));
displayRowHeight = Number(rowHeight.toFixed(2));
displayColumnWidth = Number(columnWidth.toFixed(2));
}
const [stateDistance, setDistance] = useState(distance);
if (!tableObject && Device.phone) {
@ -130,6 +132,14 @@ const PageTableOptions = props => {
</div>
</ListItem>
</List>
<BlockTitle>{_t.textCellOptions}</BlockTitle>
<List>
<ListItem title={_t.textWrap}>
<Toggle checked={!isCellNoWrap} onToggleChange={()=> {props.onOptionCellWrap(!isCellNoWrap)}} />
</ListItem>
</List>
<BlockTitle>{_t.textCellMargins}</BlockTitle>
<List>
@ -692,6 +702,7 @@ const EditTable = props => {
onOptionRepeat: props.onOptionRepeat,
onDistributeTable: props.onDistributeTable,
onChangeTableDimension: props.onChangeTableDimension,
onOptionCellWrap: props.onOptionCellWrap
}}></ListItem>
<ListItem title={_t.textStyle} link='/edit-table-style/' routeProps={{
onStyleClick: props.onStyleClick,