mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-04-07 14:06:16 +08:00
added cell wrap text option
This commit is contained in:
@ -328,6 +328,7 @@
|
||||
"txtWidth": "Width",
|
||||
"txtHeight": "Height",
|
||||
"textCellSize": "Rows & columns size",
|
||||
"textCellOptions": "Cell options",
|
||||
"textLevels": "Levels",
|
||||
"textLineSpacing": "Line spacing",
|
||||
"textLink": "Link",
|
||||
|
||||
@ -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}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user