fix: remove title and list properties from getControlList return value #683
This commit is contained in:
@@ -23,7 +23,7 @@ import { IEditorData, IEditorOption } from '../../../interface/Editor'
|
|||||||
import { IElement, IElementPosition } from '../../../interface/Element'
|
import { IElement, IElementPosition } from '../../../interface/Element'
|
||||||
import { EventBusMap } from '../../../interface/EventBus'
|
import { EventBusMap } from '../../../interface/EventBus'
|
||||||
import { IRange } from '../../../interface/Range'
|
import { IRange } from '../../../interface/Range'
|
||||||
import { deepClone, nextTick, splitText } from '../../../utils'
|
import { deepClone, nextTick, omitObject, splitText } from '../../../utils'
|
||||||
import {
|
import {
|
||||||
formatElementContext,
|
formatElementContext,
|
||||||
formatElementList,
|
formatElementList,
|
||||||
@@ -42,7 +42,11 @@ import { SelectControl } from './select/SelectControl'
|
|||||||
import { TextControl } from './text/TextControl'
|
import { TextControl } from './text/TextControl'
|
||||||
import { DateControl } from './date/DateControl'
|
import { DateControl } from './date/DateControl'
|
||||||
import { MoveDirection } from '../../../dataset/enum/Observer'
|
import { MoveDirection } from '../../../dataset/enum/Observer'
|
||||||
import { CONTROL_STYLE_ATTR } from '../../../dataset/constant/Element'
|
import {
|
||||||
|
CONTROL_STYLE_ATTR,
|
||||||
|
LIST_CONTEXT_ATTR,
|
||||||
|
TITLE_CONTEXT_ATTR
|
||||||
|
} from '../../../dataset/constant/Element'
|
||||||
|
|
||||||
interface IMoveCursorResult {
|
interface IMoveCursorResult {
|
||||||
newIndex: number
|
newIndex: number
|
||||||
@@ -876,7 +880,12 @@ export class Control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (element.controlId) {
|
if (element.controlId) {
|
||||||
controlElementList.push(element)
|
// 移除控件所在标题及列表上下文信息
|
||||||
|
const controlElement = omitObject(element, [
|
||||||
|
...TITLE_CONTEXT_ATTR,
|
||||||
|
...LIST_CONTEXT_ATTR
|
||||||
|
])
|
||||||
|
controlElementList.push(controlElement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user