mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 10:27:22 +00:00
fix: 修复兼容报错
This commit is contained in:
parent
77fc3f2db2
commit
080102db5b
@ -1,3 +1,4 @@
|
|||||||
|
import { IPublicModelNode } from './../../../types/src/shell/model/node';
|
||||||
import { Editor, globalContext } from '@alilc/lowcode-editor-core';
|
import { Editor, globalContext } from '@alilc/lowcode-editor-core';
|
||||||
import { isFormEvent } from '@alilc/lowcode-utils';
|
import { isFormEvent } from '@alilc/lowcode-utils';
|
||||||
import {
|
import {
|
||||||
@ -24,16 +25,16 @@ export function isInLiveEditing() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
function getNextForSelect(next: any, head?: any, parent?: any): any {
|
function getNextForSelect(next: IPublicModelNode | null, head?: any, parent?: IPublicModelNode | null): any {
|
||||||
if (next) {
|
if (next) {
|
||||||
if (!head) {
|
if (!head) {
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
let ret;
|
let ret;
|
||||||
if (next.isContainer()) {
|
if (next.isContainer) {
|
||||||
const children = next.getChildren() || [];
|
const children = next.children;
|
||||||
if (children && !children.isEmpty()) {
|
if (children && !children.isEmpty) {
|
||||||
ret = getNextForSelect(children.get(0));
|
ret = getNextForSelect(children.get(0));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return ret;
|
return ret;
|
||||||
@ -48,19 +49,19 @@ function getNextForSelect(next: any, head?: any, parent?: any): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
return getNextForSelect(parent.nextSibling, false, parent.getParent());
|
return getNextForSelect(parent.nextSibling, false, parent?.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
function getPrevForSelect(prev: any, head?: any, parent?: any): any {
|
function getPrevForSelect(prev: IPublicModelNode | null, head?: any, parent?: IPublicModelNode | null): any {
|
||||||
if (prev) {
|
if (prev) {
|
||||||
let ret;
|
let ret;
|
||||||
if (!head && prev.isContainer()) {
|
if (!head && prev.isContainer) {
|
||||||
const children = prev.getChildren() || [];
|
const children = prev.children;
|
||||||
const lastChild = children && !children.isEmpty() ? children.get(children.size - 1) : null;
|
const lastChild = children && !children.isEmpty ? children.get(children.size - 1) : null;
|
||||||
|
|
||||||
ret = getPrevForSelect(lastChild);
|
ret = getPrevForSelect(lastChild);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|||||||
@ -10,11 +10,11 @@ export default class NodeChildren implements IPublicModelNodeChildren {
|
|||||||
this[nodeChildrenSymbol] = nodeChildren;
|
this[nodeChildrenSymbol] = nodeChildren;
|
||||||
}
|
}
|
||||||
|
|
||||||
static create(nodeChldren: InnerNodeChildren | null): IPublicModelNodeChildren | null {
|
static create(nodeChildren: InnerNodeChildren | null): IPublicModelNodeChildren | null {
|
||||||
if (!nodeChldren) {
|
if (!nodeChildren) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new NodeChildren(nodeChldren);
|
return new NodeChildren(nodeChildren);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user