feat: add title disabled property #680
This commit is contained in:
@@ -157,6 +157,7 @@ interface IElement {
|
|||||||
title?: {
|
title?: {
|
||||||
conceptId?: string;
|
conceptId?: string;
|
||||||
deletable?: boolean;
|
deletable?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
// list
|
// list
|
||||||
listType?: ListType;
|
listType?: ListType;
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ interface IElement {
|
|||||||
title?: {
|
title?: {
|
||||||
conceptId?: string;
|
conceptId?: string;
|
||||||
deletable?: boolean;
|
deletable?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
};
|
};
|
||||||
// 列表
|
// 列表
|
||||||
listType?: ListType;
|
listType?: ListType;
|
||||||
|
|||||||
@@ -300,15 +300,13 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public applyPainterStyle() {
|
public applyPainterStyle() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
this.canvasEvent.applyPainterStyle()
|
this.canvasEvent.applyPainterStyle()
|
||||||
}
|
}
|
||||||
|
|
||||||
public format() {
|
public format() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
// 选区设置或设置换行处样式
|
// 选区设置或设置换行处样式
|
||||||
@@ -336,8 +334,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public font(payload: string) {
|
public font(payload: string) {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -359,8 +356,7 @@ export class CommandAdapt {
|
|||||||
public size(payload: number) {
|
public size(payload: number) {
|
||||||
const { minSize, maxSize, defaultSize } = this.options
|
const { minSize, maxSize, defaultSize } = this.options
|
||||||
if (payload < minSize || payload > maxSize) return
|
if (payload < minSize || payload > maxSize) return
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
// 选区设置或设置换行处样式
|
// 选区设置或设置换行处样式
|
||||||
let renderOption: IDrawOption = {}
|
let renderOption: IDrawOption = {}
|
||||||
@@ -396,8 +392,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public sizeAdd() {
|
public sizeAdd() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getTextLikeSelectionElementList()
|
const selection = this.range.getTextLikeSelectionElementList()
|
||||||
// 选区设置或设置换行处样式
|
// 选区设置或设置换行处样式
|
||||||
@@ -436,8 +431,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public sizeMinus() {
|
public sizeMinus() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getTextLikeSelectionElementList()
|
const selection = this.range.getTextLikeSelectionElementList()
|
||||||
// 选区设置或设置换行处样式
|
// 选区设置或设置换行处样式
|
||||||
@@ -476,8 +470,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public bold() {
|
public bold() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -498,8 +491,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public italic() {
|
public italic() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -520,8 +512,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public underline(textDecoration?: ITextDecoration) {
|
public underline(textDecoration?: ITextDecoration) {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -559,8 +550,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public strikeout() {
|
public strikeout() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -584,8 +574,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public superscript() {
|
public superscript() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (!selection) return
|
if (!selection) return
|
||||||
@@ -614,8 +603,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public subscript() {
|
public subscript() {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (!selection) return
|
if (!selection) return
|
||||||
@@ -644,8 +632,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public color(payload: string | null) {
|
public color(payload: string | null) {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -676,8 +663,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public highlight(payload: string | null) {
|
public highlight(payload: string | null) {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelectionElementList()
|
const selection = this.range.getSelectionElementList()
|
||||||
if (selection?.length) {
|
if (selection?.length) {
|
||||||
@@ -1802,8 +1788,7 @@ export class CommandAdapt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public image(payload: IDrawImagePayload) {
|
public image(payload: IDrawImagePayload) {
|
||||||
const isDisabled =
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
this.draw.isReadonly() || this.control.getIsDisabledControl()
|
|
||||||
if (isDisabled) return
|
if (isDisabled) return
|
||||||
const { startIndex, endIndex } = this.range.getRange()
|
const { startIndex, endIndex } = this.range.getRange()
|
||||||
if (!~startIndex && !~endIndex) return
|
if (!~startIndex && !~endIndex) return
|
||||||
|
|||||||
@@ -317,6 +317,23 @@ export class Draw {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isDisabled() {
|
||||||
|
const { startIndex, endIndex } = this.range.getRange()
|
||||||
|
const elementList = this.getElementList()
|
||||||
|
if (startIndex === endIndex) {
|
||||||
|
const startElement = elementList[startIndex]
|
||||||
|
const nextElement = elementList[startIndex + 1]
|
||||||
|
return !!(
|
||||||
|
(startElement?.title?.disabled && nextElement?.title?.disabled) ||
|
||||||
|
(startElement?.control?.disabled && nextElement?.control?.disabled)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const selectionElementList = elementList.slice(startIndex + 1, endIndex + 1)
|
||||||
|
return selectionElementList.some(
|
||||||
|
element => element.title?.disabled || element.control?.disabled
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
public getOriginalWidth(): number {
|
public getOriginalWidth(): number {
|
||||||
const { paperDirection, width, height } = this.options
|
const { paperDirection, width, height } = this.options
|
||||||
return paperDirection === PaperDirection.VERTICAL ? width : height
|
return paperDirection === PaperDirection.VERTICAL ? width : height
|
||||||
|
|||||||
@@ -208,7 +208,16 @@ export class Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getIsDisabledControl(): boolean {
|
public getIsDisabledControl(): boolean {
|
||||||
return !!this.activeControl?.getElement().control?.disabled
|
if (!this.activeControl) return false
|
||||||
|
const { startIndex, endIndex } = this.range.getRange()
|
||||||
|
if (startIndex === endIndex) {
|
||||||
|
const elementList = this.getElementList()
|
||||||
|
const startElement = elementList[startIndex]
|
||||||
|
if (startElement.controlComponent === ControlComponent.POSTFIX) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !!this.activeControl.getElement()?.control?.disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
public getContainer(): HTMLDivElement {
|
public getContainer(): HTMLDivElement {
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ export class CanvasEvent {
|
|||||||
public applyPainterStyle() {
|
public applyPainterStyle() {
|
||||||
const painterStyle = this.draw.getPainterStyle()
|
const painterStyle = this.draw.getPainterStyle()
|
||||||
if (!painterStyle) return
|
if (!painterStyle) return
|
||||||
|
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled()
|
||||||
|
if (isDisabled) return
|
||||||
const selection = this.range.getSelection()
|
const selection = this.range.getSelection()
|
||||||
if (!selection) return
|
if (!selection) return
|
||||||
const painterStyleKeys = Object.keys(painterStyle)
|
const painterStyleKeys = Object.keys(painterStyle)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { CanvasEvent } from '../CanvasEvent'
|
|||||||
|
|
||||||
export function input(data: string, host: CanvasEvent) {
|
export function input(data: string, host: CanvasEvent) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
if (draw.isReadonly()) return
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
const position = draw.getPosition()
|
const position = draw.getPosition()
|
||||||
const cursorPosition = position.getCursorPosition()
|
const cursorPosition = position.getCursorPosition()
|
||||||
if (!data || !cursorPosition) return
|
if (!data || !cursorPosition) return
|
||||||
@@ -34,26 +34,28 @@ export function input(data: string, host: CanvasEvent) {
|
|||||||
const newElement: IElement = {
|
const newElement: IElement = {
|
||||||
value
|
value
|
||||||
}
|
}
|
||||||
const nextElement = elementList[endIndex + 1]
|
if (!copyElement.title?.disabled && !copyElement.control?.disabled) {
|
||||||
if (
|
const nextElement = elementList[endIndex + 1]
|
||||||
!copyElement.type ||
|
if (
|
||||||
copyElement.type === TEXT ||
|
!copyElement.type ||
|
||||||
(copyElement.type === HYPERLINK && nextElement?.type === HYPERLINK) ||
|
copyElement.type === TEXT ||
|
||||||
(copyElement.type === DATE && nextElement?.type === DATE) ||
|
(copyElement.type === HYPERLINK && nextElement?.type === HYPERLINK) ||
|
||||||
(copyElement.type === SUBSCRIPT && nextElement?.type === SUBSCRIPT) ||
|
(copyElement.type === DATE && nextElement?.type === DATE) ||
|
||||||
(copyElement.type === SUPERSCRIPT && nextElement?.type === SUPERSCRIPT)
|
(copyElement.type === SUBSCRIPT && nextElement?.type === SUBSCRIPT) ||
|
||||||
) {
|
(copyElement.type === SUPERSCRIPT && nextElement?.type === SUPERSCRIPT)
|
||||||
EDITOR_ELEMENT_COPY_ATTR.forEach(attr => {
|
) {
|
||||||
// 在分组外无需复制分组信息
|
EDITOR_ELEMENT_COPY_ATTR.forEach(attr => {
|
||||||
if (attr === 'groupIds' && !nextElement?.groupIds) return
|
// 在分组外无需复制分组信息
|
||||||
const value = copyElement[attr] as never
|
if (attr === 'groupIds' && !nextElement?.groupIds) return
|
||||||
if (value !== undefined) {
|
const value = copyElement[attr] as never
|
||||||
newElement[attr] = value
|
if (value !== undefined) {
|
||||||
}
|
newElement[attr] = value
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
if (isComposing) {
|
}
|
||||||
newElement.underline = true
|
if (isComposing) {
|
||||||
|
newElement.underline = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return newElement
|
return newElement
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ export function mouseup(evt: MouseEvent, host: CanvasEvent) {
|
|||||||
// 判断是否允许拖放
|
// 判断是否允许拖放
|
||||||
if (host.isAllowDrop) {
|
if (host.isAllowDrop) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
if (draw.isReadonly()) return
|
if (draw.isReadonly() || draw.isDisabled()) {
|
||||||
|
host.mousedown(evt)
|
||||||
|
return
|
||||||
|
}
|
||||||
const position = draw.getPosition()
|
const position = draw.getPosition()
|
||||||
const positionList = position.getPositionList()
|
const positionList = position.getPositionList()
|
||||||
const positionContext = position.getPositionContext()
|
const positionContext = position.getPositionContext()
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ import { IOverrideResult } from '../../override/Override'
|
|||||||
|
|
||||||
export function pasteElement(host: CanvasEvent, elementList: IElement[]) {
|
export function pasteElement(host: CanvasEvent, elementList: IElement[]) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
const isReadonly = draw.isReadonly()
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
if (isReadonly) return
|
|
||||||
const rangeManager = draw.getRange()
|
const rangeManager = draw.getRange()
|
||||||
const { startIndex } = rangeManager.getRange()
|
const { startIndex } = rangeManager.getRange()
|
||||||
const originalElementList = draw.getElementList()
|
const originalElementList = draw.getElementList()
|
||||||
@@ -59,8 +58,7 @@ export function pasteElement(host: CanvasEvent, elementList: IElement[]) {
|
|||||||
|
|
||||||
export function pasteHTML(host: CanvasEvent, htmlText: string) {
|
export function pasteHTML(host: CanvasEvent, htmlText: string) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
const isReadonly = draw.isReadonly()
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
if (isReadonly) return
|
|
||||||
const elementList = getElementListByHTML(htmlText, {
|
const elementList = getElementListByHTML(htmlText, {
|
||||||
innerWidth: draw.getOriginalInnerWidth()
|
innerWidth: draw.getOriginalInnerWidth()
|
||||||
})
|
})
|
||||||
@@ -69,8 +67,7 @@ export function pasteHTML(host: CanvasEvent, htmlText: string) {
|
|||||||
|
|
||||||
export function pasteImage(host: CanvasEvent, file: File | Blob) {
|
export function pasteImage(host: CanvasEvent, file: File | Blob) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
const isReadonly = draw.isReadonly()
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
if (isReadonly) return
|
|
||||||
const rangeManager = draw.getRange()
|
const rangeManager = draw.getRange()
|
||||||
const { startIndex } = rangeManager.getRange()
|
const { startIndex } = rangeManager.getRange()
|
||||||
const elementList = draw.getElementList()
|
const elementList = draw.getElementList()
|
||||||
@@ -99,8 +96,7 @@ export function pasteImage(host: CanvasEvent, file: File | Blob) {
|
|||||||
|
|
||||||
export function pasteByEvent(host: CanvasEvent, evt: ClipboardEvent) {
|
export function pasteByEvent(host: CanvasEvent, evt: ClipboardEvent) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
const isReadonly = draw.isReadonly()
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
if (isReadonly) return
|
|
||||||
const clipboardData = evt.clipboardData
|
const clipboardData = evt.clipboardData
|
||||||
if (!clipboardData) return
|
if (!clipboardData) return
|
||||||
// 自定义粘贴事件
|
// 自定义粘贴事件
|
||||||
@@ -157,8 +153,7 @@ export function pasteByEvent(host: CanvasEvent, evt: ClipboardEvent) {
|
|||||||
|
|
||||||
export async function pasteByApi(host: CanvasEvent, options?: IPasteOption) {
|
export async function pasteByApi(host: CanvasEvent, options?: IPasteOption) {
|
||||||
const draw = host.getDraw()
|
const draw = host.getDraw()
|
||||||
const isReadonly = draw.isReadonly()
|
if (draw.isReadonly() || draw.isDisabled()) return
|
||||||
if (isReadonly) return
|
|
||||||
// 自定义粘贴事件
|
// 自定义粘贴事件
|
||||||
const { paste } = draw.getOverride()
|
const { paste } = draw.getOverride()
|
||||||
if (paste) {
|
if (paste) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export type ITitleOption = ITitleSizeOption & {}
|
|||||||
|
|
||||||
export interface ITitleRule {
|
export interface ITitleRule {
|
||||||
deletable?: boolean
|
deletable?: boolean
|
||||||
|
disabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ITitle = ITitleRule & {
|
export type ITitle = ITitleRule & {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
deepCloneOmitKeys,
|
deepCloneOmitKeys,
|
||||||
getUUID,
|
getUUID,
|
||||||
isArrayEqual,
|
isArrayEqual,
|
||||||
|
omitObject,
|
||||||
pickObject,
|
pickObject,
|
||||||
splitText
|
splitText
|
||||||
} from '.'
|
} from '.'
|
||||||
@@ -29,7 +30,8 @@ import {
|
|||||||
INLINE_NODE_NAME,
|
INLINE_NODE_NAME,
|
||||||
TABLE_CONTEXT_ATTR,
|
TABLE_CONTEXT_ATTR,
|
||||||
TABLE_TD_ZIP_ATTR,
|
TABLE_TD_ZIP_ATTR,
|
||||||
TEXTLIKE_ELEMENT_TYPE
|
TEXTLIKE_ELEMENT_TYPE,
|
||||||
|
TITLE_CONTEXT_ATTR
|
||||||
} from '../dataset/constant/Element'
|
} from '../dataset/constant/Element'
|
||||||
import {
|
import {
|
||||||
listStyleCSSMapping,
|
listStyleCSSMapping,
|
||||||
@@ -818,8 +820,12 @@ export function formatElementContext(
|
|||||||
anchorIndex: number,
|
anchorIndex: number,
|
||||||
options?: IFormatElementContextOption
|
options?: IFormatElementContextOption
|
||||||
) {
|
) {
|
||||||
const copyElement = getAnchorElement(sourceElementList, anchorIndex)
|
let copyElement = getAnchorElement(sourceElementList, anchorIndex)
|
||||||
if (!copyElement) return
|
if (!copyElement) return
|
||||||
|
// 标题元素禁用时不复制标题属性
|
||||||
|
if (copyElement.title?.disabled) {
|
||||||
|
copyElement = omitObject(copyElement, TITLE_CONTEXT_ATTR)
|
||||||
|
}
|
||||||
const { isBreakWhenWrap = false } = options || {}
|
const { isBreakWhenWrap = false } = options || {}
|
||||||
// 是否已经换行
|
// 是否已经换行
|
||||||
let isBreakWarped = false
|
let isBreakWarped = false
|
||||||
@@ -839,9 +845,9 @@ export function formatElementContext(
|
|||||||
(!copyElement.listId && targetElement.type === ElementType.LIST)
|
(!copyElement.listId && targetElement.type === ElementType.LIST)
|
||||||
) {
|
) {
|
||||||
const cloneAttr = [...TABLE_CONTEXT_ATTR, ...EDITOR_ROW_ATTR]
|
const cloneAttr = [...TABLE_CONTEXT_ATTR, ...EDITOR_ROW_ATTR]
|
||||||
cloneProperty<IElement>(cloneAttr, copyElement, targetElement)
|
cloneProperty<IElement>(cloneAttr, copyElement!, targetElement)
|
||||||
targetElement.valueList?.forEach(valueItem => {
|
targetElement.valueList?.forEach(valueItem => {
|
||||||
cloneProperty<IElement>(cloneAttr, copyElement, valueItem)
|
cloneProperty<IElement>(cloneAttr, copyElement!, valueItem)
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user