Members

getRect :function

Type:
  • function

Methods

addVnodes(parentElm, beforeopt, vnodes, startIdx, endIdx)

增加节点
Parameters:
NameTypeAttributesDefaultDescription
parentElm*
before*<optional>
null
vnodes*
startIdx*
endIdx*

computeOffset(dom, resopt) → {*}

累计偏移量计算
Parameters:
NameTypeAttributesDefaultDescription
dom*
res*<optional>
{ x: 0, y: 0 }
Returns:
Type: 
*

computeScroll(dom, resopt) → {*}

累计滚动距离计算
Parameters:
NameTypeAttributesDefaultDescription
dom*
res*<optional>
{ x: 0, y: 0 }
Returns:
Type: 
*

createKeyToOldIdx(children, beginIdx, endIdx) → {*}

生成id映射
Parameters:
NameTypeDescription
children*
beginIdx*
endIdx*
Returns:
Type: 
*

createPath(node, parentopt, prevSiblingopt, nextSiblingopt, indexopt) → {Path}

创建path
Parameters:
NameTypeAttributesDefaultDescription
nodeObject标记
Properties
NameTypeDescription
dataString | Object
formatsObject
parentPath<optional>
null
prevSiblingPath<optional>
null
nextSiblingPath<optional>
null
indexNumber<optional>
0
Returns:
Type: 
Path

defer(fn) → {*}

defer
Parameters:
NameTypeDescription
fnfunction
Returns:
Type: 
*

del(range, forceopt)

删除操作
Parameters:
NameTypeAttributesDefaultDescription
range*
forceboolean<optional>
false

findIdxInOld(node, oldCh, start, end) → {*}

在老节点中查找id
Parameters:
NameTypeDescription
node*
oldCh*
start*
end*
Returns:
Type: 
*

flush()

调度执行

horizontalMove(direction, range, event) → {*}

水平移动
Parameters:
NameTypeDescription
direction*
range*
event*
Returns:
Type: 
*

isSameLine(initialCaretInfo, prevCaretInfo, currCaretInfo, editor) → {Boolean}

光标跨行判断
Parameters:
NameTypeDescription
initialCaretInfo*
prevCaretInfo*
currCaretInfo*
editor*
Returns:
Type: 
Boolean

loop(range, direction, initialCaretInfo, prevCaretInfo, lineChanged, shiftKey) → {*}

循环执行函数
Parameters:
NameTypeDefaultDescription
range*
direction*
initialCaretInfo*
prevCaretInfo*
lineChanged*false
shiftKey*
Returns:
Type: 
*

patchVnode(vnode, oldVnode)

节点比对
Parameters:
NameTypeDescription
vnode*
oldVnode*

positionCompare(a, b) → {*}

Parameters:
NameTypeDescription
a*
b*
Returns:
0 a===b;-1 ab
Type: 
*

queryPath(target, path) → {path}

Parameters:
NameTypeDescription
targetelm | vn | position
pathpath
Returns:
Type: 
path

queryPathByElm(elm) → {*}

根据dom查询path
Parameters:
NameTypeDescription
elm*
Returns:
Type: 
*

queryPathByPosition(position, rootPath) → {*}

根据坐标查询path
Parameters:
NameTypeDescription
position*
rootPath*
Returns:
Type: 
*

queryPathByVn(vn) → {*}

根据虚拟dom查询path
Parameters:
NameTypeDescription
vn*
Returns:
Type: 
*

removeVnodes(parentElm, oldCh, startIdx, endIdx)

节点删除
Parameters:
NameTypeDescription
parentElm*
oldCh*
startIdx*
endIdx*

renderRoot(h) → {*}

Parameters:
NameTypeDescription
h*
Returns:
Type: 
*

sameVnode(vnode, oldVnode) → {*}

判断是否相同节点
Parameters:
NameTypeDescription
vnode*
oldVnode*
Returns:
Type: 
*

setStyle(dom, style)

设置光标的样式
Parameters:
NameTypeDescription
dom*
style*

updateChildren(parentElm, newCh, oldCh)

children更新函数
Parameters:
NameTypeDescription
parentElm*
newCh*
oldCh*

verticalMove(range, direction, shiftKey)

垂直移动 垂直移动等效于水平移动N步的结果,关键点在于确定N 这里通过光标位置回溯法,计算出最合适的N
Parameters:
NameTypeDescription
range*
direction*
shiftKey*