fix: copy row properties on input #415
This commit is contained in:
@@ -1071,7 +1071,7 @@ export class Draw {
|
|||||||
ascent: 0,
|
ascent: 0,
|
||||||
elementList: [],
|
elementList: [],
|
||||||
startIndex: 0,
|
startIndex: 0,
|
||||||
rowFlex: elementList?.[1]?.rowFlex
|
rowFlex: elementList?.[0]?.rowFlex || elementList?.[1]?.rowFlex
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 列表位置
|
// 列表位置
|
||||||
@@ -1449,7 +1449,7 @@ export class Draw {
|
|||||||
startIndex: i,
|
startIndex: i,
|
||||||
elementList: [rowElement],
|
elementList: [rowElement],
|
||||||
ascent,
|
ascent,
|
||||||
rowFlex: elementList[i + 1]?.rowFlex,
|
rowFlex: elementList[i]?.rowFlex || elementList[i + 1]?.rowFlex,
|
||||||
isPageBreak: element.type === ElementType.PAGE_BREAK
|
isPageBreak: element.type === ElementType.PAGE_BREAK
|
||||||
}
|
}
|
||||||
// 控件缩进
|
// 控件缩进
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { ZERO } from '../../../../dataset/constant/Common'
|
import { ZERO } from '../../../../dataset/constant/Common'
|
||||||
import { EDITOR_ELEMENT_STYLE_ATTR } from '../../../../dataset/constant/Element'
|
import {
|
||||||
|
EDITOR_ELEMENT_STYLE_ATTR,
|
||||||
|
EDITOR_ROW_ATTR
|
||||||
|
} from '../../../../dataset/constant/Element'
|
||||||
import { IElement } from '../../../../interface/Element'
|
import { IElement } from '../../../../interface/Element'
|
||||||
import {
|
import {
|
||||||
formatElementContext,
|
formatElementContext,
|
||||||
@@ -47,7 +50,8 @@ export function enter(evt: KeyboardEvent, host: CanvasEvent) {
|
|||||||
// 复制样式属性
|
// 复制样式属性
|
||||||
const copyElement = getAnchorElement(elementList, endIndex)
|
const copyElement = getAnchorElement(elementList, endIndex)
|
||||||
if (copyElement) {
|
if (copyElement) {
|
||||||
EDITOR_ELEMENT_STYLE_ATTR.forEach(attr => {
|
const copyAttr = [...EDITOR_ELEMENT_STYLE_ATTR, ...EDITOR_ROW_ATTR]
|
||||||
|
copyAttr.forEach(attr => {
|
||||||
const value = copyElement[attr] as never
|
const value = copyElement[attr] as never
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
enterText[attr] = value
|
enterText[attr] = value
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ export const EDITOR_ELEMENT_STYLE_ATTR: Array<keyof IElement> = [
|
|||||||
'strikeout'
|
'strikeout'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const EDITOR_ROW_ATTR: Array<keyof IElement> = ['rowFlex', 'rowMargin']
|
||||||
|
|
||||||
export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
|
export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
|
||||||
'type',
|
'type',
|
||||||
'font',
|
'font',
|
||||||
@@ -28,7 +30,9 @@ export const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement> = [
|
|||||||
'hyperlinkId',
|
'hyperlinkId',
|
||||||
'dateId',
|
'dateId',
|
||||||
'dateFormat',
|
'dateFormat',
|
||||||
'groupIds'
|
'groupIds',
|
||||||
|
'rowFlex',
|
||||||
|
'rowMargin'
|
||||||
]
|
]
|
||||||
|
|
||||||
export const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement> = [
|
export const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement> = [
|
||||||
|
|||||||
Reference in New Issue
Block a user